From bcca3b9f8c63254c9b8c6b774cff8174b599ad59 Mon Sep 17 00:00:00 2001 From: miaohb Date: Fri, 7 Jul 2017 15:59:07 +0800 Subject: [PATCH] Add api-ref for container stats This patch adds api-ref for container stats. Change-Id: I6bdd9973a98983042202b222a2139a03301a8bbb Partially-Implements: bp zun-api-doc --- api-ref/source/containers.inc | 45 ++++++++++++++++++- api-ref/source/parameters.yaml | 7 +++ .../source/samples/container-stats-resp.json | 9 ++++ 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 api-ref/source/samples/container-stats-resp.json diff --git a/api-ref/source/containers.inc b/api-ref/source/containers.inc index 2b2fc908e..b52b19d9a 100644 --- a/api-ref/source/containers.inc +++ b/api-ref/source/containers.inc @@ -4,7 +4,7 @@ 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. Create new container @@ -244,6 +244,49 @@ This request does not return anything in the response body. - 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 =============================== diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml index 1e538976d..b7dd87aff 100644 --- a/api-ref/source/parameters.yaml +++ b/api-ref/source/parameters.yaml @@ -209,6 +209,13 @@ state: in: body required: true 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: description: | The current state of the container. diff --git a/api-ref/source/samples/container-stats-resp.json b/api-ref/source/samples/container-stats-resp.json new file mode 100644 index 000000000..419b14fbe --- /dev/null +++ b/api-ref/source/samples/container-stats-resp.json @@ -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" +}