Add api-ref for container logs
This patch adds api-ref for container logs. Closes-Bug: #1720924 Change-Id: I652a5a592ecfe0f06e8df594ba4074f285ab891c
This commit is contained in:
parent
94ee6dabd8
commit
ef340fecb1
@ -6,7 +6,7 @@
|
||||
|
||||
Lists, creates, shows details for, stats, updates, deletes, starts, resize,
|
||||
stops, pauses, unpauses, restarts, renames, commits containers, and adds
|
||||
security group for specified container.
|
||||
security group for specified container, gets logs of a container.
|
||||
|
||||
Create new container
|
||||
====================
|
||||
@ -819,3 +819,49 @@ This request does not return anything in the response body.
|
||||
.. rest_parameters:: parameters.yaml
|
||||
|
||||
- X-Openstack-Request-Id: request_id
|
||||
|
||||
|
||||
Get logs of a container
|
||||
=======================
|
||||
|
||||
.. rest_method:: GET /v1/containers/{container_ident}/logs?timestamps={timestamps}&&since={since}&tail={tail}&stderr={stderr}&stdout={stdout}
|
||||
|
||||
Get logs of a container.
|
||||
|
||||
Response Codes
|
||||
--------------
|
||||
|
||||
.. rest_status_code:: success status.yaml
|
||||
|
||||
- 200
|
||||
|
||||
.. rest_status_code:: error status.yaml
|
||||
|
||||
- 400
|
||||
- 401
|
||||
- 403
|
||||
- 404
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
.. rest_parameters:: parameters.yaml
|
||||
|
||||
- container_ident: container_ident
|
||||
- timestamps: timestamps
|
||||
- tail: tail
|
||||
- stderr: stderr
|
||||
- stdout: stdout
|
||||
- since: since
|
||||
|
||||
Request Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: samples/container-logs-req.json
|
||||
:language: javascript
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
This request returns logs string as a response, which is
|
||||
not in json format.
|
||||
|
@ -53,18 +53,48 @@ security_group_query:
|
||||
in: query
|
||||
required: true
|
||||
type: string
|
||||
since:
|
||||
description: |
|
||||
Show logs since a given datetime or integer epoch (in seconds).
|
||||
in: query
|
||||
required: false
|
||||
type: string
|
||||
stderr:
|
||||
description: |
|
||||
Get standard error if True.
|
||||
in: query
|
||||
required: false
|
||||
type: boolean
|
||||
stdout:
|
||||
description: |
|
||||
Get standard output if True.
|
||||
in: query
|
||||
required: false
|
||||
type: boolean
|
||||
tag:
|
||||
description: |
|
||||
The tag of the container image.
|
||||
in: query
|
||||
required: true
|
||||
type: string
|
||||
tail:
|
||||
description: |
|
||||
Number of lines to show from the end of the logs, default is get all logs.
|
||||
in: query
|
||||
required: false
|
||||
type: string
|
||||
timeout:
|
||||
description: |
|
||||
Seconds to wait before operating on container.
|
||||
in: query
|
||||
required: true
|
||||
type: string
|
||||
timestamps:
|
||||
description: |
|
||||
Whether to show timestamps in the logs of container.
|
||||
in: query
|
||||
required: false
|
||||
type: boolean
|
||||
width:
|
||||
description: |
|
||||
The tty width of a container.
|
||||
|
7
api-ref/source/samples/container-logs-req.json
Normal file
7
api-ref/source/samples/container-logs-req.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"timestamps": "True",
|
||||
"tail": "all",
|
||||
"since": "600000",
|
||||
"stderr": "True",
|
||||
"stdout": "True"
|
||||
}
|
Loading…
Reference in New Issue
Block a user