2017-01-31 23:26:29 +00:00
|
|
|
angular.module('portainer.rest')
|
2017-07-20 14:22:27 +00:00
|
|
|
.factory('Volume', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', function VolumeFactory($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/volumes/:id/:action',
|
2017-03-12 16:24:15 +00:00
|
|
|
{
|
|
|
|
endpointId: EndpointProvider.endpointID
|
|
|
|
},
|
|
|
|
{
|
2017-05-23 18:56:10 +00:00
|
|
|
query: { method: 'GET' },
|
|
|
|
get: { method: 'GET', params: {id: '@id'} },
|
2017-01-31 23:26:29 +00:00
|
|
|
create: {method: 'POST', params: {action: 'create'}, transformResponse: genericHandler},
|
|
|
|
remove: {
|
2017-05-23 18:56:10 +00:00
|
|
|
method: 'DELETE', transformResponse: genericHandler, params: {id: '@id'}
|
2017-01-31 23:26:29 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}]);
|