--- swagger: "2.0" schemes: - "http" - "https" produces: - "application/json" - "text/plain" consumes: - "application/json" - "text/plain" basePath: "/v1.24" info: title: "Pouch Engine API" version: "1.24" description: | API is an HTTP API served by Pouch Engine. paths: /_ping: get: summary: "" description: "" responses: 200: description: "no error" schema: type: "string" example: "OK" 500: $ref: "#/responses/500ErrorResponse" /version: get: summary: "Get Pouchd version" description: "" responses: 200: schema: $ref: '#/definitions/SystemVersion' description: "no error" 500: $ref: "#/responses/500ErrorResponse" /info: get: summary: "Get System information" description: "" responses: 200: schema: $ref: '#/definitions/SystemInfo' description: "no error" 500: $ref: "#/responses/500ErrorResponse" /auth: post: summary: "Check auth configuration" description: "Validate credentials for a registry and, if available, get an identity token for accessing the registry without password." consumes: - "application/json" produces: - "application/json" responses: 200: description: "An identity token was generated successfully." schema: $ref: "#/definitions/AuthResponse" 401: $ref: "#/responses/401ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "authConfig" in: "body" description: "Authentication to check" schema: $ref: "#/definitions/AuthConfig" /daemon/update: post: summary: "Update daemon's labels and image proxy" consumes: - "application/json" produces: - "application/json" responses: 200: description: "no error" 400: description: "bad parameter" schema: $ref: '#/definitions/Error' 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "DaemonUpdateConfig" in: body description: "Config used to update daemon, only labels and image proxy are allowed." schema: $ref: "#/definitions/DaemonUpdateConfig" /events: get: summary: "Subscribe pouchd events to users" description: | Stream real-time events from the server. Report various object events of pouchd when something happens to them. Containers report these events: create`, `destroy`, `die`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update` and `exec_die` Images report these events: `pull`, `untag` Volumes report these events: `create`, `destroy` Networks report these events: `create`, `connect`, `disconnect`, `destroy` produces: - "application/json" responses: 200: description: "no error" schema: $ref: '#/definitions/EventsMessage' 400: description: "bad parameter" schema: $ref: '#/definitions/Error' 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "since" in: "query" description: "Show events created since this timestamp then stream new events." type: "string" - name: "until" in: "query" description: "Show events created until this timestamp then stop streaming" type: "string" - name: "filters" in: "query" description: | A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: - `container=` container name or ID - `event=` event type - `image=` image name or ID - `label=` image or container label - `network=` network name or ID - `type=` object to filter by, one of `container`, `image`, `volume`, `network` - `volume=` volume name type: "string" /images/create: post: summary: "Create an image by pulling from a registry or importing from an existing source file" consumes: - "text/plain" - "application/octet-stream" produces: - "application/json" responses: 200: description: "no error" 404: schema: $ref: '#/definitions/Error' description: "image not found" 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "fromImage" in: "query" description: "Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed." type: "string" - name: "fromSrc" in: "query" description: "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image." type: "string" - name: "repo" in: "query" description: "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image." type: "string" - name: "tag" in: "query" description: "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled." type: "string" - name: "inputImage" in: "body" description: "Image content if the value `-` has been specified in fromSrc query parameter" schema: type: "string" required: false - name: "X-Registry-Auth" in: "header" description: "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)" type: "string" /images/load: post: summary: "Import images" description: | Load a set of images by oci.v1 format tar stream consumes: - application/x-tar responses: 200: description: "no error" 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "imageTarStream" in: "body" description: "tar stream containing images" schema: type: "string" format: "binary" - name: "name" in: "query" description: "set the image name for the tar stream, default unknown/unknown" type: "string" /images/save: get: summary: "Save image" description: | Save an image by oci.v1 format tar stream. produces: - application/x-tar responses: 200: description: "no error" schema: type: "string" format: "binary" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "name" in: "query" description: "Image name which is to be saved" type: "string" /images/{imageid}/json: get: summary: "Inspect an image" description: "Return the information about image" operationId: "ImageInspect" produces: - "application/json" responses: 200: description: "no error" schema: $ref: "#/definitions/ImageInfo" examples: application/json: CreatedAt: "2017-12-19 15:32:09" Digest: "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" ID: "e216a057b1cb" Name: "ubuntu:12.04" Size: 103579269 Tag: "12.04" 404: description: "no such image" schema: $ref: "#/definitions/Error" examples: application/json: message: "No such image: e216a057b1cb" 500: $ref: "#/responses/500ErrorResponse" parameters: - $ref: "#/parameters/imageid" /images/{imageid}/history: get: summary: "Get an image's history" description: "Return the history of each layer of image" operationId: "ImageHistory" produces: - "application/json" responses: 200: description: "no error" schema: type: "array" items: $ref: "#/definitions/HistoryResultItem" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" parameters: - $ref: "#/parameters/imageid" /images/json: get: summary: "List Images" description: "Return a list of stored images." operationId: "ImageList" produces: - "application/json" responses: 200: description: "Summary image data for the images matching the query" schema: type: "array" items: $ref: "#/definitions/ImageInfo" examples: application/json: - Id: "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" ParentId: "" RepoTags: - "ubuntu:12.04" - "ubuntu:precise" RepoDigests: - "ubuntu@sha256:992069aee4016783df6345315302fa59681aae51a8eeb2f889dea59290f21787" Created: 1474925151 Size: 103579269 VirtualSize: 103579269 SharedSize: 0 Labels: {} Containers: 2 - Id: "sha256:3e314f95dcace0f5e4fd37b10862fe8398e3c60ed36600bc0ca5fda78b087175" ParentId: "" RepoTags: - "ubuntu:12.10" - "ubuntu:quantal" RepoDigests: - "ubuntu@sha256:002fba3e3255af10be97ea26e476692a7ebed0bb074a9ab960b2e7a1526b15d7" - "ubuntu@sha256:68ea0200f0b90df725d99d823905b04cf844f6039ef60c60bf3e019915017bd3" Created: 1403128455 Size: 172064416 VirtualSize: 172064416 SharedSize: 0 Labels: {} Containers: 5 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "all" in: "query" description: "Show all images. Only images from a final layer (no children) are shown by default." type: "boolean" - name: "filters" in: "query" description: | A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: - `before`=(`[:]`, `` or ``) - `reference`=(`[:]`) - `since`=(`[:]`, `` or ``) type: "string" - name: "digests" in: "query" description: "Show digest information as a `RepoDigests` field on each image." type: "boolean" /images/search: get: summary: "Search images" produces: - "application/json" responses: 200: description: "No error" schema: type: "array" items: $ref: "#/definitions/SearchResultItem" 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "term" in: "query" description: "Term to search" type: "string" required: true - name: "registry" in: "query" description: "Search images from specified registry" type: "string" # TODO: add limit and filters /images/{imageid}/tag: post: summary: "Tag an image" description: "Add tag reference to the existing image" parameters: - $ref: "#/parameters/imageid" - name: "repo" in: "query" description: "The repository to tag in. For example, `someuser/someimage`." type: "string" - name: "tag" in: "query" description: "The name of the new tag." type: "string" responses: 201: description: "No error" 400: description: "Bad parameter" schema: $ref: "#/definitions/Error" 404: description: "no such image" schema: $ref: "#/definitions/Error" 500: $ref: "#/responses/500ErrorResponse" /images/{imageid}: delete: summary: "Remove an image" description: "Remove an image by reference." parameters: - $ref: "#/parameters/imageid" - name: "force" in: "query" description: "Remove the image even if it is being used" type: "boolean" default: false responses: 204: description: "No error" 404: description: "no such image" schema: $ref: "#/definitions/Error" examples: application/json: message: "No such image: c2ada9df5af8" 500: $ref: "#/responses/500ErrorResponse" /images/{imageid}/push: post: summary: "push an image" description: "push an image on the registry" operationId: "ImagePush" consumes: - "application/octet-stream" produces: - "application/json" parameters: - $ref: "#/parameters/imageid" - name: "tag" in: "query" description: "the tag to associate with the image on the registry. This is optional." type: "string" - name: "X-Registry-Auth" in: "header" description: "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)" type: "string" responses: 200: description: "no error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" /containers/create: post: summary: "Create a container" consumes: - "application/json" produces: - "application/json" parameters: - name: "name" in: "query" description: "Assign the specified name to the container. Must match `/?[a-zA-Z0-9_-]+`." type: "string" pattern: "/?[a-zA-Z0-9_-]+" - name: "body" in: "body" description: "Container to create" schema: $ref: "#/definitions/ContainerCreateConfig" required: true responses: 201: description: "Container created successfully" schema: $ref: "#/definitions/ContainerCreateResp" examples: application/json: Id: "e90e34656806" Warnings: [] 400: description: "bad parameter" schema: $ref: "#/definitions/Error" 404: description: "no such image" schema: $ref: "#/definitions/Error" examples: application/json: message: "image: xxx:latest: not found" 409: description: "conflict" schema: $ref: "#/definitions/Error" 500: $ref: "#/responses/500ErrorResponse" tags: ["Container"] /containers/{id}/json: get: summary: "Inspect a container" description: "Return low-level information about a container." operationId: "ContainerInspect" produces: - "application/json" responses: 200: description: "no error" schema: $ref: "#/definitions/ContainerJSON" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" parameters: - $ref: "#/parameters/id" - name: "size" in: "query" type: "boolean" description: "Return the size of container as fields `SizeRw` and `SizeRootFs`" tags: ["Container"] /containers/json: get: summary: "List containers" operationId: "ContainerList" produces: ["application/json"] responses: 200: description: "Summary containers that matches the query" schema: type: "array" items: $ref: "#/definitions/Container" 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "all" in: "query" description: "Return all containers. By default, only running containers are shown" type: "boolean" default: false - name: "filters" in: "query" description: | Filters encoded as JSON string(type map[string][]string in Golang). This API will list containers match all of the filters. For example, `{"status": ["paused"]}` will only return paused containers. Available filters: - `id=` container ID filter, support regular expression. - `name=` container name filter, support regular expression. - `status=` container status filter, support regular expression. - `label==` container label filter, support equal and unequal operator. such as `label=[k=a,k!=b]`. type: "string" /containers/{id}/rename: post: summary: "Rename a container" operationId: "ContainerRename" parameters: - $ref: "#/parameters/id" - name: "name" in: "query" required: true description: "New name for the container" type: "string" responses: 204: description: "no error" 404: $ref: "#/responses/404ErrorResponse" 409: description: "name already in use" schema: $ref: "#/definitions/Error" 500: $ref: "#/responses/500ErrorResponse" tags: ["Container"] /containers/{id}/restart: post: summary: "Restart a container" operationId: "ContainerRestart" parameters: - $ref: "#/parameters/id" - name: "name" in: "query" required: true description: "New name for the container" type: "string" - name: "t" in: "query" description: "Number of seconds to wait before killing the container" type: "integer" responses: 204: description: "no error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" tags: ["Container"] /containers/{id}/start: post: summary: "Start a container" operationId: "ContainerStart" parameters: - $ref: "#/parameters/id" - name: "detachKeys" in: "query" description: "Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`." type: "string" - name: "checkpoint-dir" in: "query" description: "checkpoint directory" type: "string" - name: "checkpoint" in: "query" description: "checkpoint id" type: "string" responses: 204: description: "no error" 304: description: "container already started" 404: $ref: "#/responses/404ErrorResponse" 409: description: "container is paused" schema: $ref: "#/definitions/Error" 500: $ref: "#/responses/500ErrorResponse" tags: ["Container"] /containers/{id}/stop: post: summary: "Stop a container" operationId: "ContainerStop" parameters: - $ref: "#/parameters/id" - name: "t" in: "query" description: "Number of seconds to wait before killing the container" type: "integer" responses: 204: description: "no error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" tags: ["Container"] /containers/{id}/kill: post: summary: "Kill a container" operationId: "ContainerKill" parameters: - $ref: "#/parameters/id" - name: "signal" in: "query" description: "Signal to send to the container" type: "string" responses: 204: description: "no error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" tags: ["Container"] /containers/{id}/pause: post: summary: "Pause a container" operationId: "ContainerPause" parameters: - $ref: "#/parameters/id" responses: 204: description: "no error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" tags: ["Container"] /containers/{id}/unpause: post: summary: "Unpause a container" operationId: "ContainerUnpause" parameters: - $ref: "#/parameters/id" responses: 204: description: "no error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" tags: ["Container"] /containers/{id}/top: get: summary: "Display the running processes of a container" operationId: "ContainerTop" parameters: - $ref: "#/parameters/id" - name: "ps_args" in: "query" description: "top arguments" type: "string" responses: 200: description: "no error" schema: $ref: "#/definitions/ContainerProcessList" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" tags: ["Container"] /containers/{id}/wait: post: summary: "Block until a container stops, then returns the exit code." operationId: "ContainerWait" parameters: - $ref: "#/parameters/id" responses: 200: description: "The container has exited." schema: type: "object" required: [StatusCode] properties: StatusCode: description: "Exit code of the container" type: "integer" x-nullable: false Error: description: "The error message of waiting container" type: "string" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" tags: ["Container"] /containers/{id}: delete: summary: "Remove one container" operationId: "ContainerRemove" parameters: - $ref: "#/parameters/id" - name: "force" in: "query" description: "If the container is running, force query is used to kill it and remove it forcefully." type: "boolean" responses: 204: description: "no error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" tags: ["Container"] /containers/{id}/exec: post: summary: "Create an exec instance" description: "Run a command inside a running container." operationId: "ContainerExec" consumes: - "application/json" produces: - "application/json" responses: 201: description: "no error" schema: $ref: "#/definitions/ExecCreateResp" 404: $ref: "#/responses/404ErrorResponse" 409: description: "container is paused" schema: $ref: "#/definitions/Error" 500: $ref: "#/responses/500ErrorResponse" parameters: - $ref: "#/parameters/id" - name: "body" in: "body" schema: $ref: "#/definitions/ExecCreateConfig" required: true tags: ["Exec"] /containers/{id}/logs: get: summary: "Get container logs" description: | Get `stdout` and `stderr` logs from a container. Note: This endpoint works only for containers with the `json-file` or `journald` logging driver. operationId: "ContainerLogs" responses: 101: description: "logs returned as a stream" schema: type: "string" format: "binary" 200: description: "logs returned as a string in response body" schema: type: "string" 400: description: "bad parameter" schema: $ref: "#/definitions/Error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "id" in: "path" required: true description: "ID or name of the container" type: "string" - name: "follow" in: "query" description: | Return the logs as a stream. type: "boolean" default: false - name: "stdout" in: "query" description: "Return logs from `stdout`" type: "boolean" default: false - name: "stderr" in: "query" description: "Return logs from `stderr`" type: "boolean" default: false - name: "since" in: "query" description: "Only return logs since this time, as a UNIX timestamp" type: "integer" default: 0 - name: "until" in: "query" description: "Only return logs before this time, as a UNIX timestamp" type: "integer" default: 0 - name: "timestamps" in: "query" description: "Add timestamps to every log line" type: "boolean" default: false - name: "tail" in: "query" description: "Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines." type: "string" default: "all" tags: ["Container"] /containers/{id}/stats: get: summary: "Get container stats based on resource usage" description: | This endpoint returns a live stream of a container’s resource usage statistics. The `precpu_stats` is the CPU statistic of the *previous* read, and is used to calculate the CPU usage percentage. It is not an exact copy of the `cpu_stats` field. If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is nil then for compatibility with older daemons the length of the corresponding `cpu_usage.percpu_usage` array should be used. operationId: "ContainerStats" produces: ["application/json"] responses: 200: description: container stats schema: $ref: "#/definitions/ContainerStats" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "id" in: "path" required: true description: "ID or name of the container" type: "string" - name: "stream" in: "query" description: "Stream the output. If false, the stats will be output once and then it will disconnect." type: "boolean" default: true tags: ["Container"] /containers/{id}/resize: post: summary: "changes the size of the tty for a container" operationId: "ContainerResize" parameters: - $ref: "#/parameters/id" - name: "h" in: "query" description: "height of the tty" type: "string" - name: "w" in: "query" description: "width of the tty" type: "string" responses: 200: description: "no error" 400: description: "bad parameter" schema: $ref: "#/definitions/Error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" tags: ["Container"] /containers/{id}/checkpoints: post: summary: "create a checkpoint from a running container" operationId: "ContainerCheckpointCreate" parameters: - $ref: "#/parameters/id" - name: "body" in: "body" schema: $ref: "#/definitions/CheckpointCreateOptions" responses: 201: description: "created" 400: description: "bad parameter" schema: $ref: "#/definitions/Error" 404: $ref: "#/responses/404ErrorResponse" tags: ["Container"] get: summary: "list checkpoints of a container" operationId: "ContainerCheckpointList" parameters: - $ref: "#/parameters/id" - name: "checkpointdir" in: "query" description: "checkpoint directory" type: "string" responses: 200: description: "no error" 400: description: "bad parameter" schema: $ref: "#/definitions/Error" 404: $ref: "#/responses/404ErrorResponse" tags: ["Container"] /containers/{id}/checkpoints/{checkpointId}: delete: summary: "delete a checkpoint of a container" operationId: "ContainerCheckpointDelete" parameters: - $ref: "#/parameters/id" - name: "checkpointId" in: "path" description: "checkpoint id" type: "string" required: true - name: "dir" in: "query" description: "checkpoint directory" type: "string" responses: 204: description: "no error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" tags: ["Container"] /exec/{id}/start: post: summary: "Start an exec instance" description: "Starts a previously set up exec instance. If detach is true, this endpoint returns immediately after starting the command. Otherwise, it sets up an interactive session with the command." operationId: "ExecStart" consumes: - "application/json" produces: - "application/vnd.raw-stream" responses: 200: description: "No error" 404: description: "No such exec instance" schema: $ref: "#/definitions/Error" 409: description: "Container is stopped or paused" schema: $ref: "#/definitions/Error" parameters: - name: "execStartConfig" in: "body" schema: $ref: "#/definitions/ExecStartConfig" - name: "id" in: "path" description: "Exec instance ID" required: true type: "string" tags: ["Exec"] /exec/{id}/json: get: summary: "Inspect an exec instance" description: "Return low-level information about an exec instance." operationId: "ExecInspect" produces: - "application/json" responses: 200: description: "No error" schema: $ref: "#/definitions/ContainerExecInspect" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "id" in: "path" description: "Exec instance ID" required: true type: "string" tags: ["Exec"] /exec/{id}/resize: post: summary: "changes the size of the tty for an exec process" operationId: "ExecResize" parameters: - $ref: "#/parameters/id" - name: "h" in: "query" description: "height of the tty" type: "string" - name: "w" in: "query" description: "width of the tty" type: "string" responses: 200: description: "no error" 400: description: "bad parameter" schema: $ref: "#/definitions/Error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" tags: ["Exec"] /containers/{id}/attach: post: summary: "Attach to a container" description: | Attach to a container to read its output or send it input. You can attach to the same container multiple times and you can reattach to containers that have been detached. Either the `stream` or `logs` parameter must be `true` for this endpoint to do anything. ### Hijacking This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, and `stderr` on the same socket. This is the response from the daemon for an attach request: ``` HTTP/1.1 200 OK Content-Type: application/vnd.raw-stream [STREAM] ``` After the headers and two new lines, the TCP connection can now be used for raw, bidirectional communication between the client and server. To hint potential proxies about connection hijacking, the Pouch client can also optionally send connection upgrade headers. For example, the client sends this request to upgrade the connection: ``` POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 Upgrade: tcp Connection: Upgrade ``` The Pouch daemon will respond with a `101 UPGRADED` response, and will similarly follow with the raw stream: ``` HTTP/1.1 101 UPGRADED Content-Type: application/vnd.raw-stream Connection: Upgrade Upgrade: tcp [STREAM] ``` ### Stream format When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), the stream over the hijacked connected is multiplexed to separate out `stdout` and `stderr`. The stream consists of a series of frames, each containing a header and a payload. The header contains the information which the stream writes (`stdout` or `stderr`). It also contains the size of the associated frame encoded in the last four bytes (`uint32`). It is encoded on the first eight bytes like this: ```go header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} ``` `STREAM_TYPE` can be: - 0: `stdin` (is written on `stdout`) - 1: `stdout` - 2: `stderr` `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size encoded as big endian. Following the header is the payload, which is the specified number of bytes of `STREAM_TYPE`. The simplest way to implement this protocol is the following: 1. Read 8 bytes. 2. Choose `stdout` or `stderr` depending on the first byte. 3. Extract the frame size from the last four bytes. 4. Read the extracted size and output it on the correct output. 5. Goto 1. ### Stream format when using a TTY When the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate), the stream is not multiplexed. The data exchanged over the hijacked connection is simply the raw data from the process PTY and client's `stdin`. operationId: "ContainerAttach" produces: - "application/vnd.raw-stream" responses: 101: description: "no error, hints proxy about hijacking" 200: description: "no error, no upgrade header found" 400: description: "bad parameter" schema: $ref: "#/definitions/Error" 404: description: "no such container" schema: $ref: "#/definitions/Error" examples: application/json: message: "No such container: c2ada9df5af8" 500: description: "server error" schema: $ref: "#/definitions/Error" parameters: - name: "id" in: "path" required: true description: "ID or name of the container" type: "string" - name: "detachKeys" in: "query" description: "Override the key sequence for detaching a container.Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`." type: "string" - name: "logs" in: "query" description: | Replay previous logs from the container. This is useful for attaching to a container that has started and you want to output everything since the container started. If `stream` is also enabled, once all the previous output has been returned, it will seamlessly transition into streaming current output. type: "boolean" default: false - name: "stream" in: "query" description: "Stream attached streams from the time the request was made onwards" type: "boolean" default: false - name: "stdin" in: "query" description: "Attach to `stdin`" type: "boolean" default: false - name: "stdout" in: "query" description: "Attach to `stdout`" type: "boolean" default: false - name: "stderr" in: "query" description: "Attach to `stderr`" type: "boolean" default: false tags: ["Container"] /containers/{id}/update: post: summary: "Update the configurations of a container" operationId: "ContainerUpdate" parameters: - $ref: "#/parameters/id" - name: "updateConfig" in: "body" schema: $ref: "#/definitions/UpdateConfig" responses: 200: description: "no error" 400: description: "bad parameter" schema: $ref: "#/definitions/Error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" tags: ["Container"] /containers/{id}/upgrade: post: summary: "Upgrade a container with new image and args" operationId: "ContainerUpgrade" parameters: - $ref: "#/parameters/id" - name: "upgradeConfig" in: "body" schema: $ref: "#/definitions/ContainerUpgradeConfig" responses: 200: description: "no error" 400: description: "bad parameter" schema: $ref: "#/definitions/Error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" tags: ["Container"] /volumes: get: summary: "List volumes" operationId: "VolumeList" produces: ["application/json"] responses: 200: description: "Summary volume data that matches the query" schema: $ref: "#/definitions/VolumeListResp" examples: application/json: Volumes: - CreatedAt: "2017-07-19T12:00:26Z" Name: "tardis" Driver: "local" Mountpoint: "/var/lib/pouch/volumes/tardis" Labels: com.example.some-label: "some-value" com.example.some-other-label: "some-other-value" Scope: "local" Options: device: "tmpfs" o: "opt.size=100m,uid=1000" type: "tmpfs" Warnings: [] 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "filters" in: "query" description: | JSON encoded value of the filters (a `map[string][]string`) to process on the volumes list. Available filters: - `driver=` Matches volumes based on their driver. - `label=` or `label=:` Matches volumes based on the presence of a `label` alone or a `label` and a value. - `name=` Matches all or part of a volume name. type: "string" format: "json" tags: ["Volume"] /volumes/create: post: summary: "Create a volume" operationId: "VolumeCreate" consumes: ["application/json"] produces: ["application/json"] responses: 201: description: "The volume was created successfully" schema: $ref: "#/definitions/VolumeInfo" 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "body" in: "body" required: true description: "Volume configuration" schema: $ref: "#/definitions/VolumeCreateConfig" tags: ["Volume"] /volumes/{id}: get: summary: "Inspect a volume" operationId: "VolumeInspect" produces: ["application/json"] responses: 200: description: "No error" schema: $ref: "#/definitions/VolumeInfo" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" parameters: - $ref: "#/parameters/id" tags: ["Volume"] delete: summary: "Delete a volume" operationId: "VolumeDelete" responses: 204: description: "No error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" parameters: - $ref: "#/parameters/id" tags: ["Volume"] /networks/create: post: summary: "Create a network" operationId: "NetworkCreate" consumes: ["application/json"] produces: ["application/json"] responses: 201: description: "The network was created successfully" schema: $ref: "#/definitions/NetworkCreateResp" 400: description: "bad parameter" schema: $ref: "#/definitions/Error" 409: description: "name already in use" schema: $ref: "#/definitions/Error" 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "NetworkCreateConfig" in: "body" required: true description: "Network configuration" schema: $ref: "#/definitions/NetworkCreateConfig" tags: ["Network"] /networks/{id}: get: summary: "Inspect a network" operationId: "NetworkInspect" produces: - "application/json" responses: 200: description: "No error" schema: $ref: "#/definitions/NetworkInspectResp" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" parameters: - $ref: "#/parameters/id" tags: ["Network"] delete: summary: "Remove a network" operationId: "NetworkDelete" responses: 204: description: "No error" 403: description: "operation not supported for pre-defined networks" schema: $ref: "#/definitions/Error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" parameters: - $ref: "#/parameters/id" tags: ["Network"] /networks: get: summary: "List networks" operationId: "NetworkList" produces: ["application/json"] responses: 200: description: "Summary networks that matches the query" schema: $ref: "#/definitions/NetworkResource" 500: $ref: "#/responses/500ErrorResponse" tags: ["Network"] /networks/{id}/connect: post: summary: "Connect a container to a network" operationId: "NetworkConnect" consumes: - "application/json" responses: 200: description: "No error" 400: description: "bad parameter" schema: $ref: "#/definitions/Error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "id" in: "path" description: "Network ID or name" required: true type: "string" - name: "container" in: "body" required: true schema: $ref: "#/definitions/NetworkConnect" tags: ["Network"] /networks/{id}/disconnect: post: summary: "Disconnect a container from a network" operationId: "NetworkDisconnect" consumes: - "application/json" responses: 200: description: "No error" 400: description: "bad parameter" schema: $ref: "#/definitions/Error" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "id" in: "path" description: "Network ID or name" required: true type: "string" - name: "NetworkDisconnect" in: "body" required: true description: "Network disconnect parameters" schema: $ref: "#/definitions/NetworkDisconnect" tags: ["Network"] /commit: post: summary: "Create an image from a container" operationId: "Commit" consumes: ["application/json"] produces: ["application/json"] responses: 201: description: "The image was created successfully" schema: $ref: "#/definitions/ContainerCommitResp" 404: $ref: "#/responses/404ErrorResponse" 500: $ref: "#/responses/500ErrorResponse" parameters: - name: "ContainerCommitOptions" in: "body" required: true description: "options of commit an image from a container" schema: $ref: "#/definitions/ContainerCommitOptions" /containers/{id}/archive: head: summary: "Get information about files in a container" description: "A response header `X-Docker-Container-Path-Stat` is return containing a base64 - encoded JSON object with some filesystem header information about the path." operationId: "ContainerArchiveInfo" responses: 200: description: "no error" headers: X-Docker-Container-Path-Stat: type: "string" description: "A base64 - encoded JSON object with some filesystem header information about the path" 400: description: "Bad parameter" schema: $ref: "#/responses/400ErrorResponse" 404: description: "Container or path does not exist" schema: $ref: "#/responses/404ErrorResponse" examples: application/json: message: "No such container: c2ada9df5af8" 500: description: "Server error" schema: $ref: "#/responses/500ErrorResponse" parameters: - name: "id" in: "path" required: true description: "ID or name of the container" type: "string" - name: "path" in: "query" required: true description: "Resource in the container’s filesystem to archive." type: "string" tags: ["Copy"] get: summary: "Get an archive of a filesystem resource in a container" description: "Get a tar archive of a resource in the filesystem of container id." operationId: "ContainerArchive" produces: ["application/x-tar"] responses: 200: description: "no error" 400: description: "Bad parameter" schema: $ref: "#/responses/400ErrorResponse" 404: description: "Container or path does not exist" schema: $ref: "#/responses/404ErrorResponse" examples: application/json: message: "No such container: c2ada9df5af8" 500: description: "server error" schema: $ref: "#/responses/500ErrorResponse" parameters: - name: "id" in: "path" required: true description: "ID or name of the container" type: "string" - name: "path" in: "query" required: true description: "Resource in the container’s filesystem to archive." type: "string" tags: ["Copy"] put: summary: "Extract an archive of files or folders to a directory in a container" description: "Upload a tar archive to be extracted to a path in the filesystem of container id." operationId: "PutContainerArchive" consumes: ["application/x-tar", "application/octet-stream"] responses: 200: description: "The content was extracted successfully" 400: description: "Bad parameter" schema: $ref: "#/responses/400ErrorResponse" 403: description: "Permission denied, the volume or container rootfs is marked as read-only." schema: $ref: "#/responses/403ErrorResponse" 404: description: "No such container or path does not exist inside the container" schema: $ref: "#/responses/404ErrorResponse" examples: application/json: message: "No such container: c2ada9df5af8" 500: description: "Server error" schema: $ref: "#/responses/500ErrorResponse" parameters: - name: "id" in: "path" required: true description: "ID or name of the container" type: "string" - name: "path" in: "query" required: true description: "Path to a directory in the container to extract the archive’s contents into. " type: "string" - name: "noOverwriteDirNonDir" in: "query" description: "If “1”, “true”, or “True” then it will be an error if unpacking the given content would cause an existing directory to be replaced with a non-directory and vice versa." type: "string" - name: "copyUIDGID" in: "query" description: "If “1”, “true”, or “True” then it will copy UID/GID maps to dest file." type: "string" - name: "inputStream" in: "body" required: true description: "The input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz." schema: type: "string" tags: ["Copy"] definitions: Error: type: "object" properties: message: type: string SystemVersion: type: "object" properties: Version: type: "string" description: "version of Pouch Daemon" example: "0.1.2" ApiVersion: type: "string" description: "Api Version held by daemon" example: "" GitCommit: type: "string" description: "Commit ID held by the latest commit operation" example: "" GoVersion: type: "string" description: "version of Go runtime" example: "1.8.3" Os: type: "string" description: "Operating system type of underlying system" example: "linux" Arch: type: "string" description: "Arch type of underlying hardware" example: "amd64" KernelVersion: type: "string" description: "Operating system kernel version" example: "3.13.0-106-generic" BuildTime: type: "string" description: "The time when this binary of daemon is built" example: "2017-08-29T17:41:57.729792388+00:00" SystemInfo: type: "object" properties: ID: description: | Unique identifier of the daemon.


> **Note**: The format of the ID itself is not part of the API, and > should not be considered stable. type: "string" example: "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS" Containers: description: "Total number of containers on the host." type: "integer" example: 14 ContainersRunning: description: | Number of containers with status `"running"`. type: "integer" example: 3 ContainersPaused: description: | Number of containers with status `"paused"`. type: "integer" example: 1 ContainersStopped: description: | Number of containers with status `"stopped"`. type: "integer" example: 10 Images: description: | Total number of images on the host. Both _tagged_ and _untagged_ (dangling) images are counted. type: "integer" example: 508 Driver: description: "Name of the storage driver in use." type: "string" example: "overlay2" DriverStatus: description: | Information specific to the storage driver, provided as "label" / "value" pairs. This information is provided by the storage driver, and formatted in a way consistent with the output of `pouch info` on the command line.


> **Note**: The information returned in this field, including the > formatting of values and labels, should not be considered stable, > and may change without notice. type: "array" items: type: "array" items: type: "string" example: - ["Backing Filesystem", "extfs"] - ["Supports d_type", "true"] - ["Native Overlay Diff", "true"] PouchRootDir: description: | Root directory of persistent Pouch state. Defaults to `/var/lib/pouch` on Linux. type: "string" example: "/var/lib/pouch" Debug: description: "Indicates if the daemon is running in debug-mode / with debug-level logging enabled." type: "boolean" example: true LoggingDriver: description: | The logging driver to use as a default for new containers. type: "string" VolumeDrivers: description: | The list of volume drivers which the pouchd supports type: "array" items: type: "string" example: ["local", "tmpfs"] CgroupDriver: description: | The driver to use for managing cgroups. type: "string" x-nullable: false enum: ["cgroupfs", "systemd"] default: "cgroupfs" example: "cgroupfs" KernelVersion: description: | Kernel version of the host. On Linux, this information obtained from `uname`. type: "string" OperatingSystem: description: | Name of the host's operating system, for example: "Ubuntu 16.04.2 LTS". type: "string" example: "Alpine Linux v3.5" OSType: description: | Generic type of the operating system of the host, as returned by the Go runtime (`GOOS`). Currently returned value is "linux". A full list of possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment). type: "string" example: "linux" Architecture: description: | Hardware architecture of the host, as returned by the Go runtime (`GOARCH`). A full list of possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment). type: "string" example: "x86_64" NCPU: description: | The number of logical CPUs usable by the daemon. The number of available CPUs is checked by querying the operating system when the daemon starts. Changes to operating system CPU allocation after the daemon is started are not reflected. type: "integer" example: 4 MemTotal: description: | Total amount of physical memory available on the host, in kilobytes (kB). type: "integer" format: "int64" example: 2095882240 IndexServerAddress: description: | Address / URL of the index server that is used for image search, and as a default for user authentication. type: "string" DefaultRegistry: description: | default registry can be defined by user. type: "string" RegistryConfig: $ref: "#/definitions/RegistryServiceConfig" HttpProxy: description: | HTTP-proxy configured for the daemon. This value is obtained from the [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. Containers do not automatically inherit this configuration. type: "string" example: "http://user:pass@proxy.corp.example.com:8080" HttpsProxy: description: | HTTPS-proxy configured for the daemon. This value is obtained from the [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. Containers do not automatically inherit this configuration. type: "string" example: "https://user:pass@proxy.corp.example.com:4443" Name: description: "Hostname of the host." type: "string" example: "node5.corp.example.com" Labels: description: | User-defined labels (key/value metadata) as set on the daemon. type: "array" items: type: "string" example: ["storage=ssd", "production"] ExperimentalBuild: description: | Indicates if experimental features are enabled on the daemon. type: "boolean" example: true ServerVersion: description: | Version string of the daemon. type: "string" example: "17.06.0-ce" Runtimes: description: | List of [OCI compliant](https://github.com/opencontainers/runtime-spec) runtimes configured on the daemon. Keys hold the "name" used to reference the runtime. The Pouch daemon relies on an OCI compliant runtime (invoked via the `containerd` daemon) as its interface to the Linux kernel namespaces, cgroups, and SELinux. The default runtime is `runc`, and automatically configured. Additional runtimes can be configured by the user and will be listed here. type: "object" additionalProperties: $ref: "#/definitions/Runtime" default: runc: path: "pouch-runc" example: runc: path: "pouch-runc" runc-master: path: "/go/bin/runc" custom: path: "/usr/local/bin/my-oci-runtime" runtimeArgs: ["--debug", "--systemd-cgroup=false"] DefaultRuntime: description: | Name of the default OCI runtime that is used when starting containers. The default can be overridden per-container at create time. type: "string" x-nullable: false default: "runc" example: "runc" LiveRestoreEnabled: description: | Indicates if live restore is enabled. If enabled, containers are kept running when the daemon is shutdown or upon daemon start if running containers are detected. type: "boolean" x-nullable: false default: false example: false LxcfsEnabled: description: | Indicates if lxcfs is enabled. type: "boolean" x-nullable: false default: false example: false CriEnabled: description: | Indicates if pouchd has accepted flag --enable-cri and enables cri part. type: "boolean" x-nullable: false default: false example: false ContainerdCommit: $ref: "#/definitions/Commit" RuncCommit: $ref: "#/definitions/Commit" SecurityOptions: description: | List of security features that are enabled on the daemon, such as apparmor, seccomp, SELinux, and user-namespaces (userns). Additional configuration options for each security feature may be present, and are included as a comma-separated list of key/value pairs. type: "array" items: type: "string" example: - "name=apparmor" - "name=seccomp,profile=default" - "name=selinux" - "name=userns" ListenAddresses: description: "List of addresses the pouchd listens on" type: "array" items: type: "string" example: - ["unix:///var/run/pouchd.sock", "tcp://0.0.0.0:4243"] DaemonUpdateConfig: type: "object" properties: Labels: description: "Labels indentified the attributes of daemon" type: "array" items: type: "string" example: ["storage=ssd", "zone=hangzhou"] ImageProxy: description: "Image proxy used to pull image." type: "string" RegistryServiceConfig: description: | RegistryServiceConfig stores daemon registry services configuration. type: "object" x-nullable: true properties: AllowNondistributableArtifactsCIDRs: description: | List of IP ranges to which nondistributable artifacts can be pushed, using the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632). Some images contain artifacts whose distribution is restricted by license. When these images are pushed to a registry, restricted artifacts are not included. This configuration override this behavior, and enables the daemon to push nondistributable artifacts to all registries whose resolved IP address is within the subnet described by the CIDR syntax. This option is useful when pushing images containing nondistributable artifacts to a registry on an air-gapped network so hosts on that network can pull the images without connecting to another server. > **Warning**: Nondistributable artifacts typically have restrictions > on how and where they can be distributed and shared. Only use this > feature to push artifacts to private registries and ensure that you > are in compliance with any terms that cover redistributing > nondistributable artifacts. x-omitempty: true type: "array" items: type: "string" example: ["::1/128", "127.0.0.0/8"] AllowNondistributableArtifactsHostnames: description: | List of registry hostnames to which nondistributable artifacts can be pushed, using the format `[:]` or `[:]`. Some images (for example, Windows base images) contain artifacts whose distribution is restricted by license. When these images are pushed to a registry, restricted artifacts are not included. This configuration override this behavior for the specified registries. This option is useful when pushing images containing nondistributable artifacts to a registry on an air-gapped network so hosts on that network can pull the images without connecting to another server. > **Warning**: Nondistributable artifacts typically have restrictions > on how and where they can be distributed and shared. Only use this > feature to push artifacts to private registries and ensure that you > are in compliance with any terms that cover redistributing > nondistributable artifacts. x-omitempty: true type: "array" items: type: "string" example: ["registry.internal.corp.example.com:3000", "[2001:db8:a0b:12f0::1]:443"] InsecureRegistryCIDRs: description: | List of IP ranges of insecure registries, using the CIDR syntax ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from unknown CAs) communication. By default, local registries (`127.0.0.0/8`) are configured as insecure. All other registries are secure. Communicating with an insecure registry is not possible if the daemon assumes that registry is secure. This configuration override this behavior, insecure communication with registries whose resolved IP address is within the subnet described by the CIDR syntax. Registries can also be marked insecure by hostname. Those registries are listed under `IndexConfigs` and have their `Secure` field set to `false`. > **Warning**: Using this option can be useful when running a local > registry, but introduces security vulnerabilities. This option > should therefore ONLY be used for testing purposes. For increased > security, users should add their CA to their system's list of trusted > CAs instead of enabling this option. x-omitempty: true type: "array" items: type: "string" example: ["::1/128", "127.0.0.0/8"] IndexConfigs: x-omitempty: true type: "object" additionalProperties: $ref: "#/definitions/IndexInfo" example: "127.0.0.1:5000": "Name": "127.0.0.1:5000" "Mirrors": [] "Secure": false "Official": false "[2001:db8:a0b:12f0::1]:80": "Name": "[2001:db8:a0b:12f0::1]:80" "Mirrors": [] "Secure": false "Official": false "registry.internal.corp.example.com:3000": Name: "registry.internal.corp.example.com:3000" Mirrors: [] Secure: false Official: false Mirrors: description: "List of registry URLs that act as a mirror for the official registry." x-omitempty: true type: "array" items: type: "string" example: - "https://hub-mirror.corp.example.com:5000/" - "https://[2001:db8:a0b:12f0::1]/" IndexInfo: description: IndexInfo contains information about a registry. type: "object" x-nullable: true properties: Name: description: | Name of the registry. type: "string" Mirrors: description: | List of mirrors, expressed as URIs. type: "array" items: type: "string" example: - "https://hub-mirror.corp.example.com:5000/" Secure: description: | Indicates if the the registry is part of the list of insecure registries. If `false`, the registry is insecure. Insecure registries accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from unknown CAs) communication. > **Warning**: Insecure registries can be useful when running a local > registry. However, because its use creates security vulnerabilities > it should ONLY be enabled for testing purposes. For increased > security, users should add their CA to their system's list of > trusted CAs instead of enabling this option. type: "boolean" example: true Official: description: | Indicates whether this is an official registry. type: "boolean" example: true Runtime: description: | Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec) runtime. The runtime is invoked by the daemon via the `containerd` daemon. OCI runtimes act as an interface to the Linux kernel namespaces, cgroups, and SELinux. type: "object" properties: type: description: The runtime type used in containerd. type: "string" example: "io.containerd.runtime.v1.linux" options: description: Options are config options for specific runtime. x-go-type: "interface{}" path: description: | Name and, optional, path, of the OCI executable binary. If the path is omitted, the daemon searches the host's `$PATH` for the binary and uses the first result. type: "string" example: "/usr/local/bin/my-oci-runtime" runtimeArgs: description: | List of command-line arguments to pass to the runtime when invoked. DEPRECATED: Use Options instead. Remove when shim v1 is deprecated. type: "array" x-nullable: true items: type: "string" example: ["--debug", "--systemd-cgroup=false"] Commit: description: | Commit holds the Git-commit (SHA1) that a binary was built from, as reported in the version-string of external tools, such as `containerd`, or `runC`. type: "object" properties: ID: description: "Actual commit ID of external tool." type: "string" example: "cfb82a876ecc11b5ca0977d1733adbe58599088a" Expected: description: | Commit ID of external tool expected by pouchd as set at build time. type: "string" example: "2d41c047c83e09a6d61d464906feb2a2f3c52aa4" AuthConfig: type: "object" properties: Username: type: "string" Password: type: "string" Auth: type: "string" ServerAddress: type: "string" IdentityToken: type: "string" description: "IdentityToken is used to authenticate the user and get an access token for the registry" RegistryToken: type: "string" description: "RegistryToken is a bearer token to be sent to a registry" AuthResponse: description: "The response returned by login to a registry" type: "object" required: [Status] properties: Status: description: "The status of the authentication" type: "string" x-nullable: false IdentityToken: description: "An opaque token used to authenticate a user after a successful login" type: "string" x-nullable: false ContainerCreateConfig: description: | ContainerCreateConfig is used for API "POST /containers/create". It wraps all kinds of config used in container creation. It can be used to encode client params in client and unmarshal request body in daemon side. allOf: - $ref: "#/definitions/ContainerConfig" - type: "object" properties: HostConfig: $ref: "#/definitions/HostConfig" NetworkingConfig: $ref: "#/definitions/NetworkingConfig" ContainerConfig: type: "object" description: "Configuration for a container that is portable between hosts" required: - Image properties: Hostname: description: "The hostname to use for the container, as a valid RFC 1123 hostname." type: "string" format: hostname minLength: 1 Domainname: description: "The domain name to use for the container." type: "string" User: description: "The user that commands are run as inside the container." type: "string" AttachStdin: description: "Whether to attach to `stdin`." type: "boolean" x-nullable: false AttachStdout: description: "Whether to attach to `stdout`." type: "boolean" x-nullable: false default: true AttachStderr: description: "Whether to attach to `stderr`." type: "boolean" x-nullable: false default: true DisableNetworkFiles: description: "Whether to generate the network files(/etc/hostname, /etc/hosts and /etc/resolv.conf) for container." type: "boolean" x-nullable: false default: false ExposedPorts: description: "An object mapping ports to an empty object in the form:`{/: {}}`" type: "object" additionalProperties: type: "object" enum: - {} default: {} Tty: description: "Attach standard streams to a TTY, including `stdin` if it is not closed." type: "boolean" x-nullable: false OpenStdin: description: "Open `stdin`" type: "boolean" x-nullable: false StdinOnce: description: "Close `stdin` after one attached client disconnects" type: "boolean" x-nullable: false Env: description: | A list of environment variables to set inside the container in the form `["VAR=value", ...]`. A variable like "A=" means setting env A in container to be empty value. And a variable without `=` is removed from the environment, rather than to have an empty value. type: "array" items: type: "string" Cmd: description: "Command to run specified an array of strings." type: "array" items: type: "string" ArgsEscaped: description: "Command is already escaped (Windows only)" type: "boolean" x-nullable: false Image: description: "The name of the image to use when creating the container" type: "string" x-nullable: false Volumes: description: "An object mapping mount point paths inside the container to empty objects." type: "object" additionalProperties: type: "object" enum: - {} default: {} WorkingDir: description: "The working directory for commands to run in." type: "string" Entrypoint: description: | The entry point for the container as a string or an array of strings. If the array consists of exactly one empty string (`[""]`) then the entry point is reset to system default. type: "array" items: type: "string" NetworkDisabled: description: "Disable networking for the container." type: "boolean" MacAddress: description: "MAC address of the container." type: "string" OnBuild: description: "`ONBUILD` metadata that were defined." type: "array" items: type: "string" Labels: description: "User-defined key/value metadata." type: "object" additionalProperties: type: "string" StopSignal: description: "Signal to stop a container as a string or unsigned integer." type: "string" default: "SIGTERM" x-nullable: false StopTimeout: description: "Timeout to stop a container in seconds." type: "integer" minimum: 0 default: 10 Shell: description: "Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell." type: "array" items: type: "string" Rich: type: "boolean" description: "Whether to start container in rich container mode. (default false)" x-nullable: false RichMode: type: "string" description: "Choose one rich container mode.(default dumb-init)" enum: - "dumb-init" - "sbin-init" - "systemd" InitScript: type: "string" description: "Initial script executed in container. The script will be executed before entrypoint or command" DiskQuota: type: "object" description: | Set disk quota for container. Key is the dir in container. Value is disk quota size for the dir. / means rootfs dir in container. .* includes rootfs dir and all volume dir. x-nullable: true additionalProperties: type: "string" SpecAnnotation: description: "annotations send to runtime spec." type: "object" additionalProperties: type: "string" QuotaID: type: "string" description: | Set disk quota by specified quota id. If QuotaID <= 0, it means pouchd should allocate a unique quota id by sequence automatically. By default, a quota ID is mapped to only one container. And one quota ID can include several mountpoint. NetPriority: description: "net priority." type: "integer" default: 0 SpecificID: type: "string" description: | Create container with given id. MinLength: 64 MaxLength: 64 The characters of given id should be in 0123456789abcdef. By default, given id is unnecessary. Snapshotter: description: | The snapshotter container choose, can be different with default snapshotter. The Field only set through hook plugin. type: "string" ContainerCreateResp: description: "response returned by daemon when container create successfully" type: "object" required: [Id, Warnings] properties: Id: description: "The ID of the created container" type: "string" x-nullable: false Name: description: "The name of the created container" type: "string" Warnings: description: "Warnings encountered when creating the container" type: "array" x-nullable: false items: type: "string" HostConfig: description: "Container configuration that depends on the host we are running on" allOf: - type: "object" properties: # Applicable to all platforms Binds: type: "array" description: | A list of volume bindings for this container. Each volume binding is a string in one of these forms: - `host-src:container-dest` to bind-mount a host path into the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - `host-src:container-dest:ro` to make the bind mount read-only inside the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - `volume-name:container-dest` to bind-mount a volume managed by a volume driver into the container. `container-dest` must be an _absolute_ path. - `volume-name:container-dest:ro` to mount the volume read-only inside the container. `container-dest` must be an _absolute_ path. items: type: "string" ContainerIDFile: type: "string" description: "Path to a file where the container ID is written" LogConfig: description: "The logging configuration for this container" type: "object" $ref: "#/definitions/LogConfig" RestartPolicy: type: "object" description: "Restart policy to be used to manage the container" $ref: "#/definitions/RestartPolicy" NetworkMode: type: "string" description: "Network mode to use for this container. Supported standard values are: `netns:`, `bridge`, `host`, `none`, and `container:`. Any other value is taken as a custom network's name to which this container should connect to." PortBindings: type: "object" description: "A map of exposed container ports and the host port they should map to." $ref: "#/definitions/PortMap" AutoRemove: type: "boolean" description: "Automatically remove the container when the container's process exits. This has no effect if `RestartPolicy` is set." VolumeDriver: type: "string" description: "Driver that this container uses to mount volumes." VolumesFrom: type: "array" description: "A list of volumes to inherit from another container, specified in the form `[:]`." items: type: "string" CapAdd: type: "array" description: "A list of kernel capabilities to add to the container." items: type: "string" CapDrop: type: "array" description: "A list of kernel capabilities to drop from the container." items: type: "string" Dns: type: "array" description: "A list of DNS servers for the container to use." items: type: "string" DnsOptions: type: "array" description: "A list of DNS options." items: type: "string" DnsSearch: type: "array" description: "A list of DNS search domains." items: type: "string" ExtraHosts: type: "array" description: | A list of hostnames/IP mappings to add to the container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. items: type: "string" GroupAdd: type: "array" description: "A list of additional groups that the container process will run as." items: type: "string" CgroupMode: type: "string" description: | Determine the container has own cgroup namespace, valid values is host `"host"` means own host cgroup namespace, default or other values will share host cgroup namespace. Note cgroup namespace only take effect for kernel > 4.6 IpcMode: type: "string" description: | IPC sharing mode for the container. Possible values are: - `"none"`: own private IPC namespace, with /dev/shm not mounted - `"private"`: own private IPC namespace - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers - `"container:"`: join another (shareable) container's IPC namespace - `"host"`: use the host system's IPC namespace If not specified, daemon default is used, which can either be `"private"` or `"shareable"`, depending on daemon version and configuration. Cgroup: type: "string" description: "Cgroup to use for the container." Links: type: "array" description: "A list of links for the container in the form `container_name:alias`." items: type: "string" OomScoreAdj: description: | An integer value containing the score given to the container in order to tune OOM killer preferences. The range is in [-1000, 1000]. type: "integer" format: "int" x-nullable: false minimum: -1000 maximum: 1000 PidMode: type: "string" description: | Set the PID (Process) Namespace mode for the container. It can be either: - `"container:"`: joins another container's PID namespace - `"host"`: use the host's PID namespace inside the container Privileged: type: "boolean" x-omitempty: false description: "Gives the container full access to the host." PublishAllPorts: type: "boolean" description: "Allocates a random host port for all of a container's exposed ports." ReadonlyRootfs: type: "boolean" description: "Mount the container's root filesystem as read only." SecurityOpt: type: "array" description: "A list of string values to customize labels for MLS systems, such as SELinux." items: type: "string" StorageOpt: type: "object" description: | Storage driver options for this container, in the form `{"size": "120G"}`. additionalProperties: type: "string" Tmpfs: type: "object" description: | A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options. For example: `{ "/run": "rw,noexec,nosuid,size=65536k" }`. additionalProperties: type: "string" UTSMode: type: "string" description: "UTS namespace to use for the container." UsernsMode: type: "string" description: "Sets the usernamespace mode for the container when usernamespace remapping option is enabled." ShmSize: type: "integer" description: "Size of `/dev/shm` in bytes. If omitted, the system uses 64MB." minimum: 0 Sysctls: type: "object" description: | A list of kernel parameters (sysctls) to set in the container. For example: `{"net.ipv4.ip_forward": "1"}` additionalProperties: type: "string" Runtime: type: "string" description: "Runtime to use with this container." RuntimeType: type: "string" description: "The runtime type used in containerd." # Applicable to Windows ConsoleSize: type: "array" description: "Initial console size, as an `[height, width]` array. (Windows only)" minItems: 2 maxItems: 2 items: type: "integer" minimum: 0 Isolation: type: "string" description: "Isolation technology of the container. (Windows only)" enum: - "default" - "process" - "hyperv" EnableLxcfs: description: "Whether to enable lxcfs." type: "boolean" x-nullable: false Rich: type: "boolean" description: "Whether to start container in rich container mode. (default false)" x-nullable: false RichMode: type: "string" description: "Choose one rich container mode.(default dumb-init)" enum: - "dumb-init" - "sbin-init" - "systemd" InitScript: type: "string" description: "Initial script executed in container. The script will be executed before entrypoint or command" MaskedPaths: description: "Masks over the provided paths inside the container." type: "array" items: type: "string" ReadonlyPaths: description: "Set the provided paths as RO inside the container." type: "array" items: type: "string" - $ref: "#/definitions/Resources" UpdateConfig: description: "UpdateConfig holds the mutable attributes of a Container. Those attributes can be updated at runtime." allOf: - $ref: "#/definitions/Resources" - properties: RestartPolicy: $ref: "#/definitions/RestartPolicy" Env: description: | A list of environment variables to set inside the container in the form `["VAR=value", ...]`. A variable like "A=" means updating env A in container to be empty value. A variable without `=` is removed from the environment, rather than to have an empty value. type: "array" items: type: "string" Label: description: "List of labels set to container." type: "array" items: type: "string" DiskQuota: type: "object" description: "update disk quota for container" x-nullable: true additionalProperties: type: "string" SpecAnnotation: type: "object" description: "update specAnnotation for container" x-nullable: true additionalProperties: type: "string" ContainerUpgradeConfig: description: | ContainerUpgradeConfig is used for API "POST /containers/{name:.*}/upgrade". when upgrade a container, we must specify new image used to create a new container, and also can specify `Cmd` and `Entrypoint` for new container. There is all parameters that upgrade a container, if want to change other parameters, i think you should use `update` API interface. required: [Image] properties: Image: type: "string" x-nullable: false Cmd: type: "array" description: "Execution commands and args" items: type: "string" Entrypoint: description: | The entrypoint for the container as a string or an array of strings. If the array consists of exactly one empty string (`[""]`) then the entry point is reset to system default. type: "array" items: type: "string" LogConfig: description: "The logging configuration for this container" type: "object" properties: Type: type: "string" x-go-name: "LogDriver" enum: - "json-file" - "syslog" - "journald" - "gelf" - "fluentd" - "awslogs" - "splunk" - "etwlogs" - "none" Config: type: "object" x-go-name: "LogOpts" additionalProperties: type: "string" Resources: description: "A container's resources (cgroups config, ulimits, etc)" type: "object" properties: # Applicable to UNIX platforms CgroupParent: description: "Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist." type: "string" x-nullable: false x-omitempty: false BlkioWeight: description: "Block IO weight (relative weight), need CFQ IO Scheduler enable." type: "integer" format: "uint16" x-nullable: false minimum: 0 maximum: 1000 x-omitempty: false BlkioWeightDevice: description: | Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. type: "array" items: $ref: "#/definitions/WeightDevice" BlkioDeviceReadBps: description: | Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. type: "array" items: $ref: "#/definitions/ThrottleDevice" BlkioDeviceWriteBps: description: | Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. type: "array" items: $ref: "#/definitions/ThrottleDevice" BlkioDeviceReadIOps: description: | Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. type: "array" items: $ref: "#/definitions/ThrottleDevice" BlkioDeviceWriteIOps: description: | Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. type: "array" items: $ref: "#/definitions/ThrottleDevice" CpuShares: description: "An integer value representing this container's relative CPU weight versus other containers." type: "integer" x-nullable: false x-omitempty: false CpuPeriod: description: | CPU CFS (Completely Fair Scheduler) period. The length of a CPU period in microseconds. type: "integer" format: "int64" minimum: 1000 maximum: 1000000 x-nullable: false x-omitempty: false CpuQuota: description: | CPU CFS (Completely Fair Scheduler) quota. Microseconds of CPU time that the container can get in a CPU period." type: "integer" format: "int64" x-nullable: false x-omitempty: false CpuRealtimePeriod: description: "The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks." type: "integer" format: "int64" x-nullable: false x-omitempty: false CpuRealtimeRuntime: description: "The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks." type: "integer" format: "int64" x-nullable: false x-omitempty: false CpusetCpus: description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)" type: "string" example: "0-3" x-nullable: false x-omitempty: false CpusetMems: description: "Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems." type: "string" x-nullable: false x-omitempty: false Devices: description: "A list of devices to add to the container." type: "array" items: $ref: "#/definitions/DeviceMapping" DeviceCgroupRules: description: "a list of cgroup rules to apply to the container" type: "array" items: type: "string" example: "c 13:* rwm" KernelMemory: description: "Kernel memory limit in bytes." type: "integer" format: "int64" x-nullable: false x-omitempty: false Memory: description: "Memory limit in bytes." type: "integer" default: 0 x-nullable: false x-omitempty: false MemoryReservation: description: "Memory soft limit in bytes." type: "integer" format: "int64" x-nullable: false x-omitempty: false MemorySwap: description: "Total memory limit (memory + swap). Set as `-1` to enable unlimited swap." type: "integer" format: "int64" x-nullable: false x-omitempty: false MemorySwappiness: description: "Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. -1 is also accepted, as a legacy alias of 0." type: "integer" format: "int64" minimum: -1 maximum: 100 x-omitempty: false NanoCpus: description: "CPU quota in units of 10-9 CPUs." type: "integer" format: "int64" x-nullable: false x-omitempty: false OomKillDisable: description: "Disable OOM Killer for the container." type: "boolean" x-nullable: true x-omitempty: false PidsLimit: description: | Tune a container's pids limit. Set -1 for unlimited. Only on Linux 4.4 does this parameter support. type: "integer" format: "int64" x-nullable: false x-omitempty: false Ulimits: description: | A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" type: "array" items: $ref: "#/definitions/Ulimit" # Applicable to Windows CpuCount: description: | The number of usable CPUs (Windows only). On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. type: "integer" format: "int64" x-nullable: false x-omitempty: false CpuPercent: description: | The usable percentage of the available CPUs (Windows only). On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. type: "integer" format: "int64" x-nullable: false x-omitempty: false IOMaximumIOps: description: "Maximum IOps for the container system drive (Windows only)" type: "integer" format: "uint64" x-nullable: false x-omitempty: false IOMaximumBandwidth: description: "Maximum IO in bytes per second for the container system drive (Windows only)" type: "integer" format: "uint64" x-nullable: false x-omitempty: false IntelRdtL3Cbm: description: "IntelRdtL3Cbm specifies settings for Intel RDT/CAT group that the container is placed into to limit the resources (e.g., L3 cache) the container has available." type: "string" x-nullable: false x-omitempty: false # applicable to AliKenerl 4.9 ScheLatSwitch: description: "ScheLatSwitch enables scheduler latency count in cpuacct" type: "integer" format: "int64" x-nullable: false x-omitempty: false MemoryWmarkRatio: description: | MemoryWmarkRatio is an integer value representing this container's memory low water mark percentage. The value of memory low water mark is memory.limit_in_bytes * MemoryWmarkRatio. type: "integer" format: "int64" x-nullable: true x-omitempty: false MemoryExtra: description: | MemoryExtra is an integer value representing memory extra in bytes type: "integer" format: "int64" x-nullable: true x-omitempty: false MemoryForceEmptyCtl: description: "MemoryForceEmptyCtl represents whether to reclaim the page cache when deleting cgroup." type: "integer" format: "int64" x-nullable: false x-omitempty: false NvidiaConfig: $ref: "#/definitions/NvidiaConfig" NvidiaConfig: type: "object" properties: NvidiaVisibleDevices: description: "NvidiaVisibleDevices controls which GPUs will be made accessible inside the container" type: "string" example: | Possible values. 0,1,2, GPU-fef8089b …: a comma-separated list of GPU UUID(s) or index(es). all: all GPUs will be accessible, this is the default value in our container images. none: no GPU will be accessible, but driver capabilities will be enabled. x-nullable: false NvidiaDriverCapabilities: description: "NvidiaDriverCapabilities controls which driver libraries/binaries will be mounted inside the container" type: "string" example: | Possible values compute,video, graphics,utility …: a comma-separated list of driver features the container needs. all: enable all available driver capabilities. x-nullable: false ThrottleDevice: type: "object" properties: Path: description: "Device path" type: "string" Rate: description: "Rate" type: "integer" format: "uint64" x-nullable: false minimum: 0 WeightDevice: type: "object" description: "Weight for BlockIO Device" properties: Path: description: "Weight Device" type: "string" Weight: type: "integer" format: "uint16" x-nullable: false minimum: 0 DeviceMapping: type: "object" description: "A device mapping between the host and container" properties: PathOnHost: description: "path on host of the device mapping" type: "string" PathInContainer: description: "path in container of the device mapping" type: "string" CgroupPermissions: description: "cgroup permissions of the device" type: "string" example: PathOnHost: "/dev/deviceName" PathInContainer: "/dev/deviceName" CgroupPermissions: "mrw" Ulimit: type: "object" description: "A list of resource limits" properties: Name: description: "Name of ulimit" type: "string" Soft: description: "Soft limit" type: "integer" Hard: description: "Hard limit" type: "integer" Container: description: | an array of Container contains response of Engine API: GET "/containers/json" type: "object" properties: Id: description: "Container ID" type: "string" Names: type: "array" items: type: "string" example: - "container_1" - "container_2" Image: type: "string" ImageID: type: "string" Command: type: "string" Created: description: "Created time of container in daemon." type: "integer" format: "int64" SizeRw: type: "integer" format: "int64" SizeRootFs: type: "integer" format: "int64" Labels: type: "object" additionalProperties: type: "string" State: type: "string" Status: type: "string" HostConfig: description: | In Moby's API, HostConfig field in Container struct has following type struct { NetworkMode string `json:",omitempty"` } In Pouch, we need to pick runtime field in HostConfig from daemon side to judge runtime type, So Pouch changes this type to be the complete HostConfig. Incompatibility exists, ATTENTION. $ref: "#/definitions/HostConfig" x-nullable: false Mounts: type: "array" description: "Set of mount point in a container." items: $ref: "#/definitions/MountPoint" NetworkSettings: type: "object" properties: Networks: additionalProperties: $ref: "#/definitions/EndpointSettings" x-nullable: true NetworkingConfig: description: "Configuration for a network used to create a container." type: "object" properties: EndpointsConfig: additionalProperties: $ref: "#/definitions/EndpointSettings" x-nullable: true EndpointSettings: description: "Configuration for a network endpoint." type: "object" properties: # Configurations IPAMConfig: $ref: "#/definitions/EndpointIPAMConfig" x-nullable: true Links: type: "array" items: type: "string" example: - "container_1" - "container_2" Aliases: type: "array" items: type: "string" example: - "server_x" - "server_y" # Operational data NetworkID: description: | Unique ID of the network. type: "string" example: "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a" EndpointID: description: | Unique ID for the service endpoint in a Sandbox. type: "string" example: "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" Gateway: description: | Gateway address for this network. type: "string" example: "172.17.0.1" IPAddress: description: | IPv4 address. type: "string" example: "172.17.0.4" IPPrefixLen: description: | Mask length of the IPv4 address. type: "integer" example: 16 IPv6Gateway: description: | IPv6 gateway address. type: "string" example: "2001:db8:2::100" GlobalIPv6Address: description: | Global IPv6 address. type: "string" example: "2001:db8::5689" GlobalIPv6PrefixLen: description: | Mask length of the global IPv6 address. type: "integer" format: "int64" example: 64 MacAddress: description: | MAC address for the endpoint on this network. type: "string" example: "02:42:ac:11:00:04" DriverOpts: description: | DriverOpts is a mapping of driver options and values. These options are passed directly to the driver and are driver specific. type: "object" x-nullable: true additionalProperties: type: "string" example: com.example.some-label: "some-value" com.example.some-other-label: "some-other-value" EndpointIPAMConfig: description: "IPAM configurations for the endpoint" type: "object" properties: IPv4Address: description: "ipv4 address" type: "string" IPv6Address: description: "ipv6 address" type: "string" LinkLocalIPs: description: "link to the list of local ip" type: "array" x-nullable: false items: type: "string" NetworkDisconnect: description: "Parameters of network disconnect" type: "object" properties: Container: type: "string" description: "The ID or name of the container to disconnect from the network." Force: type: "boolean" description: "Force the container to disconnect from the network." ImageInfo: description: "An object containing all details of an image at API side" type: "object" properties: Id: description: "ID of an image." type: "string" x-nullable: false RepoTags: description: "repository with tag." type: "array" items: type: "string" RepoDigests: description: "repository with digest." type: "array" items: type: "string" CreatedAt: description: "time of image creation." type: "string" x-nullable: false Size: description: "size of image's taking disk space." type: "integer" x-nullable: false Config: $ref: "#/definitions/ContainerConfig" Architecture: description: "the CPU architecture." type: "string" x-nullable: false Os: description: "the name of the operating system." type: "string" x-nullable: false RootFS: description: "the rootfs key references the layer content addresses used by the image." type: "object" required: [Type] properties: Type: description: "type of the rootfs" type: "string" x-nullable: false Layers: description: "an array of layer content hashes" type: "array" items: type: "string" BaseLayer: description: "the base layer content hash." type: "string" HistoryResultItem: description: "An object containing image history at API side." type: "object" required: [ID, Created, CreatedBy, Author, Comment, EmptyLayer, Size] properties: ID: description: "ID of each layer image." type: "string" x-nullable: false Created: description: "the combined date and time at which the layer was created." type: "integer" format: "int64" x-nullable: false CreatedBy: description: "the command which created the layer." type: "string" x-nullable: false Author: description: "the author of the build point." type: "string" x-nullable: false Comment: description: "a custom message set when creating the layer." type: "string" x-nullable: false EmptyLayer: description: "mark whether the history item created a filesystem diff or not." type: "boolean" x-nullable: false Size: description: "size of each layer image." type: "integer" format: "int64" x-nullable: false SearchResultItem: type: "object" description: "search result item in search results." properties: description: type: "string" description: "description just shows the description of this image" is_official: type: "boolean" description: "is_official shows if this image is marked official." is_automated: type: "boolean" description: "is_automated means whether this image is automated." name: type: "string" description: "name represents the name of this image" star_count: type: "integer" description: "star_count refers to the star count of this image." VolumeInfo: type: "object" description: "Volume represents the configuration of a volume for the container." properties: Name: description: "Name is the name of the volume." type: "string" Driver: description: "Driver is the Driver name used to create the volume." type: "string" Mountpoint: description: "Mountpoint is the location on disk of the volume." type: "string" CreatedAt: type: "string" format: "dateTime" description: "Date/Time the volume was created." Status: description: "Status provides low-level status information about the volume." type: "object" additionalProperties: type: "object" enum: - {} default: {} Labels: description: "Labels is metadata specific to the volume." type: "object" additionalProperties: type: "string" Scope: description: | Scope describes the level at which the volume exists (e.g. `global` for cluster-wide or `local` for machine level) type: "string" VolumeCreateConfig: description: "config used to create a volume" type: "object" properties: Name: description: "The new volume's name. If not specified, Pouch generates a name." type: "string" x-nullable: false Driver: description: "Name of the volume driver to use." type: "string" default: "local" x-nullable: false DriverOpts: description: "A mapping of driver options and values. These options are passed directly to the driver and are driver specific." type: "object" additionalProperties: type: "string" Labels: description: "User-defined key/value metadata." type: "object" additionalProperties: type: "string" example: Name: "tardis" Labels: com.example.some-label: "some-value" com.example.some-other-label: "some-other-value" Driver: "custom" VolumeListResp: type: "object" required: [Volumes, Warnings] properties: Volumes: type: "array" x-nullable: false description: "List of volumes" items: $ref: "#/definitions/VolumeInfo" Warnings: type: "array" x-nullable: false description: "Warnings that occurred when fetching the list of volumes" items: type: "string" ExecCreateConfig: type: "object" description: is a small subset of the Config struct that holds the configuration. required: [Cmd] properties: User: type: "string" description: "User that will run the command" x-nullable: false Privileged: type: "boolean" description: "Is the container in privileged mode" Tty: type: "boolean" description: "Attach standard streams to a tty" AttachStdin: type: "boolean" description: "Attach the standard input, makes possible user interaction" AttachStderr: type: "boolean" description: "Attach the standard error" AttachStdout: type: "boolean" description: "Attach the standard output" Detach: type: "boolean" description: "Execute in detach mode" DetachKeys: type: "string" description: "Escape keys for detach" Cmd: type: "array" description: "Execution commands and args" minItems: 1 items: type: "string" Env: type: "array" description: "envs for exec command in container" items: type: "string" ContainerProcessList: description: OK Response to ContainerTop operation type: "object" properties: Titles: description: "The ps column titles" type: "array" items: type: "string" Processes: description: "Each process running in the container, where each is process is an array of values corresponding to the titles" type: "array" items: type: "array" items: type: "string" ExecCreateResp: type: "object" description: contains response of Remote API POST "/containers/{name:.*}/exec". properties: Id: type: "string" description: ID is the exec ID ExecStartConfig: type: "object" description: ExecStartConfig is a temp struct used by execStart. properties: Detach: description: ExecStart will first check if it's detached type: "boolean" Tty: description: Check if there's a tty type: "boolean" example: Detach: false Tty: false ContainerExecInspect: type: "object" description: holds information about a running process started. required: [ID, Running, ExitCode, ProcessConfig, OpenStdin, OpenStderr, OpenStdout, CanRemove, ContainerID, DetachKeys] properties: ID: x-nullable: false type: "string" description: "The ID of this exec" Running: x-nullable: false type: "boolean" ExitCode: x-nullable: false type: "integer" description: "The last exit code of this container" ProcessConfig: x-nullable: false $ref: "#/definitions/ProcessConfig" OpenStdin: x-nullable: false type: "boolean" OpenStderr: x-nullable: false type: "boolean" OpenStdout: x-nullable: false type: "boolean" CanRemove: x-nullable: false type: "boolean" ContainerID: x-nullable: false type: "string" description: "The ID of this container" DetachKeys: x-nullable: false type: "string" ProcessConfig: type: "object" description: ExecProcessConfig holds information about the exec process. required: [privileged, user, tty, entrypoint, arguments] properties: privileged: x-nullable: false type: "boolean" user: x-nullable: false type: "string" tty: x-nullable: false type: "boolean" entrypoint: x-nullable: false type: "string" arguments: x-nullable: false type: "array" items: type: "string" ContainerJSON: description: | ContainerJSON contains response of Engine API: GET "/containers/{id}/json" type: "object" properties: Id: description: "The ID of the container" type: "string" Created: description: "The time the container was created" type: "string" Path: description: "The path to the command being run" type: "string" Args: description: "The arguments to the command being run" type: "array" items: type: "string" State: description: "The state of the container." $ref: "#/definitions/ContainerState" Image: description: "The container's image" type: "string" ResolvConfPath: description: "the path of container's resolvConf file on host." type: "string" HostnamePath: description: "the path of container's hostname file on host." type: "string" HostsPath: description: "the path of container's hosts file on host." type: "string" LogPath: description: "the path of container's log file on host." type: "string" Name: description: "name of the created container." type: "string" RestartCount: description: "the container's restart time" type: "integer" Driver: description: "" type: "string" MountLabel: description: "MountLabel contains the options for the 'mount' command." type: "string" ProcessLabel: type: "string" AppArmorProfile: description: "AppArmorProfile are specific for AppArmor to Unix platforms" type: "string" ExecIDs: description: "exec ids of container" type: "array" items: type: "string" HostConfig: $ref: "#/definitions/HostConfig" SizeRw: description: "The size of files that have been created or changed by this container." type: "integer" format: "int64" x-nullable: true SizeRootFs: description: "The total size of all the files in this container." type: "integer" format: "int64" x-nullable: true Config: $ref: "#/definitions/ContainerConfig" Snapshotter: $ref: "#/definitions/SnapshotterData" GraphDriver: $ref: "#/definitions/GraphDriverData" Mounts: type: "array" description: "Set of mount point in a container." items: $ref: "#/definitions/MountPoint" NetworkSettings: description: "NetworkSettings exposes the network settings in the API." $ref: "#/definitions/NetworkSettings" HostRootPath: description: "The rootfs path of the container on the host." type: "string" ContainerState: type: "object" required: [StartedAt, FinishedAt, Pid, ExitCode, Error, OOMKilled, Dead, Paused, Restarting, Running, Status] properties: Status: $ref: "#/definitions/Status" Running: description: | Whether this container is running. Note that a running container can be _paused_. The `Running` and `Paused` booleans are not mutually exclusive: When pausing a container (on Linux), the cgroups freezer is used to suspend all processes in the container. Freezing the process requires the process to be running. As a result, paused containers are both `Running` _and_ `Paused`. Use the `Status` field instead to determine if a container's state is "running". type: "boolean" x-nullable: false Paused: description: "Whether this container is paused." type: "boolean" x-nullable: false Restarting: description: "Whether this container is restarting." type: "boolean" x-nullable: false OOMKilled: description: "Whether this container has been killed because it ran out of memory." type: "boolean" x-nullable: false Dead: description: "Whether this container is dead." type: "boolean" x-nullable: false Exited: description: | Whether this container is abnormal stopped. So that we can distinguish whether a container stoppped by API or abnormal. This flag can be used on the circumstances that when the host restart and try to pull up the containers that are running before host down. If we have a container with `RestartPolicy` is `always` but the `Status` is `Stopped`, should we start it or not? So with the `Exited` flag being set, we can make sure that this container is exited by abnormal, we should pull it up. But with status is `Stopped`, we should not pull it up because it is stopped by API. type: "boolean" x-nullable: false Pid: x-nullable: false description: "The process ID of this container" type: "integer" ExitCode: x-nullable: false description: "The last exit code of this container" type: "integer" Error: description: "The error message of this container" type: "string" x-nullable: false StartedAt: description: "The time when this container was last started." type: "string" x-nullable: false FinishedAt: description: "The time when this container last exited." type: "string" x-nullable: false ContainerLogsOptions: description: The parameters to filter the log. type: "object" properties: ShowStdout: description: "Return logs from `stdout`" type: "boolean" ShowStderr: description: "Return logs from `stderr`" type: "boolean" Since: description: "Only return logs after this time, as a UNIX timestamp" type: "string" Until: description: "Only reture logs before this time, as a UNIX timestamp" type: "string" Timestamps: description: "Add timestamps to every log line" type: "boolean" Follow: description: "Return logs as a stream" type: "boolean" Tail: description: "Only reture this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines." type: "string" Details: description: "Show extra details provided to logs" type: "boolean" ContainerStats: description: container stats almost from cgroup resource usage. type: "object" properties: read: description: read time of container stats. type: "string" format: date-time id: description: container id type: "string" name: description: container name type: "string" pids_stats: $ref: "#/definitions/PidsStats" networks: type: "object" additionalProperties: $ref: "#/definitions/NetworkStats" memory_stats: $ref: "#/definitions/MemoryStats" blkio_stats: $ref: "#/definitions/BlkioStats" cpu_stats: $ref: "#/definitions/CPUStats" precpu_stats: $ref: "#/definitions/CPUStats" PidsStats: description: PidsStats contains the stats of a container's pids type: "object" properties: current: description: Current is the number of pids in the cgroup type: "integer" format: "uint64" limit: description: | Limit is the hard limit on the number of pids in the cgroup. A "Limit" of 0 means that there is no limit. type: "integer" format: uint64 CPUStats: description: CPUStats aggregates and wraps all CPU related info of container type: "object" properties: cpu_usage: $ref: "#/definitions/CPUUsage" syetem_cpu_usage: description: System CPU Usage type: "integer" format: "uint64" online_cpus: description: onine CPUs type: "integer" format: "uint32" throttling_data: $ref: "#/definitions/ThrottlingData" CPUUsage: description: CPUUsage stores All CPU stats aggregated since container inception. type: "object" properties: total_usage: description: Total CPU time consumed. type: "integer" format: "uint64" percpu_usage: description: Total CPU time consumed per core (Linux). type: "array" items: type: "integer" format: "uint64" usage_in_kernelmode: description: | Time spent by tasks of the cgroup in kernel mode (Linux). Units, nanoseconds (Linux) type: "integer" format: "uint64" usage_in_usermode: description: | Time spent by tasks of the cgroup in user mode (Linux). Units, nanoseconds (Linux) type: "integer" format: "uint64" ThrottlingData: description: ThrottlingData stores CPU throttling stats of one running container. type: "object" properties: periods: description: Number of periods with throttling active. type: "integer" format: "uint64" throttled_periods: description: Number of periods when the container hits its throttling limit. type: "integer" format: "uint64" throttled_time: description: Aggregate time the container was throttled for in nanoseconds. type: "integer" format: "uint64" BlkioStats: description: BlkioStats stores All IO service stats for data read and write. type: "object" properties: io_service_bytes_recursive: type: "array" items: $ref: "#/definitions/BlkioStatEntry" io_serviced_recursive: type: "array" items: $ref: "#/definitions/BlkioStatEntry" io_queue_recursive: type: "array" items: $ref: "#/definitions/BlkioStatEntry" io_service_time_recursive: type: "array" items: $ref: "#/definitions/BlkioStatEntry" io_wait_time_recursive: type: "array" items: $ref: "#/definitions/BlkioStatEntry" io_merged_recursive: type: "array" items: $ref: "#/definitions/BlkioStatEntry" io_time_recursive: type: "array" items: $ref: "#/definitions/BlkioStatEntry" sectors_recursive: type: "array" items: $ref: "#/definitions/BlkioStatEntry" BlkioStatEntry: description: BlkioStatEntry is one small entity to store a piece of Blkio stats type: "object" properties: major: type: "integer" format: "uint64" minor: type: "integer" format: "uint64" op: type: "string" value: type: "integer" format: "uint64" MemoryStats: description: MemoryStats aggregates all memory stats since container inception on Linux. type: "object" properties: usage: description: current res_counter usage for memory type: "integer" format: "uint64" max_usage: description: maximum usage ever recorded. type: "integer" format: "uint64" stats: description: all the stats exported via memory.stat. type: "object" additionalProperties: type: "integer" format: "uint64" failcnt: description: number of times memory usage hits limits. type: "integer" format: "uint64" limit: description: xxx type: "integer" format: "uint64" NetworkStats: description: container stats almost from cgroup resource usage. type: "object" properties: rx_bytes: description: Bytes received. type: "integer" format: "uint64" rx_packets: description: Packets received. type: "integer" format: "uint64" rx_errors: description: Received errors. type: "integer" format: "uint64" rx_dropped: description: Incoming packets dropped. type: "integer" format: "uint64" tx_bytes: description: Bytes sent. type: "integer" format: "uint64" tx_packets: description: Packets sent. type: "integer" format: "uint64" tx_errors: description: Sent errors. type: "integer" format: "uint64" tx_dropped: description: Outgoing packets dropped. type: "integer" format: "uint64" endpoint_id: description: Endpoint ID. type: "string" instance_id: description: Instance ID. type: "string" Status: description: The status of the container. For example, "running" or "exited". type: "string" enum: ["created", "running", "stopped", "paused", "restarting", "removing", "exited", "dead"] SnapshotterData: description: "Information about a container's snapshotter." type: "object" required: [Name, Data] properties: Name: type: "string" x-nullable: false Data: type: "object" x-nullable: false additionalProperties: type: "string" GraphDriverData: description: "Information about a container's graph driver." type: "object" required: [Name, Data] properties: Name: type: "string" x-nullable: false Data: type: "object" x-nullable: false additionalProperties: type: "string" MountPoint: type: "object" description: "A mount point inside a container" x-nullable: false properties: Type: type: "string" ID: type: "string" Name: type: "string" Source: type: "string" Destination: type: "string" Driver: type: "string" Mode: type: "string" RW: type: "boolean" CopyData: type: "boolean" Named: type: "boolean" Replace: type: "string" Propagation: type: "string" NetworkSettings: description: "NetworkSettings exposes the network settings in the API." type: "object" properties: Bridge: description: Name of the network'a bridge (for example, `pouch-br`). type: "string" example: "pouch-br" SandboxID: description: SandboxID uniquely represents a container's network stack. type: "string" example: "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3" HairpinMode: description: "Indicates if hairpin NAT should be enabled on the virtual interface" type: "boolean" example: false LinkLocalIPv6Address: description: "IPv6 unicast address using the link-local prefix" type: "string" example: "fe80::42:acff:fe11:1" LinkLocalIPv6PrefixLen: description: Prefix length of the IPv6 unicast address. type: "integer" example: "64" Ports: $ref: "#/definitions/PortMap" SandboxKey: description: SandboxKey identifies the sandbox type: "string" example: "/var/run/pouch/netns/8ab54b426c38" # TODO is SecondaryIPAddresses actually used? SecondaryIPAddresses: description: "" type: "array" items: $ref: "#/definitions/IPAddress" x-nullable: true # TODO is SecondaryIPv6Addresses actually used? SecondaryIPv6Addresses: description: "" type: "array" items: $ref: "#/definitions/IPAddress" x-nullable: true Networks: description: "Information about all networks that the container is connected to" type: "object" additionalProperties: $ref: "#/definitions/EndpointSettings" x-nullable: true IPAddress: description: Address represents an IPv4 or IPv6 IP address. type: "object" properties: Addr: description: IP address. type: "string" PrefixLen: description: Mask length of the IP address. type: "integer" PortMap: description: | PortMap describes the mapping of container ports to host ports, using the container's port-number and protocol as key in the format `/`, for example, `80/udp`. If a container's port is mapped for both `tcp` and `udp`, two separate entries are added to the mapping table. type: "object" additionalProperties: type: "array" items: $ref: "#/definitions/PortBinding" example: "443/tcp": - HostIp: "127.0.0.1" HostPort: "4443" "80/tcp": - HostIp: "0.0.0.0" HostPort: "80" - HostIp: "0.0.0.0" HostPort: "8080" "80/udp": - HostIp: "0.0.0.0" HostPort: "80" "2377/tcp": null PortBinding: description: "PortBinding represents a binding between a host IP address and a host port" type: "object" x-nullable: true properties: HostIp: description: "Host IP address that the container's port is mapped to." type: "string" example: "127.0.0.1" HostPort: description: "Host port number that the container's port is mapped to. range (0,65535]" type: "string" pattern: ^([1-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$ example: "4443" RestartPolicy: description: "Define container's restart policy" type: "object" properties: Name: type: "string" MaximumRetryCount: type: "integer" NetworkConnect: type: "object" description: "contains the request for the remote API: POST /networks/{id:.*}/connect" properties: Container: type: "string" description: "The ID or name of the container to connect to the network." EndpointConfig: $ref: "#/definitions/EndpointSettings" NetworkCreateConfig: type: "object" description: "contains the request for the remote API: POST /networks/create" allOf: - properties: Name: description: "Name is the name of the network." type: "string" - $ref: "#/definitions/NetworkCreate" NetworkCreateResp: type: "object" description: "contains the response for the remote API: POST /networks/create" properties: Id: description: "ID is the id of the network." type: "string" Warning: description: "Warning means the message of create network result." type: "string" NetworkCreate: type: "object" description: "is the expected body of the \"create network\" http request message" properties: CheckDuplicate: type: "boolean" description: "CheckDuplicate is used to check the network is duplicate or not." Driver: type: "string" description: "Driver means the network's driver." EnableIPv6: type: "boolean" IPAM: type: "object" $ref: "#/definitions/IPAM" Internal: type: "boolean" description: "Internal checks the network is internal network or not." Options: type: "object" additionalProperties: type: "string" Labels: type: "object" additionalProperties: type: "string" NetworkInspectResp: type: "object" description: "is the expected body of the 'GET networks/{id}'' http request message" properties: Name: type: "string" description: "Name is the requested name of the network" Id: type: "string" description: "ID uniquely identifies a network on a single machine" Scope: type: "string" description: "Scope describes the level at which the network exists." Driver: type: "string" description: "Driver means the network's driver." EnableIPv6: type: "boolean" description: "EnableIPv6 represents whether to enable IPv6." IPAM: type: "object" description: "IPAM is the network's IP Address Management." $ref: "#/definitions/IPAM" Internal: type: "boolean" description: "Internal checks the network is internal network or not." Options: type: "object" description: "Options holds the network specific options to use for when creating the network." additionalProperties: type: "string" Labels: type: "object" description: "Labels holds metadata specific to the network being created." additionalProperties: type: "string" NetworkResource: type: "object" description: "NetworkResource is the body of the \"get network\" http response message" properties: Name: description: "Name is the requested name of the network" type: "string" Id: description: "ID uniquely identifies a network on a single machine" type: "string" Scope: description: "Scope describes the level at which the network exists (e.g. `global` for cluster-wide or `local` for machine level)" type: "string" Driver: description: "Driver is the Driver name used to create the network (e.g. `bridge`, `overlay`)" type: "string" EnableIPv6: description: "EnableIPv6 represents whether to enable IPv6" type: "boolean" IPAM: description: "" type: "object" $ref: "#/definitions/IPAM" Internal: description: "Internal represents if the network is used internal only" type: "boolean" Containers: description: "Containers contains endpoints belonging to the network" type: "object" IndexConfigs: type: "object" additionalProperties: $ref: "#/definitions/EndpointResource" Options: description: "Options holds the network specific options to use for when creating the network" type: "object" x-nullable: true additionalProperties: type: "string" example: com.example.some-options: "some-option" com.example.some-other-options: "some-other-option" Labels: description: "Labels holds metadata specific to the network being created" type: "object" x-nullable: true additionalProperties: type: "string" example: com.example.some-label: "some-label" com.example.some-other-label: "some-other-label" EndpointResource: type: "object" description: "NetworkResource is the body of the \"get network\" http response message" properties: Name: description: "Name is the requested name of the network" type: "string" EndpointID: description: "EndpointID represents the endpoint's id" type: "string" MacAddress: description: "MacAddress represents the enpoint's mac address" type: "string" IPv4Address: description: "IPv4Address represents the enpoint's ipv4 address" type: "string" IPv6Address: description: "IPv4Address represents the enpoint's ipv6 address" type: "string" IPAM: type: "object" description: "represents IP Address Management" properties: Driver: type: "string" Options: type: "object" additionalProperties: type: "string" Config: type: "array" items: $ref: '#/definitions/IPAMConfig' IPAMConfig: description: "represents IPAM configurations" type: "object" x-nullable: false properties: Subnet: description: "subnet address for network" type: "string" IPRange: description: "sub ip range in sub-network" type: "string" Gateway: description: "gateway for sub-network" type: "string" AuxAddress: description: "aux address in sub-network" type: "object" additionalProperties: type: "string" ResizeOptions: description: "options of resizing container tty size" type: "object" properties: Height: type: "integer" Width: type: "integer" ContainerStartOptions: description: "options of starting container" type: "object" properties: DetachKeys: type: "string" CheckpointID: type: "string" CheckpointDir: type: "string" ContainerRemoveOptions: description: "options of remove container" type: "object" properties: Force: type: "boolean" Volumes: type: "boolean" Link: type: "boolean" ContainerListOptions: description: | options of list container, filters (a `map[string][]string`) to process on the container list. Available filters: - `id=container-id` - `name=container-name` - `status=running` - `label=key` or `label=key=value` - `network=container-network` - `volume=volume-id` type: "object" properties: All: type: "boolean" Since: type: "string" Before: type: "string" Limit: type: "integer" Filter: type: "object" additionalProperties: type: "array" items: type: "string" EventsMessage: description: | EventsMessage represents the information an event contains, the message at least contains type, action and id. type specifies which object generates the event, like container, or a network, or a volume. the action specifies the action name, like create, or destroy. the id identifies the object that generates the event. The message also can contain the EventsActor that describes the extra attributes that describe the event. type: "object" properties: status: type: "string" id: type: "string" from: type: "string" type: $ref: "#/definitions/EventType" action: type: "string" actor: $ref: "#/definitions/EventsActor" time: type: "integer" timeNano: type: "integer" EventsActor: description: | EventsActor describes something that generates events, like a container, or a network, or a volume. It has a defined name and a set or attributes. The container attributes are its labels, other actors can generate these attributes from other properties. type: "object" properties: ID: type: "string" Attributes: type: "object" additionalProperties: type: "string" EventType: description: | The type of event. For example, "container" or "image", Now we only support container, image, network and volume events. type: "string" enum: ["container", "daemon", "image", "network", "plugin", "volume"] CheckpointCreateOptions: description: "options of creating a checkpoint from a running container, checkpoint is used to restore a container with current state later" type: "object" properties: CheckpointID: type: "string" CheckpointDir: type: "string" Exit: type: "boolean" CheckpointListOptions: description: "options of listing all checkpoints of a container" type: "object" properties: CheckpointDir: type: "string" CheckpointDeleteOptions: description: "options of deleting a checkpoint from a container" type: "object" properties: CheckpointID: type: "string" CheckpointDir: type: "string" Checkpoint: description: "describe a created checkpoint, include container name and checkpoint name" type: "object" properties: ContainerID: type: "string" CheckpointName: type: "string" ContainerCommitOptions: description: "options of committing a container into an image" type: "object" properties: Repository: type: "string" description: "repository is the image name" Tag: type: "string" description: "tag is the image tag" Comment: type: "string" description: "comment is external information add for the image" Author: type: "string" description: "author is the one build the image" ContainerCommitResp: type: "object" description: "response of commit container for the remote API: POST /commit" properties: Id: type: "string" description: "ID uniquely identifies an image committed by a container" ContainerPathStat: description: "ContainerPathStat is used to describe the stat of file" type: "object" properties: name: type: "string" size: type: "string" mode: type: "integer" format: "uint32" mtime: description: "modification time." type: "string" format: date-time path: type: "string" parameters: id: name: id in: path required: true description: ID or name of the container type: string imageid: name: imageid in: path required: true description: Image name or id type: string responses: 400ErrorResponse: description: An unexpected 400 error occurred. schema: $ref: "#/definitions/Error" 401ErrorResponse: description: An unexpected 401 error occurred. schema: $ref: "#/definitions/Error" 403ErrorResponse: description: An unexpected 403 error occurred. schema: $ref: "#/definitions/Error" 404ErrorResponse: description: An unexpected 404 error occurred. schema: $ref: "#/definitions/Error" 500ErrorResponse: description: An unexpected server error occurred. schema: $ref: "#/definitions/Error"