2018-02-01 12:27:52 +00:00
|
|
|
angular.module('portainer.docker')
|
2017-07-20 14:22:27 +00:00
|
|
|
.factory('System', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', function SystemFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
|
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: {
|
|
|
|
method: 'GET', params: { action: 'info' },
|
|
|
|
ignoreLoadingBar: true
|
|
|
|
},
|
2018-02-23 02:10:26 +00:00
|
|
|
version: { method: 'GET', params: { action: 'version' }, ignoreLoadingBar: true, timeout: 4500 },
|
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
|
|
|
});
|
|
|
|
}]);
|