Bastion API for Logs¶
Bastion API documentation for logs
Loggers¶
-
GET
/log/defaults
¶ Get the default loggers configuration
Response JSON Object: - [key] (string) – The logger level.
Example response:
{ "leaf": "info" }
-
POST
/log/defaults/{loggerID}
¶ Update the default logger
Parameters: - loggerID – The logger ID
Request JSON Object: - [key] (string) – The logger level.
Example query:
{ "leaf": "info" }
-
GET
/log/allocs/{allocID}
¶ Get the current allocation loggers configuration. An empty value means that the allocation is using the default value. An allocation is an instance of a task.
Parameters: - allocID – The allocation ID
Response JSON Object: - [key] (string) – The logger level.
Example response:
{ "leaf": "info" }
-
POST
/log/allocs/{allocID}/{loggerID}
¶ Set an allocation loggers configuration
Parameters: - allocID – The allocation ID
- loggerID – The logger ID
Request JSON Object: - [key] (string) – The logger level.
Response JSON Object: - [key] (string) – The logger level.
Example query:
{ "leaf": "info" }
Example response:
{ "leaf": "info" }
Logs¶
-
GET
/log/logs
¶ Get the logs
Response JSON Object: - [] (object) –
- [].id (string) – The name of the log.
- [].fileName (string) – The file name. Ex: stderr, stdout.
- [].group (string) – The log group.
- [].job (string) – The log job.
- [].logLevel (boolean) – If the logger support dynamic log level.
- [].task (string) – The task.
Example response:
[ { "id": "web", "fileName": "stdout", "group": "web", "job": "web", "logLevel": false, "task": "web" } ]
-
POST
/log/logs
¶ Set the logs
Request JSON Object: - [] (object) –
- [].id (string) – The name of the log.
- [].fileName (string) – The file name. Ex: stderr, stdout.
- [].group (string) – The log group.
- [].job (string) – The log job.
- [].logLevel (boolean) – If the logger support dynamic log level.
- [].task (string) – The task.
Example query:
[ { "id": "web", "fileName": "stdout", "group": "web", "job": "web", "logLevel": false, "task": "web" } ]
-
DELETE
/log/logs
¶ Delete all logs
-
POST
/log/log/{logID}
¶ Create a log
Parameters: - logID – The log’s id
Request JSON Object: - id (string) – The name of the log.
- fileName (string) – The file name. Ex: stderr, stdout.
- group (string) – The log group.
- job (string) – The log job.
- logLevel (boolean) – If the logger support dynamic log level.
- task (string) – The task.
Example query:
{ "id": "web", "fileName": "stdout", "group": "web", "job": "web", "logLevel": false, "task": "web" }
-
PUT
/log/log/{logID}
¶ Update a log
Parameters: - logID – The log’s id
Request JSON Object: - id (string) – The name of the log.
- fileName (string) – The file name. Ex: stderr, stdout.
- group (string) – The log group.
- job (string) – The log job.
- logLevel (boolean) – If the logger support dynamic log level.
- task (string) – The task.
Example query:
{ "id": "web", "fileName": "stdout", "group": "web", "job": "web", "logLevel": false, "task": "web" }
-
DELETE
/log/log/{logID}
¶ Delete a log
Parameters: - logID – The log’s id
-
GET
/log/meta/{logID}
¶ Get the log’s metadata
Parameters: - logID – undefined
Response JSON Object: - [] (object) –
- [].allocID (string) – The log allocation ID.
- [].status (string) – The task status.
- [].logLevel (boolean) – If the process supports log level or not.
- [].jobName (string) – The job name.
- [].taskName (string) – The task name.
- [].fileName (string) – The file name.
- [].createTime (string) – The creation time of the log.
Example response:
[ { "allocID": "8e8c53da-b60f-c3c7-1d63-2243507fee1a", "status": "running", "logLevel": true, "jobName": "tutorial", "taskName": "tutorial", "fileName": "stderr", "createTime": 1549982869888 } ]
-
GET
/log/fs/{alloc}/{task}/{fs}
¶ Get the log data
Parameters: - alloc – The allocation ID
- task – The task name
- fs – The file system id. Either stdout or stderr
Query Parameters: - origin – The origin of the log. start or end
- offset – The offset from the origin
Response JSON Object: - Offset (integer) – The offset from the origin.
- Data (string) – The log data.
- File (string) – The file.
- FileEvent (string) –
Example response:
{ "Offset": 0, "Data": "logData", "File": "", "FileEvent": "" }