Add api-ref for container stats

This patch adds api-ref for container stats.

Change-Id: I6bdd9973a98983042202b222a2139a03301a8bbb
Partially-Implements: bp zun-api-doc
This commit is contained in:
miaohb 2017-07-07 15:59:07 +08:00
parent 368ce78d74
commit bcca3b9f8c
3 changed files with 60 additions and 1 deletions

View File

@ -4,7 +4,7 @@
Manage Containers Manage Containers
=================== ===================
Lists, creates, shows details for, updates, deletes, starts, Lists, creates, shows details for, stats, updates, deletes, starts,
stops, pauses, unpauses, restarts and renames containers. stops, pauses, unpauses, restarts and renames containers.
Create new container Create new container
@ -244,6 +244,49 @@ This request does not return anything in the response body.
- X-Openstack-Request-Id: request_id - X-Openstack-Request-Id: request_id
Display stats of a container
============================
.. rest_method:: GET /v1/containers/{container_ident}/stats
Display stats of a container.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 401
- 403
- 404
- 409
Request
-------
.. rest_parameters:: parameters.yaml
- container_ident: container_ident
Response
--------
.. rest_parameters:: parameters.yaml
- stats_info: stats_info
Response Example
----------------
.. literalinclude:: samples/container-stats-resp.json
:language: javascript
Update information of container Update information of container
=============================== ===============================

View File

@ -209,6 +209,13 @@ state:
in: body in: body
required: true required: true
type: string type: string
stats_info:
description: |
The stats information of a container,
including cpu, memory, blk io and net io.
in: body
required: true
type: dict
status: status:
description: | description: |
The current state of the container. The current state of the container.

View File

@ -0,0 +1,9 @@
{
"CONTAINER": "test",
"CPU %": 8.89,
"MEM USAGE(MiB)": 7,
"MEM LIMIT(MiB)": 16048,
"MEM %": 0.0436191425723,
"BLOCK I/O(B)": "12910592/0",
"NET I/O(B)": "246614/648"
}