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' },
|
2018-07-23 05:01:03 +00:00
|
|
|
transformResponse: browseGetResponse
|
|
|
|
},
|
|
|
|
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
|
|
|
}
|
|
|
|
});
|
|
|
|
}]);
|