2018-02-01 12:27:52 +00:00
|
|
|
angular.module('portainer.docker')
|
2018-10-28 09:27:06 +00:00
|
|
|
.factory('System', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', 'InfoInterceptor', 'VersionInterceptor',
|
|
|
|
function SystemFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider, InfoInterceptor, VersionInterceptor) {
|
2017-06-20 11:00:32 +00:00
|
|
|
'use strict';
|
2017-07-20 14:22:27 +00:00
|
|
|
return $resource(API_ENDPOINT_ENDPOINTS + '/:endpointId/docker/:action/:subAction', {
|
2017-06-20 11:00:32 +00:00
|
|
|
name: '@name',
|
|
|
|
endpointId: EndpointProvider.endpointID
|
|
|
|
},
|
|
|
|
{
|
2018-05-06 07:15:57 +00:00
|
|
|
info: {
|
2018-10-28 09:27:06 +00:00
|
|
|
method: 'GET', params: { action: 'info' }, timeout: 10000, interceptor: InfoInterceptor
|
2018-05-06 07:15:57 +00:00
|
|
|
},
|
2018-10-28 09:27:06 +00:00
|
|
|
version: { method: 'GET', params: { action: 'version' }, timeout: 4500, interceptor: VersionInterceptor },
|
2017-06-20 11:00:32 +00:00
|
|
|
events: {
|
|
|
|
method: 'GET', params: { action: 'events', since: '@since', until: '@until' },
|
|
|
|
isArray: true, transformResponse: jsonObjectsToArrayHandler
|
|
|
|
},
|
2017-07-11 07:56:28 +00:00
|
|
|
auth: { method: 'POST', params: { action: 'auth' } },
|
2017-07-17 13:58:53 +00:00
|
|
|
dataUsage: { method: 'GET', params: { action: 'system', subAction: 'df' } }
|
2017-06-20 11:00:32 +00:00
|
|
|
});
|
|
|
|
}]);
|