Add api-ref for container get/put archive

This patch adds api-ref for container get/put archive.

Change-Id: I4e6d5e6b5c22c01e0209e52bd50d531e7b335354
Partially-Implements: bp zun-api-doc
This commit is contained in:
miaohb 2017-08-27 21:25:57 -07:00
parent 835d8ac9b6
commit 1b1a787767
4 changed files with 131 additions and 4 deletions

View File

@ -4,10 +4,11 @@
Manage Containers Manage Containers
=================== ===================
Lists, creates, shows details for, stats, updates, deletes, starts, resize, Lists, creates, shows details for, stats, updates, deletes, starts, resizes,
stops, pauses, unpauses, restarts, renames, commits containers, and adds stops, pauses, unpauses, restarts, renames, commits containers, gets archive
security group for specified container, gets logs of a container, displays from container, puts archive to container, and adds security group for
the running processes in a container. specified container, gets logs of a container, displays the running processes
in a container.
Create new container Create new container
==================== ====================
@ -622,6 +623,95 @@ Response Example
:language: javascript :language: javascript
Get archive from a container
=============================
.. rest_method:: GET /v1/containers/{container_ident}/get_archive?path={source_path}
Get a tar archive of a resource in the filesystem 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
- source_path: source_path
Response
--------
.. rest_parameters:: parameters.yaml
- data: data
- stat: stat
Response Example
----------------
.. literalinclude:: samples/container-get-archive-resp.json
:language: javascript
Put archive to a container
==========================
.. rest_method:: POST /v1/containers/{container_ident}/put_archive?path={destination_path}
Upload a tar archive to be extracted to a path in the filesystem of 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
- destination_path: destination_path
- data: data
Request Example
----------------
.. literalinclude:: samples/container-put-archive-req.json
:language: javascript
Response
--------
This request does not return anything in the response body.
.. rest_parameters:: parameters.yaml
- X-Openstack-Request-Id: request_id
Add security group for specified container Add security group for specified container
========================================== ==========================================

View File

@ -17,6 +17,12 @@ host_ident:
in: path in: path
required: true required: true
type: string type: string
destination_path:
description: |
The destination path in a container when putting archive to a container.
in: query
required: true
type: string
force: force:
description: | description: |
Specify to delete container forcefully. Specify to delete container forcefully.
@ -65,6 +71,12 @@ since:
in: query in: query
required: false required: false
type: string type: string
source_path:
description: |
The file path in a container when getting archive from a container.
in: query
required: true
type: string
stderr: stderr:
description: | description: |
Get standard error if True. Get standard error if True.
@ -159,6 +171,12 @@ created_at:
in: body in: body
required: true required: true
type: string type: string
data:
description: |
The content of the tar file which is got from a container or put to a container.
in: body
required: true
type: string
disabled: disabled:
description: | description: |
Whether or not this service is disabled or not. Whether or not this service is disabled or not.
@ -330,6 +348,12 @@ services:
in: body in: body
required: true required: true
type: array type: array
stat:
description: |
The stat information when doing get_archive.
in: body
required: true
type: string
state: state:
description: | description: |
The current state of Zun services. The current state of Zun services.

View File

@ -0,0 +1,10 @@
{
"stat": {
"linkTarget": "",
"size": 129,
"mode": 493,
"name": "ip.sh",
"mtime": "2017-07-25T18:54:50-07:00"
},
"data": "ARCHIVE FILE DATA"
}

View File

@ -0,0 +1,3 @@
{
"data": "ARCHIVE FILE DATA"
}