2018-02-01 12:27:52 +00:00
|
|
|
angular.module('portainer.docker')
|
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'} },
|
2017-10-15 17:24:40 +00:00
|
|
|
query: { method: 'GET', isArray: true, params: {filters: '@filters'} },
|
2017-06-20 11:00:32 +00:00
|
|
|
create: {
|
|
|
|
method: 'POST', params: {action: 'create'},
|
2017-11-12 19:27:28 +00:00
|
|
|
headers: { 'X-Registry-Auth': HttpRequestHelper.registryAuthenticationHeader },
|
|
|
|
ignoreLoadingBar: true
|
2017-06-20 11:00:32 +00:00
|
|
|
},
|
2017-01-31 23:26:29 +00:00
|
|
|
update: { method: 'POST', params: {id: '@id', action: 'update', version: '@version'} },
|
2018-02-28 06:19:28 +00:00
|
|
|
remove: { method: 'DELETE', params: {id: '@id'} },
|
|
|
|
logs: {
|
|
|
|
method: 'GET', params: { id: '@id', action: 'logs' },
|
|
|
|
timeout: 4500, ignoreLoadingBar: true,
|
|
|
|
transformResponse: logsHandler, isArray: true
|
|
|
|
}
|
2017-01-31 23:26:29 +00:00
|
|
|
});
|
|
|
|
}]);
|