DCOS Logging API Node.js Client Library
Node.js client library lightweigth for DCOS Logging API. ES6
Install
Install using npm or yarn
$ npm install dcos-logging-node
$ yarn add dcos-logging-node
Usage
const dcosLogging = dcosHost: 'DCOS_HOST' dcosProtocol: 'https' headers: 'Authorization': 'token=DCOS_ACCESS_TOKEN' /* You can get the access Token in the DCOS cli Using $ dcos config show core.dcos_acs_token */ ; dcosLoggingrange ;
Format
In the methods you will neet to discribe the Accept Header. The API request header can be any the following:
text/plain
,text/html
,*/*
request logs in text format, ending with\n
.application/json
request logs in JSON format.text/event-stream
request logs in Server-Sent-Events format.
Stream
You can get a readble Stream object from any end point in the Logging API
dcosLoggingrange ;
Methods
Note: If the AcceptHeader is
text/event-stream
you will need to set theRequestStream
param to false
Range
get(agentId, acceptHeader, requestStream, parameters)
download(agentId, acceptHeader, requestStream, parameters)
framework(agentId,frameworkId, executorId, containerId, acceptHeader, requestStream, parameters)
frameworkDownload(agentId, frameworkId, executorId, containerId, acceptHeader, requestStream , parameters)
Stream
get(agentId, AcceptHeader, requestStream, parameters)
framework(agentId, frameworkId, executorId, containerId, acceptHeader, requestStream)
Fields
get(agentId, field, acceptHeader, requestStream, parameters)