2017-01-31 23:26:29 +00:00
|
|
|
angular.module('portainer.rest')
|
2017-03-12 16:24:15 +00:00
|
|
|
.factory('Network', ['$resource', 'Settings', 'EndpointProvider', function NetworkFactory($resource, Settings, EndpointProvider) {
|
2017-01-31 23:26:29 +00:00
|
|
|
'use strict';
|
2017-03-12 16:24:15 +00:00
|
|
|
return $resource(Settings.url + '/:endpointId/networks/:id/:action', {
|
|
|
|
id: '@id',
|
|
|
|
endpointId: EndpointProvider.endpointID
|
|
|
|
},
|
|
|
|
{
|
2017-01-31 23:26:29 +00:00
|
|
|
query: {method: 'GET', isArray: true},
|
|
|
|
get: {method: 'GET'},
|
|
|
|
create: {method: 'POST', params: {action: 'create'}, transformResponse: genericHandler},
|
|
|
|
remove: { method: 'DELETE', transformResponse: genericHandler },
|
|
|
|
connect: {method: 'POST', params: {action: 'connect'}},
|
|
|
|
disconnect: {method: 'POST', params: {action: 'disconnect'}}
|
|
|
|
});
|
|
|
|
}]);
|