Docker-Client
view release on metacpan or search on metacpan
share/specs/v1.26.yaml view on Meta::CPAN
- 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.docker.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/ErrorResponse"
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
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-<value>` where `<value>` 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 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}/attach/ws:
get:
summary: "Attach to a container via a websocket"
operationId: "ContainerAttachWebsocket"
responses:
101:
description: "no error, hints proxy about hijacking"
200:
description: "no error, no upgrade header found"
400:
description: "bad parameter"
schema:
$ref: "#/definitions/ErrorResponse"
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
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-<value>` where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,`, or `_`."
type: "string"
- name: "logs"
in: "query"
description: "Return logs"
share/specs/v1.26.yaml view on Meta::CPAN
Networks report these events: `create, connect, disconnect, destroy`
The Docker daemon reports these events: `reload`
operationId: "SystemEvents"
produces:
- "application/json"
responses:
200:
description: "no error"
schema:
type: "object"
properties:
Type:
description: "The type of object emitting the event"
type: "string"
Action:
description: "The type of event"
type: "string"
Actor:
type: "object"
properties:
ID:
description: "The ID of the object emitting the event"
type: "string"
Attributes:
description: "Various key/value attributes of the object, depending on its type"
type: "object"
additionalProperties:
type: "string"
time:
description: "Timestamp of event"
type: "integer"
timeNano:
description: "Timestamp of event, with nanosecond accuracy"
type: "integer"
format: "int64"
examples:
application/json:
Type: "container"
Action: "create"
Actor:
ID: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743"
Attributes:
com.example.some-label: "some-label-value"
image: "alpine"
name: "my-container"
time: 1461943101
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
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=<string>` container name or ID
- `event=<string>` event type
- `image=<string>` image name or ID
- `label=<string>` image or container label
- `type=<string>` object to filter by, one of `container`, `image`, `volume`, `network`, or `daemon`
- `volume=<string>` volume name or ID
- `network=<string>` network name or ID
- `daemon=<string>` daemon name or ID
type: "string"
tags: ["System"]
/system/df:
get:
summary: "Get data usage information"
operationId: "SystemDataUsage"
responses:
200:
description: "no error"
schema:
type: "object"
properties:
LayersSize:
type: "integer"
format: "int64"
Images:
type: "array"
items:
$ref: "#/definitions/ImageSummary"
Containers:
type: "array"
items:
$ref: "#/definitions/ContainerSummary"
Volumes:
type: "array"
items:
$ref: "#/definitions/Volume"
example:
LayersSize: 1092588
Images:
-
Id: "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749"
ParentId: ""
RepoTags:
- "busybox:latest"
RepoDigests:
- "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6"
Created: 1466724217
Size: 1092588
SharedSize: 0
VirtualSize: 1092588
Labels: {}
Containers: 1
Containers:
-
Id: "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148"
( run in 0.555 second using v1.01-cache-2.11-cpan-39bf76dae61 )