2017-01-31 23:26:29 +00:00
|
|
|
angular.module('portainer.rest')
|
2017-06-20 11:00:32 +00:00
|
|
|
.factory('Service', ['$resource', 'DOCKER_ENDPOINT', 'EndpointProvider', 'HttpRequestHelper' ,function ServiceFactory($resource, DOCKER_ENDPOINT, EndpointProvider, HttpRequestHelper) {
|
2017-01-31 23:26:29 +00:00
|
|
|
'use strict';
|
2017-06-01 08:14:55 +00:00
|
|
|
return $resource(DOCKER_ENDPOINT + '/:endpointId/services/:id/:action', {
|
2017-03-12 16:24:15 +00:00
|
|
|
endpointId: EndpointProvider.endpointID
|
|
|
|
},
|
|
|
|
{
|
2017-01-31 23:26:29 +00:00
|
|
|
get: { method: 'GET', params: {id: '@id'} },
|
|
|
|
query: { method: 'GET', isArray: true },
|
2017-06-20 11:00:32 +00:00
|
|
|
create: {
|
|
|
|
method: 'POST', params: {action: 'create'},
|
|
|
|
headers: { 'X-Registry-Auth': HttpRequestHelper.registryAuthenticationHeader }
|
|
|
|
},
|
2017-01-31 23:26:29 +00:00
|
|
|
update: { method: 'POST', params: {id: '@id', action: 'update', version: '@version'} },
|
|
|
|
remove: { method: 'DELETE', params: {id: '@id'} }
|
|
|
|
});
|
|
|
|
}]);
|