2017-01-31 23:26:29 +00:00
|
|
|
angular.module('portainer.rest')
|
2017-03-12 16:24:15 +00:00
|
|
|
.factory('ContainerLogs', ['$http', 'Settings', 'EndpointProvider', function ContainerLogsFactory($http, Settings, EndpointProvider) {
|
2017-01-31 23:26:29 +00:00
|
|
|
'use strict';
|
|
|
|
return {
|
|
|
|
get: function (id, params, callback) {
|
|
|
|
$http({
|
|
|
|
method: 'GET',
|
2017-03-12 16:24:15 +00:00
|
|
|
url: Settings.url + '/' + EndpointProvider.endpointID() + '/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) {
|
|
|
|
console.log(error, data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}]);
|