2016-04-12 09:03:46 -04:00
|
|
|
.. -*- rst -*-
|
|
|
|
|
2016-10-10 14:50:17 -04:00
|
|
|
Show Console Output (os-getConsoleOutput Action)
|
2016-04-12 09:03:46 -04:00
|
|
|
================================================
|
|
|
|
|
2016-06-02 08:50:03 -04:00
|
|
|
.. rest_method:: POST /servers/{server_id}/action
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2017-03-27 09:22:10 +00:00
|
|
|
Shows console output for a server.
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-10-10 14:50:17 -04:00
|
|
|
This API returns the text of the console since boot.
|
|
|
|
The content returned may be large. Limit the lines of console
|
|
|
|
text, beginning at the tail of the content, by setting
|
|
|
|
the optional ``length`` parameter in the request body.
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-12-11 21:47:42 +08:00
|
|
|
The server to get console log from should set
|
|
|
|
``export LC_ALL=en_US.UTF-8`` in order to avoid incorrect unicode error.
|
|
|
|
|
2016-04-12 09:03:46 -04:00
|
|
|
Normal response codes: 200
|
|
|
|
|
2016-05-09 15:49:38 -04:00
|
|
|
Error response codes: unauthorized(401), forbidden(403),
|
|
|
|
notFound(404), conflict(409), methodNotImplemented(501)
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Request
|
2016-04-14 13:10:59 -04:00
|
|
|
-------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
2016-05-09 15:49:38 -04:00
|
|
|
- server_id: server_id_path
|
2016-04-12 09:03:46 -04:00
|
|
|
- os-getConsoleOutput: os-getConsoleOutput
|
|
|
|
- length: length
|
|
|
|
|
2016-10-10 14:50:17 -04:00
|
|
|
**Example Show Console Output (os-getConsoleOutput Action)**
|
2016-05-09 15:49:38 -04:00
|
|
|
|
2016-10-10 14:50:17 -04:00
|
|
|
This example requests the last 50 lines of console content
|
|
|
|
from the specified server.
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-19 17:12:00 +08:00
|
|
|
.. literalinclude:: ../../doc/api_samples/os-console-output/console-output-post-req.json
|
2016-04-12 09:03:46 -04:00
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
Response
|
2016-04-14 13:10:59 -04:00
|
|
|
--------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-05-09 15:49:38 -04:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- output: console_output
|
|
|
|
|
2016-10-10 14:50:17 -04:00
|
|
|
**Example Show Console Output (os-getConsoleOutput Action)**
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-19 17:12:00 +08:00
|
|
|
.. literalinclude:: ../../doc/api_samples/os-console-output/console-output-post-resp.json
|
2016-04-12 09:03:46 -04:00
|
|
|
:language: javascript
|