2017-01-31 23:26:29 +00:00
|
|
|
angular.module('portainer.rest')
|
2017-07-20 14:22:27 +00:00
|
|
|
.factory('ContainerLogs', ['$http', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', function ContainerLogsFactory($http, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
|
2017-01-31 23:26:29 +00:00
|
|
|
'use strict';
|
|
|
|
return {
|
|
|
|
get: function (id, params, callback) {
|
|
|
|
$http({
|
|
|
|
method: 'GET',
|
2017-07-27 08:46:29 +00:00
|
|
|
url: API_ENDPOINT_ENDPOINTS + '/' + EndpointProvider.endpointID() + '/docker/containers/' + id + '/logs',
|
2017-01-31 23:26:29 +00:00
|
|
|
params: {
|
|
|
|
'stdout': params.stdout || 0,
|
|
|
|
'stderr': params.stderr || 0,
|
|
|
|
'timestamps': params.timestamps || 0,
|
|
|
|
'tail': params.tail || 'all'
|
|
|
|
}
|
|
|
|
}).success(callback).error(function (data, status, headers, config) {
|
2017-07-27 08:46:29 +00:00
|
|
|
console.log(data);
|
2017-01-31 23:26:29 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}]);
|