2017-05-31 14:34:06 +05:30
|
|
|
.. -*- rst -*-
|
|
|
|
|
|
|
|
===================
|
|
|
|
Manage Containers
|
|
|
|
===================
|
|
|
|
|
2017-08-27 21:25:57 -07:00
|
|
|
Lists, creates, shows details for, stats, updates, deletes, starts, resizes,
|
2017-10-23 00:54:51 -07:00
|
|
|
stops, pauses, unpauses, restarts, renames, commits, kills, attaches to containers,
|
2017-10-16 01:33:20 -07:00
|
|
|
gets archive from container, puts archive to container, and adds security group
|
2017-10-16 03:53:03 -07:00
|
|
|
for specified container, executes command in a running container, gets logs
|
2017-10-16 04:34:37 -07:00
|
|
|
of a container, displays the running processes in a container, resizes
|
|
|
|
the tty session used by the exec.
|
2017-05-31 14:34:06 +05:30
|
|
|
|
|
|
|
Create new container
|
|
|
|
====================
|
|
|
|
|
|
|
|
.. rest_method:: POST /v1/containers/
|
|
|
|
|
|
|
|
Create new container.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
2017-07-14 10:18:53 +08:00
|
|
|
- 202
|
2017-05-31 14:34:06 +05:30
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 400
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- name: name
|
|
|
|
- image: image
|
|
|
|
- command: command
|
|
|
|
- cpu: cpu
|
|
|
|
- memory: memory
|
|
|
|
- workdir: workdir
|
|
|
|
- image_pull_policy: image_pull_policy
|
|
|
|
- labels: labels
|
|
|
|
- environment: environment
|
|
|
|
- restart_policy: restart_policy
|
|
|
|
- interactive: interactive
|
|
|
|
- image_driver: image_driver
|
|
|
|
- security_groups: security_groups
|
2017-07-08 22:25:20 +00:00
|
|
|
- nets: nets
|
2017-08-04 16:01:19 +05:30
|
|
|
- runtime: runtime
|
2017-09-14 10:40:15 +07:00
|
|
|
- hostname: hostname
|
2017-09-18 10:21:19 +08:00
|
|
|
- auto_remove: auto_remove
|
2017-05-31 14:34:06 +05:30
|
|
|
|
|
|
|
Request Example
|
|
|
|
----------------
|
|
|
|
|
|
|
|
.. literalinclude:: samples/container-create-req.json
|
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- links: links
|
|
|
|
- addresses: addresses
|
|
|
|
- name: name
|
|
|
|
- image: image
|
|
|
|
- labels: labels
|
|
|
|
- image_driver: image_driver
|
|
|
|
- security_groups: security_groups
|
|
|
|
- command: command
|
|
|
|
- cpu: cpu
|
|
|
|
- memory: memory
|
|
|
|
- workdir: workdir
|
|
|
|
- image_pull_policy: image_pull_policy
|
|
|
|
- environment: environment
|
|
|
|
- restart_policy: restart_policy
|
|
|
|
- interactive: interactive
|
|
|
|
- uuid: uuid
|
|
|
|
- hostname: hostname
|
|
|
|
- status: status
|
|
|
|
- status_detail: status_detail
|
|
|
|
- host: host
|
|
|
|
- task_state: task_state
|
|
|
|
- status_reason: status_reason
|
|
|
|
- ports: ports
|
2017-09-18 10:21:19 +08:00
|
|
|
- auto_remove: auto_remove
|
|
|
|
|
2017-05-31 14:34:06 +05:30
|
|
|
|
|
|
|
Response Example
|
|
|
|
----------------
|
|
|
|
|
|
|
|
.. literalinclude:: samples/container-create-resp.json
|
|
|
|
:language: javascript
|
2017-06-22 13:51:24 +05:30
|
|
|
|
|
|
|
List all containers
|
|
|
|
===================
|
|
|
|
|
|
|
|
.. rest_method:: GET /v1/containers/
|
|
|
|
|
|
|
|
List all available containers in Zun.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 200
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- containers: container_list
|
|
|
|
- links: links
|
|
|
|
- addresses: addresses
|
|
|
|
- name: name
|
|
|
|
- image: image
|
|
|
|
- labels: labels
|
|
|
|
- image_driver: image_driver
|
|
|
|
- security_groups: security_groups
|
|
|
|
- command: command
|
|
|
|
- cpu: cpu
|
|
|
|
- memory: memory
|
|
|
|
- workdir: workdir
|
|
|
|
- image_pull_policy: image_pull_policy
|
|
|
|
- environment: environment
|
|
|
|
- restart_policy: restart_policy
|
|
|
|
- interactive: interactive
|
|
|
|
- uuid: uuid
|
|
|
|
- hostname: hostname
|
|
|
|
- status: status
|
|
|
|
- status_detail: status_detail
|
|
|
|
- host: host
|
|
|
|
- task_state: task_state
|
|
|
|
- status_reason: status_reason
|
|
|
|
- ports: ports
|
|
|
|
|
|
|
|
Response Example
|
|
|
|
----------------
|
|
|
|
|
|
|
|
.. literalinclude:: samples/container-get-all-resp.json
|
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
Show details of a container
|
|
|
|
===========================
|
|
|
|
|
|
|
|
.. rest_method:: GET /v1/containers/{container_ident}
|
|
|
|
|
|
|
|
Get all information of a container in Zun.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 200
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- links: links
|
|
|
|
- addresses: addresses
|
|
|
|
- name: name
|
|
|
|
- image: image
|
|
|
|
- labels: labels
|
|
|
|
- image_driver: image_driver
|
|
|
|
- security_groups: security_groups
|
|
|
|
- command: command
|
|
|
|
- cpu: cpu
|
|
|
|
- memory: memory
|
|
|
|
- workdir: workdir
|
|
|
|
- image_pull_policy: image_pull_policy
|
|
|
|
- environment: environment
|
|
|
|
- restart_policy: restart_policy
|
|
|
|
- interactive: interactive
|
|
|
|
- uuid: uuid
|
|
|
|
- hostname: hostname
|
|
|
|
- status: status
|
|
|
|
- status_detail: status_detail
|
|
|
|
- host: host
|
|
|
|
- task_state: task_state
|
|
|
|
- status_reason: status_reason
|
|
|
|
- ports: ports
|
|
|
|
|
|
|
|
Response Example
|
|
|
|
----------------
|
|
|
|
|
|
|
|
.. literalinclude:: samples/container-show-resp.json
|
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
Delete a container
|
|
|
|
==================
|
|
|
|
|
|
|
|
.. rest_method:: DELETE /v1/containers/{container_ident}
|
|
|
|
|
|
|
|
Delete a container. To delete a container in `Creating` or `Running`
|
|
|
|
state, request to /v1/containers/{container_ident}?force=True
|
2017-10-08 18:07:15 -07:00
|
|
|
To stop and delete a container, request to /v1/containers/{container
|
|
|
|
_ident}?stop=True
|
2017-06-22 13:51:24 +05:30
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 204
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
- 409
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
- force: force
|
2017-10-08 18:07:15 -07:00
|
|
|
- stop: stop
|
2017-06-22 13:51:24 +05:30
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
This request does not return anything in the response body.
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- X-Openstack-Request-Id: request_id
|
|
|
|
|
2017-07-07 15:59:07 +08:00
|
|
|
|
2017-10-23 00:54:51 -07:00
|
|
|
Kill a container
|
|
|
|
================
|
|
|
|
|
2018-02-07 04:18:54 +00:00
|
|
|
.. rest_method:: POST /v1/containers/{container_ident}/kill
|
2017-10-23 00:54:51 -07:00
|
|
|
|
|
|
|
Kill a running container.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 202
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 400
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
- 409
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
- signal: signal
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
This request does not return anything in the response body.
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- X-Openstack-Request-Id: request_id
|
|
|
|
|
|
|
|
|
2017-07-07 15:59:07 +08:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2017-06-22 13:51:24 +05:30
|
|
|
Update information of container
|
|
|
|
===============================
|
|
|
|
|
|
|
|
.. rest_method:: PATCH /v1/containers/{container_ident}
|
|
|
|
|
|
|
|
Update information of one container attributes. Currently only `cpu` and
|
|
|
|
`memory` can be updated.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 200
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 400
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
- memory: memory
|
|
|
|
- cpu: cpu
|
|
|
|
|
|
|
|
Request Example
|
|
|
|
----------------
|
|
|
|
|
|
|
|
.. literalinclude:: samples/container-update-req.json
|
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
Return new container with updated attributes.
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- links: links
|
|
|
|
- addresses: addresses
|
|
|
|
- name: name
|
|
|
|
- image: image
|
|
|
|
- labels: labels
|
|
|
|
- image_driver: image_driver
|
|
|
|
- security_groups: security_groups
|
|
|
|
- command: command
|
|
|
|
- cpu: cpu
|
|
|
|
- memory: memory
|
|
|
|
- workdir: workdir
|
|
|
|
- image_pull_policy: image_pull_policy
|
|
|
|
- environment: environment
|
|
|
|
- restart_policy: restart_policy
|
|
|
|
- interactive: interactive
|
|
|
|
- uuid: uuid
|
|
|
|
- hostname: hostname
|
|
|
|
- status: status
|
|
|
|
- status_detail: status_detail
|
|
|
|
- host: host
|
|
|
|
- task_state: task_state
|
|
|
|
- status_reason: status_reason
|
|
|
|
- ports: ports
|
|
|
|
|
|
|
|
Response Example
|
|
|
|
----------------
|
|
|
|
|
|
|
|
.. literalinclude:: samples/container-update-resp.json
|
|
|
|
:language: javascript
|
2017-07-07 10:59:45 +08:00
|
|
|
|
|
|
|
Start a container
|
|
|
|
=================
|
|
|
|
|
|
|
|
.. rest_method:: POST /v1/containers/{container_ident}/start
|
|
|
|
|
|
|
|
Start a container.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 202
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
- 409
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
This request does not return anything in the response body.
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- X-Openstack-Request-Id: request_id
|
|
|
|
|
|
|
|
Stop a container
|
|
|
|
================
|
|
|
|
|
2018-02-07 04:18:54 +00:00
|
|
|
.. rest_method:: POST /v1/containers/{container_ident}/stop
|
2017-07-07 10:59:45 +08:00
|
|
|
|
|
|
|
Stop a container.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 202
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
- 409
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
- timeout: timeout
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
This request does not return anything in the response body.
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- X-Openstack-Request-Id: request_id
|
|
|
|
|
|
|
|
Pause a container
|
|
|
|
=================
|
|
|
|
|
|
|
|
.. rest_method:: POST /v1/containers/{container_ident}/pause
|
|
|
|
|
|
|
|
Pause a container.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 202
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
- 409
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
This request does not return anything in the response body.
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- X-Openstack-Request-Id: request_id
|
|
|
|
|
|
|
|
Unpause a container
|
|
|
|
===================
|
|
|
|
|
|
|
|
.. rest_method:: POST /v1/containers/{container_ident}/unpause
|
|
|
|
|
|
|
|
Unpause a container.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 202
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
- 409
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
This request does not return anything in the response body.
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- X-Openstack-Request-Id: request_id
|
|
|
|
|
|
|
|
Restart a container
|
|
|
|
===================
|
|
|
|
|
2018-02-07 04:18:54 +00:00
|
|
|
.. rest_method:: POST /v1/containers/{container_ident}/reboot
|
2017-07-07 10:59:45 +08:00
|
|
|
|
|
|
|
Restart a container.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 202
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
- 409
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
- timeout: timeout
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
This request does not return anything in the response body.
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- X-Openstack-Request-Id: request_id
|
|
|
|
|
|
|
|
|
|
|
|
Rename a container
|
|
|
|
==================
|
|
|
|
|
2018-02-07 04:18:54 +00:00
|
|
|
.. rest_method:: POST /v1/containers/{container_ident}/rename
|
2017-07-07 10:59:45 +08:00
|
|
|
|
|
|
|
Rename a container.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
2017-07-14 10:18:53 +08:00
|
|
|
- 200
|
2017-07-07 10:59:45 +08:00
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
- 409
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
- new_name: new_name
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- links: links
|
|
|
|
- addresses: addresses
|
|
|
|
- name: name
|
|
|
|
- image: image
|
|
|
|
- labels: labels
|
|
|
|
- image_driver: image_driver
|
|
|
|
- security_groups: security_groups
|
|
|
|
- command: command
|
|
|
|
- cpu: cpu
|
|
|
|
- memory: memory
|
|
|
|
- workdir: workdir
|
|
|
|
- image_pull_policy: image_pull_policy
|
|
|
|
- environment: environment
|
|
|
|
- restart_policy: restart_policy
|
|
|
|
- interactive: interactive
|
|
|
|
- uuid: uuid
|
|
|
|
- hostname: hostname
|
|
|
|
- status: status
|
|
|
|
- status_detail: status_detail
|
|
|
|
- host: host
|
|
|
|
- task_state: task_state
|
|
|
|
- status_reason: status_reason
|
|
|
|
- ports: ports
|
|
|
|
|
|
|
|
Response Example
|
|
|
|
----------------
|
|
|
|
|
|
|
|
.. literalinclude:: samples/container-rename-resp.json
|
|
|
|
:language: javascript
|
2017-08-22 19:59:43 -07:00
|
|
|
|
|
|
|
|
2017-08-27 21:25:57 -07:00
|
|
|
Get archive from a container
|
|
|
|
=============================
|
|
|
|
|
2018-02-07 04:18:54 +00:00
|
|
|
.. rest_method:: GET /v1/containers/{container_ident}/get_archive
|
2017-08-27 21:25:57 -07:00
|
|
|
|
|
|
|
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
|
|
|
|
==========================
|
|
|
|
|
2018-02-07 04:18:54 +00:00
|
|
|
.. rest_method:: POST /v1/containers/{container_ident}/put_archive
|
2017-08-27 21:25:57 -07:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
2017-08-22 19:59:43 -07:00
|
|
|
Add security group for specified container
|
|
|
|
==========================================
|
|
|
|
|
2018-02-07 04:18:54 +00:00
|
|
|
.. rest_method:: POST /v1/containers/{container_ident}/add_securtiy_group
|
2017-08-22 19:59:43 -07:00
|
|
|
|
|
|
|
Add security group for specified container.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 202
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
- 409
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
2017-10-09 12:53:42 +08:00
|
|
|
- security_group: security_group_query
|
2017-08-22 19:59:43 -07:00
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
This request does not return anything in the response body.
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- X-Openstack-Request-Id: request_id
|
2017-08-26 00:34:28 -07:00
|
|
|
|
|
|
|
|
|
|
|
Commit a container
|
|
|
|
==================
|
|
|
|
|
2018-02-07 04:18:54 +00:00
|
|
|
.. rest_method:: POST /v1/containers/{container_ident}/commit
|
2017-08-26 00:34:28 -07:00
|
|
|
|
2017-09-28 04:22:46 -07:00
|
|
|
Create a new image from a container's changes.
|
2017-08-26 00:34:28 -07:00
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 202
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
- 409
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
- repository: repository
|
|
|
|
- tag: tag
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- image: image
|
2017-08-15 16:37:43 +08:00
|
|
|
|
2017-09-28 04:22:46 -07:00
|
|
|
Response Example
|
|
|
|
----------------
|
|
|
|
|
|
|
|
.. literalinclude:: samples/container-commit-resp.json
|
|
|
|
:language: javascript
|
|
|
|
|
2017-08-15 16:37:43 +08:00
|
|
|
|
2017-10-16 01:33:20 -07:00
|
|
|
Attach to a container
|
|
|
|
=====================
|
|
|
|
|
|
|
|
.. rest_method:: GET /v1/containers/{container_ident}/attach
|
|
|
|
|
|
|
|
Attach to a running container.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
2018-02-09 03:36:43 +00:00
|
|
|
- 200
|
2017-10-16 01:33:20 -07:00
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 400
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
- 409
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
This request returns websocket url as a response, which is
|
|
|
|
not in json format.
|
|
|
|
|
|
|
|
|
2017-08-15 16:37:43 +08:00
|
|
|
Detach a network from a container
|
2017-08-30 18:48:56 -07:00
|
|
|
=================================
|
2017-08-15 16:37:43 +08:00
|
|
|
|
2018-02-07 04:18:54 +00:00
|
|
|
.. rest_method:: POST /v1/containers/{container_ident}/network_detach
|
2017-08-15 16:37:43 +08:00
|
|
|
|
|
|
|
Detach a network from a container.
|
|
|
|
|
|
|
|
Response Codes
|
2017-08-30 18:48:56 -07:00
|
|
|
--------------
|
2017-08-15 16:37:43 +08:00
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 202
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
- network: network
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
This request does not return anything in the response body.
|
|
|
|
|
2017-08-28 02:20:59 -07:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- X-Openstack-Request-Id: request_id
|
|
|
|
|
|
|
|
|
|
|
|
Resize a container
|
|
|
|
==================
|
|
|
|
|
2018-02-07 04:18:54 +00:00
|
|
|
.. rest_method:: POST /v1/containers/{container_ident}/resize
|
2017-08-28 02:20:59 -07:00
|
|
|
|
|
|
|
Resize tty to a container
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
This API is primarily designed to be used by zunclient or Zun-UI.
|
|
|
|
The point of this API is to coordinate between client-side tools and
|
|
|
|
Zun to adjust the size of the TTY for the container.
|
|
|
|
Unless you are writing client-side tools you **should not** be using
|
|
|
|
this API.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 200
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
- 409
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
2017-08-30 18:48:56 -07:00
|
|
|
|
2017-08-28 02:20:59 -07:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
- width: width
|
|
|
|
- height: height
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
This request does not return anything in the response body.
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- X-Openstack-Request-Id: request_id
|
2017-09-04 15:52:31 +08:00
|
|
|
|
|
|
|
|
|
|
|
Attach a network to a container
|
|
|
|
===============================
|
|
|
|
|
2018-02-07 04:18:54 +00:00
|
|
|
.. rest_method:: POST /v1/containers/{container_ident}/network_attach
|
2017-09-04 15:52:31 +08:00
|
|
|
|
|
|
|
Attach a network to a container.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 202
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
- network: network
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
This request does not return anything in the response body.
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- X-Openstack-Request-Id: request_id
|
2017-10-08 23:54:08 -07:00
|
|
|
|
|
|
|
|
2017-10-16 03:53:03 -07:00
|
|
|
Execute command in a running container
|
|
|
|
======================================
|
|
|
|
|
2018-02-07 04:18:54 +00:00
|
|
|
.. rest_method:: POST /v1/containers/{container_ident}/execute
|
2017-10-16 03:53:03 -07:00
|
|
|
|
|
|
|
Execute command in a running container.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 200
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 400
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
- command: exec_command
|
|
|
|
- run: exec_run
|
|
|
|
- interactive: exec_interactive
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- exec_output: exec_output
|
|
|
|
- exec_exit_code: exec_exit_code
|
|
|
|
- exec_id: exec_id
|
|
|
|
- exec_url: exec_url
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
2017-11-23 16:31:09 +08:00
|
|
|
If the run parameter is set to true, the output will be
|
|
|
|
{"output": "...", "exit_code": "...", "exec_id": None, "url": None}.
|
|
|
|
Otherwise, the output will be
|
|
|
|
{"output": None, "exit_code": None, "exec_id": "...", "url": "..."}.
|
2017-10-16 03:53:03 -07:00
|
|
|
|
|
|
|
Response Example
|
|
|
|
----------------
|
|
|
|
|
|
|
|
.. literalinclude:: samples/container-execute-resp.json
|
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
.. literalinclude:: samples/container-execute-resp-2.json
|
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
|
2017-10-16 04:34:37 -07:00
|
|
|
Resize tty when execute command in a container
|
|
|
|
==============================================
|
|
|
|
|
2018-02-07 04:18:54 +00:00
|
|
|
.. rest_method:: POST /v1/containers/{container_ident}/execute_resize
|
2017-10-16 04:34:37 -07:00
|
|
|
|
|
|
|
Resize tty when execute command in a container.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 200
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 400
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
- height: height
|
|
|
|
- exec_id: exec_resize_id
|
|
|
|
- width: width
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- exec_resize_output: exec_resize_output
|
|
|
|
|
|
|
|
Response Example
|
|
|
|
----------------
|
|
|
|
|
|
|
|
.. literalinclude:: samples/container-execute-resize-resp.json
|
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
|
2017-10-08 23:54:08 -07:00
|
|
|
Get logs of a container
|
|
|
|
=======================
|
|
|
|
|
2018-02-07 04:18:54 +00:00
|
|
|
.. rest_method:: GET /v1/containers/{container_ident}/logs
|
2017-10-08 23:54:08 -07:00
|
|
|
|
|
|
|
Get logs of a container.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 200
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 400
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
- timestamps: timestamps
|
|
|
|
- tail: tail
|
|
|
|
- stderr: stderr
|
|
|
|
- stdout: stdout
|
|
|
|
- since: since
|
|
|
|
|
|
|
|
Request Example
|
|
|
|
----------------
|
|
|
|
|
|
|
|
.. literalinclude:: samples/container-logs-req.json
|
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
This request returns logs string as a response, which is
|
|
|
|
not in json format.
|
2017-10-15 23:46:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
Display the running processes in a container
|
|
|
|
============================================
|
|
|
|
|
2018-02-07 04:18:54 +00:00
|
|
|
.. rest_method:: GET /v1/containers/{container_ident}/top
|
2017-10-15 23:46:59 -07:00
|
|
|
|
|
|
|
Display the running processes in a container.
|
|
|
|
|
|
|
|
Response Codes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. rest_status_code:: success status.yaml
|
|
|
|
|
|
|
|
- 200
|
|
|
|
|
|
|
|
.. rest_status_code:: error status.yaml
|
|
|
|
|
|
|
|
- 400
|
|
|
|
- 401
|
|
|
|
- 403
|
|
|
|
- 404
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- container_ident: container_ident
|
|
|
|
- ps_args: ps_args
|
|
|
|
|
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- ps_output: ps_output
|
|
|
|
|
|
|
|
Response Example
|
|
|
|
----------------
|
|
|
|
|
|
|
|
.. literalinclude:: samples/container-top-resp.json
|
|
|
|
:language: javascript
|