GET /docker/api/v2/containers
列出所有 container

GET /docker/api/v2/compute_resources/:compute_resource_id/containers
列出運算資源中的所有 container

Params

Param Name Description
compute_resource_id
Optional

Value: Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.
search
Optional

filter results


Value: Must be String
order
Optional

sort results


Value: Must be String
page
Optional

paginate results


Value: Must be String
per_page
Optional

number of entries per request


Value: Must be String

GET /docker/api/v2/containers/:id
顯示 container

GET /docker/api/v2/compute_resources/:compute_resource_id/containers/:id
顯示運算資源中的 container

Params

Param Name Description
id
Required

Value: Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.
compute_resource_id
Optional

Value: Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

POST /docker/api/v2/containers
建立 container

POST /docker/api/v2/compute_resources/:compute_resource_id/containers
在運算資源中建立 container

Params

Param Name Description
container
Required

Value: Must be a Hash
container[name]
Optional , <span class="translation_missing" title="translation missing: zh-TW.apipie.nil_allowed">Nil Allowed</span>

Value: Must be String
container[compute_resource_id]
Required

Value: Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.
container[registry_id]
Optional , <span class="translation_missing" title="translation missing: zh-TW.apipie.nil_allowed">Nil Allowed</span>

Registry this container will have to

use to get the image

Value: Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.
container[repository_name]
Required

Name of the repository to use

to create the container. e.g: centos

Value: Must be String
container[tag]
Required

Tag to use to create the container. e.g: latest


Value: Must be String
container[tty]
Optional , <span class="translation_missing" title="translation missing: zh-TW.apipie.nil_allowed">Nil Allowed</span>

Value: Must be 'true' or 'false'
container[entrypoint]
Optional , <span class="translation_missing" title="translation missing: zh-TW.apipie.nil_allowed">Nil Allowed</span>

Value: Must be String
container[command]
Required

Value: Must be String
container[memory]
Optional , <span class="translation_missing" title="translation missing: zh-TW.apipie.nil_allowed">Nil Allowed</span>

Value: Must be String
container[cpu_shares]
Optional , <span class="translation_missing" title="translation missing: zh-TW.apipie.nil_allowed">Nil Allowed</span>

Value: Must be a number.
container[cpu_set]
Optional , <span class="translation_missing" title="translation missing: zh-TW.apipie.nil_allowed">Nil Allowed</span>

Value: Must be String
container[environment_variables]
Optional , <span class="translation_missing" title="translation missing: zh-TW.apipie.nil_allowed">Nil Allowed</span>

Value: Must be Hash
container[attach_stdout]
Optional , <span class="translation_missing" title="translation missing: zh-TW.apipie.nil_allowed">Nil Allowed</span>

Value: Must be 'true' or 'false'
container[attach_stdin]
Optional , <span class="translation_missing" title="translation missing: zh-TW.apipie.nil_allowed">Nil Allowed</span>

Value: Must be 'true' or 'false'
container[attach_stderr]
Optional , <span class="translation_missing" title="translation missing: zh-TW.apipie.nil_allowed">Nil Allowed</span>

Value: Must be 'true' or 'false'
container[capsule_id]
Optional , <span class="translation_missing" title="translation missing: zh-TW.apipie.nil_allowed">Nil Allowed</span>

The capsule this container will have to use

to get the image. Relevant for images
retrieved from katello registry.

Value: Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

DELETE /docker/api/v2/containers/:id
刪除 container

DELETE /docker/api/v2/compute_resources/:compute_resource_id/containers/:id
刪除運算資源中的 container

Params

Param Name Description
id
Required

Value: Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.
compute_resource_id
Optional

Value: Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

GET /docker/api/v2/containers/:id/logs
顯示 container 的日誌

GET /docker/api/v2/compute_resources/:compute_resource_id/containers/:id/logs
顯示運算資源中的 container 日誌

Params

Param Name Description
id
Required

Value: Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.
compute_resource_id
Optional

Value: Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.
stdout
Optional

Value: Must be 'true' or 'false'
stderr
Optional

Value: Must be 'true' or 'false'
tail
Optional

欲以 tail 顯示的行數。預設值:100


Value: Must be Fixnum

PUT /docker/api/v2/containers/:id/power
在一個 container 上執行電源作業

PUT /docker/api/v2/compute_resources/:compute_resource_id/containers/:id/power
在運算資源中的 container 上執行電源作業

Params

Param Name Description
id
Required

Value: Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.
compute_resource_id
Optional

Value: Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.
power_action
Required

電源動作,有效的動作為(start)、(stop)、(status)


Value: Must be String