2018-02-01 12:27:52 +00:00
|
|
|
angular.module('portainer.docker')
|
2018-05-06 07:15:57 +00:00
|
|
|
.factory('Network', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider',
|
|
|
|
function NetworkFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
|
2017-01-31 23:26:29 +00:00
|
|
|
'use strict';
|
2017-07-20 14:22:27 +00:00
|
|
|
return $resource(API_ENDPOINT_ENDPOINTS + '/:endpointId/docker/networks/:id/:action', {
|
2017-03-12 16:24:15 +00:00
|
|
|
id: '@id',
|
|
|
|
endpointId: EndpointProvider.endpointID
|
|
|
|
},
|
|
|
|
{
|
2018-05-06 07:15:57 +00:00
|
|
|
query: {
|
|
|
|
method: 'GET', isArray: true
|
|
|
|
},
|
|
|
|
get: {
|
|
|
|
method: 'GET'
|
|
|
|
},
|
|
|
|
create: {
|
|
|
|
method: 'POST', params: {action: 'create'},
|
|
|
|
transformResponse: genericHandler, ignoreLoadingBar: true
|
|
|
|
},
|
|
|
|
remove: {
|
|
|
|
method: 'DELETE', transformResponse: genericHandler
|
|
|
|
},
|
|
|
|
connect: {
|
|
|
|
method: 'POST', params: { action: 'connect' }
|
|
|
|
},
|
|
|
|
disconnect: {
|
|
|
|
method: 'POST', params: { action: 'disconnect' }
|
|
|
|
}
|
2017-01-31 23:26:29 +00:00
|
|
|
});
|
|
|
|
}]);
|