GET /docker/api/v2/containers
列出所有容器

GET /docker/api/v2/compute_resources/:compute_resource_id/containers
列出计算资源中的所有容器

参数

参数名字 描述
compute_resource_id
选填

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
选填

过滤结果


Value:

Must be String

order
选填

结果排序


Value:

Must be String

page
选填

页数


Value:

Must be String

per_page
选填

每个请求中的条目数


Value:

Must be String


GET /docker/api/v2/containers/:id
显示容器

GET /docker/api/v2/compute_resources/:compute_resource_id/containers/:id
显示计算资源中的容器

参数

参数名字 描述
id
必填

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
选填

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
生成容器

POST /docker/api/v2/compute_resources/:compute_resource_id/containers
在计算资源中生成容器

参数

参数名字 描述
container
必填

Value:

Must be a Hash

container[name]
选填 , 允许空值

Value:

Must be String

container[compute_resource_id]
必填

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]
选填 , 允许空值

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

Name of the repository to use

to create the container. e.g: centos

Value:

Must be String

container[tag]
必填

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


Value:

Must be String

container[tty]
选填 , 允许空值

Value:

Must be ‘true’ or ‘false’

container[entrypoint]
选填 , 允许空值

Value:

Must be String

container[command]
必填

Value:

Must be String

container[memory]
选填 , 允许空值

Value:

Must be String

container[cpu_shares]
选填 , 允许空值

Value:

Must be a number.

container[cpu_set]
选填 , 允许空值

Value:

Must be String

container[environment_variables]
选填 , 允许空值

Value:

Must be Hash

container[attach_stdout]
选填 , 允许空值

Value:

Must be ‘true’ or ‘false’

container[attach_stdin]
选填 , 允许空值

Value:

Must be ‘true’ or ‘false’

container[attach_stderr]
选填 , 允许空值

Value:

Must be ‘true’ or ‘false’

container[capsule_id]
选填 , 允许空值

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
删除容器

DELETE /docker/api/v2/compute_resources/:compute_resource_id/containers/:id
删除计算资源中的容器

参数

参数名字 描述
id
必填

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
选填

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
显示容器日志

GET /docker/api/v2/compute_resources/:compute_resource_id/containers/:id/logs
显示来自计算资源容器中的日志

参数

参数名字 描述
id
必填

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
选填

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
选填

Value:

Must be ‘true’ or ‘false’

stderr
选填

Value:

Must be ‘true’ or ‘false’

tail
选填

查看的行数。默认为 100。


Value:

Must be Fixnum


PUT /docker/api/v2/containers/:id/power
在容器中运行电源操作

PUT /docker/api/v2/compute_resources/:compute_resource_id/containers/:id/power
在计算资源中的容器中运行电源操作

参数

参数名字 描述
id
必填

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
选填

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

电源操作,有效操作为 (start), (stop), (status)


Value:

Must be String