diff --git a/api-ref/source/containers.inc b/api-ref/source/containers.inc index d2fb49a60..2eb278e94 100644 --- a/api-ref/source/containers.inc +++ b/api-ref/source/containers.inc @@ -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 ========================================== diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml index 8ccfa980d..e8b305463 100644 --- a/api-ref/source/parameters.yaml +++ b/api-ref/source/parameters.yaml @@ -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. diff --git a/api-ref/source/samples/container-get-archive-resp.json b/api-ref/source/samples/container-get-archive-resp.json new file mode 100644 index 000000000..244d29147 --- /dev/null +++ b/api-ref/source/samples/container-get-archive-resp.json @@ -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" +} diff --git a/api-ref/source/samples/container-put-archive-req.json b/api-ref/source/samples/container-put-archive-req.json new file mode 100644 index 000000000..4941879c6 --- /dev/null +++ b/api-ref/source/samples/container-put-archive-req.json @@ -0,0 +1,3 @@ +{ + "data": "ARCHIVE FILE DATA" +}