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
===================
Lists, creates, shows details for, stats, updates, deletes, starts, resize,
stops, pauses, unpauses, restarts, renames, commits containers, and adds
security group for specified container, gets logs of a container, displays
the running processes in a container.
Lists, creates, shows details for, stats, updates, deletes, starts, resizes,
stops, pauses, unpauses, restarts, renames, commits containers, gets archive
from container, puts archive to container, and adds security group for
specified container, gets logs of a container, displays the running processes
in a container.
Create new container
====================
@ -622,6 +623,95 @@ Response Example
: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
==========================================

View File

@ -17,6 +17,12 @@ host_ident:
in: path
required: true
type: string
destination_path:
description: |
The destination path in a container when putting archive to a container.
in: query
required: true
type: string
force:
description: |
Specify to delete container forcefully.
@ -65,6 +71,12 @@ since:
in: query
required: false
type: string
source_path:
description: |
The file path in a container when getting archive from a container.
in: query
required: true
type: string
stderr:
description: |
Get standard error if True.
@ -159,6 +171,12 @@ created_at:
in: body
required: true
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:
description: |
Whether or not this service is disabled or not.
@ -330,6 +348,12 @@ services:
in: body
required: true
type: array
stat:
description: |
The stat information when doing get_archive.
in: body
required: true
type: string
state:
description: |
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"
}