2019-03-21 05:46:49 +00:00
|
|
|
import { browseGetResponse } from './response/browse';
|
|
|
|
|
2018-07-23 05:01:03 +00:00
|
|
|
angular.module('portainer.agent')
|
2018-10-26 03:16:29 +00:00
|
|
|
.factory('Browse', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', 'StateManager',
|
|
|
|
function BrowseFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider, StateManager) {
|
2018-07-23 05:01:03 +00:00
|
|
|
'use strict';
|
2018-10-26 03:16:29 +00:00
|
|
|
return $resource(API_ENDPOINT_ENDPOINTS + '/:endpointId/docker/v:version/browse/:action', {
|
|
|
|
endpointId: EndpointProvider.endpointID,
|
|
|
|
version: StateManager.getAgentApiVersion
|
2018-07-23 05:01:03 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ls: {
|
2018-10-07 22:34:47 +00:00
|
|
|
method: 'GET', isArray: true, params: { action: 'ls' }
|
2018-07-23 05:01:03 +00:00
|
|
|
},
|
|
|
|
get: {
|
2018-10-07 22:34:47 +00:00
|
|
|
method: 'GET', params: { action: 'get' },
|
2019-06-21 13:44:29 +00:00
|
|
|
transformResponse: browseGetResponse,
|
|
|
|
responseType: 'arraybuffer'
|
2018-07-23 05:01:03 +00:00
|
|
|
},
|
|
|
|
delete: {
|
2018-10-07 22:34:47 +00:00
|
|
|
method: 'DELETE', params: { action: 'delete' }
|
2018-07-23 05:01:03 +00:00
|
|
|
},
|
|
|
|
rename: {
|
2018-10-07 22:34:47 +00:00
|
|
|
method: 'PUT', params: { action: 'rename' }
|
2018-07-23 05:01:03 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}]);
|