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