zun/api-ref/source/parameters.yaml

1068 lines
25 KiB
YAML

request_id:
type: UUID
in: header
required: true
description: |
A unique ID for tracking service request. The request ID associated
with the request by default appears in the service logs.
container_ident:
description: |
The UUID or name of container in Zun.
in: path
required: true
type: string
host_ident:
description: |
The UUID or name of host in Zun.
in: path
required: true
type: string
quota_class_name:
description: |
The name of quota class
in: path
required: true
type: string
request_ident:
description: |
The ID of the request.
in: path
required: true
type: string
auto_remove_query:
description: |
Filters the response according to whether they are
auto-removed on exiting.
in: query
required: false
type: boolean
destination_path:
description: |
The destination path in a container when putting archive to a container.
in: query
required: true
type: string
exec_command:
description: |
The command to execute in a container.
in: query
required: true
type: string
exec_interactive:
description: |
Keep STDIN open even if not attached, allocate a pseudo-TTY.
in: query
required: false
type: boolean
exec_resize_id:
description: |
The ID of the exec instance.
in: query
required: true
type: string
exec_run:
description: |
Whether to run the command or not. If this parameter is set to true,
Zun will run the command right away. If this parameter is set to false,
Zun won't run the command but return the necessary information (i.e. the
URL and execution id) for users to trigger the execution of the command.
in: query
required: false
type: boolean
fixed_ip-query:
description: |
Fixed IP addresses. If you request a specific fixed IP address without
a ``network``, the request returns a Bad Request (400) response code.
in: query
required: false
type: string
force:
description: |
Specify to delete container forcefully.
in: query
required: true
type: string
height:
description: |
The tty height of a container.
in: query
required: true
type: string
host_query:
description: |
Filters the response by a host name, as a string.
in: query
required: false
type: string
image_query:
description: |
Filters the response by image.
in: query
required: false
type: string
memory_query:
description: |
Filters the response by memory size in Mib.
in: query
required: false
type: integer
name_query:
description: |
Filters the response by name.
in: query
required: false
type: string
network:
description: |
The ID or name of the network to be detached from the container.
in: query
required: true
type: string
network-query:
description: |
The ID or name of the network to be attached to the container.
in: query
required: false
type: string
new_name:
description: |
The new name for the container.
in: query
required: true
type: string
port-query:
description: |
The ID or name of the port for which you want to bind to the container.
The ``network`` and ``port`` parameters are mutually exclusive.
If you do not specify the ``port`` parameter, Zun will allocate a port
and bind the port to the container.
in: query
required: false
type: string
project_id_query:
description: |
Filters the response by the ID of the project.
in: query
required: false
type: string
ps_args:
description: |
The arguments of ps command.
in: query
required: false
type: string
repository:
description: |
The reposiroty of the container image.
in: query
required: true
type: string
run:
description: |
Set false if enabled interactive.
in: query
required: false
type: boolean
security_group_query:
description: |
Security groups to be added to the container.
in: query
required: true
type: string
signal:
description: |
The signal to kill a container.
in: query
required: false
type: string
since:
description: |
Show logs since a given datetime or integer epoch (in seconds).
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
status_query:
description: |
Filters the response by the current state of the container.
in: query
required: false
type: string
stderr:
description: |
Get standard error if True.
in: query
required: false
type: boolean
stdout:
description: |
Get standard output if True.
in: query
required: false
type: boolean
stop:
description: |
Whether or not stop a container firstly before deleting it.
in: query
required: false
type: string
tag:
description: |
The tag of the container image.
in: query
required: true
type: string
tail:
description: |
Number of lines to show from the end of the logs, default is get all logs.
in: query
required: false
type: string
task_state_query:
description: |
Filters the response by task state.
in: query
required: false
type: string
timeout:
description: |
Seconds to wait before operating on container.
in: query
required: true
type: string
timestamps:
description: |
Whether to show timestamps in the logs of container.
in: query
required: false
type: boolean
usages:
description: |
Whether to show in_use in the quotas
in: query
required: false
type: boolean
user_id_query:
description: |
Filters the response by user ID.
in: query
required: false
type: string
width:
description: |
The tty width of a container.
in: query
required: true
type: string
action:
description: |
The name of the action.
in: body
required: true
type: string
addresses:
type: string
description: |
IP address of the container. This includes both ipv4 and/or ipv6 addresses.
in: body
required: true
auto_heal:
description: |
The flag of healing non-existent container in docker.
in: body
required: true
type: boolean
auto_heal-request:
description: |
The flag of healing non-existent container in docker.
in: body
required: false
type: boolean
auto_remove:
description: |
enable auto-removal of the container on daemon side
when the container's process exits.
in: body
required: true
type: boolean
auto_remove-request:
description: |
enable auto-removal of the container on daemon side
when the container's process exits.
in: body
required: false
type: boolean
availability_zone:
in: body
type: string
required: true
description: |
The availability zone of the Zun service.
binary:
in: body
type: string
required: true
description: |
The name of the binary form of the Zun service.
command:
description: |
Send command to the container.
in: body
required: true
type: string
command-request:
description: |
Send command to the container.
in: body
required: false
type: string
container-request:
description: |
The number of containers
in: body
required: false
type: int
container-response:
description: |
The object of detailed containers quota, including in_use,
limit of number of instances.
in: body
required: true
type: object
container_action:
description: |
The container action object.
in: body
required: true
type: object
container_action_events:
description: |
The events occurred in this action.
in: body
required: true
type: array
container_actions:
description: |
List of the actions for the given container.
in: body
required: true
type: array
container_availability_zone:
in: body
type: string
required: false
description: |
The availability zone from which to run the container. Typically,
an admin user will use availability zones to arrange container hosts into
logical groups. An availability zone provides a form of physical isolation
and redundancy from other availability zones. For instance, if some racks
in your data center are on a separate power source, you can put containers
in those racks in their own availability zone. By segregating resources
into availability zones, you can ensure that your application resources are
spread across disparate machines to achieve high availability in the event
of hardware or other failure. You can see the available availability zones
by calling the ``services`` API.
container_list:
type: array
in: body
required: true
description: |
The list of all containers in Zun.
cpu:
description: |
The number of virtual cpus.
in: body
required: true
type: float
cpu-request:
description: |
The number of virtual cpus.
in: body
required: false
type: float
cpu-response:
description: |
The object of detailed cpu set quota, including in_use,
limit of number of cpu set.
in: body
required: true
type: object
created_at:
description: |
The date and time when the resource was created.
The date and time stamp format is `ISO 8601
<https://en.wikipedia.org/wiki/ISO_8601>`_:
::
CCYY-MM-DDThh:mm:ss±hh:mm
For example, ``2015-08-27T09:49:58-05:00``.
The ``±hh:mm`` value, if included, is the time zone as an offset
from UTC.
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.
in: body
required: true
type: boolean
disabled_reason:
description: |
The disable reason of the service, ``null`` if the service is enabled or
disabled without reason provided.
in: body
required: true
type: string
disk-request:
description: |
The number of gigabytes of container disk
required: false
in: body
type: int
disk-response:
description: |
The object of detailed disk quota, including in_use,
limit of disk.
required: true
in: body
type: object
environment:
description: |
The environment variables.
in: body
required: true
type: object
environment-request:
description: |
The environment variables.
in: body
required: false
type: object
event:
description: |
The name of the event.
in: body
required: true
type: string
event_finish_time:
description: |
The date and time when the event was finished. The date and time
stamp format is `ISO 8601 <https://en.wikipedia.org/wiki/ISO_8601>`_
::
CCYY-MM-DDThh:mm:ss±hh:mm
For example, ``2015-08-27T09:49:58-05:00``. The ``±hh:mm``
value, if included, is the time zone as an offset from UTC. In
the previous example, the offset value is ``-05:00``.
in: body
required: true
type: string
event_result:
description: |
The result of the event.
in: body
required: true
type: string
event_start_time:
description: |
The date and time when the event was started. The date and time
stamp format is `ISO 8601 <https://en.wikipedia.org/wiki/ISO_8601>`_
::
CCYY-MM-DDThh:mm:ss±hh:mm
For example, ``2015-08-27T09:49:58-05:00``. The ``±hh:mm``
value, if included, is the time zone as an offset from UTC. In
the previous example, the offset value is ``-05:00``.
in: body
required: true
type: string
event_traceback:
description: |
The traceback stack if error occurred in this event.
in: body
required: true
type: string
exec_exit_code:
description: |
The exit code of the command executed in a container.
in: body
type: dict
exec_id:
description: |
The ID of the exec instance.
in: body
type: dict
exec_output:
description: |
The output of the command executed in a container.
in: body
type: dict
exec_resize_output:
description: |
The output of exec_resize, including exec_id and websocket url.
in: body
type: array
exec_url:
description: |
The URL to start an exec instance.
in: body
type: dict
exposed_ports:
description: |
A list of dictionary data to specify how to expose container's ports.
If this parameter is specified, Zun will create a security group with
a set of rules to open the ports that should be exposed, and associate
the security group to the container. The value is in the form of
``{"<port>/<protocol>: {}"}``, where the ``port`` is the container's
port and ``protocol`` is either ``tcp`` or ``udp``. If ``protocol``
is not provided, ``tcp`` will be used.
in: body
required: false
type: object
fixed_ips:
description: |
A list of fixed IP addresses with subnet IDs and other detailed
information.
in: body
required: true
type: string
forced_down:
description: |
Whether or not this service was forced down manually by an
administrator. This value is useful to know that some 3rd party has
verified the service should be marked down.
in: body
required: true
type: boolean
healthcheck:
description: |
A dict of health check for the container. Specify a test command to
perform to check that the container is healthy. Four parameters are
supported:
* cmd: Command to run to check health.
* interval: Time between running the check in seconds.
* retries: Consecutive failures needed to report unhealthy.
* timeout: Maximum time to allow one check to run in seconds.
in: body
required: true
type: object
healthcheck-request:
description: |
A dict of health check for the container. Specify a test command to
perform to check that the container is healthy. Four parameters are
supported:
* cmd: Command to run to check health.
* interval: Time between running the check in seconds.
* retries: Consecutive failures needed to report unhealthy.
* timeout: Maximum time to allow one check to run in seconds.
in: body
required: false
type: object
hints:
description: |
The dictionary of data to send to the scheduler.
in: body
required: false
type: string
host:
description: |
The host for the service.
in: body
required: true
type: string
host-architecture:
description: |
The architecture of the host operating system.
in: body
required: true
type: string
host-cpu_used:
description: |
The used cpus of the host.
in: body
required: true
type: string
host-cpus:
description: |
The total cpus of the host.
in: body
required: true
type: string
host-disk_total:
description: |
The total amount of disk of the host.
in: body
required: true
type: string
host-disk_used:
description: |
The amount of used disk of the host.
in: body
required: true
type: string
host-hostname:
description: |
The hostname.
in: body
required: true
type: string
host-kernel_version:
description: |
The kernel version of the host.
in: body
required: true
type: string
host-labels:
description: |
The labels of the local container engine (i.e. Docker daemon).
in: body
required: true
type: string
host-mem_total:
description: |
The total amount of memory of the host.
in: body
required: true
type: string
host-mem_used:
description: |
The amount of used memory of the host.
in: body
required: true
type: string
host-os:
description: |
The name of host operating system.
in: body
required: true
type: string
host-os_type:
description: |
The type of host operating system.
in: body
required: true
type: string
host-total_containers:
description: |
The total number of containers in the host.
in: body
required: true
type: string
host-uuid:
description: |
The UUID of the host.
in: body
required: true
type: string
host_list:
description: |
The host information list, including hostname, uuid, links, labels,
cpus, mem_total and os.
in: body
required: true
type: array
hostname:
description: |
The hostname of container.
in: body
required: true
type: string
hostname-request:
description: |
The hostname of container.
in: body
required: false
type: string
id_s:
description: |
The ID of the Zun service.
in: body
required: true
type: string
image:
description: |
The name or ID of the image.
in: body
required: true
type: string
image_driver:
description: |
The image driver to use to pull container image.
in: body
required: true
type: string
image_driver-request:
description: |
The image driver to use to pull container image. Allowed values are
``docker`` to pull the image from Docker Hub and ``glance`` to pull
the image from Glance.
in: body
required: false
type: string
image_pull_policy:
description: |
The policy which determines if the image should be pulled prior to starting
the container. Allowed values are ``ifnotpresent`` that means pull the
image if it does not already exist on the node, ``always`` means always
pull the image from repository and ``never`` mean never pull the image.
in: body
required: true
type: string
image_pull_policy-request:
description: |
The policy which determines if the image should be pulled prior to starting
the container. Allowed values are ``ifnotpresent`` that means pull the
image if it does not already exist on the node, ``always`` means always
pull the image from repository and ``never`` mean never pull the image.
in: body
required: false
type: string
interactive:
description: |
Keep STDIN open even if not attached, allocate a pseudo-TTY.
in: body
required: true
type: boolean
interactive-request:
description: |
Keep STDIN open even if not attached, allocate a pseudo-TTY.
in: body
required: false
type: boolean
ip_address:
description: |
The IP address.
in: body
required: true
type: string
labels:
description: |
A map of labels of the container.
in: body
required: true
type: object
labels-request:
description: |
Adds a map of labels to a container.
in: body
required: false
type: object
links:
description: |
A list of relative links. Includes the self and
bookmark links.
in: body
required: true
type: array
memory:
description: |
The container memory size in MiB.
in: body
required: true
type: integer
memory-request:
description: |
The container memory size in MiB.
in: body
required: false
type: integer
memory-response:
description: |
The object of detailed memory quota, including in_use,
limit number of memory.
in: body
required: true
type: object
message:
description: |
The error message message about this action when error occurred.
in: body
required: true
type: string
mounts:
description: |
A list of dictionary data to specify how volumes are mounted into the
container. The container will mount the volumes at create time.
Each item can have an ``type`` attribute that specifies the volume
type. The supported volume types are ``volume`` or ``bind``. If this
attribute is not specified, the default is ``volume``.
To provision a container with pre-existing Cinder volumes bind-mounted,
specify the UUID or name of the volume in the ``source`` attribute.
Alternatively, Cinder volumes can be dynamically created. In this case,
the size of the volume needs to be specified in the ``size`` attribute.
Another option is to mount a user-provided file into the container.
In this case, the ``type`` attribute should be 'bind' and
the content of the file is contained in the ``source`` attribute.
The volumes will be mounted into the file system of the container and
the path to mount the volume needs to be specified in the ``destination``
attribute.
in: body
type: object
name:
description: |
The name of the container.
in: body
required: true
type: string
name-request:
description: |
The name of the container.
in: body
required: false
type: string
net_id:
description: |
The UUID of network.
in: body
required: true
type: string
nets:
description: |
A list of networks for the container. When you do not specify the nets
parameter, the container attaches to the only network created for the
current tenant. To provision the container with a NIC for a network,
specify the UUID or name of the network in the ``network`` attribute.
To provision the container with a NIC for an already existing port,
specify the port id or name in the ``port`` attribute.
If multiple networks are defined, the order in which they appear in the
container will not necessarily reflect the order in which they are given
in the request. Users should therefore not depend on device order
to deduce any information about their network devices.
in: body
type: object
port_id:
description: |
The UUID of port of a container.
in: body
required: true
type: string
ports:
description: |
The ports exposed on the container.
in: body
required: true
type: string
privileged:
description: |
Give extended privileges to the container.
in: body
required: true
type: boolean
privileged-request:
description: |
Give extended privileges to the container.
in: body
required: false
type: boolean
project_id_container_action:
description: |
The UUID of the project that this container belongs to.
in: body
required: ture
type: string
ps_output:
description: |
The output of zun top.
in: body
required: true
type: dict
report_count:
description: |
The total number of report.
in: body
required: true
type: integer
request_id_body:
description: |
The request id generated when execute the API of this action.
in: body
required: true
type: string
restart_policy:
description: |
Restart policy to apply when a container exits. It must contain a
``Name`` key and its allowed values are ``no``, ``on-failure``, ``always``,
``unless-stopped``. Optionally, it can contain a ``MaximumRetryCount`` key
and its value is an integer.
in: body
required: true
type: object
restart_policy-request:
description: |
Restart policy to apply when a container exits. It must contain a
``Name`` key and its allowed values are ``no``, ``on-failure``, ``always``,
``unless-stopped``. Optionally, it can contain a ``MaximumRetryCount`` key
and its value is an integer.
in: body
required: false
type: object
runtime:
description: |
The container runtime tool to create container with. You can use
the default runtime that is `runc` or any other runtime configured
to use with Docker.
in: body
type: string
security_groups:
description: |
Security groups to be added to the container.
in: body
required: true
type: string
security_groups-request:
description: |
Security groups to be added to the container.
in: body
required: false
type: string
service:
description: |
A Zun service.
in: body
required: true
type: dict
services:
description: |
A list of Zun services.
in: body
required: true
type: array
start_time:
description: |
The date and time when the action was started. The date and time
stamp format is `ISO 8601 <https://en.wikipedia.org/wiki/ISO_8601>`_
::
CCYY-MM-DDThh:mm:ss±hh:mm
For example, ``2015-08-27T09:49:58-05:00``. The ``±hh:mm``
value, if included, is the time zone as an offset from UTC. In
the previous example, the offset value is ``-05:00``.
in: body
required: true
type: string
stat:
description: |
The stat information when doing get_archive.
in: body
required: true
type: string
state:
description: |
The current state of Zun services.
in: body
required: true
type: string
stats_info:
description: |
The stats information of a container,
including cpu, memory, blk io and net io.
in: body
required: true
type: dict
status:
description: |
The current state of the container.
in: body
required: true
type: string
status_detail:
description: |
The status detail of the container.
in: body
required: true
type: string
status_reason:
description: |
The reason of container current status.
in: body
required: true
type: string
subnet_id:
description: |
The UUID of subnet.
in: body
required: true
type: string
task_state:
description: |
The current task of the container.
in: body
required: true
type: string
updated_at:
description: |
The date and time when the resource was updated.
The date and time stamp format is `ISO 8601
<https://en.wikipedia.org/wiki/ISO_8601>`_:
::
CCYY-MM-DDThh:mm:ss±hh:mm
For example, ``2015-08-27T09:49:58-05:00``.
The ``±hh:mm`` value, if included, is the time zone as an offset
from UTC. In the previous example, the offset value is ``-05:00``.
If the ``updated_at`` date and time stamp is not set, its value is
``null``.
in: body
required: true
type: string
user_id:
description: |
The user ID of the user who owns the container.
in: body
required: true
type: string
uuid:
description: |
UUID of the resource.
in: body
required: true
type: UUID
version:
description: |
The version of the Internet Protocol.
in: body
required: true
type: string
workdir:
description: |
The working directory for commands to run in.
in: body
required: true
type: string
workdir-request:
description: |
The working directory for commands to run in.
in: body
required: false
type: string