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

GET /docker/api/v2/compute_resources/:compute_resource_id/containers
List all containers on a compute resource

參數

參數名字 描述
compute_resource_id
選填

Validations:

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

search
選填

篩選結果

Validations:

  • Must be a String

order
選填

排序結果

Validations:

  • Must be a String

page
選填

編頁結果

Validations:

  • Must be a String

per_page
選填

每個請求的項目數量

Validations:

  • Must be a String


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

GET /docker/api/v2/compute_resources/:compute_resource_id/containers/:id
Show container on a compute resource

參數

參數名字 描述
id
必填

Validations:

  • 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
選填

Validations:

  • 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
Create container on a compute resource

參數

參數名字 描述
container
必填

Validations:

  • Must be a Hash

container[name]
選填 , 允許空值

Validations:

  • Must be a String

container[location_ids]
選填 , 允許空值

將位置取代為特定 ID

Validations:

  • Must be an array of any type

container[organization_ids]
選填 , 允許空值

將組織取代為特定 ID。

Validations:

  • Must be an array of any type

container[compute_resource_id]
必填

Validations:

  • 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]
選填 , 允許空值

Registry this container will have to use to get the image

Validations:

  • 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]
必填

Name of the repository to use to create the container. e.g. centos

Validations:

  • Must be a String

container[tag]
必填

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

Validations:

  • Must be a String

container[tty]
選填 , 允許空值

Validations:

  • Must be one of: true, false, 1, 0

container[entrypoint]
選填 , 允許空值

Validations:

  • Must be a String

container[command]
必填

Validations:

  • Must be a String

container[memory]
選填 , 允許空值

Validations:

  • Must be a String

container[cpu_shares]
選填 , 允許空值

Validations:

  • Must be a number.

container[cpu_set]
選填 , 允許空值

Validations:

  • Must be a String

container[environment_variables]
選填 , 允許空值

Optional array of environment variables hashes. e.g. 'environment_variables': [{'name' => 'example', 'value' => '123'}]

Validations:

  • Must be an array of any type

container[attach_stdout]
選填 , 允許空值

Validations:

  • Must be one of: true, false, 1, 0

container[attach_stdin]
選填 , 允許空值

Validations:

  • Must be one of: true, false, 1, 0

container[attach_stderr]
選填 , 允許空值

Validations:

  • Must be one of: true, false, 1, 0

container[capsule_id]
選填 , 允許空值

The capsule this container will have to use to get the image. Relevant for images retrieved from katello registry.

Validations:

  • 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
Delete container on a compute resource

參數

參數名字 描述
id
必填

Validations:

  • 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
選填

Validations:

  • 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
Show logs from a container on a compute resource

參數

參數名字 描述
id
必填

Validations:

  • 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
選填

Validations:

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

stdout
選填

Validations:

  • Must be one of: true, false, 1, 0

stderr
選填

Validations:

  • Must be one of: true, false, 1, 0

tail
選填

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

Validations:

  • Must be a Integer


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

PUT /docker/api/v2/compute_resources/:compute_resource_id/containers/:id/power
Run power operation on a container on a compute resource

參數

參數名字 描述
id
必填

Validations:

  • 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
選填

Validations:

  • 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
必填

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

Validations:

  • Must be a String