2017-01-31 23:26:29 +00:00
|
|
|
angular.module('portainer.rest')
|
2017-07-20 14:22:27 +00:00
|
|
|
.factory('Service', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', 'HttpRequestHelper' ,function ServiceFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider, HttpRequestHelper) {
|
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/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'} }
|
|
|
|
});
|
|
|
|
}]);
|