}
+ ```
type: "array"
items:
- type: "object"
- additionalProperties:
- type: "string"
+ $ref: "#/definitions/IPAMConfig"
Options:
description: "Driver-specific options, specified as a map."
- type: "array"
- items:
- type: "object"
- additionalProperties:
- type: "string"
+ type: "object"
+ additionalProperties:
+ type: "string"
+
+ IPAMConfig:
+ type: "object"
+ properties:
+ Subnet:
+ type: "string"
+ IPRange:
+ type: "string"
+ Gateway:
+ type: "string"
+ AuxiliaryAddresses:
+ type: "object"
+ additionalProperties:
+ type: "string"
NetworkContainer:
type: "object"
@@ -1498,6 +2281,84 @@ definitions:
aux:
$ref: "#/definitions/ImageID"
+ BuildCache:
+ type: "object"
+ description: |
+ BuildCache contains information about a build cache record.
+ properties:
+ ID:
+ type: "string"
+ description: |
+ Unique ID of the build cache record.
+ example: "ndlpt0hhvkqcdfkputsk4cq9c"
+ Parent:
+ description: |
+ ID of the parent build cache record.
+
+ > **Deprecated**: This field is deprecated, and omitted if empty.
+ type: "string"
+ x-nullable: true
+ example: ""
+ Parents:
+ description: |
+ List of parent build cache record IDs.
+ type: "array"
+ items:
+ type: "string"
+ x-nullable: true
+ example: ["hw53o5aio51xtltp5xjp8v7fx"]
+ Type:
+ type: "string"
+ description: |
+ Cache record type.
+ example: "regular"
+ # see https://github.com/moby/buildkit/blob/fce4a32258dc9d9664f71a4831d5de10f0670677/client/diskusage.go#L75-L84
+ enum:
+ - "internal"
+ - "frontend"
+ - "source.local"
+ - "source.git.checkout"
+ - "exec.cachemount"
+ - "regular"
+ Description:
+ type: "string"
+ description: |
+ Description of the build-step that produced the build cache.
+ example: "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache"
+ InUse:
+ type: "boolean"
+ description: |
+ Indicates if the build cache is in use.
+ example: false
+ Shared:
+ type: "boolean"
+ description: |
+ Indicates if the build cache is shared.
+ example: true
+ Size:
+ description: |
+ Amount of disk space used by the build cache (in bytes).
+ type: "integer"
+ example: 51
+ CreatedAt:
+ description: |
+ Date and time at which the build cache was created in
+ [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.
+ type: "string"
+ format: "dateTime"
+ example: "2016-08-18T10:44:24.496525531Z"
+ LastUsedAt:
+ description: |
+ Date and time at which the build cache was last used in
+ [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.
+ type: "string"
+ format: "dateTime"
+ x-nullable: true
+ example: "2017-08-09T07:09:37.632105588Z"
+ UsageCount:
+ type: "integer"
+ example: 26
+
ImageID:
type: "object"
description: "Image ID or Digest"
@@ -1514,6 +2375,8 @@ definitions:
type: "string"
error:
type: "string"
+ errorDetail:
+ $ref: "#/definitions/ErrorDetail"
status:
type: "string"
progress:
@@ -1760,6 +2623,25 @@ definitions:
type: "string"
x-nullable: false
+ PluginPrivilege:
+ description: |
+ Describes a permission the user has to accept upon installing
+ the plugin.
+ type: "object"
+ x-go-name: "PluginPrivilege"
+ properties:
+ Name:
+ type: "string"
+ example: "network"
+ Description:
+ type: "string"
+ Value:
+ type: "array"
+ items:
+ type: "string"
+ example:
+ - "host"
+
Plugin:
description: "A plugin for the Engine API"
type: "object"
@@ -1773,7 +2655,9 @@ definitions:
x-nullable: false
example: "tiborvass/sample-volume-plugin"
Enabled:
- description: "True if the plugin is running. False if the plugin is not running, only installed."
+ description:
+ True if the plugin is running. False if the plugin is not running,
+ only installed.
type: "boolean"
x-nullable: false
example: true
@@ -1837,7 +2721,7 @@ definitions:
Documentation:
type: "string"
x-nullable: false
- example: "https://docs.docker.com/engine/extend/plugins/"
+ example: "/engine/extend/plugins/"
Interface:
description: "The interface between Docker and the plugin"
x-nullable: false
@@ -1854,6 +2738,13 @@ definitions:
type: "string"
x-nullable: false
example: "plugins.sock"
+ ProtocolScheme:
+ type: "string"
+ example: "some.protocol/v1.0"
+ description: "Protocol to use for clients connecting to the plugin."
+ enum:
+ - ""
+ - "moby.plugins.http/v1"
Entrypoint:
type: "array"
items:
@@ -1968,13 +2859,16 @@ definitions:
ObjectVersion:
description: |
- The version number of the object such as node, service, etc. This is needed to avoid conflicting writes.
- The client must send the version number along with the modified specification when updating these objects.
- This approach ensures safe concurrency and determinism in that the change on the object
- may not be applied if the version number has changed from the last read. In other words,
- if two update requests specify the same base version, only one of the requests can succeed.
- As a result, two separate update requests that happen at the same time will not
- unintentionally overwrite each other.
+ The version number of the object such as node, service, etc. This is needed
+ to avoid conflicting writes. The client must send the version number along
+ with the modified specification when updating these objects.
+
+ This approach ensures safe concurrency and determinism in that the change
+ on the object may not be applied if the version number has changed from the
+ last read. In other words, if two update requests specify the same base
+ version, only one of the requests can succeed. As a result, two separate
+ update requests that happen at the same time will not unintentionally
+ overwrite each other.
type: "object"
properties:
Index:
@@ -2143,17 +3037,23 @@ definitions:
Name: "vieux/sshfs:latest"
TLSInfo:
- description: "Information about the issuer of leaf TLS certificates and the trusted root CA certificate"
+ description: |
+ Information about the issuer of leaf TLS certificates and the trusted root
+ CA certificate.
type: "object"
properties:
TrustRoot:
- description: "The root CA certificate(s) that are used to validate leaf TLS certificates"
+ description: |
+ The root CA certificate(s) that are used to validate leaf TLS
+ certificates.
type: "string"
CertIssuerSubject:
- description: "The base64-url-safe-encoded raw subject bytes of the issuer"
+ description:
+ The base64-url-safe-encoded raw subject bytes of the issuer.
type: "string"
CertIssuerPublicKey:
- description: "The base64-url-safe-encoded raw public key bytes of the issuer"
+ description: |
+ The base64-url-safe-encoded raw public key bytes of the issuer.
type: "string"
example:
TrustRoot: |
@@ -2249,7 +3149,9 @@ definitions:
x-nullable: true
properties:
TaskHistoryRetentionLimit:
- description: "The number of historic tasks to keep per instance or node. If negative, never remove completed or failed tasks."
+ description: |
+ The number of historic tasks to keep per instance or node. If
+ negative, never remove completed or failed tasks.
type: "integer"
format: "int64"
example: 10
@@ -2263,26 +3165,34 @@ definitions:
format: "uint64"
example: 10000
KeepOldSnapshots:
- description: "The number of snapshots to keep beyond the current snapshot."
+ description: |
+ The number of snapshots to keep beyond the current snapshot.
type: "integer"
format: "uint64"
LogEntriesForSlowFollowers:
- description: "The number of log entries to keep around to sync up slow followers after a snapshot is created."
+ description: |
+ The number of log entries to keep around to sync up slow followers
+ after a snapshot is created.
type: "integer"
format: "uint64"
example: 500
ElectionTick:
description: |
- The number of ticks that a follower will wait for a message from the leader before becoming a candidate and starting an election. `ElectionTick` must be greater than `HeartbeatTick`.
+ The number of ticks that a follower will wait for a message from
+ the leader before becoming a candidate and starting an election.
+ `ElectionTick` must be greater than `HeartbeatTick`.
- A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed.
+ A tick currently defaults to one second, so these translate
+ directly to seconds currently, but this is NOT guaranteed.
type: "integer"
example: 3
HeartbeatTick:
description: |
- The number of ticks between heartbeats. Every HeartbeatTick ticks, the leader will send a heartbeat to the followers.
+ The number of ticks between heartbeats. Every HeartbeatTick ticks,
+ the leader will send a heartbeat to the followers.
- A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed.
+ A tick currently defaults to one second, so these translate
+ directly to seconds currently, but this is NOT guaranteed.
type: "integer"
example: 1
Dispatcher:
@@ -2291,7 +3201,8 @@ definitions:
x-nullable: true
properties:
HeartbeatPeriod:
- description: "The delay for an agent to send a heartbeat to the dispatcher."
+ description: |
+ The delay for an agent to send a heartbeat to the dispatcher.
type: "integer"
format: "int64"
example: 5000000000
@@ -2306,36 +3217,53 @@ definitions:
format: "int64"
example: 7776000000000000
ExternalCAs:
- description: "Configuration for forwarding signing requests to an external certificate authority."
+ description: |
+ Configuration for forwarding signing requests to an external
+ certificate authority.
type: "array"
items:
type: "object"
properties:
Protocol:
- description: "Protocol for communication with the external CA (currently only `cfssl` is supported)."
+ description: |
+ Protocol for communication with the external CA (currently
+ only `cfssl` is supported).
type: "string"
enum:
- "cfssl"
default: "cfssl"
URL:
- description: "URL where certificate signing requests should be sent."
+ description: |
+ URL where certificate signing requests should be sent.
type: "string"
Options:
- description: "An object with key/value pairs that are interpreted as protocol-specific options for the external CA driver."
+ description: |
+ An object with key/value pairs that are interpreted as
+ protocol-specific options for the external CA driver.
type: "object"
additionalProperties:
type: "string"
CACert:
- description: "The root CA certificate (in PEM format) this external CA uses to issue TLS certificates (assumed to be to the current swarm root CA certificate if not provided)."
+ description: |
+ The root CA certificate (in PEM format) this external CA uses
+ to issue TLS certificates (assumed to be to the current swarm
+ root CA certificate if not provided).
type: "string"
SigningCACert:
- description: "The desired signing CA certificate for all swarm node TLS leaf certificates, in PEM format."
+ description: |
+ The desired signing CA certificate for all swarm node TLS leaf
+ certificates, in PEM format.
type: "string"
SigningCAKey:
- description: "The desired signing CA key for all swarm node TLS leaf certificates, in PEM format."
+ description: |
+ The desired signing CA key for all swarm node TLS leaf certificates,
+ in PEM format.
type: "string"
ForceRotate:
- description: "An integer whose purpose is to force swarm to generate a new signing CA certificate and key, if none have been specified in `SigningCACert` and `SigningCAKey`"
+ description: |
+ An integer whose purpose is to force swarm to generate a new
+ signing CA certificate and key, if none have been specified in
+ `SigningCACert` and `SigningCAKey`
format: "uint64"
type: "integer"
EncryptionConfig:
@@ -2343,7 +3271,9 @@ definitions:
type: "object"
properties:
AutoLockManagers:
- description: "If set, generate a key and use it to lock data stored on the managers."
+ description: |
+ If set, generate a key and use it to lock data stored on the
+ managers.
type: "boolean"
example: false
TaskDefaults:
@@ -2409,9 +3339,37 @@ definitions:
TLSInfo:
$ref: "#/definitions/TLSInfo"
RootRotationInProgress:
- description: "Whether there is currently a root CA rotation in progress for the swarm"
+ description: |
+ Whether there is currently a root CA rotation in progress for the swarm
type: "boolean"
example: false
+ DataPathPort:
+ description: |
+ DataPathPort specifies the data path port number for data traffic.
+ Acceptable port range is 1024 to 49151.
+ If no port is set or is set to 0, the default port (4789) is used.
+ type: "integer"
+ format: "uint32"
+ default: 4789
+ example: 4789
+ DefaultAddrPool:
+ description: |
+ Default Address Pool specifies default subnet pools for global scope
+ networks.
+ type: "array"
+ items:
+ type: "string"
+ format: "CIDR"
+ example: ["10.10.0.0/16", "20.20.0.0/16"]
+ SubnetSize:
+ description: |
+ SubnetSize specifies the subnet size of the networks created from the
+ default subnet pool.
+ type: "integer"
+ format: "uint32"
+ maximum: 29
+ default: 24
+ example: 24
JoinTokens:
description: |
@@ -2444,7 +3402,15 @@ definitions:
properties:
PluginSpec:
type: "object"
- description: "Invalid when specified with `ContainerSpec`. *(Experimental release only.)*"
+ description: |
+ Plugin spec for the service. *(Experimental release only.)*
+
+
+
+ > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are
+ > mutually exclusive. PluginSpec is only used when the Runtime field
+ > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime
+ > field is set to `attachment`.
properties:
Name:
description: "The name or 'alias' to use for the plugin."
@@ -2458,20 +3424,18 @@ definitions:
PluginPrivilege:
type: "array"
items:
- description: "Describes a permission accepted by the user upon installing the plugin."
- type: "object"
- properties:
- Name:
- type: "string"
- Description:
- type: "string"
- Value:
- type: "array"
- items:
- type: "string"
+ $ref: "#/definitions/PluginPrivilege"
ContainerSpec:
type: "object"
- description: "Invalid when specified with `PluginSpec`."
+ description: |
+ Container spec for the service.
+
+
+
+ > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are
+ > mutually exclusive. PluginSpec is only used when the Runtime field
+ > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime
+ > field is set to `attachment`.
properties:
Image:
description: "The image name to use for the container"
@@ -2492,10 +3456,13 @@ definitions:
items:
type: "string"
Hostname:
- description: "The hostname to use for the container, as a valid RFC 1123 hostname."
+ description: |
+ The hostname to use for the container, as a valid
+ [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname.
type: "string"
Env:
- description: "A list of environment variables in the form `VAR=value`."
+ description: |
+ A list of environment variables in the form `VAR=value`.
type: "array"
items:
type: "string"
@@ -2507,7 +3474,8 @@ definitions:
type: "string"
Groups:
type: "array"
- description: "A list of additional groups that the container process will run as."
+ description: |
+ A list of additional groups that the container process will run as.
items:
type: "string"
Privileges:
@@ -2518,30 +3486,48 @@ definitions:
type: "object"
description: "CredentialSpec for managed service account (Windows only)"
properties:
+ Config:
+ type: "string"
+ example: "0bt9dmxjvjiqermk6xrop3ekq"
+ description: |
+ Load credential spec from a Swarm Config with the given ID.
+ The specified config must also be present in the Configs
+ field with the Runtime property set.
+
+
+
+
+ > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,
+ > and `CredentialSpec.Config` are mutually exclusive.
File:
type: "string"
+ example: "spec.json"
description: |
- Load credential spec from this file. The file is read by the daemon, and must be present in the
- `CredentialSpecs` subdirectory in the docker data directory, which defaults to
- `C:\ProgramData\Docker\` on Windows.
+ Load credential spec from this file. The file is read by
+ the daemon, and must be present in the `CredentialSpecs`
+ subdirectory in the docker data directory, which defaults
+ to `C:\ProgramData\Docker\` on Windows.
- For example, specifying `spec.json` loads `C:\ProgramData\Docker\CredentialSpecs\spec.json`.
+ For example, specifying `spec.json` loads
+ `C:\ProgramData\Docker\CredentialSpecs\spec.json`.
- > **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive.
+ > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,
+ > and `CredentialSpec.Config` are mutually exclusive.
Registry:
type: "string"
description: |
- Load credential spec from this value in the Windows registry. The specified registry value must be
- located in:
+ Load credential spec from this value in the Windows
+ registry. The specified registry value must be located in:
`HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs`
- > **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive.
+ > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,
+ > and `CredentialSpec.Config` are mutually exclusive.
SELinuxContext:
type: "object"
description: "SELinux labels of the container"
@@ -2571,7 +3557,9 @@ definitions:
description: "Mount the container's root filesystem as read only."
type: "boolean"
Mounts:
- description: "Specification for mounts to be added to containers created as part of the service."
+ description: |
+ Specification for mounts to be added to containers created as part
+ of the service.
type: "array"
items:
$ref: "#/definitions/Mount"
@@ -2579,7 +3567,9 @@ definitions:
description: "Signal to stop the container."
type: "string"
StopGracePeriod:
- description: "Amount of time to wait for the container to terminate before forcefully killing it."
+ description: |
+ Amount of time to wait for the container to terminate before
+ forcefully killing it.
type: "integer"
format: "int64"
HealthCheck:
@@ -2596,7 +3586,9 @@ definitions:
items:
type: "string"
DNSConfig:
- description: "Specification for DNS related configurations in resolver configuration file (`resolv.conf`)."
+ description: |
+ Specification for DNS related configurations in resolver configuration
+ file (`resolv.conf`).
type: "object"
properties:
Nameservers:
@@ -2610,22 +3602,28 @@ definitions:
items:
type: "string"
Options:
- description: "A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.)."
+ description: |
+ A list of internal resolver variables to be modified (e.g.,
+ `debug`, `ndots:3`, etc.).
type: "array"
items:
type: "string"
Secrets:
- description: "Secrets contains references to zero or more secrets that will be exposed to the service."
+ description: |
+ Secrets contains references to zero or more secrets that will be
+ exposed to the service.
type: "array"
items:
type: "object"
properties:
File:
- description: "File represents a specific target that is backed by a file."
+ description: |
+ File represents a specific target that is backed by a file.
type: "object"
properties:
Name:
- description: "Name represents the final filename in the filesystem."
+ description: |
+ Name represents the final filename in the filesystem.
type: "string"
UID:
description: "UID represents the file UID."
@@ -2638,25 +3636,36 @@ definitions:
type: "integer"
format: "uint32"
SecretID:
- description: "SecretID represents the ID of the specific secret that we're referencing."
+ description: |
+ SecretID represents the ID of the specific secret that we're
+ referencing.
type: "string"
SecretName:
description: |
- SecretName is the name of the secret that this references, but this is just provided for
- lookup/display purposes. The secret in the reference will be identified by its ID.
+ SecretName is the name of the secret that this references,
+ but this is just provided for lookup/display purposes. The
+ secret in the reference will be identified by its ID.
type: "string"
Configs:
- description: "Configs contains references to zero or more configs that will be exposed to the service."
+ description: |
+ Configs contains references to zero or more configs that will be
+ exposed to the service.
type: "array"
items:
type: "object"
properties:
File:
- description: "File represents a specific target that is backed by a file."
+ description: |
+ File represents a specific target that is backed by a file.
+
+
+
+ > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive
type: "object"
properties:
Name:
- description: "Name represents the final filename in the filesystem."
+ description: |
+ Name represents the final filename in the filesystem.
type: "string"
UID:
description: "UID represents the file UID."
@@ -2668,33 +3677,125 @@ definitions:
description: "Mode represents the FileMode of the file."
type: "integer"
format: "uint32"
- ConfigID:
- description: "ConfigID represents the ID of the specific config that we're referencing."
+ Runtime:
+ description: |
+ Runtime represents a target that is not mounted into the
+ container but is used by the task
+
+
+
+ > **Note**: `Configs.File` and `Configs.Runtime` are mutually
+ > exclusive
+ type: "object"
+ ConfigID:
+ description: |
+ ConfigID represents the ID of the specific config that we're
+ referencing.
type: "string"
ConfigName:
description: |
- ConfigName is the name of the config that this references, but this is just provided for
- lookup/display purposes. The config in the reference will be identified by its ID.
+ ConfigName is the name of the config that this references,
+ but this is just provided for lookup/display purposes. The
+ config in the reference will be identified by its ID.
type: "string"
Isolation:
type: "string"
- description: "Isolation technology of the containers running the service. (Windows only)"
+ description: |
+ Isolation technology of the containers running the service.
+ (Windows only)
enum:
- "default"
- "process"
- "hyperv"
+ Init:
+ description: |
+ Run an init inside the container that forwards signals and reaps
+ processes. This field is omitted if empty, and the default (as
+ configured on the daemon) is used.
+ type: "boolean"
+ x-nullable: true
+ Sysctls:
+ description: |
+ Set kernel namedspaced parameters (sysctls) in the container.
+ The Sysctls option on services accepts the same sysctls as the
+ are supported on containers. Note that while the same sysctls are
+ supported, no guarantees or checks are made about their
+ suitability for a clustered environment, and it's up to the user
+ to determine whether a given sysctl will work properly in a
+ Service.
+ type: "object"
+ additionalProperties:
+ type: "string"
+ # This option is not used by Windows containers
+ CapabilityAdd:
+ type: "array"
+ description: |
+ A list of kernel capabilities to add to the default set
+ for the container.
+ items:
+ type: "string"
+ example:
+ - "CAP_NET_RAW"
+ - "CAP_SYS_ADMIN"
+ - "CAP_SYS_CHROOT"
+ - "CAP_SYSLOG"
+ CapabilityDrop:
+ type: "array"
+ description: |
+ A list of kernel capabilities to drop from the default set
+ for the container.
+ items:
+ type: "string"
+ example:
+ - "CAP_NET_RAW"
+ Ulimits:
+ description: |
+ A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`"
+ type: "array"
+ items:
+ type: "object"
+ properties:
+ Name:
+ description: "Name of ulimit"
+ type: "string"
+ Soft:
+ description: "Soft limit"
+ type: "integer"
+ Hard:
+ description: "Hard limit"
+ type: "integer"
+ NetworkAttachmentSpec:
+ description: |
+ Read-only spec type for non-swarm containers attached to swarm overlay
+ networks.
+
+
+
+ > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are
+ > mutually exclusive. PluginSpec is only used when the Runtime field
+ > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime
+ > field is set to `attachment`.
+ type: "object"
+ properties:
+ ContainerID:
+ description: "ID of the container represented by this task"
+ type: "string"
Resources:
- description: "Resource requirements which apply to each individual container created as part of the service."
+ description: |
+ Resource requirements which apply to each individual container created
+ as part of the service.
type: "object"
properties:
Limits:
description: "Define resources limits."
- $ref: "#/definitions/ResourceObject"
- Reservation:
+ $ref: "#/definitions/Limit"
+ Reservations:
description: "Define resources reservation."
$ref: "#/definitions/ResourceObject"
RestartPolicy:
- description: "Specification for the restart policy which applies to containers created as part of this service."
+ description: |
+ Specification for the restart policy which applies to containers
+ created as part of this service.
type: "object"
properties:
Condition:
@@ -2709,12 +3810,16 @@ definitions:
type: "integer"
format: "int64"
MaxAttempts:
- description: "Maximum attempts to restart a given container before giving up (default value is 0, which is ignored)."
+ description: |
+ Maximum attempts to restart a given container before giving up
+ (default value is 0, which is ignored).
type: "integer"
format: "int64"
default: 0
Window:
- description: "Windows is the time window used to evaluate the restart policy (default value is 0, which is unbounded)."
+ description: |
+ Windows is the time window used to evaluate the restart policy
+ (default value is 0, which is unbounded).
type: "integer"
format: "int64"
default: 0
@@ -2722,7 +3827,27 @@ definitions:
type: "object"
properties:
Constraints:
- description: "An array of constraints."
+ description: |
+ An array of constraint expressions to limit the set of nodes where
+ a task can be scheduled. Constraint expressions can either use a
+ _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find
+ nodes that satisfy every expression (AND match). Constraints can
+ match node or Docker Engine labels as follows:
+
+ node attribute | matches | example
+ ---------------------|--------------------------------|-----------------------------------------------
+ `node.id` | Node ID | `node.id==2ivku8v2gvtg4`
+ `node.hostname` | Node hostname | `node.hostname!=node-2`
+ `node.role` | Node role (`manager`/`worker`) | `node.role==manager`
+ `node.platform.os` | Node operating system | `node.platform.os==windows`
+ `node.platform.arch` | Node architecture | `node.platform.arch==x86_64`
+ `node.labels` | User-defined node labels | `node.labels.security==high`
+ `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-14.04`
+
+ `engine.labels` apply to Docker Engine labels like operating system,
+ drivers, etc. Swarm administrators add `node.labels` for operational
+ purposes by using the [`node update endpoint`](#operation/NodeUpdate).
+
type: "array"
items:
type: "string"
@@ -2730,8 +3855,13 @@ definitions:
- "node.hostname!=node3.corp.example.com"
- "node.role!=manager"
- "node.labels.type==production"
+ - "node.platform.os==linux"
+ - "node.platform.arch==x86_64"
Preferences:
- description: "Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence."
+ description: |
+ Preferences provide a way to make the scheduler aware of factors
+ such as topology. They are provided in order from highest to
+ lowest precedence.
type: "array"
items:
type: "object"
@@ -2740,13 +3870,21 @@ definitions:
type: "object"
properties:
SpreadDescriptor:
- description: "label descriptor, such as engine.labels.az"
+ description: |
+ label descriptor, such as `engine.labels.az`.
type: "string"
example:
- Spread:
SpreadDescriptor: "node.labels.datacenter"
- Spread:
SpreadDescriptor: "node.labels.rack"
+ MaxReplicas:
+ description: |
+ Maximum number of replicas for per node (default value is 0, which
+ is unlimited)
+ type: "integer"
+ format: "int64"
+ default: 0
Platforms:
description: |
Platforms stores all the platforms that the service's image can
@@ -2757,24 +3895,24 @@ definitions:
items:
$ref: "#/definitions/Platform"
ForceUpdate:
- description: "A counter that triggers an update even if no relevant parameters have been changed."
+ description: |
+ A counter that triggers an update even if no relevant parameters have
+ been changed.
type: "integer"
Runtime:
- description: "Runtime is the type of runtime specified for the task executor."
+ description: |
+ Runtime is the type of runtime specified for the task executor.
type: "string"
Networks:
+ description: "Specifies which networks the service should attach to."
type: "array"
items:
- type: "object"
- properties:
- Target:
- type: "string"
- Aliases:
- type: "array"
- items:
- type: "string"
+ $ref: "#/definitions/NetworkAttachmentConfig"
LogDriver:
- description: "Specifies the log driver to use for tasks created from this spec. If not present, the default one for the swarm will be used, finally falling back to the engine default if not specified."
+ description: |
+ Specifies the log driver to use for tasks created from this spec. If
+ not present, the default one for the swarm will be used, finally
+ falling back to the engine default if not specified.
type: "object"
properties:
Name:
@@ -2800,6 +3938,8 @@ definitions:
- "shutdown"
- "failed"
- "rejected"
+ - "remove"
+ - "orphaned"
Task:
type: "object"
@@ -2858,6 +3998,12 @@ definitions:
type: "integer"
DesiredState:
$ref: "#/definitions/TaskState"
+ JobIteration:
+ description: |
+ If the Service this Task belongs to is a job-mode service, contains
+ the JobIteration of the Service this Task was created for. Absent if
+ the Task was created for a Replicated or Global Service.
+ $ref: "#/definitions/ObjectVersion"
example:
ID: "0kzzo1i0y4jz6027t0k7aezc7"
Version:
@@ -2927,6 +4073,7 @@ definitions:
ServiceSpec:
description: "User modifiable configuration for a service."
+ type: object
properties:
Name:
description: "Name of the service."
@@ -2950,12 +4097,37 @@ definitions:
format: "int64"
Global:
type: "object"
+ ReplicatedJob:
+ description: |
+ The mode used for services with a finite number of tasks that run
+ to a completed state.
+ type: "object"
+ properties:
+ MaxConcurrent:
+ description: |
+ The maximum number of replicas to run simultaneously.
+ type: "integer"
+ format: "int64"
+ default: 1
+ TotalCompletions:
+ description: |
+ The total number of replicas desired to reach the Completed
+ state. If unset, will default to the value of `MaxConcurrent`
+ type: "integer"
+ format: "int64"
+ GlobalJob:
+ description: |
+ The mode used for services which run a task to the completed state
+ on each valid node.
+ type: "object"
UpdateConfig:
description: "Specification for the update strategy of the service."
type: "object"
properties:
Parallelism:
- description: "Maximum number of tasks to be updated in one iteration (0 means unlimited parallelism)."
+ description: |
+ Maximum number of tasks to be updated in one iteration (0 means
+ unlimited parallelism).
type: "integer"
format: "int64"
Delay:
@@ -2963,22 +4135,32 @@ definitions:
type: "integer"
format: "int64"
FailureAction:
- description: "Action to take if an updated task fails to run, or stops running during the update."
+ description: |
+ Action to take if an updated task fails to run, or stops running
+ during the update.
type: "string"
enum:
- "continue"
- "pause"
- "rollback"
Monitor:
- description: "Amount of time to monitor each updated task for failures, in nanoseconds."
+ description: |
+ Amount of time to monitor each updated task for failures, in
+ nanoseconds.
type: "integer"
format: "int64"
MaxFailureRatio:
- description: "The fraction of tasks that may fail during an update before the failure action is invoked, specified as a floating point number between 0 and 1."
+ description: |
+ The fraction of tasks that may fail during an update before the
+ failure action is invoked, specified as a floating point number
+ between 0 and 1.
type: "number"
default: 0
Order:
- description: "The order of operations when rolling out an updated task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down."
+ description: |
+ The order of operations when rolling out an updated task. Either
+ the old task is shut down before the new task is started, or the
+ new task is started before the old task is shut down.
type: "string"
enum:
- "stop-first"
@@ -2988,45 +4170,52 @@ definitions:
type: "object"
properties:
Parallelism:
- description: "Maximum number of tasks to be rolled back in one iteration (0 means unlimited parallelism)."
+ description: |
+ Maximum number of tasks to be rolled back in one iteration (0 means
+ unlimited parallelism).
type: "integer"
format: "int64"
Delay:
- description: "Amount of time between rollback iterations, in nanoseconds."
+ description: |
+ Amount of time between rollback iterations, in nanoseconds.
type: "integer"
format: "int64"
FailureAction:
- description: "Action to take if an rolled back task fails to run, or stops running during the rollback."
+ description: |
+ Action to take if an rolled back task fails to run, or stops
+ running during the rollback.
type: "string"
enum:
- "continue"
- "pause"
Monitor:
- description: "Amount of time to monitor each rolled back task for failures, in nanoseconds."
+ description: |
+ Amount of time to monitor each rolled back task for failures, in
+ nanoseconds.
type: "integer"
format: "int64"
MaxFailureRatio:
- description: "The fraction of tasks that may fail during a rollback before the failure action is invoked, specified as a floating point number between 0 and 1."
+ description: |
+ The fraction of tasks that may fail during a rollback before the
+ failure action is invoked, specified as a floating point number
+ between 0 and 1.
type: "number"
default: 0
Order:
- description: "The order of operations when rolling back a task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down."
+ description: |
+ The order of operations when rolling back a task. Either the old
+ task is shut down before the new task is started, or the new task
+ is started before the old task is shut down.
type: "string"
enum:
- "stop-first"
- "start-first"
Networks:
- description: "Array of network names or IDs to attach the service to."
+ description: "Specifies which networks the service should attach to."
type: "array"
items:
- type: "object"
- properties:
- Target:
- type: "string"
- Aliases:
- type: "array"
- items:
- type: "string"
+ $ref: "#/definitions/NetworkAttachmentConfig"
+
EndpointSpec:
$ref: "#/definitions/EndpointSpec"
@@ -3040,6 +4229,7 @@ definitions:
enum:
- "tcp"
- "udp"
+ - "sctp"
TargetPort:
description: "The port inside the container."
type: "integer"
@@ -3052,7 +4242,7 @@ definitions:
- - "ingress" makes the target port accessible on on every node,
+ - "ingress" makes the target port accessible on every node,
regardless of whether there is a task for the service running on
that node or not.
- "host" bypasses the routing mesh and publish the port directly on
@@ -3070,14 +4260,17 @@ definitions:
type: "object"
properties:
Mode:
- description: "The mode of resolution to use for internal load balancing between tasks."
+ description: |
+ The mode of resolution to use for internal load balancing between tasks.
type: "string"
enum:
- "vip"
- "dnsrr"
default: "vip"
Ports:
- description: "List of exposed ports that this service is accessible on from the outside. Ports can only be provided if `vip` resolution mode is used."
+ description: |
+ List of exposed ports that this service is accessible on from the
+ outside. Ports can only be provided if `vip` resolution mode is used.
type: "array"
items:
$ref: "#/definitions/EndpointPortConfig"
@@ -3133,6 +4326,61 @@ definitions:
format: "dateTime"
Message:
type: "string"
+ ServiceStatus:
+ description: |
+ The status of the service's tasks. Provided only when requested as
+ part of a ServiceList operation.
+ type: "object"
+ properties:
+ RunningTasks:
+ description: |
+ The number of tasks for the service currently in the Running state.
+ type: "integer"
+ format: "uint64"
+ example: 7
+ DesiredTasks:
+ description: |
+ The number of tasks for the service desired to be running.
+ For replicated services, this is the replica count from the
+ service spec. For global services, this is computed by taking
+ count of all tasks for the service with a Desired State other
+ than Shutdown.
+ type: "integer"
+ format: "uint64"
+ example: 10
+ CompletedTasks:
+ description: |
+ The number of tasks for a job that are in the Completed state.
+ This field must be cross-referenced with the service type, as the
+ value of 0 may mean the service is not in a job mode, or it may
+ mean the job-mode service has no tasks yet Completed.
+ type: "integer"
+ format: "uint64"
+ JobStatus:
+ description: |
+ The status of the service when it is in one of ReplicatedJob or
+ GlobalJob modes. Absent on Replicated and Global mode services. The
+ JobIteration is an ObjectVersion, but unlike the Service's version,
+ does not need to be sent with an update request.
+ type: "object"
+ properties:
+ JobIteration:
+ description: |
+ JobIteration is a value increased each time a Job is executed,
+ successfully or otherwise. "Executed", in this case, means the
+ job as a whole has been started, not that an individual Task has
+ been launched. A job is "Executed" when its ServiceSpec is
+ updated. JobIteration can be used to disambiguate Tasks belonging
+ to different executions of a job. Though JobIteration will
+ increase with each subsequent execution, it may not necessarily
+ increase by 1, and so JobIteration should not be used to
+ $ref: "#/definitions/ObjectVersion"
+ LastExecution:
+ description: |
+ The last time, as observed by the server, that this job was
+ started.
+ type: "string"
+ format: "dateTime"
example:
ID: "9mnpnzenvg8p8tdbtq4wvbkcz"
Version:
@@ -3217,73 +4465,71 @@ definitions:
Warning: "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found"
ContainerSummary:
- type: "array"
- items:
- type: "object"
- properties:
- Id:
- description: "The ID of this container"
- type: "string"
- x-go-name: "ID"
- Names:
- description: "The names that this container has been given"
- type: "array"
- items:
- type: "string"
- Image:
- description: "The name of the image used when creating this container"
- type: "string"
- ImageID:
- description: "The ID of the image that this container was created from"
+ type: "object"
+ properties:
+ Id:
+ description: "The ID of this container"
+ type: "string"
+ x-go-name: "ID"
+ Names:
+ description: "The names that this container has been given"
+ type: "array"
+ items:
type: "string"
- Command:
- description: "Command to run when starting the container"
+ Image:
+ description: "The name of the image used when creating this container"
+ type: "string"
+ ImageID:
+ description: "The ID of the image that this container was created from"
+ type: "string"
+ Command:
+ description: "Command to run when starting the container"
+ type: "string"
+ Created:
+ description: "When the container was created"
+ type: "integer"
+ format: "int64"
+ Ports:
+ description: "The ports exposed by this container"
+ type: "array"
+ items:
+ $ref: "#/definitions/Port"
+ SizeRw:
+ description: "The size of files that have been created or changed by this container"
+ type: "integer"
+ format: "int64"
+ SizeRootFs:
+ description: "The total size of all the files in this container"
+ type: "integer"
+ format: "int64"
+ Labels:
+ description: "User-defined key/value metadata."
+ type: "object"
+ additionalProperties:
type: "string"
- Created:
- description: "When the container was created"
- type: "integer"
- format: "int64"
- Ports:
- description: "The ports exposed by this container"
- type: "array"
- items:
- $ref: "#/definitions/Port"
- SizeRw:
- description: "The size of files that have been created or changed by this container"
- type: "integer"
- format: "int64"
- SizeRootFs:
- description: "The total size of all the files in this container"
- type: "integer"
- format: "int64"
- Labels:
- description: "User-defined key/value metadata."
- type: "object"
- additionalProperties:
+ State:
+ description: "The state of this container (e.g. `Exited`)"
+ type: "string"
+ Status:
+ description: "Additional human-readable status of this container (e.g. `Exit 0`)"
+ type: "string"
+ HostConfig:
+ type: "object"
+ properties:
+ NetworkMode:
type: "string"
- State:
- description: "The state of this container (e.g. `Exited`)"
- type: "string"
- Status:
- description: "Additional human-readable status of this container (e.g. `Exit 0`)"
- type: "string"
- HostConfig:
- type: "object"
- properties:
- NetworkMode:
- type: "string"
- NetworkSettings:
- description: "A summary of the container's network settings"
- type: "object"
- properties:
- Networks:
- type: "object"
- additionalProperties:
- $ref: "#/definitions/EndpointSettings"
- Mounts:
- type: "array"
- items:
- $ref: "#/definitions/Mount"
+ NetworkSettings:
+ description: "A summary of the container's network settings"
+ type: "object"
+ properties:
+ Networks:
+ type: "object"
+ additionalProperties:
+ $ref: "#/definitions/EndpointSettings"
+ Mounts:
+ type: "array"
+ items:
+ $ref: "#/definitions/MountPoint"
Driver:
description: "Driver represents a driver (network, logging, secrets)."
@@ -3321,7 +4567,7 @@ definitions:
com.example.some-other-label: "some-other-value"
Data:
description: |
- Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2))
+ Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5))
data to store as secret.
This field is only used to _create_ a secret, and is not returned by
@@ -3329,7 +4575,16 @@ definitions:
type: "string"
example: ""
Driver:
- description: "Name of the secrets driver used to fetch the secret's value from an external secret store"
+ description: |
+ Name of the secrets driver used to fetch the secret's value from an
+ external secret store.
+ $ref: "#/definitions/Driver"
+ Templating:
+ description: |
+ Templating driver, if applicable
+
+ Templating controls whether and how to evaluate the config payload as
+ a template. If no driver is set, no templating is used.
$ref: "#/definitions/Driver"
Secret:
@@ -3364,9 +4619,16 @@ definitions:
type: "string"
Data:
description: |
- Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2))
+ Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5))
config data.
type: "string"
+ Templating:
+ description: |
+ Templating driver, if applicable
+
+ Templating controls whether and how to evaluate the config payload as
+ a template. If no driver is set, no templating is used.
+ $ref: "#/definitions/Driver"
Config:
type: "object"
@@ -3384,6 +4646,212 @@ definitions:
Spec:
$ref: "#/definitions/ConfigSpec"
+ ContainerState:
+ description: |
+ ContainerState stores container's running state. It's part of ContainerJSONBase
+ and will be returned by the "inspect" command.
+ type: "object"
+ x-nullable: true
+ properties:
+ Status:
+ description: |
+ String representation of the container state. Can be one of "created",
+ "running", "paused", "restarting", "removing", "exited", or "dead".
+ type: "string"
+ enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"]
+ example: "running"
+ 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 freezer cgroup 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"
+ example: true
+ Paused:
+ description: "Whether this container is paused."
+ type: "boolean"
+ example: false
+ Restarting:
+ description: "Whether this container is restarting."
+ type: "boolean"
+ example: false
+ OOMKilled:
+ description: |
+ Whether a process within this container has been killed because it ran
+ out of memory since the container was last started.
+ type: "boolean"
+ example: false
+ Dead:
+ type: "boolean"
+ example: false
+ Pid:
+ description: "The process ID of this container"
+ type: "integer"
+ example: 1234
+ ExitCode:
+ description: "The last exit code of this container"
+ type: "integer"
+ example: 0
+ Error:
+ type: "string"
+ StartedAt:
+ description: "The time when this container was last started."
+ type: "string"
+ example: "2020-01-06T09:06:59.461876391Z"
+ FinishedAt:
+ description: "The time when this container last exited."
+ type: "string"
+ example: "2020-01-06T09:07:59.461876391Z"
+ Health:
+ $ref: "#/definitions/Health"
+
+ ContainerCreateResponse:
+ description: "OK response to ContainerCreate operation"
+ type: "object"
+ title: "ContainerCreateResponse"
+ x-go-name: "CreateResponse"
+ required: [Id, Warnings]
+ properties:
+ Id:
+ description: "The ID of the created container"
+ type: "string"
+ x-nullable: false
+ example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743"
+ Warnings:
+ description: "Warnings encountered when creating the container"
+ type: "array"
+ x-nullable: false
+ items:
+ type: "string"
+ example: []
+
+ ContainerWaitResponse:
+ description: "OK response to ContainerWait operation"
+ type: "object"
+ x-go-name: "WaitResponse"
+ title: "ContainerWaitResponse"
+ required: [StatusCode]
+ properties:
+ StatusCode:
+ description: "Exit code of the container"
+ type: "integer"
+ format: "int64"
+ x-nullable: false
+ Error:
+ $ref: "#/definitions/ContainerWaitExitError"
+
+ ContainerWaitExitError:
+ description: "container waiting error, if any"
+ type: "object"
+ x-go-name: "WaitExitError"
+ properties:
+ Message:
+ description: "Details of an error"
+ type: "string"
+
+ SystemVersion:
+ type: "object"
+ description: |
+ Response of Engine API: GET "/version"
+ properties:
+ Platform:
+ type: "object"
+ required: [Name]
+ properties:
+ Name:
+ type: "string"
+ Components:
+ type: "array"
+ description: |
+ Information about system components
+ items:
+ type: "object"
+ x-go-name: ComponentVersion
+ required: [Name, Version]
+ properties:
+ Name:
+ description: |
+ Name of the component
+ type: "string"
+ example: "Engine"
+ Version:
+ description: |
+ Version of the component
+ type: "string"
+ x-nullable: false
+ example: "19.03.12"
+ Details:
+ description: |
+ Key/value pairs of strings with additional information about the
+ component. These values are intended for informational purposes
+ only, and their content is not defined, and not part of the API
+ specification.
+
+ These messages can be printed by the client as information to the user.
+ type: "object"
+ x-nullable: true
+ Version:
+ description: "The version of the daemon"
+ type: "string"
+ example: "19.03.12"
+ ApiVersion:
+ description: |
+ The default (and highest) API version that is supported by the daemon
+ type: "string"
+ example: "1.40"
+ MinAPIVersion:
+ description: |
+ The minimum API version that is supported by the daemon
+ type: "string"
+ example: "1.12"
+ GitCommit:
+ description: |
+ The Git commit of the source code that was used to build the daemon
+ type: "string"
+ example: "48a66213fe"
+ GoVersion:
+ description: |
+ The version Go used to compile the daemon, and the version of the Go
+ runtime in use.
+ type: "string"
+ example: "go1.13.14"
+ Os:
+ description: |
+ The operating system that the daemon is running on ("linux" or "windows")
+ type: "string"
+ example: "linux"
+ Arch:
+ description: |
+ The architecture that the daemon is running on
+ type: "string"
+ example: "amd64"
+ KernelVersion:
+ description: |
+ The kernel version (`uname -r`) that the daemon is running on.
+
+ This field is omitted when empty.
+ type: "string"
+ example: "4.19.76-linuxkit"
+ Experimental:
+ description: |
+ Indicates if the daemon is started with experimental features enabled.
+
+ This field is omitted when empty / false.
+ type: "boolean"
+ example: true
+ BuildTime:
+ description: |
+ The date and time that the daemon was compiled.
+ type: "string"
+ example: "2020-06-22T15:49:27.000000000+00:00"
+
SystemInfo:
type: "object"
properties:
@@ -3458,44 +4926,6 @@ definitions:
on Windows.
type: "string"
example: "/var/lib/docker"
- SystemStatus:
- description: |
- Status information about this node (standalone Swarm API).
-
-
-
- > **Note**: The information returned in this field is only propagated
- > by the Swarm standalone API, and is empty (`null`) when using
- > built-in swarm mode.
- type: "array"
- items:
- type: "array"
- items:
- type: "string"
- example:
- - ["Role", "primary"]
- - ["State", "Healthy"]
- - ["Strategy", "spread"]
- - ["Filters", "health, port, containerslots, dependency, affinity, constraint, whitelist"]
- - ["Nodes", "2"]
- - [" swarm-agent-00", "192.168.99.102:2376"]
- - [" └ ID", "5CT6:FBGO:RVGO:CZL4:PB2K:WCYN:2JSV:KSHH:GGFW:QOPG:6J5Q:IOZ2|192.168.99.102:2376"]
- - [" └ Status", "Healthy"]
- - [" └ Containers", "1 (1 Running, 0 Paused, 0 Stopped)"]
- - [" └ Reserved CPUs", "0 / 1"]
- - [" └ Reserved Memory", "0 B / 1.021 GiB"]
- - [" └ Labels", "kernelversion=4.4.74-boot2docker, operatingsystem=Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017, ostype=linux, provider=virtualbox, storagedriver=aufs"]
- - [" └ UpdatedAt", "2017-08-09T10:03:46Z"]
- - [" └ ServerVersion", "17.06.0-ce"]
- - [" swarm-manager", "192.168.99.101:2376"]
- - [" └ ID", "TAMD:7LL3:SEF7:LW2W:4Q2X:WVFH:RTXX:JSYS:XY2P:JEHL:ZMJK:JGIW|192.168.99.101:2376"]
- - [" └ Status", "Healthy"]
- - [" └ Containers", "2 (2 Running, 0 Paused, 0 Stopped)"]
- - [" └ Reserved CPUs", "0 / 1"]
- - [" └ Reserved Memory", "0 B / 1.021 GiB"]
- - [" └ Labels", "kernelversion=4.4.74-boot2docker, operatingsystem=Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017, ostype=linux, provider=virtualbox, storagedriver=aufs"]
- - [" └ UpdatedAt", "2017-08-09T10:04:11Z"]
- - [" └ ServerVersion", "17.06.0-ce"]
Plugins:
$ref: "#/definitions/PluginsInfo"
MemoryLimit:
@@ -3506,20 +4936,30 @@ definitions:
description: "Indicates if the host has memory swap limit support enabled."
type: "boolean"
example: true
- KernelMemory:
- description: "Indicates if the host has kernel memory limit support enabled."
+ KernelMemoryTCP:
+ description: |
+ Indicates if the host has kernel memory TCP limit support enabled. This
+ field is omitted if not supported.
+
+ Kernel memory TCP limits are not supported when using cgroups v2, which
+ does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup.
type: "boolean"
example: true
CpuCfsPeriod:
- description: "Indicates if CPU CFS(Completely Fair Scheduler) period is supported by the host."
+ description: |
+ Indicates if CPU CFS(Completely Fair Scheduler) period is supported by
+ the host.
type: "boolean"
example: true
CpuCfsQuota:
- description: "Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by the host."
+ description: |
+ Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by
+ the host.
type: "boolean"
example: true
CPUShares:
- description: "Indicates if CPU Shares limiting is supported by the host."
+ description: |
+ Indicates if CPU Shares limiting is supported by the host.
type: "boolean"
example: true
CPUSet:
@@ -3529,6 +4969,10 @@ definitions:
See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt)
type: "boolean"
example: true
+ PidsLimit:
+ description: "Indicates if the host kernel has PID limit support enabled."
+ type: "boolean"
+ example: true
OomKillDisable:
description: "Indicates if OOM killer disable is supported on the host."
type: "boolean"
@@ -3545,7 +4989,9 @@ definitions:
type: "boolean"
example: true
Debug:
- description: "Indicates if the daemon is running in debug-mode / with debug-level logging enabled."
+ description: |
+ Indicates if the daemon is running in debug-mode / with debug-level
+ logging enabled.
type: "boolean"
example: true
NFd:
@@ -3576,9 +5022,16 @@ definitions:
description: |
The driver to use for managing cgroups.
type: "string"
- enum: ["cgroupfs", "systemd"]
+ enum: ["cgroupfs", "systemd", "none"]
default: "cgroupfs"
example: "cgroupfs"
+ CgroupVersion:
+ description: |
+ The version of the cgroup.
+ type: "string"
+ enum: ["1", "2"]
+ default: "1"
+ example: "1"
NEventsListener:
description: "Number of event listeners subscribed."
type: "integer"
@@ -3598,6 +5051,17 @@ definitions:
or "Windows Server 2016 Datacenter"
type: "string"
example: "Alpine Linux v3.5"
+ OSVersion:
+ description: |
+ Version of the host's operating system
+
+
+
+ > **Note**: The information returned in this field, including its
+ > very existence, and the formatting of values, should not be considered
+ > stable, and may change without notice.
+ type: "string"
+ example: "16.04"
OSType:
description: |
Generic type of the operating system of the host, as returned by the
@@ -3626,7 +5090,7 @@ definitions:
example: 4
MemTotal:
description: |
- Total amount of physical memory available on the host, in kilobytes (kB).
+ Total amount of physical memory available on the host, in bytes.
type: "integer"
format: "int64"
example: 2095882240
@@ -3646,18 +5110,22 @@ definitions:
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.
+ Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL
+ are masked in the API response.
Containers do not automatically inherit this configuration.
type: "string"
- example: "http://user:pass@proxy.corp.example.com:8080"
+ example: "http://xxxxx:xxxxx@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.
+ Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL
+ are masked in the API response.
Containers do not automatically inherit this configuration.
type: "string"
- example: "https://user:pass@proxy.corp.example.com:4443"
+ example: "https://xxxxx:xxxxx@proxy.corp.example.com:4443"
NoProxy:
description: |
Comma-separated list of domain extensions for which no proxy should be
@@ -3694,42 +5162,8 @@ definitions:
ServerVersion:
description: |
Version string of the daemon.
-
- > **Note**: the [standalone Swarm API](https://docs.docker.com/swarm/swarm-api/)
- > returns the Swarm version instead of the daemon version, for example
- > `swarm/1.2.8`.
- type: "string"
- example: "17.06.0-ce"
- ClusterStore:
- description: |
- URL of the distributed storage backend.
-
-
- The storage backend is used for multihost networking (to store
- network and endpoint information) and by the node discovery mechanism.
-
-
-
- > **Note**: This field is only propagated when using standalone Swarm
- > mode, and overlay networking using an external k/v store. Overlay
- > networks with Swarm mode enabled use the built-in raft store, and
- > this field will be empty.
- type: "string"
- example: "consul://consul.corp.example.com:8600/some/path"
- ClusterAdvertise:
- description: |
- The network endpoint that the Engine advertises for the purpose of
- node discovery. ClusterAdvertise is a `host:port` combination on which
- the daemon is reachable by other hosts.
-
-
-
- > **Note**: This field is only propagated when using standalone Swarm
- > mode, and overlay networking using an external k/v store. Overlay
- > networks with Swarm mode enabled use the built-in raft store, and
- > this field will be empty.
type: "string"
- example: "node5.corp.example.com:8000"
+ example: "24.0.2"
Runtimes:
description: |
List of [OCI compliant](https://github.com/opencontainers/runtime-spec)
@@ -3747,10 +5181,10 @@ definitions:
$ref: "#/definitions/Runtime"
default:
runc:
- path: "docker-runc"
+ path: "runc"
example:
runc:
- path: "docker-runc"
+ path: "runc"
runc-master:
path: "/go/bin/runc"
custom:
@@ -3792,7 +5226,7 @@ definitions:
- "process"
InitBinary:
description: |
- Name and, optional, path of the the `docker-init` binary.
+ Name and, optional, path of the `docker-init` binary.
If the path is omitted, the daemon searches the host's `$PATH` for the
binary and uses the first result.
@@ -3806,20 +5240,62 @@ definitions:
$ref: "#/definitions/Commit"
SecurityOptions:
description: |
- List of security features that are enabled on the daemon, such as
- apparmor, seccomp, SELinux, and user-namespaces (userns).
+ List of security features that are enabled on the daemon, such as
+ apparmor, seccomp, SELinux, user-namespaces (userns), rootless and
+ no-new-privileges.
+
+ 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"
+ - "name=rootless"
+ ProductLicense:
+ description: |
+ Reports a summary of the product license on the daemon.
+
+ If a commercial license has been applied to the daemon, information
+ such as number of nodes, and expiration are included.
+ type: "string"
+ example: "Community Engine"
+ DefaultAddressPools:
+ description: |
+ List of custom default address pools for local networks, which can be
+ specified in the daemon.json file or dockerd option.
+
+ Example: a Base "10.10.0.0/16" with Size 24 will define the set of 256
+ 10.10.[0-255].0/24 address pools.
+ type: "array"
+ items:
+ type: "object"
+ properties:
+ Base:
+ description: "The network address in CIDR format"
+ type: "string"
+ example: "10.10.0.0/16"
+ Size:
+ description: "The network pool size"
+ type: "integer"
+ example: "24"
+ Warnings:
+ description: |
+ List of warnings / informational messages about missing features, or
+ issues related to the daemon configuration.
- Additional configuration options for each security feature may
- be present, and are included as a comma-separated list of key/value
- pairs.
+ These messages can be printed by the client as information to the user.
type: "array"
items:
type: "string"
example:
- - "name=apparmor"
- - "name=seccomp,profile=default"
- - "name=selinux"
- - "name=userns"
+ - "WARNING: No memory limit support"
+ - "WARNING: bridge-nf-call-iptables is disabled"
+ - "WARNING: bridge-nf-call-ip6tables is disabled"
# PluginsInfo is a temp struct holding Plugins name
@@ -4010,7 +5486,7 @@ definitions:
- "https://registry-3.docker.io/"
Secure:
description: |
- Indicates if the the registry is part of the list of insecure
+ Indicates if the registry is part of the list of insecure
registries.
If `false`, the registry is insecure. Insecure registries accept
@@ -4143,6 +5619,7 @@ definitions:
PeerNode:
description: "Represents a peer-node in the swarm"
+ type: "object"
properties:
NodeID:
description: "Unique identifier of for this node in the swarm."
@@ -4152,37 +5629,457 @@ definitions:
IP address and ports at which this node can be reached.
type: "string"
+ NetworkAttachmentConfig:
+ description: |
+ Specifies how a service should be attached to a particular network.
+ type: "object"
+ properties:
+ Target:
+ description: |
+ The target network for attachment. Must be a network name or ID.
+ type: "string"
+ Aliases:
+ description: |
+ Discoverable alternate names for the service on this network.
+ type: "array"
+ items:
+ type: "string"
+ DriverOpts:
+ description: |
+ Driver attachment options for the network target.
+ type: "object"
+ additionalProperties:
+ type: "string"
+
+ EventActor:
+ description: |
+ Actor describes something that generates events, like a container, network,
+ or a volume.
+ type: "object"
+ properties:
+ ID:
+ description: "The ID of the object emitting the event"
+ type: "string"
+ example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743"
+ Attributes:
+ description: |
+ Various key/value attributes of the object, depending on its type.
+ type: "object"
+ additionalProperties:
+ type: "string"
+ example:
+ com.example.some-label: "some-label-value"
+ image: "alpine:latest"
+ name: "my-container"
+
+ EventMessage:
+ description: |
+ EventMessage represents the information an event contains.
+ type: "object"
+ title: "SystemEventsResponse"
+ properties:
+ Type:
+ description: "The type of object emitting the event"
+ type: "string"
+ enum: ["builder", "config", "container", "daemon", "image", "network", "node", "plugin", "secret", "service", "volume"]
+ example: "container"
+ Action:
+ description: "The type of event"
+ type: "string"
+ example: "create"
+ Actor:
+ $ref: "#/definitions/EventActor"
+ scope:
+ description: |
+ Scope of the event. Engine events are `local` scope. Cluster (Swarm)
+ events are `swarm` scope.
+ type: "string"
+ enum: ["local", "swarm"]
+ time:
+ description: "Timestamp of event"
+ type: "integer"
+ format: "int64"
+ example: 1629574695
+ timeNano:
+ description: "Timestamp of event, with nanosecond accuracy"
+ type: "integer"
+ format: "int64"
+ example: 1629574695515050031
+
+ OCIDescriptor:
+ type: "object"
+ x-go-name: Descriptor
+ description: |
+ A descriptor struct containing digest, media type, and size, as defined in
+ the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md).
+ properties:
+ mediaType:
+ description: |
+ The media type of the object this schema refers to.
+ type: "string"
+ example: "application/vnd.docker.distribution.manifest.v2+json"
+ digest:
+ description: |
+ The digest of the targeted content.
+ type: "string"
+ example: "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96"
+ size:
+ description: |
+ The size in bytes of the blob.
+ type: "integer"
+ format: "int64"
+ example: 3987495
+ # TODO Not yet including these fields for now, as they are nil / omitted in our response.
+ # urls:
+ # description: |
+ # List of URLs from which this object MAY be downloaded.
+ # type: "array"
+ # items:
+ # type: "string"
+ # format: "uri"
+ # annotations:
+ # description: |
+ # Arbitrary metadata relating to the targeted content.
+ # type: "object"
+ # additionalProperties:
+ # type: "string"
+ # platform:
+ # $ref: "#/definitions/OCIPlatform"
+
+ OCIPlatform:
+ type: "object"
+ x-go-name: Platform
+ description: |
+ Describes the platform which the image in the manifest runs on, as defined
+ in the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md).
+ properties:
+ architecture:
+ description: |
+ The CPU architecture, for example `amd64` or `ppc64`.
+ type: "string"
+ example: "arm"
+ os:
+ description: |
+ The operating system, for example `linux` or `windows`.
+ type: "string"
+ example: "windows"
+ os.version:
+ description: |
+ Optional field specifying the operating system version, for example on
+ Windows `10.0.19041.1165`.
+ type: "string"
+ example: "10.0.19041.1165"
+ os.features:
+ description: |
+ Optional field specifying an array of strings, each listing a required
+ OS feature (for example on Windows `win32k`).
+ type: "array"
+ items:
+ type: "string"
+ example:
+ - "win32k"
+ variant:
+ description: |
+ Optional field specifying a variant of the CPU, for example `v7` to
+ specify ARMv7 when architecture is `arm`.
+ type: "string"
+ example: "v7"
+
+ DistributionInspect:
+ type: "object"
+ x-go-name: DistributionInspect
+ title: "DistributionInspectResponse"
+ required: [Descriptor, Platforms]
+ description: |
+ Describes the result obtained from contacting the registry to retrieve
+ image metadata.
+ properties:
+ Descriptor:
+ $ref: "#/definitions/OCIDescriptor"
+ Platforms:
+ type: "array"
+ description: |
+ An array containing all platforms supported by the image.
+ items:
+ $ref: "#/definitions/OCIPlatform"
+
+ ClusterVolume:
+ type: "object"
+ description: |
+ Options and information specific to, and only present on, Swarm CSI
+ cluster volumes.
+ properties:
+ ID:
+ type: "string"
+ description: |
+ The Swarm ID of this volume. Because cluster volumes are Swarm
+ objects, they have an ID, unlike non-cluster volumes. This ID can
+ be used to refer to the Volume instead of the name.
+ Version:
+ $ref: "#/definitions/ObjectVersion"
+ CreatedAt:
+ type: "string"
+ format: "dateTime"
+ UpdatedAt:
+ type: "string"
+ format: "dateTime"
+ Spec:
+ $ref: "#/definitions/ClusterVolumeSpec"
+ Info:
+ type: "object"
+ description: |
+ Information about the global status of the volume.
+ properties:
+ CapacityBytes:
+ type: "integer"
+ format: "int64"
+ description: |
+ The capacity of the volume in bytes. A value of 0 indicates that
+ the capacity is unknown.
+ VolumeContext:
+ type: "object"
+ description: |
+ A map of strings to strings returned from the storage plugin when
+ the volume is created.
+ additionalProperties:
+ type: "string"
+ VolumeID:
+ type: "string"
+ description: |
+ The ID of the volume as returned by the CSI storage plugin. This
+ is distinct from the volume's ID as provided by Docker. This ID
+ is never used by the user when communicating with Docker to refer
+ to this volume. If the ID is blank, then the Volume has not been
+ successfully created in the plugin yet.
+ AccessibleTopology:
+ type: "array"
+ description: |
+ The topology this volume is actually accessible from.
+ items:
+ $ref: "#/definitions/Topology"
+ PublishStatus:
+ type: "array"
+ description: |
+ The status of the volume as it pertains to its publishing and use on
+ specific nodes
+ items:
+ type: "object"
+ properties:
+ NodeID:
+ type: "string"
+ description: |
+ The ID of the Swarm node the volume is published on.
+ State:
+ type: "string"
+ description: |
+ The published state of the volume.
+ * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed.
+ * `published` The volume is published successfully to the node.
+ * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so.
+ * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller.
+ enum:
+ - "pending-publish"
+ - "published"
+ - "pending-node-unpublish"
+ - "pending-controller-unpublish"
+ PublishContext:
+ type: "object"
+ description: |
+ A map of strings to strings returned by the CSI controller
+ plugin when a volume is published.
+ additionalProperties:
+ type: "string"
+
+ ClusterVolumeSpec:
+ type: "object"
+ description: |
+ Cluster-specific options used to create the volume.
+ properties:
+ Group:
+ type: "string"
+ description: |
+ Group defines the volume group of this volume. Volumes belonging to
+ the same group can be referred to by group name when creating
+ Services. Referring to a volume by group instructs Swarm to treat
+ volumes in that group interchangeably for the purpose of scheduling.
+ Volumes with an empty string for a group technically all belong to
+ the same, emptystring group.
+ AccessMode:
+ type: "object"
+ description: |
+ Defines how the volume is used by tasks.
+ properties:
+ Scope:
+ type: "string"
+ description: |
+ The set of nodes this volume can be used on at one time.
+ - `single` The volume may only be scheduled to one node at a time.
+ - `multi` the volume may be scheduled to any supported number of nodes at a time.
+ default: "single"
+ enum: ["single", "multi"]
+ x-nullable: false
+ Sharing:
+ type: "string"
+ description: |
+ The number and way that different tasks can use this volume
+ at one time.
+ - `none` The volume may only be used by one task at a time.
+ - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly
+ - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write.
+ - `all` The volume may have any number of readers and writers.
+ default: "none"
+ enum: ["none", "readonly", "onewriter", "all"]
+ x-nullable: false
+ MountVolume:
+ type: "object"
+ description: |
+ Options for using this volume as a Mount-type volume.
+
+ Either MountVolume or BlockVolume, but not both, must be
+ present.
+ properties:
+ FsType:
+ type: "string"
+ description: |
+ Specifies the filesystem type for the mount volume.
+ Optional.
+ MountFlags:
+ type: "array"
+ description: |
+ Flags to pass when mounting the volume. Optional.
+ items:
+ type: "string"
+ BlockVolume:
+ type: "object"
+ description: |
+ Options for using this volume as a Block-type volume.
+ Intentionally empty.
+ Secrets:
+ type: "array"
+ description: |
+ Swarm Secrets that are passed to the CSI storage plugin when
+ operating on this volume.
+ items:
+ type: "object"
+ description: |
+ One cluster volume secret entry. Defines a key-value pair that
+ is passed to the plugin.
+ properties:
+ Key:
+ type: "string"
+ description: |
+ Key is the name of the key of the key-value pair passed to
+ the plugin.
+ Secret:
+ type: "string"
+ description: |
+ Secret is the swarm Secret object from which to read data.
+ This can be a Secret name or ID. The Secret data is
+ retrieved by swarm and used as the value of the key-value
+ pair passed to the plugin.
+ AccessibilityRequirements:
+ type: "object"
+ description: |
+ Requirements for the accessible topology of the volume. These
+ fields are optional. For an in-depth description of what these
+ fields mean, see the CSI specification.
+ properties:
+ Requisite:
+ type: "array"
+ description: |
+ A list of required topologies, at least one of which the
+ volume must be accessible from.
+ items:
+ $ref: "#/definitions/Topology"
+ Preferred:
+ type: "array"
+ description: |
+ A list of topologies that the volume should attempt to be
+ provisioned in.
+ items:
+ $ref: "#/definitions/Topology"
+ CapacityRange:
+ type: "object"
+ description: |
+ The desired capacity that the volume should be created with. If
+ empty, the plugin will decide the capacity.
+ properties:
+ RequiredBytes:
+ type: "integer"
+ format: "int64"
+ description: |
+ The volume must be at least this big. The value of 0
+ indicates an unspecified minimum
+ LimitBytes:
+ type: "integer"
+ format: "int64"
+ description: |
+ The volume must not be bigger than this. The value of 0
+ indicates an unspecified maximum.
+ Availability:
+ type: "string"
+ description: |
+ The availability of the volume for use in tasks.
+ - `active` The volume is fully available for scheduling on the cluster
+ - `pause` No new workloads should use the volume, but existing workloads are not stopped.
+ - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started.
+ default: "active"
+ x-nullable: false
+ enum:
+ - "active"
+ - "pause"
+ - "drain"
+
+ Topology:
+ description: |
+ A map of topological domains to topological segments. For in depth
+ details, see documentation for the Topology object in the CSI
+ specification.
+ type: "object"
+ additionalProperties:
+ type: "string"
+
paths:
/containers/json:
get:
summary: "List containers"
description: |
- Returns a list of containers. For details on the format, see [the inspect endpoint](#operation/ContainerInspect).
+ Returns a list of containers. For details on the format, see the
+ [inspect endpoint](#operation/ContainerInspect).
- Note that it uses a different, smaller representation of a container than inspecting a single container. For example,
- the list of linked containers is not propagated .
+ Note that it uses a different, smaller representation of a container
+ than inspecting a single container. For example, the list of linked
+ containers is not propagated .
operationId: "ContainerList"
produces:
- "application/json"
parameters:
- name: "all"
in: "query"
- description: "Return all containers. By default, only running containers are shown"
+ description: |
+ Return all containers. By default, only running containers are shown.
type: "boolean"
default: false
- name: "limit"
in: "query"
- description: "Return this number of most recently created containers, including non-running ones."
+ description: |
+ Return this number of most recently created containers, including
+ non-running ones.
type: "integer"
- name: "size"
in: "query"
- description: "Return the size of container as fields `SizeRw` and `SizeRootFs`."
+ description: |
+ Return the size of container as fields `SizeRw` and `SizeRootFs`.
type: "boolean"
default: false
- name: "filters"
in: "query"
description: |
- Filters to process on the container list, encoded as JSON (a `map[string][]string`). For example, `{"status": ["paused"]}` will only return paused containers. Available filters:
+ Filters to process on the container list, encoded as JSON (a
+ `map[string][]string`). For example, `{"status": ["paused"]}` will
+ only return paused containers.
+
+ Available filters:
- `ancestor`=(`[:]`, ``, or ``)
- `before`=(`` or ``)
@@ -4204,7 +6101,9 @@ paths:
200:
description: "no error"
schema:
- $ref: "#/definitions/ContainerSummary"
+ type: "array"
+ items:
+ $ref: "#/definitions/ContainerSummary"
examples:
application/json:
- Id: "8dfafdbc3a40"
@@ -4353,9 +6252,33 @@ paths:
parameters:
- name: "name"
in: "query"
- description: "Assign the specified name to the container. Must match `/?[a-zA-Z0-9_-]+`."
+ description: |
+ Assign the specified name to the container. Must match
+ `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`.
+ type: "string"
+ pattern: "^/?[a-zA-Z0-9][a-zA-Z0-9_.-]+$"
+ - name: "platform"
+ in: "query"
+ description: |
+ Platform in the format `os[/arch[/variant]]` used for image lookup.
+
+ When specified, the daemon checks if the requested image is present
+ in the local image cache with the given OS and Architecture, and
+ otherwise returns a `404` status.
+
+ If the option is not set, the host's native OS and Architecture are
+ used to look up the image in the image cache. However, if no platform
+ is passed and the given image does exist in the local image cache,
+ but its OS or architecture does not match, the container is created
+ with the available image, and a warning is added to the `Warnings`
+ field in the response, for example;
+
+ WARNING: The requested image's platform (linux/arm64/v8) does not
+ match the detected host platform (linux/amd64) and no
+ specific platform was requested
+
type: "string"
- pattern: "/?[a-zA-Z0-9_-]+"
+ default: ""
- name: "body"
in: "body"
description: "Container to create"
@@ -4367,14 +6290,7 @@ paths:
HostConfig:
$ref: "#/definitions/HostConfig"
NetworkingConfig:
- description: "This container's networking configuration."
- type: "object"
- properties:
- EndpointsConfig:
- description: "A mapping of network name to endpoint configuration for that network."
- type: "object"
- additionalProperties:
- $ref: "#/definitions/EndpointSettings"
+ $ref: "#/definitions/NetworkingConfig"
example:
Hostname: ""
Domainname: ""
@@ -4413,8 +6329,7 @@ paths:
Memory: 0
MemorySwap: 0
MemoryReservation: 0
- KernelMemory: 0
- NanoCPUs: 500000
+ NanoCpus: 500000
CpuPercent: 80
CpuShares: 512
CpuPeriod: 100000
@@ -4436,11 +6351,19 @@ paths:
- {}
BlkioDeviceWriteIOps:
- {}
+ DeviceRequests:
+ - Driver: "nvidia"
+ Count: -1
+ DeviceIDs": ["0", "1", "GPU-fef8089b-4820-abfc-e83e-94318197576e"]
+ Capabilities: [["gpu", "nvidia", "compute"]]
+ Options:
+ property1: "string"
+ property2: "string"
MemorySwappiness: 60
OomKillDisable: false
OomScoreAdj: 500
PidMode: ""
- PidsLimit: -1
+ PidsLimit: 0
PortBindings:
22/tcp:
- HostPort: "11022"
@@ -4499,36 +6422,18 @@ paths:
201:
description: "Container created successfully"
schema:
- type: "object"
- title: "ContainerCreateResponse"
- description: "OK response to ContainerCreate operation"
- required: [Id, Warnings]
- properties:
- Id:
- description: "The ID of the created container"
- type: "string"
- x-nullable: false
- Warnings:
- description: "Warnings encountered when creating the container"
- type: "array"
- x-nullable: false
- items:
- type: "string"
- examples:
- application/json:
- Id: "e90e34656806"
- Warnings: []
+ $ref: "#/definitions/ContainerCreateResponse"
400:
description: "bad parameter"
schema:
$ref: "#/definitions/ErrorResponse"
404:
- description: "no such container"
+ description: "no such image"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
- message: "No such container: c2ada9df5af8"
+ message: "No such image: c2ada9df5af8"
409:
description: "conflict"
schema:
@@ -4567,54 +6472,9 @@ paths:
items:
type: "string"
State:
- description: "The state of the container."
- type: "object"
- properties:
- Status:
- description: |
- The status of the container. For example, `"running"` or `"exited"`.
- type: "string"
- enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"]
- 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"
- Paused:
- description: "Whether this container is paused."
- type: "boolean"
- Restarting:
- description: "Whether this container is restarting."
- type: "boolean"
- OOMKilled:
- description: "Whether this container has been killed because it ran out of memory."
- type: "boolean"
- Dead:
- type: "boolean"
- Pid:
- description: "The process ID of this container"
- type: "integer"
- ExitCode:
- description: "The last exit code of this container"
- type: "integer"
- Error:
- type: "string"
- StartedAt:
- description: "The time when this container was last started."
- type: "string"
- FinishedAt:
- description: "The time when this container last exited."
- type: "string"
+ $ref: "#/definitions/ContainerState"
Image:
- description: "The container's image"
+ description: "The container's image ID"
type: "string"
ResolvConfPath:
type: "string"
@@ -4624,15 +6484,14 @@ paths:
type: "string"
LogPath:
type: "string"
- Node:
- description: "TODO"
- type: "object"
Name:
type: "string"
RestartCount:
type: "integer"
Driver:
type: "string"
+ Platform:
+ type: "string"
MountLabel:
type: "string"
ProcessLabel:
@@ -4640,13 +6499,19 @@ paths:
AppArmorProfile:
type: "string"
ExecIDs:
- type: "string"
+ description: "IDs of exec instances that are running in the container."
+ type: "array"
+ items:
+ type: "string"
+ x-nullable: true
HostConfig:
$ref: "#/definitions/HostConfig"
GraphDriver:
$ref: "#/definitions/GraphDriverData"
SizeRw:
- description: "The size of files that have been created or changed by this container."
+ description: |
+ The size of files that have been created or changed by this
+ container.
type: "integer"
format: "int64"
SizeRootFs:
@@ -4678,6 +6543,8 @@ paths:
Domainname: ""
Env:
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+ Healthcheck:
+ Test: ["CMD-SHELL", "exit 0"]
Hostname: "ba033ac44011"
Image: "ubuntu"
Labels:
@@ -4697,6 +6564,9 @@ paths:
StopTimeout: 10
Created: "2015-01-06T15:47:31.485331387Z"
Driver: "devicemapper"
+ ExecIDs:
+ - "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca"
+ - "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4"
HostConfig:
MaximumIOps: 0
MaximumIOBps: 0
@@ -4720,12 +6590,18 @@ paths:
CpuRealtimePeriod: 1000000
CpuRealtimeRuntime: 10000
Devices: []
+ DeviceRequests:
+ - Driver: "nvidia"
+ Count: -1
+ DeviceIDs": ["0", "1", "GPU-fef8089b-4820-abfc-e83e-94318197576e"]
+ Capabilities: [["gpu", "nvidia", "compute"]]
+ Options:
+ property1: "string"
+ property2: "string"
IpcMode: ""
- LxcConf: []
Memory: 0
MemorySwap: 0
MemoryReservation: 0
- KernelMemory: 0
OomKillDisable: false
OomScoreAdj: 500
NetworkMode: "bridge"
@@ -4786,6 +6662,14 @@ paths:
Error: ""
ExitCode: 9
FinishedAt: "2015-01-06T15:47:32.080254511Z"
+ Health:
+ Status: "healthy"
+ FailingStreak: 0
+ Log:
+ - Start: "2019-12-22T10:59:05.6385933Z"
+ End: "2019-12-22T10:59:05.8078452Z"
+ ExitCode: 0
+ Output: ""
OOMKilled: false
Dead: false
Paused: false
@@ -4828,7 +6712,9 @@ paths:
/containers/{id}/top:
get:
summary: "List processes running inside a container"
- description: "On Unix systems, this is done by running the `ps` command. This endpoint is not supported on Windows."
+ description: |
+ On Unix systems, this is done by running the `ps` command. This endpoint
+ is not supported on Windows.
operationId: "ContainerTop"
responses:
200:
@@ -4844,7 +6730,9 @@ paths:
items:
type: "string"
Processes:
- description: "Each process running in the container, where each is process is an array of values corresponding to the titles"
+ 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"
@@ -4909,18 +6797,22 @@ paths:
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"
+ Note: This endpoint works only for containers with the `json-file` or
+ `journald` logging driver.
+ produces:
+ - "application/vnd.docker.raw-stream"
+ - "application/vnd.docker.multiplexed-stream"
+ operationId: "ContainerLogs"
+ responses:
200:
- description: "logs returned as a string in response body"
+ description: |
+ logs returned as a stream in response body.
+ For the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach).
+ Note that unlike the attach endpoint, the logs endpoint does not
+ upgrade the connection and does not set Content-Type.
schema:
type: "string"
+ format: "binary"
404:
description: "no such container"
schema:
@@ -4940,10 +6832,7 @@ paths:
type: "string"
- name: "follow"
in: "query"
- description: |
- Return the logs as a stream.
-
- This will return a `101` HTTP response with a `Connection: upgrade` header, then hijack the HTTP connection to send raw output. For more information about hijacking and the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach).
+ description: "Keep connection after returning logs."
type: "boolean"
default: false
- name: "stdout"
@@ -4973,7 +6862,9 @@ paths:
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."
+ 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"]
@@ -4984,9 +6875,9 @@ paths:
Returns which files in a container's filesystem have been added, deleted,
or modified. The `Kind` of modification can be one of:
- - `0`: Modified
- - `1`: Added
- - `2`: Deleted
+ - `0`: Modified ("C")
+ - `1`: Added ("A")
+ - `2`: Deleted ("D")
operationId: "ContainerChanges"
produces: ["application/json"]
responses:
@@ -4995,22 +6886,7 @@ paths:
schema:
type: "array"
items:
- type: "object"
- x-go-name: "ContainerChangeResponseItem"
- title: "ContainerChangeResponseItem"
- description: "change item in response to ContainerChanges operation"
- required: [Path, Kind]
- properties:
- Path:
- description: "Path to file that has changed"
- type: "string"
- x-nullable: false
- Kind:
- description: "Kind of change"
- type: "integer"
- format: "uint8"
- enum: [0, 1, 2]
- x-nullable: false
+ $ref: "#/definitions/FilesystemChange"
examples:
application/json:
- Path: "/dev"
@@ -5072,13 +6948,29 @@ paths:
This endpoint returns a live stream of a container’s resource usage
statistics.
- The `precpu_stats` is the CPU statistic of last read, which is used
- for calculating the CPU usage percentage. It is not the same as the
- `cpu_stats` field.
+ 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.
+
+ On a cgroup v2 host, the following fields are not set
+ * `blkio_stats`: all fields other than `io_service_bytes_recursive`
+ * `cpu_stats`: `cpu_usage.percpu_usage`
+ * `memory_stats`: `max_usage` and `failcnt`
+ Also, `memory_stats.stats` fields are incompatible with cgroup v1.
+
+ To calculate the values shown by the `stats` command of the docker cli tool
+ the following formulas can be used:
+ * used_memory = `memory_stats.usage - memory_stats.stats.cache`
+ * available_memory = `memory_stats.limit`
+ * Memory usage % = `(used_memory / available_memory) * 100.0`
+ * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage`
+ * system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage`
+ * number_cpus = `lenght(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus`
+ * CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0`
operationId: "ContainerStats"
produces: ["application/json"]
responses:
@@ -5197,14 +7089,23 @@ paths:
type: "string"
- name: "stream"
in: "query"
- description: "Stream the output. If false, the stats will be output once and then it will disconnect."
+ description: |
+ Stream the output. If false, the stats will be output once and then
+ it will disconnect.
type: "boolean"
default: true
+ - name: "one-shot"
+ in: "query"
+ description: |
+ Only get a single stat instead of waiting for 2 cycles. Must be used
+ with `stream=false`.
+ type: "boolean"
+ default: false
tags: ["Container"]
/containers/{id}/resize:
post:
summary: "Resize a container TTY"
- description: "Resize the TTY for a container. You must restart the container for the resize to take effect."
+ description: "Resize the TTY for a container."
operationId: "ContainerResize"
consumes:
- "application/octet-stream"
@@ -5232,11 +7133,11 @@ paths:
type: "string"
- name: "h"
in: "query"
- description: "Height of the tty session in characters"
+ description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
- description: "Width of the tty session in characters"
+ description: "Width of the TTY session in characters"
type: "integer"
tags: ["Container"]
/containers/{id}/start:
@@ -5248,8 +7149,6 @@ paths:
description: "no error"
304:
description: "container already started"
- schema:
- $ref: "#/definitions/ErrorResponse"
404:
description: "no such container"
schema:
@@ -5269,7 +7168,10 @@ paths:
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 `_`."
+ 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"
tags: ["Container"]
/containers/{id}/stop:
@@ -5281,8 +7183,6 @@ paths:
description: "no error"
304:
description: "container already stopped"
- schema:
- $ref: "#/definitions/ErrorResponse"
404:
description: "no such container"
schema:
@@ -5300,6 +7200,11 @@ paths:
required: true
description: "ID or name of the container"
type: "string"
+ - name: "signal"
+ in: "query"
+ description: |
+ Signal to send to the container as an integer or string (e.g. `SIGINT`).
+ type: "string"
- name: "t"
in: "query"
description: "Number of seconds to wait before killing the container"
@@ -5329,6 +7234,11 @@ paths:
required: true
description: "ID or name of the container"
type: "string"
+ - name: "signal"
+ in: "query"
+ description: |
+ Signal to send to the container as an integer or string (e.g. `SIGINT`).
+ type: "string"
- name: "t"
in: "query"
description: "Number of seconds to wait before killing the container"
@@ -5337,7 +7247,9 @@ paths:
/containers/{id}/kill:
post:
summary: "Kill a container"
- description: "Send a POSIX signal to a container, defaulting to killing to the container."
+ description: |
+ Send a POSIX signal to a container, defaulting to killing to the
+ container.
operationId: "ContainerKill"
responses:
204:
@@ -5349,6 +7261,13 @@ paths:
examples:
application/json:
message: "No such container: c2ada9df5af8"
+ 409:
+ description: "container is not running"
+ schema:
+ $ref: "#/definitions/ErrorResponse"
+ examples:
+ application/json:
+ message: "Container d37cde0fe4ad63c3a7252023b2f9800282894247d145cb5933ddf6e52cc03a28 is not running"
500:
description: "server error"
schema:
@@ -5361,14 +7280,17 @@ paths:
type: "string"
- name: "signal"
in: "query"
- description: "Signal to send to the container as an integer or string (e.g. `SIGINT`)"
+ description: |
+ Signal to send to the container as an integer or string (e.g. `SIGINT`).
type: "string"
default: "SIGKILL"
tags: ["Container"]
/containers/{id}/update:
post:
summary: "Update a container"
- description: "Change various configuration options of a container without having to recreate it."
+ description: |
+ Change various configuration options of a container without having to
+ recreate it.
operationId: "ContainerUpdate"
consumes: ["application/json"]
produces: ["application/json"]
@@ -5423,7 +7345,6 @@ paths:
Memory: 314572800
MemorySwap: 514288000
MemoryReservation: 209715200
- KernelMemory: 52428800
RestartPolicy:
MaximumRetryCount: 4
Name: "on-failure"
@@ -5466,9 +7387,12 @@ paths:
post:
summary: "Pause a container"
description: |
- Use the cgroups freezer to suspend all processes in a container.
+ Use the freezer cgroup to suspend all processes in a container.
- Traditionally, when suspending a process the `SIGSTOP` signal is used, which is observable by the process being suspended. With the cgroups freezer the process is unaware, and unable to capture, that it is being suspended, and subsequently resumed.
+ Traditionally, when suspending a process the `SIGSTOP` signal is used,
+ which is observable by the process being suspended. With the freezer
+ cgroup the process is unaware, and unable to capture, that it is being
+ suspended, and subsequently resumed.
operationId: "ContainerPause"
responses:
204:
@@ -5521,15 +7445,20 @@ paths:
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.
+ 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.
+ Either the `stream` or `logs` parameter must be `true` for this endpoint
+ to do anything.
- See [the documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) for more details.
+ See the [documentation for the `docker attach` command](/engine/reference/commandline/attach/)
+ for more details.
### Hijacking
- This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, and `stderr` on the same socket.
+ 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:
@@ -5540,9 +7469,11 @@ paths:
[STREAM]
```
- After the headers and two new lines, the TCP connection can now be used for raw, bidirectional communication between the client and server.
+ 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 Docker client can also optionally send connection upgrade headers.
+ To hint potential proxies about connection hijacking, the Docker client
+ can also optionally send connection upgrade headers.
For example, the client sends this request to upgrade the connection:
@@ -5552,7 +7483,8 @@ paths:
Connection: Upgrade
```
- The Docker daemon will respond with a `101 UPGRADED` response, and will similarly follow with the raw stream:
+ The Docker daemon will respond with a `101 UPGRADED` response, and will
+ similarly follow with the raw stream:
```
HTTP/1.1 101 UPGRADED
@@ -5565,9 +7497,15 @@ paths:
### 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.
+ When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate),
+ the HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream
+ and 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`).
+ 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:
@@ -5581,9 +7519,11 @@ paths:
- 1: `stdout`
- 2: `stderr`
- `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size encoded as big endian.
+ `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`.
+ 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:
@@ -5595,11 +7535,15 @@ paths:
### 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`.
+ 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"
+ - "application/vnd.docker.multiplexed-stream"
responses:
101:
description: "no error, hints proxy about hijacking"
@@ -5628,21 +7572,28 @@ paths:
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 `_`."
+ 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.
+ 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.
+ 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"
+ description: |
+ Stream attached streams from the time the request was made onwards.
type: "boolean"
default: false
- name: "stdin"
@@ -5693,7 +7644,10 @@ paths:
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 `_`."
+ 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"
@@ -5731,22 +7685,11 @@ paths:
200:
description: "The container has exit."
schema:
- type: "object"
- title: "ContainerWaitResponse"
- description: "OK response to ContainerWait operation"
- required: [StatusCode]
- properties:
- StatusCode:
- description: "Exit code of the container"
- type: "integer"
- x-nullable: false
- Error:
- description: "container waiting error, if any"
- type: "object"
- properties:
- Message:
- description: "Details of an error"
- type: "string"
+ $ref: "#/definitions/ContainerWaitResponse"
+ 400:
+ description: "bad parameter"
+ schema:
+ $ref: "#/definitions/ErrorResponse"
404:
description: "no such container"
schema:
@@ -5766,8 +7709,15 @@ paths:
type: "string"
- name: "condition"
in: "query"
- description: "Wait until a container state reaches the given condition, either 'not-running' (default), 'next-exit', or 'removed'."
+ description: |
+ Wait until a container state reaches the given condition.
+
+ Defaults to `not-running` if omitted or empty.
type: "string"
+ enum:
+ - "not-running"
+ - "next-exit"
+ - "removed"
default: "not-running"
tags: ["Container"]
/containers/{id}:
@@ -5794,7 +7744,9 @@ paths:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
- message: "You cannot remove a running container: c2ada9df5af8. Stop the container before attempting removal or force remove"
+ message: |
+ You cannot remove a running container: c2ada9df5af8. Stop the
+ container before attempting removal or force remove
500:
description: "server error"
schema:
@@ -5807,7 +7759,7 @@ paths:
type: "string"
- name: "v"
in: "query"
- description: "Remove the volumes associated with the container."
+ description: "Remove anonymous volumes associated with the container."
type: "boolean"
default: false
- name: "force"
@@ -5824,7 +7776,10 @@ paths:
/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."
+ description: |
+ A response header `X-Docker-Container-Path-Stat` is returned, containing
+ a base64 - encoded JSON object with some filesystem header information
+ about the path.
operationId: "ContainerArchiveInfo"
responses:
200:
@@ -5832,18 +7787,13 @@ paths:
headers:
X-Docker-Container-Path-Stat:
type: "string"
- description: "TODO"
+ description: |
+ A base64 - encoded JSON object with some filesystem header
+ information about the path
400:
description: "Bad parameter"
schema:
- allOf:
- - $ref: "#/definitions/ErrorResponse"
- - type: "object"
- properties:
- message:
- description: "The error message. Either \"must specify path parameter\" (path cannot be empty) or \"not a directory\" (path was asserted to be a directory but exists as a file)."
- type: "string"
- x-nullable: false
+ $ref: "#/definitions/ErrorResponse"
404:
description: "Container or path does not exist"
schema:
@@ -5878,14 +7828,7 @@ paths:
400:
description: "Bad parameter"
schema:
- allOf:
- - $ref: "#/definitions/ErrorResponse"
- - type: "object"
- properties:
- message:
- description: "The error message. Either \"must specify path parameter\" (path cannot be empty) or \"not a directory\" (path was asserted to be a directory but exists as a file)."
- type: "string"
- x-nullable: false
+ $ref: "#/definitions/ErrorResponse"
404:
description: "Container or path does not exist"
schema:
@@ -5911,7 +7854,10 @@ paths:
tags: ["Container"]
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."
+ description: |
+ Upload a tar archive to be extracted to a path in the filesystem of container id.
+ `path` parameter is asserted to be a directory. If it exists as a file, 400 error
+ will be returned with message "not a directory".
operationId: "PutContainerArchive"
consumes: ["application/x-tar", "application/octet-stream"]
responses:
@@ -5921,6 +7867,9 @@ paths:
description: "Bad parameter"
schema:
$ref: "#/definitions/ErrorResponse"
+ examples:
+ application/json:
+ message: "not a directory"
403:
description: "Permission denied, the volume or container rootfs is marked as read-only."
schema:
@@ -5949,14 +7898,27 @@ paths:
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."
+ 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`, then it will copy UID/GID maps to the dest file or
+ dir
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."
+ description: |
+ The input stream must be a tar archive compressed with one of the
+ following algorithms: `identity` (no compression), `gzip`, `bzip2`,
+ or `xz`.
schema:
type: "string"
+ format: "binary"
tags: ["Container"]
/containers/prune:
post:
@@ -6009,35 +7971,6 @@ paths:
type: "array"
items:
$ref: "#/definitions/ImageSummary"
- 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:
description: "server error"
schema:
@@ -6051,7 +7984,10 @@ paths:
- name: "filters"
in: "query"
description: |
- A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:
+ A JSON encoded value of the filters (a `map[string][]string`) to
+ process on the images list.
+
+ Available filters:
- `before`=(`[:]`, `` or ``)
- `dangling=true`
@@ -6059,6 +7995,11 @@ paths:
- `reference`=(`[:]`)
- `since`=(`[:]`, `` or ``)
type: "string"
+ - name: "shared-size"
+ in: "query"
+ description: "Compute and show shared size as a `SharedSize` field on each image."
+ type: "boolean"
+ default: false
- name: "digests"
in: "query"
description: "Show digest information as a `RepoDigests` field on each image."
@@ -6071,7 +8012,7 @@ paths:
description: |
Build an image from a tar archive with a `Dockerfile` in it.
- The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/).
+ The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](/engine/reference/builder/).
The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output.
@@ -6159,7 +8100,18 @@ paths:
type: "integer"
- name: "buildargs"
in: "query"
- description: "JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values. [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg)"
+ description: >
+ JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker
+ uses the buildargs as the environment context for commands run via the `Dockerfile` RUN
+ instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for
+ passing secret values.
+
+
+ For example, the build arg `FOO=bar` would become `{"FOO":"bar"}` in JSON. This would result in the
+ query parameter `buildargs={"FOO":"bar"}`. Note that `{"FOO":"bar"}` should be URI component encoded.
+
+
+ [Read more about the buildargs instruction.](/engine/reference/builder/#arg)
type: "string"
- name: "shmsize"
in: "query"
@@ -6175,7 +8127,11 @@ paths:
type: "string"
- name: "networkmode"
in: "query"
- description: "Sets the networking mode for the run commands during build. Supported standard values are: `bridge`, `host`, `none`, and `container:`. Any other value is taken as a custom network's name to which this container should connect to."
+ description: |
+ Sets the networking mode for the run commands during build. Supported
+ standard values are: `bridge`, `host`, `none`, and `container:`.
+ Any other value is taken as a custom network's name or ID to which this
+ container should connect to.
type: "string"
- name: "Content-type"
in: "header"
@@ -6210,6 +8166,16 @@ paths:
description: "Platform in the format os[/arch[/variant]]"
type: "string"
default: ""
+ - name: "target"
+ in: "query"
+ description: "Target build stage"
+ type: "string"
+ default: ""
+ - name: "outputs"
+ in: "query"
+ description: "BuildKit output configuration"
+ type: "string"
+ default: ""
responses:
200:
description: "no error"
@@ -6228,6 +8194,33 @@ paths:
produces:
- "application/json"
operationId: "BuildPrune"
+ parameters:
+ - name: "keep-storage"
+ in: "query"
+ description: "Amount of disk space in bytes to keep for cache"
+ type: "integer"
+ format: "int64"
+ - name: "all"
+ in: "query"
+ type: "boolean"
+ description: "Remove all types of build cache"
+ - name: "filters"
+ in: "query"
+ type: "string"
+ description: |
+ A JSON encoded value of the filters (a `map[string][]string`) to
+ process on the list of build cache objects.
+
+ Available filters:
+
+ - `until=` remove cache older than ``. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time.
+ - `id=`
+ - `parent=`
+ - `type=`
+ - `description=`
+ - `inuse`
+ - `shared`
+ - `private`
responses:
200:
description: "No error"
@@ -6235,6 +8228,11 @@ paths:
type: "object"
title: "BuildPruneResponse"
properties:
+ CachesDeleted:
+ type: "array"
+ items:
+ description: "ID of build cache object"
+ type: "string"
SpaceReclaimed:
description: "Disk space reclaimed in bytes"
type: "integer"
@@ -6282,6 +8280,10 @@ paths:
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: "message"
+ in: "query"
+ description: "Set commit message for imported image."
+ type: "string"
- name: "inputImage"
in: "body"
description: "Image content if the value `-` has been specified in fromSrc query parameter"
@@ -6290,11 +8292,42 @@ paths:
required: false
- name: "X-Registry-Auth"
in: "header"
- description: "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)"
+ description: |
+ A base64url-encoded auth configuration.
+
+ Refer to the [authentication section](#section/Authentication) for
+ details.
type: "string"
+ - name: "changes"
+ in: "query"
+ description: |
+ Apply `Dockerfile` instructions to the image that is created,
+ for example: `changes=ENV DEBUG=true`.
+ Note that `ENV DEBUG=true` should be URI component encoded.
+
+ Supported `Dockerfile` instructions:
+ `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR`
+ type: "array"
+ items:
+ type: "string"
- name: "platform"
in: "query"
- description: "Platform in the format os[/arch[/variant]]"
+ description: |
+ Platform in the format os[/arch[/variant]].
+
+ When used in combination with the `fromImage` option, the daemon checks
+ if the given image is present in the local image cache with the given
+ OS and Architecture, and otherwise attempts to pull the image. If the
+ option is not set, the host's native OS and Architecture are used.
+ If the given image does not exist in the local image cache, the daemon
+ attempts to pull the image with the host's native OS and Architecture.
+ If the given image does exists in the local image cache, but its OS or
+ architecture does not match, a warning is produced.
+
+ When used with the `fromSrc` option to import an image from an archive,
+ this option sets the platform information for the imported image. If
+ the option is not set, the host's native OS and Architecture are used
+ for the imported image.
type: "string"
default: ""
tags: ["Image"]
@@ -6309,84 +8342,7 @@ paths:
200:
description: "No error"
schema:
- $ref: "#/definitions/Image"
- examples:
- application/json:
- Id: "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c"
- Container: "cb91e48a60d01f1e27028b4fc6819f4f290b3cf12496c8176ec714d0d390984a"
- Comment: ""
- Os: "linux"
- Architecture: "amd64"
- Parent: "sha256:91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c"
- ContainerConfig:
- Tty: false
- Hostname: "e611e15f9c9d"
- Domainname: ""
- AttachStdout: false
- PublishService: ""
- AttachStdin: false
- OpenStdin: false
- StdinOnce: false
- NetworkDisabled: false
- OnBuild: []
- Image: "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c"
- User: ""
- WorkingDir: ""
- MacAddress: ""
- AttachStderr: false
- Labels:
- com.example.license: "GPL"
- com.example.version: "1.0"
- com.example.vendor: "Acme"
- Env:
- - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
- Cmd:
- - "/bin/sh"
- - "-c"
- - "#(nop) LABEL com.example.vendor=Acme com.example.license=GPL com.example.version=1.0"
- DockerVersion: "1.9.0-dev"
- VirtualSize: 188359297
- Size: 0
- Author: ""
- Created: "2015-09-10T08:30:53.26995814Z"
- GraphDriver:
- Name: "aufs"
- Data: {}
- RepoDigests:
- - "localhost:5000/test/busybox/example@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf"
- RepoTags:
- - "example:1.0"
- - "example:latest"
- - "example:stable"
- Config:
- Image: "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c"
- NetworkDisabled: false
- OnBuild: []
- StdinOnce: false
- PublishService: ""
- AttachStdin: false
- OpenStdin: false
- Domainname: ""
- AttachStdout: false
- Tty: false
- Hostname: "e611e15f9c9d"
- Cmd:
- - "/bin/bash"
- Env:
- - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
- Labels:
- com.example.vendor: "Acme"
- com.example.version: "1.0"
- com.example.license: "GPL"
- MacAddress: ""
- AttachStderr: false
- WorkingDir: ""
- User: ""
- RootFS:
- Type: "layers"
- Layers:
- - "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6"
- - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef"
+ $ref: "#/definitions/ImageInspect"
404:
description: "No such image"
schema:
@@ -6489,7 +8445,9 @@ paths:
description: |
Push an image to a registry.
- If you wish to push an image on to a private registry, that image must already have a tag which references the registry. For example, `registry.example.com/myimage:latest`.
+ If you wish to push an image on to a private registry, that image must
+ already have a tag which references the registry. For example,
+ `registry.example.com/myimage:latest`.
The push is cancelled if the HTTP connection is closed.
operationId: "ImagePush"
@@ -6518,7 +8476,11 @@ paths:
type: "string"
- name: "X-Registry-Auth"
in: "header"
- description: "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)"
+ description: |
+ A base64url-encoded auth configuration.
+
+ Refer to the [authentication section](#section/Authentication) for
+ details.
type: "string"
required: true
tags: ["Image"]
@@ -6722,7 +8684,9 @@ paths:
/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."
+ description: |
+ Validate credentials for a registry and, if available, get an identity
+ token for accessing the registry without password.
operationId: "SystemAuth"
consumes: ["application/json"]
produces: ["application/json"]
@@ -6748,6 +8712,10 @@ paths:
IdentityToken: "9cbaf023786cd7..."
204:
description: "No error"
+ 401:
+ description: "Auth error"
+ schema:
+ $ref: "#/definitions/ErrorResponse"
500:
description: "Server error"
schema:
@@ -6785,63 +8753,7 @@ paths:
200:
description: "no error"
schema:
- type: "object"
- title: "SystemVersionResponse"
- properties:
- Platform:
- type: "object"
- required: [Name]
- properties:
- Name:
- type: "string"
- Components:
- type: "array"
- items:
- type: "object"
- x-go-name: ComponentVersion
- required: [Name, Version]
- properties:
- Name:
- type: "string"
- Version:
- type: "string"
- x-nullable: false
- Details:
- type: "object"
- x-nullable: true
-
- Version:
- type: "string"
- ApiVersion:
- type: "string"
- MinAPIVersion:
- type: "string"
- GitCommit:
- type: "string"
- GoVersion:
- type: "string"
- Os:
- type: "string"
- Arch:
- type: "string"
- KernelVersion:
- type: "string"
- Experimental:
- type: "boolean"
- BuildTime:
- type: "string"
- examples:
- application/json:
- Version: "17.04.0"
- Os: "linux"
- KernelVersion: "3.19.0-23-generic"
- GoVersion: "go1.7.5"
- GitCommit: "deadbee"
- Arch: "amd64"
- ApiVersion: "1.27"
- MinAPIVersion: "1.12"
- BuildTime: "2016-06-14T07:09:13.444803460+00:00"
- Experimental: true
+ $ref: "#/definitions/SystemVersion"
500:
description: "server error"
schema:
@@ -6863,9 +8775,81 @@ paths:
API-Version:
type: "string"
description: "Max API Version the server supports"
+ Builder-Version:
+ type: "string"
+ description: |
+ Default version of docker image builder
+
+ The default on Linux is version "2" (BuildKit), but the daemon
+ can be configured to recommend version "1" (classic Builder).
+ Windows does not yet support BuildKit for native Windows images,
+ and uses "1" (classic builder) as a default.
+
+ This value is a recommendation as advertised by the daemon, and
+ it is up to the client to choose which builder to use.
+ default: "2"
+ Docker-Experimental:
+ type: "boolean"
+ description: "If the server is running with experimental mode enabled"
+ Swarm:
+ type: "string"
+ enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"]
+ description: |
+ Contains information about Swarm status of the daemon,
+ and if the daemon is acting as a manager or worker node.
+ default: "inactive"
+ Cache-Control:
+ type: "string"
+ default: "no-cache, no-store, must-revalidate"
+ Pragma:
+ type: "string"
+ default: "no-cache"
+ 500:
+ description: "server error"
+ schema:
+ $ref: "#/definitions/ErrorResponse"
+ headers:
+ Cache-Control:
+ type: "string"
+ default: "no-cache, no-store, must-revalidate"
+ Pragma:
+ type: "string"
+ default: "no-cache"
+ tags: ["System"]
+ head:
+ summary: "Ping"
+ description: "This is a dummy endpoint you can use to test if the server is accessible."
+ operationId: "SystemPingHead"
+ produces: ["text/plain"]
+ responses:
+ 200:
+ description: "no error"
+ schema:
+ type: "string"
+ example: "(empty)"
+ headers:
+ API-Version:
+ type: "string"
+ description: "Max API Version the server supports"
+ Builder-Version:
+ type: "string"
+ description: "Default version of docker image builder"
Docker-Experimental:
type: "boolean"
description: "If the server is running with experimental mode enabled"
+ Swarm:
+ type: "string"
+ enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"]
+ description: |
+ Contains information about Swarm status of the daemon,
+ and if the daemon is acting as a manager or worker node.
+ default: "inactive"
+ Cache-Control:
+ type: "string"
+ default: "no-cache, no-store, must-revalidate"
+ Pragma:
+ type: "string"
+ default: "no-cache"
500:
description: "server error"
schema:
@@ -6939,13 +8923,13 @@ paths:
Various objects within Docker report events when something happens to them.
- Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, and `update`
+ Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune`
- Images report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, and `untag`
+ Images report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune`
- Volumes report these events: `create`, `mount`, `unmount`, and `destroy`
+ Volumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune`
- Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, and `remove`
+ Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune`
The Docker daemon reports these events: `reload`
@@ -6957,6 +8941,8 @@ paths:
Configs report these events: `create`, `update`, and `remove`
+ The Builder reports `prune` events
+
operationId: "SystemEvents"
produces:
- "application/json"
@@ -6964,44 +8950,7 @@ paths:
200:
description: "no error"
schema:
- type: "object"
- title: "SystemEventsResponse"
- 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
+ $ref: "#/definitions/EventMessage"
400:
description: "bad parameter"
schema:
@@ -7066,6 +9015,10 @@ paths:
type: "array"
items:
$ref: "#/definitions/Volume"
+ BuildCache:
+ type: "array"
+ items:
+ $ref: "#/definitions/BuildCache"
example:
LayersSize: 1092588
Images:
@@ -7125,10 +9078,43 @@ paths:
UsageData:
Size: 10920104
RefCount: 2
+ BuildCache:
+ -
+ ID: "hw53o5aio51xtltp5xjp8v7fx"
+ Parents: []
+ Type: "regular"
+ Description: "pulled from docker.io/library/debian@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0"
+ InUse: false
+ Shared: true
+ Size: 0
+ CreatedAt: "2021-06-28T13:31:01.474619385Z"
+ LastUsedAt: "2021-07-07T22:02:32.738075951Z"
+ UsageCount: 26
+ -
+ ID: "ndlpt0hhvkqcdfkputsk4cq9c"
+ Parents: ["ndlpt0hhvkqcdfkputsk4cq9c"]
+ Type: "regular"
+ Description: "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache"
+ InUse: false
+ Shared: true
+ Size: 51
+ CreatedAt: "2021-06-28T13:31:03.002625487Z"
+ LastUsedAt: "2021-07-07T22:02:32.773909517Z"
+ UsageCount: 26
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
+ parameters:
+ - name: "type"
+ in: "query"
+ description: |
+ Object types, for which to compute and return data.
+ type: "array"
+ collectionFormat: multi
+ items:
+ type: "string"
+ enum: ["container", "image", "volume", "build-cache"]
tags: ["System"]
/images/{name}/get:
get:
@@ -7181,11 +9167,16 @@ paths:
get:
summary: "Export several images"
description: |
- Get a tarball containing all images and metadata for several image repositories.
+ Get a tarball containing all images and metadata for several image
+ repositories.
- For each value of the `names` parameter: if it is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned; if it is an image ID, similarly only that image (and its parents) are returned and there would be no names referenced in the 'repositories' file for this image ID.
+ For each value of the `names` parameter: if it is a specific name and
+ tag (e.g. `ubuntu:latest`), then only that image (and its parents) are
+ returned; if it is an image ID, similarly only that image (and its parents)
+ are returned and there would be no names referenced in the 'repositories'
+ file for this image ID.
- For details on the format, see [the export image endpoint](#operation/ImageGet).
+ For details on the format, see the [export image endpoint](#operation/ImageGet).
operationId: "ImageGetAll"
produces:
- "application/x-tar"
@@ -7213,7 +9204,7 @@ paths:
description: |
Load a set of images and tags into a repository.
- For details on the format, see [the export image endpoint](#operation/ImageGet).
+ For details on the format, see the [export image endpoint](#operation/ImageGet).
operationId: "ImageLoad"
consumes:
- "application/x-tar"
@@ -7274,6 +9265,7 @@ paths:
description: "Exec configuration"
schema:
type: "object"
+ title: "ExecConfig"
properties:
AttachStdin:
type: "boolean"
@@ -7284,14 +9276,27 @@ paths:
AttachStderr:
type: "boolean"
description: "Attach to `stderr` of the exec command."
+ ConsoleSize:
+ type: "array"
+ description: "Initial console size, as an `[height, width]` array."
+ x-nullable: true
+ minItems: 2
+ maxItems: 2
+ items:
+ type: "integer"
+ minimum: 0
DetachKeys:
type: "string"
- 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 `_`."
+ 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 `_`.
Tty:
type: "boolean"
description: "Allocate a pseudo-TTY."
Env:
- description: "A list of environment variables in the form `[\"VAR=value\", ...]`."
+ description: |
+ A list of environment variables in the form `["VAR=value", ...]`.
type: "array"
items:
type: "string"
@@ -7306,10 +9311,14 @@ paths:
default: false
User:
type: "string"
- description: "The user, and optionally, group to run the exec process inside the container. Format is one of: `user`, `user:group`, `uid`, or `uid:gid`."
+ description: |
+ The user, and optionally, group to run the exec process inside
+ the container. Format is one of: `user`, `user:group`, `uid`,
+ or `uid:gid`.
WorkingDir:
type: "string"
- description: "The working directory for the exec process inside the container."
+ description: |
+ The working directory for the exec process inside the container.
example:
AttachStdin: false
AttachStdout: true
@@ -7331,12 +9340,16 @@ paths:
/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."
+ 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.docker.raw-stream"
+ - "application/vnd.docker.multiplexed-stream"
responses:
200:
description: "No error"
@@ -7353,6 +9366,7 @@ paths:
in: "body"
schema:
type: "object"
+ title: "ExecStartConfig"
properties:
Detach:
type: "boolean"
@@ -7360,9 +9374,19 @@ paths:
Tty:
type: "boolean"
description: "Allocate a pseudo-TTY."
+ ConsoleSize:
+ type: "array"
+ description: "Initial console size, as an `[height, width]` array."
+ x-nullable: true
+ minItems: 2
+ maxItems: 2
+ items:
+ type: "integer"
+ minimum: 0
example:
Detach: false
- Tty: false
+ Tty: true
+ ConsoleSize: [80, 64]
- name: "id"
in: "path"
description: "Exec instance ID"
@@ -7372,15 +9396,25 @@ paths:
/exec/{id}/resize:
post:
summary: "Resize an exec instance"
- description: "Resize the TTY session used by an exec instance. This endpoint only works if `tty` was specified as part of creating and starting the exec instance."
+ description: |
+ Resize the TTY session used by an exec instance. This endpoint only works
+ if `tty` was specified as part of creating and starting the exec instance.
operationId: "ExecResize"
responses:
- 201:
+ 200:
description: "No error"
+ 400:
+ description: "bad parameter"
+ schema:
+ $ref: "#/definitions/ErrorResponse"
404:
description: "No such exec instance"
schema:
$ref: "#/definitions/ErrorResponse"
+ 500:
+ description: "Server error"
+ schema:
+ $ref: "#/definitions/ErrorResponse"
parameters:
- name: "id"
in: "path"
@@ -7478,39 +9512,7 @@ paths:
200:
description: "Summary volume data that matches the query"
schema:
- type: "object"
- title: "VolumeListResponse"
- required: [Volumes, Warnings]
- properties:
- Volumes:
- type: "array"
- x-nullable: false
- description: "List of volumes"
- items:
- $ref: "#/definitions/Volume"
- Warnings:
- type: "array"
- x-nullable: false
- description: "Warnings that occurred when fetching the list of volumes"
- items:
- type: "string"
-
- examples:
- application/json:
- Volumes:
- - CreatedAt: "2017-07-19T12:00:26Z"
- Name: "tardis"
- Driver: "local"
- Mountpoint: "/var/lib/docker/volumes/tardis"
- Labels:
- com.example.some-label: "some-value"
- com.example.some-other-label: "some-other-value"
- Scope: "local"
- Options:
- device: "tmpfs"
- o: "size=100m,uid=1000"
- type: "tmpfs"
- Warnings: []
+ $ref: "#/definitions/VolumeListResponse"
500:
description: "Server error"
schema:
@@ -7555,33 +9557,7 @@ paths:
required: true
description: "Volume configuration"
schema:
- type: "object"
- properties:
- Name:
- description: "The new volume's name. If not specified, Docker 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"
+ $ref: "#/definitions/VolumeCreateOptions"
tags: ["Volume"]
/volumes/{name}:
@@ -7610,6 +9586,64 @@ paths:
type: "string"
tags: ["Volume"]
+ put:
+ summary: |
+ "Update a volume. Valid only for Swarm cluster volumes"
+ operationId: "VolumeUpdate"
+ consumes: ["application/json"]
+ produces: ["application/json"]
+ responses:
+ 200:
+ description: "no error"
+ 400:
+ description: "bad parameter"
+ schema:
+ $ref: "#/definitions/ErrorResponse"
+ 404:
+ description: "no such volume"
+ schema:
+ $ref: "#/definitions/ErrorResponse"
+ 500:
+ description: "server error"
+ schema:
+ $ref: "#/definitions/ErrorResponse"
+ 503:
+ description: "node is not part of a swarm"
+ schema:
+ $ref: "#/definitions/ErrorResponse"
+ parameters:
+ - name: "name"
+ in: "path"
+ description: "The name or ID of the volume"
+ type: "string"
+ required: true
+ - name: "body"
+ in: "body"
+ schema:
+ # though the schema for is an object that contains only a
+ # ClusterVolumeSpec, wrapping the ClusterVolumeSpec in this object
+ # means that if, later on, we support things like changing the
+ # labels, we can do so without duplicating that information to the
+ # ClusterVolumeSpec.
+ type: "object"
+ description: "Volume configuration"
+ properties:
+ Spec:
+ $ref: "#/definitions/ClusterVolumeSpec"
+ description: |
+ The spec of the volume to update. Currently, only Availability may
+ change. All other fields must remain unchanged.
+ - name: "version"
+ in: "query"
+ description: |
+ The version number of the volume being updated. This is required to
+ avoid conflicting writes. Found in the volume's `ClusterVolume`
+ field.
+ type: "integer"
+ format: "int64"
+ required: true
+ tags: ["Volume"]
+
delete:
summary: "Remove a volume"
description: "Instruct the driver to remove the volume."
@@ -7641,6 +9675,7 @@ paths:
type: "boolean"
default: false
tags: ["Volume"]
+
/volumes/prune:
post:
summary: "Delete unused volumes"
@@ -7655,6 +9690,7 @@ paths:
Available filters:
- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels.
+ - `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes.
type: "string"
responses:
200:
@@ -7681,10 +9717,12 @@ paths:
get:
summary: "List networks"
description: |
- Returns a list of networks. For details on the format, see [the network inspect endpoint](#operation/NetworkInspect).
+ Returns a list of networks. For details on the format, see the
+ [network inspect endpoint](#operation/NetworkInspect).
- Note that it uses a different, smaller representation of a network than inspecting a single network. For example,
- the list of containers attached to the network is not propagated in API versions 1.28 and up.
+ Note that it uses a different, smaller representation of a network than
+ inspecting a single network. For example, the list of containers attached
+ to the network is not propagated in API versions 1.28 and up.
operationId: "NetworkList"
produces:
- "application/json"
@@ -7754,8 +9792,15 @@ paths:
- name: "filters"
in: "query"
description: |
- JSON encoded value of the filters (a `map[string][]string`) to process on the networks list. Available filters:
+ JSON encoded value of the filters (a `map[string][]string`) to process
+ on the networks list.
+
+ Available filters:
+ - `dangling=` When set to `true` (or `1`), returns all
+ networks that are not in use by a container. When set to `false`
+ (or `0`), only networks that are in use by one or more
+ containers are returned.
- `driver=` Matches a network's driver.
- `id=` Matches all or part of a network ID.
- `label=` or `label==` of a network label.
@@ -7869,13 +9914,21 @@ paths:
required: true
schema:
type: "object"
+ title: "NetworkCreateRequest"
required: ["Name"]
properties:
Name:
description: "The network's name."
type: "string"
CheckDuplicate:
- description: "Check for networks with duplicate names. Since Network is primarily keyed based on a random ID and not on the name, and network name is strictly a user-friendly alias to the network which is uniquely identified using ID, there is no guaranteed way to check for duplicates. CheckDuplicate is there to provide a best effort checking of any networks which has the same name but it is not guaranteed to catch all name collisions."
+ description: |
+ Check for networks with duplicate names. Since Network is
+ primarily keyed based on a random ID and not on the name, and
+ network name is strictly a user-friendly alias to the network
+ which is uniquely identified using ID, there is no guaranteed
+ way to check for duplicates. CheckDuplicate is there to provide
+ a best effort checking of any networks which has the same name
+ but it is not guaranteed to catch all name collisions.
type: "boolean"
Driver:
description: "Name of the network driver plugin to use."
@@ -7885,10 +9938,14 @@ paths:
description: "Restrict external access to the network."
type: "boolean"
Attachable:
- description: "Globally scoped network is manually attachable by regular containers from workers in swarm mode."
+ description: |
+ Globally scoped network is manually attachable by regular
+ containers from workers in swarm mode.
type: "boolean"
Ingress:
- description: "Ingress network is the network which provides the routing-mesh in swarm mode."
+ description: |
+ Ingress network is the network which provides the routing-mesh
+ in swarm mode.
type: "boolean"
IPAM:
description: "Optional custom IP scheme for the network."
@@ -7968,6 +10025,7 @@ paths:
required: true
schema:
type: "object"
+ title: "NetworkConnectRequest"
properties:
Container:
type: "string"
@@ -8014,13 +10072,16 @@ paths:
required: true
schema:
type: "object"
+ title: "NetworkDisconnectRequest"
properties:
Container:
type: "string"
- description: "The ID or name of the container to disconnect from the network."
+ 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."
+ description: |
+ Force the container to disconnect from the network.
tags: ["Network"]
/networks/prune:
post:
@@ -8077,7 +10138,10 @@ paths:
in: "query"
type: "string"
description: |
- A JSON encoded value of the filters (a `map[string][]string`) to process on the plugin list. Available filters:
+ A JSON encoded value of the filters (a `map[string][]string`) to
+ process on the plugin list.
+
+ Available filters:
- `capability=`
- `enable=|`
@@ -8093,18 +10157,7 @@ paths:
schema:
type: "array"
items:
- description: "Describes a permission the user has to accept upon installing the plugin."
- type: "object"
- title: "PluginPrivilegeItem"
- properties:
- Name:
- type: "string"
- Description:
- type: "string"
- Value:
- type: "array"
- items:
- type: "string"
+ $ref: "#/definitions/PluginPrivilege"
example:
- Name: "network"
Description: ""
@@ -8125,7 +10178,9 @@ paths:
parameters:
- name: "remote"
in: "query"
- description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted."
+ description: |
+ The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
required: true
type: "string"
tags:
@@ -8136,7 +10191,8 @@ paths:
summary: "Install a plugin"
operationId: "PluginPull"
description: |
- Pulls and installs a plugin. After the plugin is installed, it can be enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable).
+ Pulls and installs a plugin. After the plugin is installed, it can be
+ enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable).
produces:
- "application/json"
responses:
@@ -8165,24 +10221,19 @@ paths:
type: "string"
- name: "X-Registry-Auth"
in: "header"
- description: "A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)"
+ description: |
+ A base64url-encoded auth configuration to use when pulling a plugin
+ from a registry.
+
+ Refer to the [authentication section](#section/Authentication) for
+ details.
type: "string"
- name: "body"
in: "body"
schema:
type: "array"
items:
- description: "Describes a permission accepted by the user upon installing the plugin."
- type: "object"
- properties:
- Name:
- type: "string"
- Description:
- type: "string"
- Value:
- type: "array"
- items:
- type: "string"
+ $ref: "#/definitions/PluginPrivilege"
example:
- Name: "network"
Description: ""
@@ -8217,7 +10268,9 @@ paths:
parameters:
- name: "name"
in: "path"
- description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted."
+ description: |
+ The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
required: true
type: "string"
tags: ["Plugin"]
@@ -8241,12 +10294,16 @@ paths:
parameters:
- name: "name"
in: "path"
- description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted."
+ description: |
+ The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
required: true
type: "string"
- name: "force"
in: "query"
- description: "Disable the plugin before removing. This may result in issues if the plugin is in use by a container."
+ description: |
+ Disable the plugin before removing. This may result in issues if the
+ plugin is in use by a container.
type: "boolean"
default: false
tags: ["Plugin"]
@@ -8268,7 +10325,9 @@ paths:
parameters:
- name: "name"
in: "path"
- description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted."
+ description: |
+ The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
required: true
type: "string"
- name: "timeout"
@@ -8295,9 +10354,17 @@ paths:
parameters:
- name: "name"
in: "path"
- description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted."
+ description: |
+ The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
required: true
type: "string"
+ - name: "force"
+ in: "query"
+ description: |
+ Force disable a plugin even if still in use.
+ required: false
+ type: "boolean"
tags: ["Plugin"]
/plugins/{name}/upgrade:
post:
@@ -8317,7 +10384,9 @@ paths:
parameters:
- name: "name"
in: "path"
- description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted."
+ description: |
+ The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
required: true
type: "string"
- name: "remote"
@@ -8330,24 +10399,19 @@ paths:
type: "string"
- name: "X-Registry-Auth"
in: "header"
- description: "A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)"
+ description: |
+ A base64url-encoded auth configuration to use when pulling a plugin
+ from a registry.
+
+ Refer to the [authentication section](#section/Authentication) for
+ details.
type: "string"
- name: "body"
in: "body"
schema:
type: "array"
items:
- description: "Describes a permission accepted by the user upon installing the plugin."
- type: "object"
- properties:
- Name:
- type: "string"
- Description:
- type: "string"
- Value:
- type: "array"
- items:
- type: "string"
+ $ref: "#/definitions/PluginPrivilege"
example:
- Name: "network"
Description: ""
@@ -8378,7 +10442,9 @@ paths:
parameters:
- name: "name"
in: "query"
- description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted."
+ description: |
+ The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
required: true
type: "string"
- name: "tarContext"
@@ -8397,7 +10463,9 @@ paths:
parameters:
- name: "name"
in: "path"
- description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted."
+ description: |
+ The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
required: true
type: "string"
responses:
@@ -8421,7 +10489,9 @@ paths:
parameters:
- name: "name"
in: "path"
- description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted."
+ description: |
+ The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
required: true
type: "string"
- name: "body"
@@ -8473,6 +10543,7 @@ paths:
- `label=`
- `membership=`(`accepted`|`pending`)`
- `name=`
+ - `node.label=`
- `role=`(`manager`|`worker`)`
type: "string"
tags: ["Node"]
@@ -8569,7 +10640,9 @@ paths:
$ref: "#/definitions/NodeSpec"
- name: "version"
in: "query"
- description: "The version number of the node object being updated. This is required to avoid conflicting writes."
+ description: |
+ The version number of the node object being updated. This is required
+ to avoid conflicting writes.
type: "integer"
format: "int64"
required: true
@@ -8628,31 +10701,71 @@ paths:
required: true
schema:
type: "object"
+ title: "SwarmInitRequest"
properties:
ListenAddr:
- description: "Listen address used for inter-manager communication, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP). This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the default swarm listening port is used."
+ description: |
+ Listen address used for inter-manager communication, as well
+ as determining the networking interface used for the VXLAN
+ Tunnel Endpoint (VTEP). This can either be an address/port
+ combination in the form `192.168.1.1:4567`, or an interface
+ followed by a port number, like `eth0:4567`. If the port number
+ is omitted, the default swarm listening port is used.
type: "string"
AdvertiseAddr:
- description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible."
+ description: |
+ Externally reachable address advertised to other nodes. This
+ can either be an address/port combination in the form
+ `192.168.1.1:4567`, or an interface followed by a port number,
+ like `eth0:4567`. If the port number is omitted, the port
+ number from the listen address is used. If `AdvertiseAddr` is
+ not specified, it will be automatically detected when possible.
type: "string"
DataPathAddr:
description: |
- Address or interface to use for data path traffic (format: ``), for example, `192.168.1.1`,
- or an interface, like `eth0`. If `DataPathAddr` is unspecified, the same address as `AdvertiseAddr`
- is used.
-
- The `DataPathAddr` specifies the address that global scope network drivers will publish towards other
- nodes in order to reach the containers running on this node. Using this parameter it is possible to
- separate the container data traffic from the management traffic of the cluster.
+ Address or interface to use for data path traffic (format:
+ ``), for example, `192.168.1.1`, or an interface,
+ like `eth0`. If `DataPathAddr` is unspecified, the same address
+ as `AdvertiseAddr` is used.
+
+ The `DataPathAddr` specifies the address that global scope
+ network drivers will publish towards other nodes in order to
+ reach the containers running on this node. Using this parameter
+ it is possible to separate the container data traffic from the
+ management traffic of the cluster.
type: "string"
+ DataPathPort:
+ description: |
+ DataPathPort specifies the data path port number for data traffic.
+ Acceptable port range is 1024 to 49151.
+ if no port is set or is set to 0, default port 4789 will be used.
+ type: "integer"
+ format: "uint32"
+ DefaultAddrPool:
+ description: |
+ Default Address Pool specifies default subnet pools for global
+ scope networks.
+ type: "array"
+ items:
+ type: "string"
+ example: ["10.10.0.0/16", "20.20.0.0/16"]
ForceNewCluster:
description: "Force creation of a new swarm."
type: "boolean"
+ SubnetSize:
+ description: |
+ SubnetSize specifies the subnet size of the networks created
+ from the default subnet pool.
+ type: "integer"
+ format: "uint32"
Spec:
$ref: "#/definitions/SwarmSpec"
example:
ListenAddr: "0.0.0.0:2377"
AdvertiseAddr: "192.168.1.1:2377"
+ DataPathPort: 4789
+ DefaultAddrPool: ["10.10.0.0/8", "20.20.0.0/8"]
+ SubnetSize: 24
ForceNewCluster: false
Spec:
Orchestration: {}
@@ -8687,27 +10800,43 @@ paths:
required: true
schema:
type: "object"
+ title: "SwarmJoinRequest"
properties:
ListenAddr:
- description: "Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)."
+ description: |
+ Listen address used for inter-manager communication if the node
+ gets promoted to manager, as well as determining the networking
+ interface used for the VXLAN Tunnel Endpoint (VTEP).
type: "string"
AdvertiseAddr:
- description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible."
+ description: |
+ Externally reachable address advertised to other nodes. This
+ can either be an address/port combination in the form
+ `192.168.1.1:4567`, or an interface followed by a port number,
+ like `eth0:4567`. If the port number is omitted, the port
+ number from the listen address is used. If `AdvertiseAddr` is
+ not specified, it will be automatically detected when possible.
type: "string"
DataPathAddr:
description: |
- Address or interface to use for data path traffic (format: ``), for example, `192.168.1.1`,
- or an interface, like `eth0`. If `DataPathAddr` is unspecified, the same address as `AdvertiseAddr`
- is used.
+ Address or interface to use for data path traffic (format:
+ ``), for example, `192.168.1.1`, or an interface,
+ like `eth0`. If `DataPathAddr` is unspecified, the same address
+ as `AdvertiseAddr` is used.
- The `DataPathAddr` specifies the address that global scope network drivers will publish towards other
- nodes in order to reach the containers running on this node. Using this parameter it is possible to
- separate the container data traffic from the management traffic of the cluster.
+ The `DataPathAddr` specifies the address that global scope
+ network drivers will publish towards other nodes in order to
+ reach the containers running on this node. Using this parameter
+ it is possible to separate the container data traffic from the
+ management traffic of the cluster.
type: "string"
RemoteAddrs:
- description: "Addresses of manager nodes already participating in the swarm."
- type: "string"
+ description: |
+ Addresses of manager nodes already participating in the swarm.
+ type: "array"
+ items:
+ type: "string"
JoinToken:
description: "Secret token for joining this swarm."
type: "string"
@@ -8735,7 +10864,9 @@ paths:
$ref: "#/definitions/ErrorResponse"
parameters:
- name: "force"
- description: "Force leave swarm, even if this is the last manager or that it will break the cluster."
+ description: |
+ Force leave swarm, even if this is the last manager or that it will
+ break the cluster.
in: "query"
type: "boolean"
default: false
@@ -8767,7 +10898,9 @@ paths:
$ref: "#/definitions/SwarmSpec"
- name: "version"
in: "query"
- description: "The version number of the swarm object being updated. This is required to avoid conflicting writes."
+ description: |
+ The version number of the swarm object being updated. This is
+ required to avoid conflicting writes.
type: "integer"
format: "int64"
required: true
@@ -8828,6 +10961,7 @@ paths:
required: true
schema:
type: "object"
+ title: "SwarmUnlockRequest"
properties:
UnlockKey:
description: "The swarm's unlock key."
@@ -8870,12 +11004,20 @@ paths:
in: "query"
type: "string"
description: |
- A JSON encoded value of the filters (a `map[string][]string`) to process on the services list. Available filters:
+ A JSON encoded value of the filters (a `map[string][]string`) to
+ process on the services list.
+
+ Available filters:
- `id=`
- `label=`
- `mode=["replicated"|"global"]`
- `name=`
+ - name: "status"
+ in: "query"
+ type: "boolean"
+ description: |
+ Include service status, with count of running and desired tasks.
tags: ["Service"]
/services/create:
post:
@@ -8998,7 +11140,12 @@ paths:
foo: "bar"
- name: "X-Registry-Auth"
in: "header"
- description: "A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)"
+ description: |
+ A base64url-encoded auth configuration for pulling from private
+ registries.
+
+ Refer to the [authentication section](#section/Authentication) for
+ details.
type: "string"
tags: ["Service"]
/services/{id}:
@@ -9134,21 +11281,37 @@ paths:
- name: "version"
in: "query"
- description: "The version number of the service object being updated. This is required to avoid conflicting writes."
+ description: |
+ The version number of the service object being updated. This is
+ required to avoid conflicting writes.
+ This version number should be the value as currently set on the
+ service *before* the update. You can find the current version by
+ calling `GET /services/{id}`
required: true
type: "integer"
- name: "registryAuthFrom"
in: "query"
+ description: |
+ If the `X-Registry-Auth` header is not specified, this parameter
+ indicates where to find registry authorization credentials.
type: "string"
- description: "If the X-Registry-Auth header is not specified, this parameter indicates where to find registry authorization credentials. The valid values are `spec` and `previous-spec`."
+ enum: ["spec", "previous-spec"]
default: "spec"
- name: "rollback"
in: "query"
+ description: |
+ Set to this parameter to `previous` to cause a server-side rollback
+ to the previous service spec. The supplied spec will be ignored in
+ this case.
type: "string"
- description: "Set to this parameter to `previous` to cause a server-side rollback to the previous service spec. The supplied spec will be ignored in this case."
- name: "X-Registry-Auth"
in: "header"
- description: "A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)"
+ description: |
+ A base64url-encoded auth configuration for pulling from private
+ registries.
+
+ Refer to the [authentication section](#section/Authentication) for
+ details.
type: "string"
tags: ["Service"]
@@ -9156,23 +11319,21 @@ paths:
get:
summary: "Get service logs"
description: |
- Get `stdout` and `stderr` logs from a service.
+ Get `stdout` and `stderr` logs from a service. See also
+ [`/containers/{id}/logs`](#operation/ContainerLogs).
- **Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers.
- operationId: "ServiceLogs"
+ **Note**: This endpoint works only for services with the `local`,
+ `json-file` or `journald` logging drivers.
produces:
- "application/vnd.docker.raw-stream"
- - "application/json"
+ - "application/vnd.docker.multiplexed-stream"
+ operationId: "ServiceLogs"
responses:
- 101:
- description: "logs returned as a stream"
- schema:
- type: "string"
- format: "binary"
200:
- description: "logs returned as a string in response body"
+ description: "logs returned as a stream in response body"
schema:
type: "string"
+ format: "binary"
404:
description: "no such service"
schema:
@@ -9201,10 +11362,7 @@ paths:
default: false
- name: "follow"
in: "query"
- description: |
- Return the logs as a stream.
-
- This will return a `101` HTTP response with a `Connection: upgrade` header, then hijack the HTTP connection to send raw output. For more information about hijacking and the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach).
+ description: "Keep connection after returning logs."
type: "boolean"
default: false
- name: "stdout"
@@ -9229,7 +11387,9 @@ paths:
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."
+ 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: ["Service"]
@@ -9370,7 +11530,10 @@ paths:
in: "query"
type: "string"
description: |
- A JSON encoded value of the filters (a `map[string][]string`) to process on the tasks list. Available filters:
+ A JSON encoded value of the filters (a `map[string][]string`) to
+ process on the tasks list.
+
+ Available filters:
- `desired-state=(running | shutdown | accepted)`
- `id=`
@@ -9414,22 +11577,20 @@ paths:
summary: "Get task logs"
description: |
Get `stdout` and `stderr` logs from a task.
+ See also [`/containers/{id}/logs`](#operation/ContainerLogs).
- **Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers.
+ **Note**: This endpoint works only for services with the `local`,
+ `json-file` or `journald` logging drivers.
operationId: "TaskLogs"
produces:
- "application/vnd.docker.raw-stream"
- - "application/json"
+ - "application/vnd.docker.multiplexed-stream"
responses:
- 101:
- description: "logs returned as a stream"
- schema:
- type: "string"
- format: "binary"
200:
- description: "logs returned as a string in response body"
+ description: "logs returned as a stream in response body"
schema:
type: "string"
+ format: "binary"
404:
description: "no such task"
schema:
@@ -9458,10 +11619,7 @@ paths:
default: false
- name: "follow"
in: "query"
- description: |
- Return the logs as a stream.
-
- This will return a `101` HTTP response with a `Connection: upgrade` header, then hijack the HTTP connection to send raw output. For more information about hijacking and the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach).
+ description: "Keep connection after returning logs."
type: "boolean"
default: false
- name: "stdout"
@@ -9486,9 +11644,12 @@ paths:
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."
+ 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: ["Task"]
/secrets:
get:
summary: "List secrets"
@@ -9539,7 +11700,10 @@ paths:
in: "query"
type: "string"
description: |
- A JSON encoded value of the filters (a `map[string][]string`) to process on the secrets list. Available filters:
+ A JSON encoded value of the filters (a `map[string][]string`) to
+ process on the secrets list.
+
+ Available filters:
- `id=`
- `label= or label==value`
@@ -9696,10 +11860,15 @@ paths:
in: "body"
schema:
$ref: "#/definitions/SecretSpec"
- description: "The spec of the secret to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the [SecretInspect endpoint](#operation/SecretInspect) response values."
+ description: |
+ The spec of the secret to update. Currently, only the Labels field
+ can be updated. All other fields must remain unchanged from the
+ [SecretInspect endpoint](#operation/SecretInspect) response values.
- name: "version"
in: "query"
- description: "The version number of the secret object being updated. This is required to avoid conflicting writes."
+ description: |
+ The version number of the secret object being updated. This is
+ required to avoid conflicting writes.
type: "integer"
format: "int64"
required: true
@@ -9738,7 +11907,10 @@ paths:
in: "query"
type: "string"
description: |
- A JSON encoded value of the filters (a `map[string][]string`) to process on the configs list. Available filters:
+ A JSON encoded value of the filters (a `map[string][]string`) to
+ process on the configs list.
+
+ Available filters:
- `id=`
- `label= or label==value`
@@ -9882,10 +12054,15 @@ paths:
in: "body"
schema:
$ref: "#/definitions/ConfigSpec"
- description: "The spec of the config to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the [ConfigInspect endpoint](#operation/ConfigInspect) response values."
+ description: |
+ The spec of the config to update. Currently, only the Labels field
+ can be updated. All other fields must remain unchanged from the
+ [ConfigInspect endpoint](#operation/ConfigInspect) response values.
- name: "version"
in: "query"
- description: "The version number of the config object being updated. This is required to avoid conflicting writes."
+ description: |
+ The version number of the config object being updated. This is
+ required to avoid conflicting writes.
type: "integer"
format: "int64"
required: true
@@ -9893,7 +12070,8 @@ paths:
/distribution/{name}/json:
get:
summary: "Get image information from the registry"
- description: "Return image digest and platform information by contacting the registry."
+ description: |
+ Return image digest and platform information by contacting the registry.
operationId: "DistributionInspect"
produces:
- "application/json"
@@ -9901,65 +12079,7 @@ paths:
200:
description: "descriptor and platform information"
schema:
- type: "object"
- x-go-name: DistributionInspect
- title: "DistributionInspectResponse"
- required: [Descriptor, Platforms]
- properties:
- Descriptor:
- type: "object"
- description: "A descriptor struct containing digest, media type, and size"
- properties:
- MediaType:
- type: "string"
- Size:
- type: "integer"
- format: "int64"
- Digest:
- type: "string"
- URLs:
- type: "array"
- items:
- type: "string"
- Platforms:
- type: "array"
- description: "An array containing all platforms supported by the image"
- items:
- type: "object"
- properties:
- Architecture:
- type: "string"
- OS:
- type: "string"
- OSVersion:
- type: "string"
- OSFeatures:
- type: "array"
- items:
- type: "string"
- Variant:
- type: "string"
- Features:
- type: "array"
- items:
- type: "string"
- examples:
- application/json:
- Descriptor:
- MediaType: "application/vnd.docker.distribution.manifest.v2+json"
- Digest: "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96"
- Size: 3987495
- URLs:
- - ""
- Platforms:
- - Architecture: "amd64"
- OS: "linux"
- OSVersion: ""
- OSFeatures:
- - ""
- Variant: ""
- Features:
- - ""
+ $ref: "#/definitions/DistributionInspect"
401:
description: "Failed authentication or no image found"
schema:
@@ -9982,14 +12102,13 @@ paths:
post:
summary: "Initialize interactive session"
description: |
- Start a new interactive session with a server. Session allows server to call back to the client for advanced capabilities.
-
- > **Note**: This endpoint is *experimental* and only available if the daemon is started with experimental
- > features enabled. The specifications for this endpoint may still change in a future version of the API.
+ Start a new interactive session with a server. Session allows server to
+ call back to the client for advanced capabilities.
### Hijacking
- This endpoint hijacks the HTTP connection to HTTP2 transport that allows the client to expose gPRC services on that connection.
+ This endpoint hijacks the HTTP connection to HTTP2 transport that allows
+ the client to expose gPRC services on that connection.
For example, the client sends this request to upgrade the connection:
@@ -9999,7 +12118,8 @@ paths:
Connection: Upgrade
```
- The Docker daemon will respond with a `101 UPGRADED` response follow with the raw stream:
+ The Docker daemon responds with a `101 UPGRADED` response follow with
+ the raw stream:
```
HTTP/1.1 101 UPGRADED
@@ -10020,4 +12140,4 @@ paths:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
- tags: ["Session (experimental)"]
+ tags: ["Session"]
diff --git a/src/Client.php b/src/Client.php
index 322a543a..be97b2ea 100644
--- a/src/Client.php
+++ b/src/Client.php
@@ -1,166 +1,187 @@
executePsr7Endpoint(new \Docker\API\Endpoint\ContainerList($queryParameters), $fetch);
- }
-
- /**
- * @param \Docker\API\Model\ContainersCreatePostBody $body Container to create
- * @param array $queryParameters {
- *
- * @var string $name Assign the specified name to the container. Must match `/?[a-zA-Z0-9_-]+`.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerCreateBadRequestException
- * @throws \Docker\API\Exception\ContainerCreateNotFoundException
- * @throws \Docker\API\Exception\ContainerCreateConflictException
- * @throws \Docker\API\Exception\ContainerCreateInternalServerErrorException
- *
- * @return null|\Docker\API\Model\ContainersCreatePostResponse201|\Psr\Http\Message\ResponseInterface
- */
- public function containerCreate(\Docker\API\Model\ContainersCreatePostBody $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerCreate($body, $queryParameters), $fetch);
+ * Returns a list of containers. For details on the format, see the
+ [inspect endpoint](#operation/ContainerInspect).
+
+ Note that it uses a different, smaller representation of a container
+ than inspecting a single container. For example, the list of linked
+ containers is not propagated .
+
+ *
+ * @param array $queryParameters {
+ * @var bool $all Return all containers. By default, only running containers are shown.
+
+ * @var int $limit Return this number of most recently created containers, including
+ non-running ones.
+
+ * @var bool $size Return the size of container as fields `SizeRw` and `SizeRootFs`.
+
+ * @var string $filters Filters to process on the container list, encoded as JSON (a
+ `map[string][]string`). For example, `{"status": ["paused"]}` will
+ only return paused containers.
+
+ Available filters:
+
+ - `ancestor`=(`[:]`, ``, or ``)
+ - `before`=(`` or ``)
+ - `expose`=(`[/]`|`/[]`)
+ - `exited=` containers with exit code of ``
+ - `health`=(`starting`|`healthy`|`unhealthy`|`none`)
+ - `id=` a container's ID
+ - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only)
+ - `is-task=`(`true`|`false`)
+ - `label=key` or `label="key=value"` of a container label
+ - `name=` a container's name
+ - `network`=(`` or ``)
+ - `publish`=(`[/]`|`/[]`)
+ - `since`=(`` or ``)
+ - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`)
+ - `volume`=(`` or ``)
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ContainerListBadRequestException
+ * @throws \Docker\API\Exception\ContainerListInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\ContainerSummary[]|\Psr\Http\Message\ResponseInterface
+ */
+ public function containerList(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerList($queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param \Docker\API\Model\ContainersCreatePostBody $body Container to create
+ * @param array $queryParameters {
+ * @var string $name Assign the specified name to the container. Must match
+ `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`.
+
+ * @var string $platform Platform in the format `os[/arch[/variant]]` used for image lookup.
+
+ When specified, the daemon checks if the requested image is present
+ in the local image cache with the given OS and Architecture, and
+ otherwise returns a `404` status.
+
+ If the option is not set, the host's native OS and Architecture are
+ used to look up the image in the image cache. However, if no platform
+ is passed and the given image does exist in the local image cache,
+ but its OS or architecture does not match, the container is created
+ with the available image, and a warning is added to the `Warnings`
+ field in the response, for example;
+
+ WARNING: The requested image's platform (linux/arm64/v8) does not
+ match the detected host platform (linux/amd64) and no
+ specific platform was requested
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ContainerCreateBadRequestException
+ * @throws \Docker\API\Exception\ContainerCreateNotFoundException
+ * @throws \Docker\API\Exception\ContainerCreateConflictException
+ * @throws \Docker\API\Exception\ContainerCreateInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\ContainerCreateResponse|\Psr\Http\Message\ResponseInterface
+ */
+ public function containerCreate(\Docker\API\Model\ContainersCreatePostBody $body, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerCreate($body, $queryParameters), $fetch);
}
-
/**
* Return low-level information about a container.
*
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
+ * @param string $id ID or name of the container
+ * @param array $queryParameters {
* @var bool $size Return the size of container as fields `SizeRw` and `SizeRootFs`
* }
- *
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\ContainerInspectNotFoundException
* @throws \Docker\API\Exception\ContainerInspectInternalServerErrorException
*
* @return null|\Docker\API\Model\ContainersIdJsonGetResponse200|\Psr\Http\Message\ResponseInterface
*/
- public function containerInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerInspect($id, $queryParameters), $fetch);
- }
-
- /**
- * On Unix systems, this is done by running the `ps` command. This endpoint is not supported on Windows.
- *
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var string $ps_args The arguments to pass to `ps`. For example, `aux`
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerTopNotFoundException
- * @throws \Docker\API\Exception\ContainerTopInternalServerErrorException
- *
- * @return null|\Docker\API\Model\ContainersIdTopGetResponse200|\Psr\Http\Message\ResponseInterface
- */
- public function containerTop(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerTop($id, $queryParameters), $fetch);
- }
-
- /**
- * Get `stdout` and `stderr` logs from a container.
-
- Note: This endpoint works only for containers with the `json-file` or `journald` logging driver.
-
- *
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var bool $follow return the logs as a stream
-
- * @var bool $stdout Return logs from `stdout`
- * @var bool $stderr Return logs from `stderr`
- * @var int $since Only return logs since this time, as a UNIX timestamp
- * @var int $until Only return logs before this time, as a UNIX timestamp
- * @var bool $timestamps Add timestamps to every log line
- * @var string $tail Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerLogsNotFoundException
- * @throws \Docker\API\Exception\ContainerLogsInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function containerLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerLogs($id, $queryParameters), $fetch);
- }
-
- /**
- * Returns which files in a container's filesystem have been added, deleted,.
+ public function containerInspect(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerInspect($id, $queryParameters), $fetch);
+ }
+ /**
+ * On Unix systems, this is done by running the `ps` command. This endpoint
+ is not supported on Windows.
+
+ *
+ * @param string $id ID or name of the container
+ * @param array $queryParameters {
+ * @var string $ps_args The arguments to pass to `ps`. For example, `aux`
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ContainerTopNotFoundException
+ * @throws \Docker\API\Exception\ContainerTopInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\ContainersIdTopGetResponse200|\Psr\Http\Message\ResponseInterface
+ */
+ public function containerTop(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerTop($id, $queryParameters), $fetch);
+ }
+ /**
+ * Get `stdout` and `stderr` logs from a container.
+
+ Note: This endpoint works only for containers with the `json-file` or
+ `journald` logging driver.
+
+ *
+ * @param string $id ID or name of the container
+ * @param array $queryParameters {
+ * @var bool $follow Keep connection after returning logs.
+ * @var bool $stdout Return logs from `stdout`
+ * @var bool $stderr Return logs from `stderr`
+ * @var int $since Only return logs since this time, as a UNIX timestamp
+ * @var int $until Only return logs before this time, as a UNIX timestamp
+ * @var bool $timestamps Add timestamps to every log line
+ * @var string $tail Only return this number of log lines from the end of the logs.
+ Specify as an integer or `all` to output all log lines.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ContainerLogsNotFoundException
+ * @throws \Docker\API\Exception\ContainerLogsInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function containerLogs(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerLogs($id, $queryParameters), $fetch);
+ }
+ /**
+ * Returns which files in a container's filesystem have been added, deleted,
or modified. The `Kind` of modification can be one of:
-
- - `0`: Modified
- - `1`: Added
- - `2`: Deleted
-
- *
- * @param string $id ID or name of the container
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerChangesNotFoundException
- * @throws \Docker\API\Exception\ContainerChangesInternalServerErrorException
- *
- * @return null|\Docker\API\Model\ContainersIdChangesGetResponse200Item[]|\Psr\Http\Message\ResponseInterface
- */
+
+ - `0`: Modified ("C")
+ - `1`: Added ("A")
+ - `2`: Deleted ("D")
+
+ *
+ * @param string $id ID or name of the container
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ContainerChangesNotFoundException
+ * @throws \Docker\API\Exception\ContainerChangesInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\FilesystemChange[]|\Psr\Http\Message\ResponseInterface
+ */
public function containerChanges(string $id, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerChanges($id), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerChanges($id), $fetch);
}
-
/**
* Export the contents of a container as a tarball.
*
- * @param string $id ID or name of the container
+ * @param string $id ID or name of the container
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\ContainerExportNotFoundException
* @throws \Docker\API\Exception\ContainerExportInternalServerErrorException
*
@@ -168,202 +189,211 @@ public function containerChanges(string $id, string $fetch = self::FETCH_OBJECT)
*/
public function containerExport(string $id, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerExport($id), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerExport($id), $fetch);
}
-
/**
- * This endpoint returns a live stream of a container’s resource usage.
+ * This endpoint returns a live stream of a container’s resource usage
statistics.
-
- The `precpu_stats` is the CPU statistic of last read, which is used
- for calculating the CPU usage percentage. It is not the same as the
- `cpu_stats` field.
-
+
+ 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.
-
- *
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var bool $stream Stream the output. If false, the stats will be output once and then it will disconnect.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerStatsNotFoundException
- * @throws \Docker\API\Exception\ContainerStatsInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function containerStats(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerStats($id, $queryParameters), $fetch);
- }
-
- /**
- * Resize the TTY for a container. You must restart the container for the resize to take effect.
- *
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var int $h Height of the tty session in characters
- * @var int $w Width of the tty session in characters
+
+ On a cgroup v2 host, the following fields are not set
+ * `blkio_stats`: all fields other than `io_service_bytes_recursive`
+ * `cpu_stats`: `cpu_usage.percpu_usage`
+ * `memory_stats`: `max_usage` and `failcnt`
+ Also, `memory_stats.stats` fields are incompatible with cgroup v1.
+
+ To calculate the values shown by the `stats` command of the docker cli tool
+ the following formulas can be used:
+ * used_memory = `memory_stats.usage - memory_stats.stats.cache`
+ * available_memory = `memory_stats.limit`
+ * Memory usage % = `(used_memory / available_memory) * 100.0`
+ * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage`
+ * system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage`
+ * number_cpus = `lenght(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus`
+ * CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0`
+
+ *
+ * @param string $id ID or name of the container
+ * @param array $queryParameters {
+ * @var bool $stream Stream the output. If false, the stats will be output once and then
+ it will disconnect.
+
+ * @var bool $one-shot Only get a single stat instead of waiting for 2 cycles. Must be used
+ with `stream=false`.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ContainerStatsNotFoundException
+ * @throws \Docker\API\Exception\ContainerStatsInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function containerStats(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerStats($id, $queryParameters), $fetch);
+ }
+ /**
+ * Resize the TTY for a container.
+ *
+ * @param string $id ID or name of the container
+ * @param array $queryParameters {
+ * @var int $h Height of the TTY session in characters
+ * @var int $w Width of the TTY session in characters
* }
- *
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\ContainerResizeNotFoundException
* @throws \Docker\API\Exception\ContainerResizeInternalServerErrorException
*
* @return null|\Psr\Http\Message\ResponseInterface
*/
- public function containerResize(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
+ public function containerResize(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerResize($id, $queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerResize($id, $queryParameters), $fetch);
}
-
/**
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var string $detachKeys Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerStartNotFoundException
- * @throws \Docker\API\Exception\ContainerStartInternalServerErrorException
- *
- * @return null|\Docker\API\Model\ErrorResponse|\Psr\Http\Message\ResponseInterface
- */
- public function containerStart(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
+ *
+ *
+ * @param string $id ID or name of the container
+ * @param array $queryParameters {
+ * @var string $detachKeys Override the key sequence for detaching a container. Format is a
+ single character `[a-Z]` or `ctrl-` where `` is one
+ of: `a-z`, `@`, `^`, `[`, `,` or `_`.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ContainerStartNotFoundException
+ * @throws \Docker\API\Exception\ContainerStartInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function containerStart(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerStart($id, $queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerStart($id, $queryParameters), $fetch);
}
-
/**
- * @param string $id ID or name of the container
- * @param array $queryParameters {
+ *
*
+ * @param string $id ID or name of the container
+ * @param array $queryParameters {
+ * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`).
* @var int $t Number of seconds to wait before killing the container
* }
- *
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\ContainerStopNotFoundException
* @throws \Docker\API\Exception\ContainerStopInternalServerErrorException
*
- * @return null|\Docker\API\Model\ErrorResponse|\Psr\Http\Message\ResponseInterface
+ * @return null|\Psr\Http\Message\ResponseInterface
*/
- public function containerStop(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
+ public function containerStop(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerStop($id, $queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerStop($id, $queryParameters), $fetch);
}
-
/**
- * @param string $id ID or name of the container
- * @param array $queryParameters {
+ *
*
+ * @param string $id ID or name of the container
+ * @param array $queryParameters {
+ * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`).
* @var int $t Number of seconds to wait before killing the container
* }
- *
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\ContainerRestartNotFoundException
* @throws \Docker\API\Exception\ContainerRestartInternalServerErrorException
*
* @return null|\Psr\Http\Message\ResponseInterface
*/
- public function containerRestart(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerRestart($id, $queryParameters), $fetch);
- }
-
- /**
- * Send a POSIX signal to a container, defaulting to killing to the container.
- *
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`)
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerKillNotFoundException
- * @throws \Docker\API\Exception\ContainerKillInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function containerKill(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerKill($id, $queryParameters), $fetch);
- }
-
- /**
- * Change various configuration options of a container without having to recreate it.
- *
- * @param string $id ID or name of the container
- * @param \Docker\API\Model\ContainersIdUpdatePostBody $update
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerUpdateNotFoundException
- * @throws \Docker\API\Exception\ContainerUpdateInternalServerErrorException
- *
- * @return null|\Docker\API\Model\ContainersIdUpdatePostResponse200|\Psr\Http\Message\ResponseInterface
- */
+ public function containerRestart(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerRestart($id, $queryParameters), $fetch);
+ }
+ /**
+ * Send a POSIX signal to a container, defaulting to killing to the
+ container.
+
+ *
+ * @param string $id ID or name of the container
+ * @param array $queryParameters {
+ * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`).
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ContainerKillNotFoundException
+ * @throws \Docker\API\Exception\ContainerKillConflictException
+ * @throws \Docker\API\Exception\ContainerKillInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function containerKill(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerKill($id, $queryParameters), $fetch);
+ }
+ /**
+ * Change various configuration options of a container without having to
+ recreate it.
+
+ *
+ * @param string $id ID or name of the container
+ * @param \Docker\API\Model\ContainersIdUpdatePostBody $update
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ContainerUpdateNotFoundException
+ * @throws \Docker\API\Exception\ContainerUpdateInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\ContainersIdUpdatePostResponse200|\Psr\Http\Message\ResponseInterface
+ */
public function containerUpdate(string $id, \Docker\API\Model\ContainersIdUpdatePostBody $update, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerUpdate($id, $update), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerUpdate($id, $update), $fetch);
}
-
/**
- * @param string $id ID or name of the container
- * @param array $queryParameters {
+ *
*
+ * @param string $id ID or name of the container
+ * @param array $queryParameters {
* @var string $name New name for the container
* }
- *
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\ContainerRenameNotFoundException
* @throws \Docker\API\Exception\ContainerRenameConflictException
* @throws \Docker\API\Exception\ContainerRenameInternalServerErrorException
*
* @return null|\Psr\Http\Message\ResponseInterface
*/
- public function containerRename(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerRename($id, $queryParameters), $fetch);
- }
-
- /**
- * Use the cgroups freezer to suspend all processes in a container.
-
- Traditionally, when suspending a process the `SIGSTOP` signal is used, which is observable by the process being suspended. With the cgroups freezer the process is unaware, and unable to capture, that it is being suspended, and subsequently resumed.
-
- *
- * @param string $id ID or name of the container
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerPauseNotFoundException
- * @throws \Docker\API\Exception\ContainerPauseInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
+ public function containerRename(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerRename($id, $queryParameters), $fetch);
+ }
+ /**
+ * Use the freezer cgroup to suspend all processes in a container.
+
+ Traditionally, when suspending a process the `SIGSTOP` signal is used,
+ which is observable by the process being suspended. With the freezer
+ cgroup the process is unaware, and unable to capture, that it is being
+ suspended, and subsequently resumed.
+
+ *
+ * @param string $id ID or name of the container
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ContainerPauseNotFoundException
+ * @throws \Docker\API\Exception\ContainerPauseInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
public function containerPause(string $id, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerPause($id), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerPause($id), $fetch);
}
-
/**
* Resume a container which has been paused.
*
- * @param string $id ID or name of the container
+ * @param string $id ID or name of the container
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\ContainerUnpauseNotFoundException
* @throws \Docker\API\Exception\ContainerUnpauseInternalServerErrorException
*
@@ -371,169 +401,194 @@ public function containerPause(string $id, string $fetch = self::FETCH_OBJECT)
*/
public function containerUnpause(string $id, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerUnpause($id), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerUnpause($id), $fetch);
}
-
/**
- * 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.
-
- See [the documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) for more details.
-
+ * 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.
+
+ See the [documentation for the `docker attach` command](/engine/reference/commandline/attach/)
+ for more details.
+
### Hijacking
-
- This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, and `stderr` on the same socket.
-
+
+ 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.docker.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 Docker client can also optionally send connection upgrade headers.
-
+
+ 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 Docker 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 Docker daemon will respond with a `101 UPGRADED` response, and will similarly follow with the raw stream:
-
+
+ The Docker 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.docker.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`).
-
+
+ When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate),
+ the HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream
+ and 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`.
-
+
+ `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`.
-
- *
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var string $detachKeys Override the key sequence for detaching a container.Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
- * @var bool $logs replay previous logs from the container
-
- * @var bool $stream Stream attached streams from the time the request was made onwards
- * @var bool $stdin Attach to `stdin`
- * @var bool $stdout Attach to `stdout`
- * @var bool $stderr Attach to `stderr`
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerAttachBadRequestException
- * @throws \Docker\API\Exception\ContainerAttachNotFoundException
- * @throws \Docker\API\Exception\ContainerAttachInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function containerAttach(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerAttach($id, $queryParameters), $fetch);
- }
-
- /**
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var string $detachKeys Override the key sequence for detaching a container.Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,`, or `_`.
- * @var bool $logs Return logs
- * @var bool $stream Return stream
- * @var bool $stdin Attach to `stdin`
- * @var bool $stdout Attach to `stdout`
- * @var bool $stderr Attach to `stderr`
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerAttachWebsocketBadRequestException
- * @throws \Docker\API\Exception\ContainerAttachWebsocketNotFoundException
- * @throws \Docker\API\Exception\ContainerAttachWebsocketInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function containerAttachWebsocket(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerAttachWebsocket($id, $queryParameters), $fetch);
- }
-
- /**
- * Block until a container stops, then returns the exit code.
- *
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var string $condition Wait until a container state reaches the given condition, either 'not-running' (default), 'next-exit', or 'removed'.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerWaitNotFoundException
- * @throws \Docker\API\Exception\ContainerWaitInternalServerErrorException
- *
- * @return null|\Docker\API\Model\ContainersIdWaitPostResponse200|\Psr\Http\Message\ResponseInterface
- */
- public function containerWait(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerWait($id, $queryParameters), $fetch);
- }
-
- /**
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var bool $v remove the volumes associated with the container
- * @var bool $force if the container is running, kill it before removing it
+
+ 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`.
+
+ *
+ * @param string $id ID or name of the container
+ * @param array $queryParameters {
+ * @var string $detachKeys Override the key sequence for detaching a container.Format is a single
+ character `[a-Z]` or `ctrl-` where `` is one of: `a-z`,
+ `@`, `^`, `[`, `,` or `_`.
+
+ * @var bool $logs 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.
+
+ * @var bool $stream Stream attached streams from the time the request was made onwards.
+
+ * @var bool $stdin Attach to `stdin`
+ * @var bool $stdout Attach to `stdout`
+ * @var bool $stderr Attach to `stderr`
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ContainerAttachBadRequestException
+ * @throws \Docker\API\Exception\ContainerAttachNotFoundException
+ * @throws \Docker\API\Exception\ContainerAttachInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function containerAttach(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerAttach($id, $queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string $id ID or name of the container
+ * @param array $queryParameters {
+ * @var string $detachKeys Override the key sequence for detaching a container.Format is a single
+ character `[a-Z]` or `ctrl-` where `` is one of: `a-z`,
+ `@`, `^`, `[`, `,`, or `_`.
+
+ * @var bool $logs Return logs
+ * @var bool $stream Return stream
+ * @var bool $stdin Attach to `stdin`
+ * @var bool $stdout Attach to `stdout`
+ * @var bool $stderr Attach to `stderr`
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ContainerAttachWebsocketBadRequestException
+ * @throws \Docker\API\Exception\ContainerAttachWebsocketNotFoundException
+ * @throws \Docker\API\Exception\ContainerAttachWebsocketInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function containerAttachWebsocket(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerAttachWebsocket($id, $queryParameters), $fetch);
+ }
+ /**
+ * Block until a container stops, then returns the exit code.
+ *
+ * @param string $id ID or name of the container
+ * @param array $queryParameters {
+ * @var string $condition Wait until a container state reaches the given condition.
+
+ Defaults to `not-running` if omitted or empty.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ContainerWaitBadRequestException
+ * @throws \Docker\API\Exception\ContainerWaitNotFoundException
+ * @throws \Docker\API\Exception\ContainerWaitInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\ContainerWaitResponse|\Psr\Http\Message\ResponseInterface
+ */
+ public function containerWait(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerWait($id, $queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string $id ID or name of the container
+ * @param array $queryParameters {
+ * @var bool $v Remove anonymous volumes associated with the container.
+ * @var bool $force If the container is running, kill it before removing it.
* @var bool $link Remove the specified link associated with the container.
* }
- *
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\ContainerDeleteBadRequestException
* @throws \Docker\API\Exception\ContainerDeleteNotFoundException
* @throws \Docker\API\Exception\ContainerDeleteConflictException
@@ -541,291 +596,357 @@ public function containerWait(string $id, array $queryParameters = [], string $f
*
* @return null|\Psr\Http\Message\ResponseInterface
*/
- public function containerDelete(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
+ public function containerDelete(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerDelete($id, $queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerDelete($id, $queryParameters), $fetch);
}
-
/**
* Get a tar archive of a resource in the filesystem of container id.
*
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
+ * @param string $id ID or name of the container
+ * @param array $queryParameters {
* @var string $path Resource in the container’s filesystem to archive.
* }
- *
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\ContainerArchiveBadRequestException
* @throws \Docker\API\Exception\ContainerArchiveNotFoundException
* @throws \Docker\API\Exception\ContainerArchiveInternalServerErrorException
*
* @return null|\Psr\Http\Message\ResponseInterface
*/
- public function containerArchive(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
+ public function containerArchive(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerArchive($id, $queryParameters), $fetch);
+ }
+ /**
+ * A response header `X-Docker-Container-Path-Stat` is returned, containing
+ a base64 - encoded JSON object with some filesystem header information
+ about the path.
+
+ *
+ * @param string $id ID or name of the container
+ * @param array $queryParameters {
+ * @var string $path Resource in the container’s filesystem to archive.
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ContainerArchiveInfoBadRequestException
+ * @throws \Docker\API\Exception\ContainerArchiveInfoNotFoundException
+ * @throws \Docker\API\Exception\ContainerArchiveInfoInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function containerArchiveInfo(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerArchiveInfo($id, $queryParameters), $fetch);
+ }
+ /**
+ * Upload a tar archive to be extracted to a path in the filesystem of container id.
+ `path` parameter is asserted to be a directory. If it exists as a file, 400 error
+ will be returned with message "not a directory".
+
+ *
+ * @param string $id ID or name of the container
+ * @param string|resource|\Psr\Http\Message\StreamInterface $inputStream The input stream must be a tar archive compressed with one of the
+ following algorithms: `identity` (no compression), `gzip`, `bzip2`,
+ or `xz`.
+
+ * @param array $queryParameters {
+ * @var string $path Path to a directory in the container to extract the archive’s contents into.
+ * @var string $noOverwriteDirNonDir 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.
+
+ * @var string $copyUIDGID If `1`, `true`, then it will copy UID/GID maps to the dest file or
+ dir
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\PutContainerArchiveBadRequestException
+ * @throws \Docker\API\Exception\PutContainerArchiveForbiddenException
+ * @throws \Docker\API\Exception\PutContainerArchiveNotFoundException
+ * @throws \Docker\API\Exception\PutContainerArchiveInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function putContainerArchive(string $id, $inputStream, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\PutContainerArchive($id, $inputStream, $queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param array $queryParameters {
+ * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`).
+
+ Available filters:
+ - `until=` Prune containers created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.
+ - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune containers with (or without, in case `label!=...` is used) the specified labels.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ContainerPruneInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\ContainersPrunePostResponse200|\Psr\Http\Message\ResponseInterface
+ */
+ public function containerPrune(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerPrune($queryParameters), $fetch);
+ }
+ /**
+ * Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image.
+ *
+ * @param array $queryParameters {
+ * @var bool $all Show all images. Only images from a final layer (no children) are shown by default.
+ * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to
+ process on the images list.
+
+ Available filters:
+
+ - `before`=(`[:]`, `` or ``)
+ - `dangling=true`
+ - `label=key` or `label="key=value"` of an image label
+ - `reference`=(`[:]`)
+ - `since`=(`[:]`, `` or ``)
+
+ * @var bool $shared-size Compute and show shared size as a `SharedSize` field on each image.
+ * @var bool $digests Show digest information as a `RepoDigests` field on each image.
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ImageListInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\ImageSummary[]|\Psr\Http\Message\ResponseInterface
+ */
+ public function imageList(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ImageList($queryParameters), $fetch);
+ }
+ /**
+ * Build an image from a tar archive with a `Dockerfile` in it.
+
+ The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](/engine/reference/builder/).
+
+ The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output.
+
+ The build is canceled if the client drops the connection by quitting or being killed.
+
+ *
+ * @param string|resource|\Psr\Http\Message\StreamInterface $inputStream A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz.
+ * @param array $queryParameters {
+ * @var string $dockerfile Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`.
+ * @var string $t A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters.
+ * @var string $extrahosts Extra hosts to add to /etc/hosts
+ * @var string $remote A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball.
+ * @var bool $q Suppress verbose build output.
+ * @var bool $nocache Do not use the cache when building the image.
+ * @var string $cachefrom JSON array of images used for build cache resolution.
+ * @var string $pull Attempt to pull the image even if an older image exists locally.
+ * @var bool $rm Remove intermediate containers after a successful build.
+ * @var bool $forcerm Always remove intermediate containers, even upon failure.
+ * @var int $memory Set memory limit for build.
+ * @var int $memswap Total memory (memory + swap). Set as `-1` to disable swap.
+ * @var int $cpushares CPU shares (relative weight).
+ * @var string $cpusetcpus CPUs in which to allow execution (e.g., `0-3`, `0,1`).
+ * @var int $cpuperiod The length of a CPU period in microseconds.
+ * @var int $cpuquota Microseconds of CPU time that the container can get in a CPU period.
+ * @var string $buildargs JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values.
+
+ For example, the build arg `FOO=bar` would become `{"FOO":"bar"}` in JSON. This would result in the query parameter `buildargs={"FOO":"bar"}`. Note that `{"FOO":"bar"}` should be URI component encoded.
+
+ [Read more about the buildargs instruction.](/engine/reference/builder/#arg)
+
+ * @var int $shmsize Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB.
+ * @var bool $squash Squash the resulting images layers into a single layer. *(Experimental release only.)*
+ * @var string $labels Arbitrary key/value labels to set on the image, as a JSON map of string pairs.
+ * @var string $networkmode Sets the networking mode for the run commands during build. Supported
+ standard values are: `bridge`, `host`, `none`, and `container:`.
+ Any other value is taken as a custom network's name or ID to which this
+ container should connect to.
+
+ * @var string $platform Platform in the format os[/arch[/variant]]
+ * @var string $target Target build stage
+ * @var string $outputs BuildKit output configuration
+ * }
+ * @param array $headerParameters {
+ * @var string $Content-type
+ * @var string $X-Registry-Config This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to.
+
+ The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example:
+
+ ```
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerArchive($id, $queryParameters), $fetch);
+ "docker.example.com": {
+ "username": "janedoe",
+ "password": "hunter2"
+ },
+ "https://index.docker.io/v1/": {
+ "username": "mobydock",
+ "password": "conta1n3rize14"
+ }
+ }
+ ```
+
+ Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a `https://` prefix and a `/v1/` suffix even though Docker will prefer to use the v2 registry API.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ImageBuildBadRequestException
+ * @throws \Docker\API\Exception\ImageBuildInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function imageBuild($inputStream, array $queryParameters = array(), array $headerParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ImageBuild($inputStream, $queryParameters, $headerParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param array $queryParameters {
+ * @var int $keep-storage Amount of disk space in bytes to keep for cache
+ * @var bool $all Remove all types of build cache
+ * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to
+ process on the list of build cache objects.
+
+ Available filters:
+
+ - `until=` remove cache older than ``. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time.
+ - `id=`
+ - `parent=`
+ - `type=`
+ - `description=`
+ - `inuse`
+ - `shared`
+ - `private`
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\BuildPruneInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\BuildPrunePostResponse200|\Psr\Http\Message\ResponseInterface
+ */
+ public function buildPrune(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\BuildPrune($queryParameters), $fetch);
+ }
+ /**
+ * Create an image by either pulling it from a registry or importing it.
+ *
+ * @param string $inputImage Image content if the value `-` has been specified in fromSrc query parameter
+ * @param array $queryParameters {
+ * @var string $fromImage 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.
+ * @var string $fromSrc 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.
+ * @var string $repo 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.
+ * @var string $tag Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled.
+ * @var string $message Set commit message for imported image.
+ * @var array $changes Apply `Dockerfile` instructions to the image that is created,
+ for example: `changes=ENV DEBUG=true`.
+ Note that `ENV DEBUG=true` should be URI component encoded.
+
+ Supported `Dockerfile` instructions:
+ `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR`
+
+ * @var string $platform Platform in the format os[/arch[/variant]].
+
+ When used in combination with the `fromImage` option, the daemon checks
+ if the given image is present in the local image cache with the given
+ OS and Architecture, and otherwise attempts to pull the image. If the
+ option is not set, the host's native OS and Architecture are used.
+ If the given image does not exist in the local image cache, the daemon
+ attempts to pull the image with the host's native OS and Architecture.
+ If the given image does exists in the local image cache, but its OS or
+ architecture does not match, a warning is produced.
+
+ When used with the `fromSrc` option to import an image from an archive,
+ this option sets the platform information for the imported image. If
+ the option is not set, the host's native OS and Architecture are used
+ for the imported image.
+
+ * }
+ * @param array $headerParameters {
+ * @var string $X-Registry-Auth A base64url-encoded auth configuration.
+
+ Refer to the [authentication section](#section/Authentication) for
+ details.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ImageCreateNotFoundException
+ * @throws \Docker\API\Exception\ImageCreateInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function imageCreate(string $inputImage, array $queryParameters = array(), array $headerParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ImageCreate($inputImage, $queryParameters, $headerParameters), $fetch);
}
-
/**
- * A response header `X-Docker-Container-Path-Stat` is return containing a base64 - encoded JSON object with some filesystem header information about the path.
- *
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var string $path Resource in the container’s filesystem to archive.
- * }
+ * Return low-level information about an image.
*
+ * @param string $name Image name or id
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ImageInspectNotFoundException
+ * @throws \Docker\API\Exception\ImageInspectInternalServerErrorException
*
- * @throws \Docker\API\Exception\ContainerArchiveInfoBadRequestException
- * @throws \Docker\API\Exception\ContainerArchiveInfoNotFoundException
- * @throws \Docker\API\Exception\ContainerArchiveInfoInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
+ * @return null|\Docker\API\Model\ImageInspect|\Psr\Http\Message\ResponseInterface
*/
- public function containerArchiveInfo(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
+ public function imageInspect(string $name, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerArchiveInfo($id, $queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ImageInspect($name), $fetch);
}
-
/**
- * Upload a tar archive to be extracted to a path in the filesystem of container id.
- *
- * @param string $id ID or name of the container
- * @param string $inputStream the input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz
- * @param array $queryParameters {
- *
- * @var string $path Path to a directory in the container to extract the archive’s contents into.
- * @var string $noOverwriteDirNonDir 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.
- * }
+ * Return parent layers of an image.
*
+ * @param string $name Image name or ID
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ImageHistoryNotFoundException
+ * @throws \Docker\API\Exception\ImageHistoryInternalServerErrorException
*
- * @throws \Docker\API\Exception\PutContainerArchiveBadRequestException
- * @throws \Docker\API\Exception\PutContainerArchiveForbiddenException
- * @throws \Docker\API\Exception\PutContainerArchiveNotFoundException
- * @throws \Docker\API\Exception\PutContainerArchiveInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
+ * @return null|\Docker\API\Model\ImagesNameHistoryGetResponse200Item[]|\Psr\Http\Message\ResponseInterface
*/
- public function putContainerArchive(string $id, string $inputStream, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
+ public function imageHistory(string $name, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PutContainerArchive($id, $inputStream, $queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ImageHistory($name), $fetch);
}
-
/**
- * @param array $queryParameters {
- *
- * @var string $filters filters to process on the prune list, encoded as JSON (a `map[string][]string`)
-
- * }
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerPruneInternalServerErrorException
- *
- * @return null|\Docker\API\Model\ContainersPrunePostResponse200|\Psr\Http\Message\ResponseInterface
- */
- public function containerPrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerPrune($queryParameters), $fetch);
- }
-
- /**
- * Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image.
- *
- * @param array $queryParameters {
- *
- * @var bool $all Show all images. Only images from a final layer (no children) are shown by default.
- * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:
-
- * @var bool $digests Show digest information as a `RepoDigests` field on each image.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ImageListInternalServerErrorException
- *
- * @return null|\Docker\API\Model\ImageSummary[]|\Psr\Http\Message\ResponseInterface
- */
- public function imageList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageList($queryParameters), $fetch);
- }
-
- /**
- * Build an image from a tar archive with a `Dockerfile` in it.
-
- The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/).
-
- The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output.
-
- The build is canceled if the client drops the connection by quitting or being killed.
-
- *
- * @param string|resource|\Psr\Http\Message\StreamInterface $inputStream a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz
- * @param array $queryParameters {
- *
- * @var string $dockerfile Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`.
- * @var string $t A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters.
- * @var string $extrahosts Extra hosts to add to /etc/hosts
- * @var string $remote A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball.
- * @var bool $q suppress verbose build output
- * @var bool $nocache do not use the cache when building the image
- * @var string $cachefrom JSON array of images used for build cache resolution
- * @var string $pull attempt to pull the image even if an older image exists locally
- * @var bool $rm remove intermediate containers after a successful build
- * @var bool $forcerm always remove intermediate containers, even upon failure
- * @var int $memory set memory limit for build
- * @var int $memswap Total memory (memory + swap). Set as `-1` to disable swap.
- * @var int $cpushares CPU shares (relative weight)
- * @var string $cpusetcpus CPUs in which to allow execution (e.g., `0-3`, `0,1`).
- * @var int $cpuperiod the length of a CPU period in microseconds
- * @var int $cpuquota microseconds of CPU time that the container can get in a CPU period
- * @var string $buildargs JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values. [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg)
- * @var int $shmsize Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB.
- * @var bool $squash Squash the resulting images layers into a single layer. *(Experimental release only.)*
- * @var string $labels arbitrary key/value labels to set on the image, as a JSON map of string pairs
- * @var string $networkmode Sets the networking mode for the run commands during build. Supported standard values are: `bridge`, `host`, `none`, and `container:`. Any other value is taken as a custom network's name to which this container should connect to.
- * @var string $platform Platform in the format os[/arch[/variant]]
- * }
- *
- * @param array $headerParameters {
- *
- * @var string $Content-type
- * @var string $X-Registry-Config This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to
-
- * }
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ImageBuildBadRequestException
- * @throws \Docker\API\Exception\ImageBuildInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function imageBuild($inputStream, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageBuild($inputStream, $queryParameters, $headerParameters), $fetch);
- }
-
- /**
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\BuildPruneInternalServerErrorException
- *
- * @return null|\Docker\API\Model\BuildPrunePostResponse200|\Psr\Http\Message\ResponseInterface
- */
- public function buildPrune(string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\BuildPrune(), $fetch);
- }
-
- /**
- * Create an image by either pulling it from a registry or importing it.
- *
- * @param string $inputImage Image content if the value `-` has been specified in fromSrc query parameter
- * @param array $queryParameters {
- *
- * @var string $fromImage 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.
- * @var string $fromSrc 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.
- * @var string $repo 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.
- * @var string $tag Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled.
- * @var string $platform Platform in the format os[/arch[/variant]]
- * }
- *
- * @param array $headerParameters {
- *
- * @var string $X-Registry-Auth A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ImageCreateNotFoundException
- * @throws \Docker\API\Exception\ImageCreateInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function imageCreate(string $inputImage, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageCreate($inputImage, $queryParameters, $headerParameters), $fetch);
- }
-
- /**
- * Return low-level information about an image.
- *
- * @param string $name Image name or id
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ImageInspectNotFoundException
- * @throws \Docker\API\Exception\ImageInspectInternalServerErrorException
- *
- * @return null|\Docker\API\Model\Image|\Psr\Http\Message\ResponseInterface
- */
- public function imageInspect(string $name, string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageInspect($name), $fetch);
- }
-
- /**
- * Return parent layers of an image.
- *
- * @param string $name Image name or ID
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ImageHistoryNotFoundException
- * @throws \Docker\API\Exception\ImageHistoryInternalServerErrorException
- *
- * @return null|\Docker\API\Model\ImagesNameHistoryGetResponse200Item[]|\Psr\Http\Message\ResponseInterface
- */
- public function imageHistory(string $name, string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageHistory($name), $fetch);
- }
-
- /**
- * Push an image to a registry.
-
- If you wish to push an image on to a private registry, that image must already have a tag which references the registry. For example, `registry.example.com/myimage:latest`.
-
+ * Push an image to a registry.
+
+ If you wish to push an image on to a private registry, that image must
+ already have a tag which references the registry. For example,
+ `registry.example.com/myimage:latest`.
+
The push is cancelled if the HTTP connection is closed.
-
- *
- * @param string $name image name or ID
- * @param array $queryParameters {
- *
- * @var string $tag The tag to associate with the image on the registry.
- * }
- *
- * @param array $headerParameters {
- *
- * @var string $X-Registry-Auth A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ImagePushNotFoundException
- * @throws \Docker\API\Exception\ImagePushInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function imagePush(string $name, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImagePush($name, $queryParameters, $headerParameters), $fetch);
+
+ *
+ * @param string $name Image name or ID.
+ * @param array $queryParameters {
+ * @var string $tag The tag to associate with the image on the registry.
+ * }
+ * @param array $headerParameters {
+ * @var string $X-Registry-Auth A base64url-encoded auth configuration.
+
+ Refer to the [authentication section](#section/Authentication) for
+ details.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ImagePushNotFoundException
+ * @throws \Docker\API\Exception\ImagePushInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function imagePush(string $name, array $queryParameters = array(), array $headerParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ImagePush($name, $queryParameters, $headerParameters), $fetch);
}
-
/**
* Tag an image so that it becomes part of a repository.
*
- * @param string $name image name or ID to tag
- * @param array $queryParameters {
- *
+ * @param string $name Image name or ID to tag.
+ * @param array $queryParameters {
* @var string $repo The repository to tag in. For example, `someuser/someimage`.
* @var string $tag The name of the new tag.
* }
- *
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\ImageTagBadRequestException
* @throws \Docker\API\Exception\ImageTagNotFoundException
* @throws \Docker\API\Exception\ImageTagConflictException
@@ -833,134 +954,139 @@ public function imagePush(string $name, array $queryParameters = [], array $head
*
* @return null|\Psr\Http\Message\ResponseInterface
*/
- public function imageTag(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
+ public function imageTag(string $name, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageTag($name, $queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ImageTag($name, $queryParameters), $fetch);
}
-
/**
- * Remove an image, along with any untagged parent images that were.
+ * Remove an image, along with any untagged parent images that were
referenced by that image.
-
+
Images can't be removed if they have descendant images, are being
used by a running container or are being used by a build.
-
- *
- * @param string $name Image name or ID
- * @param array $queryParameters {
- *
- * @var bool $force Remove the image even if it is being used by stopped containers or has other tags
- * @var bool $noprune Do not delete untagged parent images
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ImageDeleteNotFoundException
- * @throws \Docker\API\Exception\ImageDeleteConflictException
- * @throws \Docker\API\Exception\ImageDeleteInternalServerErrorException
- *
- * @return null|\Docker\API\Model\ImageDeleteResponseItem[]|\Psr\Http\Message\ResponseInterface
- */
- public function imageDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageDelete($name, $queryParameters), $fetch);
- }
-
- /**
- * Search for an image on Docker Hub.
- *
- * @param array $queryParameters {
- *
- * @var string $term Term to search
- * @var int $limit Maximum number of results to return
- * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:
-
- * }
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ImageSearchInternalServerErrorException
- *
- * @return null|\Docker\API\Model\ImagesSearchGetResponse200Item[]|\Psr\Http\Message\ResponseInterface
- */
- public function imageSearch(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageSearch($queryParameters), $fetch);
- }
-
- /**
- * @param array $queryParameters {
- *
- * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters:
-
+
+ *
+ * @param string $name Image name or ID
+ * @param array $queryParameters {
+ * @var bool $force Remove the image even if it is being used by stopped containers or has other tags
+ * @var bool $noprune Do not delete untagged parent images
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ImageDeleteNotFoundException
+ * @throws \Docker\API\Exception\ImageDeleteConflictException
+ * @throws \Docker\API\Exception\ImageDeleteInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\ImageDeleteResponseItem[]|\Psr\Http\Message\ResponseInterface
+ */
+ public function imageDelete(string $name, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ImageDelete($name, $queryParameters), $fetch);
+ }
+ /**
+ * Search for an image on Docker Hub.
+ *
+ * @param array $queryParameters {
+ * @var string $term Term to search
+ * @var int $limit Maximum number of results to return
+ * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:
+
+ - `is-automated=(true|false)`
+ - `is-official=(true|false)`
+ - `stars=` Matches images that has at least 'number' stars.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ImageSearchInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\ImagesSearchGetResponse200Item[]|\Psr\Http\Message\ResponseInterface
+ */
+ public function imageSearch(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ImageSearch($queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param array $queryParameters {
+ * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters:
+
- `dangling=` When set to `true` (or `1`), prune only
unused *and* untagged images. When set to `false`
- * }
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ImagePruneInternalServerErrorException
- *
- * @return null|\Docker\API\Model\ImagesPrunePostResponse200|\Psr\Http\Message\ResponseInterface
- */
- public function imagePrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImagePrune($queryParameters), $fetch);
- }
-
- /**
- * Validate credentials for a registry and, if available, get an identity token for accessing the registry without password.
- *
- * @param \Docker\API\Model\AuthConfig $authConfig Authentication to check
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\SystemAuthInternalServerErrorException
- *
- * @return null|\Docker\API\Model\AuthPostResponse200|\Psr\Http\Message\ResponseInterface
- */
+ (or `0`), all unused images are pruned.
+ - `until=` Prune images created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.
+ - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune images with (or without, in case `label!=...` is used) the specified labels.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ImagePruneInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\ImagesPrunePostResponse200|\Psr\Http\Message\ResponseInterface
+ */
+ public function imagePrune(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ImagePrune($queryParameters), $fetch);
+ }
+ /**
+ * Validate credentials for a registry and, if available, get an identity
+ token for accessing the registry without password.
+
+ *
+ * @param \Docker\API\Model\AuthConfig $authConfig Authentication to check
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\SystemAuthUnauthorizedException
+ * @throws \Docker\API\Exception\SystemAuthInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\AuthPostResponse200|\Psr\Http\Message\ResponseInterface
+ */
public function systemAuth(\Docker\API\Model\AuthConfig $authConfig, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SystemAuth($authConfig), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SystemAuth($authConfig), $fetch);
}
-
/**
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\SystemInfoInternalServerErrorException
*
* @return null|\Docker\API\Model\SystemInfo|\Psr\Http\Message\ResponseInterface
*/
public function systemInfo(string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SystemInfo(), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SystemInfo(), $fetch);
}
-
/**
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\SystemVersionInternalServerErrorException
*
- * @return null|\Docker\API\Model\VersionGetResponse200|\Psr\Http\Message\ResponseInterface
+ * @return null|\Docker\API\Model\SystemVersion|\Psr\Http\Message\ResponseInterface
*/
public function systemVersion(string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SystemVersion(), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SystemVersion(), $fetch);
}
-
/**
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\SystemPingInternalServerErrorException
*
* @return null|\Psr\Http\Message\ResponseInterface
*/
public function systemPing(string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SystemPing(), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SystemPing(), $fetch);
}
-
/**
- * @param \Docker\API\Model\ContainerConfig $containerConfig The container configuration
- * @param array $queryParameters {
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\SystemPingHeadInternalServerErrorException
*
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function systemPingHead(string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SystemPingHead(), $fetch);
+ }
+ /**
+ *
+ *
+ * @param \Docker\API\Model\ContainerConfig $containerConfig The container configuration
+ * @param array $queryParameters {
* @var string $container The ID or name of the container to commit
* @var string $repo Repository name for the created image
* @var string $tag Tag name for the create image
@@ -969,91 +1095,105 @@ public function systemPing(string $fetch = self::FETCH_OBJECT)
* @var bool $pause Whether to pause the container before committing
* @var string $changes `Dockerfile` instructions to apply while committing
* }
- *
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\ImageCommitNotFoundException
* @throws \Docker\API\Exception\ImageCommitInternalServerErrorException
*
* @return null|\Docker\API\Model\IdResponse|\Psr\Http\Message\ResponseInterface
*/
- public function imageCommit(\Docker\API\Model\ContainerConfig $containerConfig, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
+ public function imageCommit(\Docker\API\Model\ContainerConfig $containerConfig, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageCommit($containerConfig, $queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ImageCommit($containerConfig, $queryParameters), $fetch);
}
-
/**
- * Stream real-time events from the server.
-
+ * Stream real-time events from the server.
+
Various objects within Docker report events when something happens to them.
-
- Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, and `update`
-
- Images report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, and `untag`
-
- Volumes report these events: `create`, `mount`, `unmount`, and `destroy`
-
- Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, and `remove`
-
+
+ Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune`
+
+ Images report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune`
+
+ Volumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune`
+
+ Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune`
+
The Docker daemon reports these events: `reload`
-
+
Services report these events: `create`, `update`, and `remove`
-
+
Nodes report these events: `create`, `update`, and `remove`
-
+
Secrets report these events: `create`, `update`, and `remove`
-
+
Configs report these events: `create`, `update`, and `remove`
-
+
+ The Builder reports `prune` events
+
+ *
+ * @param array $queryParameters {
+ * @var string $since Show events created since this timestamp then stream new events.
+ * @var string $until Show events created until this timestamp then stop streaming.
+ * @var string $filters A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters:
+
+ - `config=` config name or ID
+ - `container=` container name or ID
+ - `daemon=` daemon name or ID
+ - `event=` event type
+ - `image=` image name or ID
+ - `label=` image or container label
+ - `network=` network name or ID
+ - `node=` node ID
+ - `plugin`= plugin name or ID
+ - `scope`= local or swarm
+ - `secret=` secret name or ID
+ - `service=` service name or ID
+ - `type=` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config`
+ - `volume=` volume name
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\SystemEventsBadRequestException
+ * @throws \Docker\API\Exception\SystemEventsInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\EventMessage|\Psr\Http\Message\ResponseInterface
+ */
+ public function systemEvents(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SystemEvents($queryParameters), $fetch);
+ }
+ /**
+ *
*
* @param array $queryParameters {
- *
- * @var string $since show events created since this timestamp then stream new events
- * @var string $until show events created until this timestamp then stop streaming
- * @var string $filters A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters:
-
+ * @var array $type Object types, for which to compute and return data.
* }
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\SystemEventsBadRequestException
- * @throws \Docker\API\Exception\SystemEventsInternalServerErrorException
- *
- * @return null|\Docker\API\Model\EventsGetResponse200|\Psr\Http\Message\ResponseInterface
- */
- public function systemEvents(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SystemEvents($queryParameters), $fetch);
- }
-
- /**
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\SystemDataUsageInternalServerErrorException
*
* @return null|\Docker\API\Model\SystemDfGetResponse200|\Psr\Http\Message\ResponseInterface
*/
- public function systemDataUsage(string $fetch = self::FETCH_OBJECT)
+ public function systemDataUsage(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SystemDataUsage(), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SystemDataUsage($queryParameters), $fetch);
}
-
/**
- * Get a tarball containing all images and metadata for a repository.
-
+ * Get a tarball containing all images and metadata for a repository.
+
If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced.
-
+
### Image tarball format
-
+
An image tarball contains one directory per image layer (named using its long ID), each containing these files:
-
+
- `VERSION`: currently `1.0` - the file format version
- `json`: detailed layer information, similar to `docker inspect layer_id`
- `layer.tar`: A tarfile containing the filesystem changes in this layer
-
+
The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions.
-
+
If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs.
-
+
```json
{
"hello-world": {
@@ -1061,74 +1201,68 @@ public function systemDataUsage(string $fetch = self::FETCH_OBJECT)
}
}
```
-
- *
- * @param string $name Image name or ID
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ImageGetInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
+
+ *
+ * @param string $name Image name or ID
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ImageGetInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
public function imageGet(string $name, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageGet($name), $fetch);
- }
-
- /**
- * Get a tarball containing all images and metadata for several image repositories.
-
- For each value of the `names` parameter: if it is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned; if it is an image ID, similarly only that image (and its parents) are returned and there would be no names referenced in the 'repositories' file for this image ID.
-
- For details on the format, see [the export image endpoint](#operation/ImageGet).
-
- *
- * @param array $queryParameters {
- *
- * @var array $names Image names to filter by
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ImageGetAllInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function imageGetAll(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageGetAll($queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ImageGet($name), $fetch);
+ }
+ /**
+ * Get a tarball containing all images and metadata for several image
+ repositories.
+
+ For each value of the `names` parameter: if it is a specific name and
+ tag (e.g. `ubuntu:latest`), then only that image (and its parents) are
+ returned; if it is an image ID, similarly only that image (and its parents)
+ are returned and there would be no names referenced in the 'repositories'
+ file for this image ID.
+
+ For details on the format, see the [export image endpoint](#operation/ImageGet).
+
+ *
+ * @param array $queryParameters {
+ * @var array $names Image names to filter by
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ImageGetAllInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function imageGetAll(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ImageGetAll($queryParameters), $fetch);
+ }
+ /**
+ * Load a set of images and tags into a repository.
+
+ For details on the format, see the [export image endpoint](#operation/ImageGet).
+
+ *
+ * @param string|resource|\Psr\Http\Message\StreamInterface $imagesTarball Tar archive containing images
+ * @param array $queryParameters {
+ * @var bool $quiet Suppress progress details during load.
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ImageLoadInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function imageLoad($imagesTarball, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ImageLoad($imagesTarball, $queryParameters), $fetch);
}
-
- /**
- * Load a set of images and tags into a repository.
-
- For details on the format, see [the export image endpoint](#operation/ImageGet).
-
- *
- * @param string|resource|\Psr\Http\Message\StreamInterface $imagesTarball Tar archive containing images
- * @param array $queryParameters {
- *
- * @var bool $quiet Suppress progress details during load.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ImageLoadInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function imageLoad($imagesTarball, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageLoad($imagesTarball, $queryParameters), $fetch);
- }
-
/**
* Run a command inside a running container.
*
- * @param string $id ID or name of container
+ * @param string $id ID or name of container
* @param \Docker\API\Model\ContainersIdExecPostBody $execConfig Exec configuration
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \Docker\API\Exception\ContainerExecNotFoundException
* @throws \Docker\API\Exception\ContainerExecConflictException
* @throws \Docker\API\Exception\ContainerExecInternalServerErrorException
@@ -1137,53 +1271,52 @@ public function imageLoad($imagesTarball, array $queryParameters = [], string $f
*/
public function containerExec(string $id, \Docker\API\Model\ContainersIdExecPostBody $execConfig, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerExec($id, $execConfig), $fetch);
- }
-
- /**
- * 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.
- *
- * @param string $id Exec instance ID
- * @param \Docker\API\Model\ExecIdStartPostBody $execStartConfig
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ExecStartNotFoundException
- * @throws \Docker\API\Exception\ExecStartConflictException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ContainerExec($id, $execConfig), $fetch);
+ }
+ /**
+ * 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.
+
+ *
+ * @param string $id Exec instance ID
+ * @param \Docker\API\Model\ExecIdStartPostBody $execStartConfig
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ExecStartNotFoundException
+ * @throws \Docker\API\Exception\ExecStartConflictException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
public function execStart(string $id, \Docker\API\Model\ExecIdStartPostBody $execStartConfig, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ExecStart($id, $execStartConfig), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ExecStart($id, $execStartConfig), $fetch);
}
-
/**
- * Resize the TTY session used by an exec instance. This endpoint only works if `tty` was specified as part of creating and starting the exec instance.
- *
- * @param string $id Exec instance ID
- * @param array $queryParameters {
- *
- * @var int $h Height of the TTY session in characters
- * @var int $w Width of the TTY session in characters
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ExecResizeNotFoundException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function execResize(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
+ * Resize the TTY session used by an exec instance. This endpoint only works
+ if `tty` was specified as part of creating and starting the exec instance.
+
+ *
+ * @param string $id Exec instance ID
+ * @param array $queryParameters {
+ * @var int $h Height of the TTY session in characters
+ * @var int $w Width of the TTY session in characters
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ExecResizeBadRequestException
+ * @throws \Docker\API\Exception\ExecResizeNotFoundException
+ * @throws \Docker\API\Exception\ExecResizeInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function execResize(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ExecResize($id, $queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ExecResize($id, $queryParameters), $fetch);
}
-
/**
* Return low-level information about an exec instance.
*
- * @param string $id Exec instance ID
+ * @param string $id Exec instance ID
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\ExecInspectNotFoundException
* @throws \Docker\API\Exception\ExecInspectInternalServerErrorException
*
@@ -1191,64 +1324,70 @@ public function execResize(string $id, array $queryParameters = [], string $fetc
*/
public function execInspect(string $id, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ExecInspect($id), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ExecInspect($id), $fetch);
}
-
/**
- * @param array $queryParameters {
- *
- * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to
- * }
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\VolumeListInternalServerErrorException
- *
- * @return null|\Docker\API\Model\VolumesGetResponse200|\Psr\Http\Message\ResponseInterface
- */
- public function volumeList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
+ *
+ *
+ * @param array $queryParameters {
+ * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to
+ process on the volumes list. Available filters:
+
+ - `dangling=` When set to `true` (or `1`), returns all
+ volumes that are not in use by a container. When set to `false`
+ (or `0`), only volumes that are in use by one or more
+ containers are returned.
+ - `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.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\VolumeListInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\VolumeListResponse|\Psr\Http\Message\ResponseInterface
+ */
+ public function volumeList(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\VolumeList($queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\VolumeList($queryParameters), $fetch);
}
-
/**
- * @param \Docker\API\Model\VolumesCreatePostBody $volumeConfig Volume configuration
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ *
*
+ * @param \Docker\API\Model\VolumeCreateOptions $volumeConfig Volume configuration
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \Docker\API\Exception\VolumeCreateInternalServerErrorException
*
* @return null|\Docker\API\Model\Volume|\Psr\Http\Message\ResponseInterface
*/
- public function volumeCreate(\Docker\API\Model\VolumesCreatePostBody $volumeConfig, string $fetch = self::FETCH_OBJECT)
+ public function volumeCreate(\Docker\API\Model\VolumeCreateOptions $volumeConfig, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\VolumeCreate($volumeConfig), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\VolumeCreate($volumeConfig), $fetch);
}
-
/**
* Instruct the driver to remove the volume.
*
- * @param string $name Volume name or ID
- * @param array $queryParameters {
- *
+ * @param string $name Volume name or ID
+ * @param array $queryParameters {
* @var bool $force Force the removal of the volume
* }
- *
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\VolumeDeleteNotFoundException
* @throws \Docker\API\Exception\VolumeDeleteConflictException
* @throws \Docker\API\Exception\VolumeDeleteInternalServerErrorException
*
* @return null|\Psr\Http\Message\ResponseInterface
*/
- public function volumeDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
+ public function volumeDelete(string $name, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\VolumeDelete($name, $queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\VolumeDelete($name, $queryParameters), $fetch);
}
-
/**
- * @param string $name Volume name or ID
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ *
*
+ * @param string $name Volume name or ID
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \Docker\API\Exception\VolumeInspectNotFoundException
* @throws \Docker\API\Exception\VolumeInspectInternalServerErrorException
*
@@ -1256,53 +1395,94 @@ public function volumeDelete(string $name, array $queryParameters = [], string $
*/
public function volumeInspect(string $name, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\VolumeInspect($name), $fetch);
- }
-
- /**
- * @param array $queryParameters {
- *
- * @var string $filters filters to process on the prune list, encoded as JSON (a `map[string][]string`)
-
- * }
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\VolumePruneInternalServerErrorException
- *
- * @return null|\Docker\API\Model\VolumesPrunePostResponse200|\Psr\Http\Message\ResponseInterface
- */
- public function volumePrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\VolumePrune($queryParameters), $fetch);
- }
-
- /**
- * Returns a list of networks. For details on the format, see [the network inspect endpoint](#operation/NetworkInspect).
-
- Note that it uses a different, smaller representation of a network than inspecting a single network. For example,
- the list of containers attached to the network is not propagated in API versions 1.28 and up.
-
- *
- * @param array $queryParameters {
- *
- * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to process on the networks list. Available filters:
-
- * }
+ return $this->executeEndpoint(new \Docker\API\Endpoint\VolumeInspect($name), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string $name The name or ID of the volume
+ * @param \Docker\API\Model\VolumesNamePutBody $body The spec of the volume to update. Currently, only Availability may
+ change. All other fields must remain unchanged.
+
+ * @param array $queryParameters {
+ * @var int $version The version number of the volume being updated. This is required to
+ avoid conflicting writes. Found in the volume's `ClusterVolume`
+ field.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\VolumeUpdateBadRequestException
+ * @throws \Docker\API\Exception\VolumeUpdateNotFoundException
+ * @throws \Docker\API\Exception\VolumeUpdateInternalServerErrorException
+ * @throws \Docker\API\Exception\VolumeUpdateServiceUnavailableException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function volumeUpdate(string $name, \Docker\API\Model\VolumesNamePutBody $body, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\VolumeUpdate($name, $body, $queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param array $queryParameters {
+ * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`).
+
+ Available filters:
+ - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels.
+ - `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\VolumePruneInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\VolumesPrunePostResponse200|\Psr\Http\Message\ResponseInterface
+ */
+ public function volumePrune(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\VolumePrune($queryParameters), $fetch);
+ }
+ /**
+ * Returns a list of networks. For details on the format, see the
+ [network inspect endpoint](#operation/NetworkInspect).
+
+ Note that it uses a different, smaller representation of a network than
+ inspecting a single network. For example, the list of containers attached
+ to the network is not propagated in API versions 1.28 and up.
+
+ *
+ * @param array $queryParameters {
+ * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to process
+ on the networks list.
+
+ Available filters:
+
+ - `dangling=` When set to `true` (or `1`), returns all
+ networks that are not in use by a container. When set to `false`
+ (or `0`), only networks that are in use by one or more
+ containers are returned.
+ - `driver=` Matches a network's driver.
+ - `id=` Matches all or part of a network ID.
+ - `label=` or `label==` of a network label.
+ - `name=` Matches all or part of a network name.
+ - `scope=["swarm"|"global"|"local"]` Filters networks by scope (`swarm`, `global`, or `local`).
+ - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\NetworkListInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\Network[]|\Psr\Http\Message\ResponseInterface
+ */
+ public function networkList(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkList($queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string $id Network ID or name
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\NetworkListInternalServerErrorException
- *
- * @return null|\Docker\API\Model\Network[]|\Psr\Http\Message\ResponseInterface
- */
- public function networkList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkList($queryParameters), $fetch);
- }
-
- /**
- * @param string $id Network ID or name
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\NetworkDeleteForbiddenException
* @throws \Docker\API\Exception\NetworkDeleteNotFoundException
* @throws \Docker\API\Exception\NetworkDeleteInternalServerErrorException
@@ -1311,345 +1491,372 @@ public function networkList(array $queryParameters = [], string $fetch = self::F
*/
public function networkDelete(string $id, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkDelete($id), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkDelete($id), $fetch);
}
-
/**
- * @param string $id Network ID or name
- * @param array $queryParameters {
+ *
*
+ * @param string $id Network ID or name
+ * @param array $queryParameters {
* @var bool $verbose Detailed inspect output for troubleshooting
* @var string $scope Filter the network by scope (swarm, global, or local)
* }
- *
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\NetworkInspectNotFoundException
* @throws \Docker\API\Exception\NetworkInspectInternalServerErrorException
*
* @return null|\Docker\API\Model\Network|\Psr\Http\Message\ResponseInterface
*/
- public function networkInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
+ public function networkInspect(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkInspect($id, $queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkInspect($id, $queryParameters), $fetch);
}
-
/**
- * @param \Docker\API\Model\NetworksCreatePostBody $networkConfig Network configuration
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ *
*
+ * @param \Docker\API\Model\NetworksCreatePostBody $networkConfig Network configuration
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \Docker\API\Exception\NetworkCreateForbiddenException
* @throws \Docker\API\Exception\NetworkCreateNotFoundException
* @throws \Docker\API\Exception\NetworkCreateInternalServerErrorException
*
- * @return null|\Docker\API\Model\NetworksCreatePostResponse201|\Psr\Http\Message\ResponseInterface
- */
- public function networkCreate(\Docker\API\Model\NetworksCreatePostBody $networkConfig, string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkCreate($networkConfig), $fetch);
- }
-
- /**
- * @param string $id Network ID or name
- * @param \Docker\API\Model\NetworksIdConnectPostBody $container
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\NetworkConnectForbiddenException
- * @throws \Docker\API\Exception\NetworkConnectNotFoundException
- * @throws \Docker\API\Exception\NetworkConnectInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function networkConnect(string $id, \Docker\API\Model\NetworksIdConnectPostBody $container, string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkConnect($id, $container), $fetch);
- }
-
- /**
- * @param string $id Network ID or name
- * @param \Docker\API\Model\NetworksIdDisconnectPostBody $container
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\NetworkDisconnectForbiddenException
- * @throws \Docker\API\Exception\NetworkDisconnectNotFoundException
- * @throws \Docker\API\Exception\NetworkDisconnectInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function networkDisconnect(string $id, \Docker\API\Model\NetworksIdDisconnectPostBody $container, string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkDisconnect($id, $container), $fetch);
- }
-
- /**
- * @param array $queryParameters {
- *
- * @var string $filters filters to process on the prune list, encoded as JSON (a `map[string][]string`)
-
- * }
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\NetworkPruneInternalServerErrorException
- *
- * @return null|\Docker\API\Model\NetworksPrunePostResponse200|\Psr\Http\Message\ResponseInterface
- */
- public function networkPrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkPrune($queryParameters), $fetch);
- }
-
- /**
- * Returns information about installed plugins.
- *
- * @param array $queryParameters {
- *
- * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the plugin list. Available filters:
-
- * }
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\PluginListInternalServerErrorException
- *
- * @return null|\Docker\API\Model\Plugin[]|\Psr\Http\Message\ResponseInterface
- */
- public function pluginList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginList($queryParameters), $fetch);
- }
-
- /**
- * @param array $queryParameters {
- *
- * @var string $remote The name of the plugin. The `:latest` tag is optional, and is the default if omitted.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\GetPluginPrivilegesInternalServerErrorException
- *
- * @return null|\Docker\API\Model\PluginsPrivilegesGetResponse200Item[]|\Psr\Http\Message\ResponseInterface
- */
- public function getPluginPrivileges(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\GetPluginPrivileges($queryParameters), $fetch);
- }
-
- /**
- * Pulls and installs a plugin. After the plugin is installed, it can be enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable).
-
- *
- * @param array $body
- * @param array $queryParameters {
- *
- * @var string $remote remote reference for plugin to install
-
- * @var string $name local name for the pulled plugin
-
- The `:latest` tag is optional, and is used as the default if omitted.
-
- * }
- *
- * @param array $headerParameters {
- *
- * @var string $X-Registry-Auth A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\PluginPullInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function pluginPull(array $body, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginPull($body, $queryParameters, $headerParameters), $fetch);
- }
-
- /**
- * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted.
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\PluginInspectNotFoundException
- * @throws \Docker\API\Exception\PluginInspectInternalServerErrorException
- *
- * @return null|\Docker\API\Model\Plugin|\Psr\Http\Message\ResponseInterface
- */
- public function pluginInspect(string $name, string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginInspect($name), $fetch);
- }
-
- /**
- * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted.
- * @param array $queryParameters {
- *
- * @var bool $force Disable the plugin before removing. This may result in issues if the plugin is in use by a container.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\PluginDeleteNotFoundException
- * @throws \Docker\API\Exception\PluginDeleteInternalServerErrorException
- *
- * @return null|\Docker\API\Model\Plugin|\Psr\Http\Message\ResponseInterface
- */
- public function pluginDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginDelete($name, $queryParameters), $fetch);
- }
-
- /**
- * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted.
- * @param array $queryParameters {
- *
- * @var int $timeout Set the HTTP client timeout (in seconds)
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\PluginEnableNotFoundException
- * @throws \Docker\API\Exception\PluginEnableInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function pluginEnable(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginEnable($name, $queryParameters), $fetch);
- }
-
- /**
- * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted.
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\PluginDisableNotFoundException
- * @throws \Docker\API\Exception\PluginDisableInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function pluginDisable(string $name, string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginDisable($name), $fetch);
- }
-
- /**
- * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted.
- * @param array $body
- * @param array $queryParameters {
- *
- * @var string $remote remote reference to upgrade to
-
- The `:latest` tag is optional, and is used as the default if omitted.
-
- * }
- *
- * @param array $headerParameters {
- *
- * @var string $X-Registry-Auth A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\PluginUpgradeNotFoundException
- * @throws \Docker\API\Exception\PluginUpgradeInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function pluginUpgrade(string $name, array $body, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginUpgrade($name, $body, $queryParameters, $headerParameters), $fetch);
- }
-
- /**
- * @param string|resource|\Psr\Http\Message\StreamInterface $tarContext Path to tar containing plugin rootfs and manifest
- * @param array $queryParameters {
- *
- * @var string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\PluginCreateInternalServerErrorException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
+ * @return null|\Docker\API\Model\NetworksCreatePostResponse201|\Psr\Http\Message\ResponseInterface
*/
- public function pluginCreate($tarContext, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
+ public function networkCreate(\Docker\API\Model\NetworksCreatePostBody $networkConfig, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginCreate($tarContext, $queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkCreate($networkConfig), $fetch);
}
-
/**
- * Push a plugin to the registry.
+ *
*
- * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted.
+ * @param string $id Network ID or name
+ * @param \Docker\API\Model\NetworksIdConnectPostBody $container
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\PluginPushNotFoundException
- * @throws \Docker\API\Exception\PluginPushInternalServerErrorException
+ * @throws \Docker\API\Exception\NetworkConnectForbiddenException
+ * @throws \Docker\API\Exception\NetworkConnectNotFoundException
+ * @throws \Docker\API\Exception\NetworkConnectInternalServerErrorException
*
* @return null|\Psr\Http\Message\ResponseInterface
*/
- public function pluginPush(string $name, string $fetch = self::FETCH_OBJECT)
+ public function networkConnect(string $id, \Docker\API\Model\NetworksIdConnectPostBody $container, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginPush($name), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkConnect($id, $container), $fetch);
}
-
/**
- * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted.
- * @param array $body
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ *
*
- * @throws \Docker\API\Exception\PluginSetNotFoundException
- * @throws \Docker\API\Exception\PluginSetInternalServerErrorException
+ * @param string $id Network ID or name
+ * @param \Docker\API\Model\NetworksIdDisconnectPostBody $container
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\NetworkDisconnectForbiddenException
+ * @throws \Docker\API\Exception\NetworkDisconnectNotFoundException
+ * @throws \Docker\API\Exception\NetworkDisconnectInternalServerErrorException
*
* @return null|\Psr\Http\Message\ResponseInterface
*/
+ public function networkDisconnect(string $id, \Docker\API\Model\NetworksIdDisconnectPostBody $container, string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkDisconnect($id, $container), $fetch);
+ }
+ /**
+ *
+ *
+ * @param array $queryParameters {
+ * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`).
+
+ Available filters:
+ - `until=` Prune networks created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.
+ - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune networks with (or without, in case `label!=...` is used) the specified labels.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\NetworkPruneInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\NetworksPrunePostResponse200|\Psr\Http\Message\ResponseInterface
+ */
+ public function networkPrune(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\NetworkPrune($queryParameters), $fetch);
+ }
+ /**
+ * Returns information about installed plugins.
+ *
+ * @param array $queryParameters {
+ * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to
+ process on the plugin list.
+
+ Available filters:
+
+ - `capability=`
+ - `enable=|`
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\PluginListInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\Plugin[]|\Psr\Http\Message\ResponseInterface
+ */
+ public function pluginList(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\PluginList($queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param array $queryParameters {
+ * @var string $remote The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\GetPluginPrivilegesInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\PluginPrivilege[]|\Psr\Http\Message\ResponseInterface
+ */
+ public function getPluginPrivileges(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\GetPluginPrivileges($queryParameters), $fetch);
+ }
+ /**
+ * Pulls and installs a plugin. After the plugin is installed, it can be
+ enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable).
+
+ *
+ * @param \Docker\API\Model\PluginPrivilege[] $body
+ * @param array $queryParameters {
+ * @var string $remote Remote reference for plugin to install.
+
+ The `:latest` tag is optional, and is used as the default if omitted.
+
+ * @var string $name Local name for the pulled plugin.
+
+ The `:latest` tag is optional, and is used as the default if omitted.
+
+ * }
+ * @param array $headerParameters {
+ * @var string $X-Registry-Auth A base64url-encoded auth configuration to use when pulling a plugin
+ from a registry.
+
+ Refer to the [authentication section](#section/Authentication) for
+ details.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\PluginPullInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function pluginPull(array $body, array $queryParameters = array(), array $headerParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\PluginPull($body, $queryParameters, $headerParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string $name The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
+
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\PluginInspectNotFoundException
+ * @throws \Docker\API\Exception\PluginInspectInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\Plugin|\Psr\Http\Message\ResponseInterface
+ */
+ public function pluginInspect(string $name, string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\PluginInspect($name), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string $name The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
+
+ * @param array $queryParameters {
+ * @var bool $force Disable the plugin before removing. This may result in issues if the
+ plugin is in use by a container.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\PluginDeleteNotFoundException
+ * @throws \Docker\API\Exception\PluginDeleteInternalServerErrorException
+ *
+ * @return null|\Docker\API\Model\Plugin|\Psr\Http\Message\ResponseInterface
+ */
+ public function pluginDelete(string $name, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\PluginDelete($name, $queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string $name The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
+
+ * @param array $queryParameters {
+ * @var int $timeout Set the HTTP client timeout (in seconds)
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\PluginEnableNotFoundException
+ * @throws \Docker\API\Exception\PluginEnableInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function pluginEnable(string $name, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\PluginEnable($name, $queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string $name The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
+
+ * @param array $queryParameters {
+ * @var bool $force Force disable a plugin even if still in use.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\PluginDisableNotFoundException
+ * @throws \Docker\API\Exception\PluginDisableInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function pluginDisable(string $name, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\PluginDisable($name, $queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string $name The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
+
+ * @param \Docker\API\Model\PluginPrivilege[] $body
+ * @param array $queryParameters {
+ * @var string $remote Remote reference to upgrade to.
+
+ The `:latest` tag is optional, and is used as the default if omitted.
+
+ * }
+ * @param array $headerParameters {
+ * @var string $X-Registry-Auth A base64url-encoded auth configuration to use when pulling a plugin
+ from a registry.
+
+ Refer to the [authentication section](#section/Authentication) for
+ details.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\PluginUpgradeNotFoundException
+ * @throws \Docker\API\Exception\PluginUpgradeInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function pluginUpgrade(string $name, array $body, array $queryParameters = array(), array $headerParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\PluginUpgrade($name, $body, $queryParameters, $headerParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string|resource|\Psr\Http\Message\StreamInterface $tarContext Path to tar containing plugin rootfs and manifest
+ * @param array $queryParameters {
+ * @var string $name The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\PluginCreateInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function pluginCreate($tarContext, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\PluginCreate($tarContext, $queryParameters), $fetch);
+ }
+ /**
+ * Push a plugin to the registry.
+
+ *
+ * @param string $name The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
+
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\PluginPushNotFoundException
+ * @throws \Docker\API\Exception\PluginPushInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function pluginPush(string $name, string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\PluginPush($name), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string $name The name of the plugin. The `:latest` tag is optional, and is the
+ default if omitted.
+
+ * @param array $body
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\PluginSetNotFoundException
+ * @throws \Docker\API\Exception\PluginSetInternalServerErrorException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
public function pluginSet(string $name, array $body, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginSet($name, $body), $fetch);
- }
-
- /**
+ return $this->executeEndpoint(new \Docker\API\Endpoint\PluginSet($name, $body), $fetch);
+ }
+ /**
+ *
+ *
+ * @param array $queryParameters {
+ * @var string $filters Filters to process on the nodes list, encoded as JSON (a `map[string][]string`).
+
+ Available filters:
+ - `id=`
+ - `label=`
+ - `membership=`(`accepted`|`pending`)`
+ - `name=`
+ - `node.label=`
+ - `role=`(`manager`|`worker`)`
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\NodeListInternalServerErrorException
+ * @throws \Docker\API\Exception\NodeListServiceUnavailableException
+ *
+ * @return null|\Docker\API\Model\Node[]|\Psr\Http\Message\ResponseInterface
+ */
+ public function nodeList(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\NodeList($queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string $id The ID or name of the node
* @param array $queryParameters {
- *
- * @var string $filters filters to process on the nodes list, encoded as JSON (a `map[string][]string`)
-
- * }
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\NodeListInternalServerErrorException
- * @throws \Docker\API\Exception\NodeListServiceUnavailableException
- *
- * @return null|\Docker\API\Model\Node[]|\Psr\Http\Message\ResponseInterface
- */
- public function nodeList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NodeList($queryParameters), $fetch);
- }
-
- /**
- * @param string $id The ID or name of the node
- * @param array $queryParameters {
- *
* @var bool $force Force remove a node from the swarm
* }
- *
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\NodeDeleteNotFoundException
* @throws \Docker\API\Exception\NodeDeleteInternalServerErrorException
* @throws \Docker\API\Exception\NodeDeleteServiceUnavailableException
*
* @return null|\Psr\Http\Message\ResponseInterface
*/
- public function nodeDelete(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
+ public function nodeDelete(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NodeDelete($id, $queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\NodeDelete($id, $queryParameters), $fetch);
}
-
/**
- * @param string $id The ID or name of the node
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ *
*
+ * @param string $id The ID or name of the node
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \Docker\API\Exception\NodeInspectNotFoundException
* @throws \Docker\API\Exception\NodeInspectInternalServerErrorException
* @throws \Docker\API\Exception\NodeInspectServiceUnavailableException
@@ -1658,34 +1865,32 @@ public function nodeDelete(string $id, array $queryParameters = [], string $fetc
*/
public function nodeInspect(string $id, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NodeInspect($id), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\NodeInspect($id), $fetch);
}
-
/**
- * @param string $id The ID of the node
- * @param \Docker\API\Model\NodeSpec $body
- * @param array $queryParameters {
- *
- * @var int $version The version number of the node object being updated. This is required to avoid conflicting writes.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\NodeUpdateBadRequestException
- * @throws \Docker\API\Exception\NodeUpdateNotFoundException
- * @throws \Docker\API\Exception\NodeUpdateInternalServerErrorException
- * @throws \Docker\API\Exception\NodeUpdateServiceUnavailableException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function nodeUpdate(string $id, \Docker\API\Model\NodeSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
+ *
+ *
+ * @param string $id The ID of the node
+ * @param \Docker\API\Model\NodeSpec $body
+ * @param array $queryParameters {
+ * @var int $version The version number of the node object being updated. This is required
+ to avoid conflicting writes.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\NodeUpdateBadRequestException
+ * @throws \Docker\API\Exception\NodeUpdateNotFoundException
+ * @throws \Docker\API\Exception\NodeUpdateInternalServerErrorException
+ * @throws \Docker\API\Exception\NodeUpdateServiceUnavailableException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function nodeUpdate(string $id, \Docker\API\Model\NodeSpec $body, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NodeUpdate($id, $body, $queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\NodeUpdate($id, $body, $queryParameters), $fetch);
}
-
/**
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\SwarmInspectNotFoundException
* @throws \Docker\API\Exception\SwarmInspectInternalServerErrorException
* @throws \Docker\API\Exception\SwarmInspectServiceUnavailableException
@@ -1694,13 +1899,13 @@ public function nodeUpdate(string $id, \Docker\API\Model\NodeSpec $body, array $
*/
public function swarmInspect(string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmInspect(), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SwarmInspect(), $fetch);
}
-
/**
- * @param \Docker\API\Model\SwarmInitPostBody $body
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ *
*
+ * @param \Docker\API\Model\SwarmInitPostBody $body
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \Docker\API\Exception\SwarmInitBadRequestException
* @throws \Docker\API\Exception\SwarmInitInternalServerErrorException
* @throws \Docker\API\Exception\SwarmInitServiceUnavailableException
@@ -1709,13 +1914,13 @@ public function swarmInspect(string $fetch = self::FETCH_OBJECT)
*/
public function swarmInit(\Docker\API\Model\SwarmInitPostBody $body, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmInit($body), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SwarmInit($body), $fetch);
}
-
/**
- * @param \Docker\API\Model\SwarmJoinPostBody $body
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ *
*
+ * @param \Docker\API\Model\SwarmJoinPostBody $body
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \Docker\API\Exception\SwarmJoinBadRequestException
* @throws \Docker\API\Exception\SwarmJoinInternalServerErrorException
* @throws \Docker\API\Exception\SwarmJoinServiceUnavailableException
@@ -1724,53 +1929,51 @@ public function swarmInit(\Docker\API\Model\SwarmInitPostBody $body, string $fet
*/
public function swarmJoin(\Docker\API\Model\SwarmJoinPostBody $body, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmJoin($body), $fetch);
- }
-
- /**
- * @param array $queryParameters {
- *
- * @var bool $force Force leave swarm, even if this is the last manager or that it will break the cluster.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\SwarmLeaveInternalServerErrorException
- * @throws \Docker\API\Exception\SwarmLeaveServiceUnavailableException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function swarmLeave(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmLeave($queryParameters), $fetch);
- }
-
- /**
- * @param \Docker\API\Model\SwarmSpec $body
- * @param array $queryParameters {
- *
- * @var int $version The version number of the swarm object being updated. This is required to avoid conflicting writes.
- * @var bool $rotateWorkerToken rotate the worker join token
- * @var bool $rotateManagerToken rotate the manager join token
- * @var bool $rotateManagerUnlockKey Rotate the manager unlock key.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\SwarmUpdateBadRequestException
- * @throws \Docker\API\Exception\SwarmUpdateInternalServerErrorException
- * @throws \Docker\API\Exception\SwarmUpdateServiceUnavailableException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function swarmUpdate(\Docker\API\Model\SwarmSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmUpdate($body, $queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SwarmJoin($body), $fetch);
+ }
+ /**
+ *
+ *
+ * @param array $queryParameters {
+ * @var bool $force Force leave swarm, even if this is the last manager or that it will
+ break the cluster.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\SwarmLeaveInternalServerErrorException
+ * @throws \Docker\API\Exception\SwarmLeaveServiceUnavailableException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function swarmLeave(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SwarmLeave($queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param \Docker\API\Model\SwarmSpec $body
+ * @param array $queryParameters {
+ * @var int $version The version number of the swarm object being updated. This is
+ required to avoid conflicting writes.
+
+ * @var bool $rotateWorkerToken Rotate the worker join token.
+ * @var bool $rotateManagerToken Rotate the manager join token.
+ * @var bool $rotateManagerUnlockKey Rotate the manager unlock key.
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\SwarmUpdateBadRequestException
+ * @throws \Docker\API\Exception\SwarmUpdateInternalServerErrorException
+ * @throws \Docker\API\Exception\SwarmUpdateServiceUnavailableException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function swarmUpdate(\Docker\API\Model\SwarmSpec $body, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SwarmUpdate($body, $queryParameters), $fetch);
}
-
/**
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\SwarmUnlockkeyInternalServerErrorException
* @throws \Docker\API\Exception\SwarmUnlockkeyServiceUnavailableException
*
@@ -1778,13 +1981,13 @@ public function swarmUpdate(\Docker\API\Model\SwarmSpec $body, array $queryParam
*/
public function swarmUnlockkey(string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmUnlockkey(), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SwarmUnlockkey(), $fetch);
}
-
/**
- * @param \Docker\API\Model\SwarmUnlockPostBody $body
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ *
*
+ * @param \Docker\API\Model\SwarmUnlockPostBody $body
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \Docker\API\Exception\SwarmUnlockInternalServerErrorException
* @throws \Docker\API\Exception\SwarmUnlockServiceUnavailableException
*
@@ -1792,53 +1995,65 @@ public function swarmUnlockkey(string $fetch = self::FETCH_OBJECT)
*/
public function swarmUnlock(\Docker\API\Model\SwarmUnlockPostBody $body, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmUnlock($body), $fetch);
- }
-
- /**
- * @param array $queryParameters {
- *
- * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the services list. Available filters:
-
- * }
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ServiceListInternalServerErrorException
- * @throws \Docker\API\Exception\ServiceListServiceUnavailableException
- *
- * @return null|\Docker\API\Model\Service[]|\Psr\Http\Message\ResponseInterface
- */
- public function serviceList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ServiceList($queryParameters), $fetch);
- }
-
- /**
- * @param \Docker\API\Model\ServicesCreatePostBody $body
- * @param array $headerParameters {
- *
- * @var string $X-Registry-Auth A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ServiceCreateBadRequestException
- * @throws \Docker\API\Exception\ServiceCreateForbiddenException
- * @throws \Docker\API\Exception\ServiceCreateConflictException
- * @throws \Docker\API\Exception\ServiceCreateInternalServerErrorException
- * @throws \Docker\API\Exception\ServiceCreateServiceUnavailableException
- *
- * @return null|\Docker\API\Model\ServicesCreatePostResponse201|\Psr\Http\Message\ResponseInterface
- */
- public function serviceCreate(\Docker\API\Model\ServicesCreatePostBody $body, array $headerParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ServiceCreate($body, $headerParameters), $fetch);
- }
-
- /**
- * @param string $id ID or name of service
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SwarmUnlock($body), $fetch);
+ }
+ /**
+ *
+ *
+ * @param array $queryParameters {
+ * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to
+ process on the services list.
+
+ Available filters:
+
+ - `id=`
+ - `label=`
+ - `mode=["replicated"|"global"]`
+ - `name=`
+
+ * @var bool $status Include service status, with count of running and desired tasks.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ServiceListInternalServerErrorException
+ * @throws \Docker\API\Exception\ServiceListServiceUnavailableException
+ *
+ * @return null|\Docker\API\Model\Service[]|\Psr\Http\Message\ResponseInterface
+ */
+ public function serviceList(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ServiceList($queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param \Docker\API\Model\ServicesCreatePostBody $body
+ * @param array $headerParameters {
+ * @var string $X-Registry-Auth A base64url-encoded auth configuration for pulling from private
+ registries.
+
+ Refer to the [authentication section](#section/Authentication) for
+ details.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ServiceCreateBadRequestException
+ * @throws \Docker\API\Exception\ServiceCreateForbiddenException
+ * @throws \Docker\API\Exception\ServiceCreateConflictException
+ * @throws \Docker\API\Exception\ServiceCreateInternalServerErrorException
+ * @throws \Docker\API\Exception\ServiceCreateServiceUnavailableException
+ *
+ * @return null|\Docker\API\Model\ServicesCreatePostResponse201|\Psr\Http\Message\ResponseInterface
+ */
+ public function serviceCreate(\Docker\API\Model\ServicesCreatePostBody $body, array $headerParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ServiceCreate($body, $headerParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string $id ID or name of service.
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\ServiceDeleteNotFoundException
* @throws \Docker\API\Exception\ServiceDeleteInternalServerErrorException
* @throws \Docker\API\Exception\ServiceDeleteServiceUnavailableException
@@ -1847,112 +2062,129 @@ public function serviceCreate(\Docker\API\Model\ServicesCreatePostBody $body, ar
*/
public function serviceDelete(string $id, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ServiceDelete($id), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ServiceDelete($id), $fetch);
}
-
/**
- * @param string $id ID or name of service
- * @param array $queryParameters {
+ *
*
+ * @param string $id ID or name of service.
+ * @param array $queryParameters {
* @var bool $insertDefaults Fill empty fields with default values.
* }
- *
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\ServiceInspectNotFoundException
* @throws \Docker\API\Exception\ServiceInspectInternalServerErrorException
* @throws \Docker\API\Exception\ServiceInspectServiceUnavailableException
*
* @return null|\Docker\API\Model\Service|\Psr\Http\Message\ResponseInterface
*/
- public function serviceInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ServiceInspect($id, $queryParameters), $fetch);
- }
-
- /**
- * @param string $id ID or name of service
- * @param \Docker\API\Model\ServicesIdUpdatePostBody $body
- * @param array $queryParameters {
- *
- * @var int $version The version number of the service object being updated. This is required to avoid conflicting writes.
- * @var string $registryAuthFrom If the X-Registry-Auth header is not specified, this parameter indicates where to find registry authorization credentials. The valid values are `spec` and `previous-spec`.
- * @var string $rollback Set to this parameter to `previous` to cause a server-side rollback to the previous service spec. The supplied spec will be ignored in this case.
- * }
- *
- * @param array $headerParameters {
- *
- * @var string $X-Registry-Auth A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ServiceUpdateBadRequestException
- * @throws \Docker\API\Exception\ServiceUpdateNotFoundException
- * @throws \Docker\API\Exception\ServiceUpdateInternalServerErrorException
- * @throws \Docker\API\Exception\ServiceUpdateServiceUnavailableException
- *
- * @return null|\Docker\API\Model\ServiceUpdateResponse|\Psr\Http\Message\ResponseInterface
- */
- public function serviceUpdate(string $id, \Docker\API\Model\ServicesIdUpdatePostBody $body, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ServiceUpdate($id, $body, $queryParameters, $headerParameters), $fetch);
- }
-
- /**
- * Get `stdout` and `stderr` logs from a service.
-
- **Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers.
-
- *
- * @param string $id ID or name of the service
- * @param array $queryParameters {
- *
- * @var bool $details show service context and extra details provided to logs
- * @var bool $follow return the logs as a stream
-
- * @var bool $stdout Return logs from `stdout`
- * @var bool $stderr Return logs from `stderr`
- * @var int $since Only return logs since this time, as a UNIX timestamp
- * @var bool $timestamps Add timestamps to every log line
- * @var string $tail Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ServiceLogsNotFoundException
- * @throws \Docker\API\Exception\ServiceLogsInternalServerErrorException
- * @throws \Docker\API\Exception\ServiceLogsServiceUnavailableException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function serviceLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ServiceLogs($id, $queryParameters), $fetch);
- }
-
- /**
- * @param array $queryParameters {
- *
- * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the tasks list. Available filters:
-
- * }
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\TaskListInternalServerErrorException
- * @throws \Docker\API\Exception\TaskListServiceUnavailableException
- *
- * @return null|\Docker\API\Model\Task[]|\Psr\Http\Message\ResponseInterface
- */
- public function taskList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\TaskList($queryParameters), $fetch);
- }
-
- /**
- * @param string $id ID of the task
+ public function serviceInspect(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ServiceInspect($id, $queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string $id ID or name of service.
+ * @param \Docker\API\Model\ServicesIdUpdatePostBody $body
+ * @param array $queryParameters {
+ * @var int $version The version number of the service object being updated. This is
+ required to avoid conflicting writes.
+ This version number should be the value as currently set on the
+ service *before* the update. You can find the current version by
+ calling `GET /services/{id}`
+
+ * @var string $registryAuthFrom If the `X-Registry-Auth` header is not specified, this parameter
+ indicates where to find registry authorization credentials.
+
+ * @var string $rollback Set to this parameter to `previous` to cause a server-side rollback
+ to the previous service spec. The supplied spec will be ignored in
+ this case.
+
+ * }
+ * @param array $headerParameters {
+ * @var string $X-Registry-Auth A base64url-encoded auth configuration for pulling from private
+ registries.
+
+ Refer to the [authentication section](#section/Authentication) for
+ details.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ServiceUpdateBadRequestException
+ * @throws \Docker\API\Exception\ServiceUpdateNotFoundException
+ * @throws \Docker\API\Exception\ServiceUpdateInternalServerErrorException
+ * @throws \Docker\API\Exception\ServiceUpdateServiceUnavailableException
+ *
+ * @return null|\Docker\API\Model\ServiceUpdateResponse|\Psr\Http\Message\ResponseInterface
+ */
+ public function serviceUpdate(string $id, \Docker\API\Model\ServicesIdUpdatePostBody $body, array $queryParameters = array(), array $headerParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ServiceUpdate($id, $body, $queryParameters, $headerParameters), $fetch);
+ }
+ /**
+ * Get `stdout` and `stderr` logs from a service. See also
+ [`/containers/{id}/logs`](#operation/ContainerLogs).
+
+ **Note**: This endpoint works only for services with the `local`,
+ `json-file` or `journald` logging drivers.
+
+ *
+ * @param string $id ID or name of the service
+ * @param array $queryParameters {
+ * @var bool $details Show service context and extra details provided to logs.
+ * @var bool $follow Keep connection after returning logs.
+ * @var bool $stdout Return logs from `stdout`
+ * @var bool $stderr Return logs from `stderr`
+ * @var int $since Only return logs since this time, as a UNIX timestamp
+ * @var bool $timestamps Add timestamps to every log line
+ * @var string $tail Only return this number of log lines from the end of the logs.
+ Specify as an integer or `all` to output all log lines.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ServiceLogsNotFoundException
+ * @throws \Docker\API\Exception\ServiceLogsInternalServerErrorException
+ * @throws \Docker\API\Exception\ServiceLogsServiceUnavailableException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function serviceLogs(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ServiceLogs($id, $queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param array $queryParameters {
+ * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to
+ process on the tasks list.
+
+ Available filters:
+
+ - `desired-state=(running | shutdown | accepted)`
+ - `id=`
+ - `label=key` or `label="key=value"`
+ - `name=`
+ - `node=`
+ - `service=`
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\TaskListInternalServerErrorException
+ * @throws \Docker\API\Exception\TaskListServiceUnavailableException
+ *
+ * @return null|\Docker\API\Model\Task[]|\Psr\Http\Message\ResponseInterface
+ */
+ public function taskList(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\TaskList($queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string $id ID of the task
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\TaskInspectNotFoundException
* @throws \Docker\API\Exception\TaskInspectInternalServerErrorException
* @throws \Docker\API\Exception\TaskInspectServiceUnavailableException
@@ -1961,63 +2193,69 @@ public function taskList(array $queryParameters = [], string $fetch = self::FETC
*/
public function taskInspect(string $id, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\TaskInspect($id), $fetch);
- }
-
- /**
- * Get `stdout` and `stderr` logs from a task.
-
- **Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers.
-
- *
- * @param string $id ID of the task
- * @param array $queryParameters {
- *
- * @var bool $details show task context and extra details provided to logs
- * @var bool $follow return the logs as a stream
-
- * @var bool $stdout Return logs from `stdout`
- * @var bool $stderr Return logs from `stderr`
- * @var int $since Only return logs since this time, as a UNIX timestamp
- * @var bool $timestamps Add timestamps to every log line
- * @var string $tail Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\TaskLogsNotFoundException
- * @throws \Docker\API\Exception\TaskLogsInternalServerErrorException
- * @throws \Docker\API\Exception\TaskLogsServiceUnavailableException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function taskLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\TaskLogs($id, $queryParameters), $fetch);
- }
-
- /**
- * @param array $queryParameters {
- *
- * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the secrets list. Available filters:
-
- * }
+ return $this->executeEndpoint(new \Docker\API\Endpoint\TaskInspect($id), $fetch);
+ }
+ /**
+ * Get `stdout` and `stderr` logs from a task.
+ See also [`/containers/{id}/logs`](#operation/ContainerLogs).
+
+ **Note**: This endpoint works only for services with the `local`,
+ `json-file` or `journald` logging drivers.
+
+ *
+ * @param string $id ID of the task
+ * @param array $queryParameters {
+ * @var bool $details Show task context and extra details provided to logs.
+ * @var bool $follow Keep connection after returning logs.
+ * @var bool $stdout Return logs from `stdout`
+ * @var bool $stderr Return logs from `stderr`
+ * @var int $since Only return logs since this time, as a UNIX timestamp
+ * @var bool $timestamps Add timestamps to every log line
+ * @var string $tail Only return this number of log lines from the end of the logs.
+ Specify as an integer or `all` to output all log lines.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\TaskLogsNotFoundException
+ * @throws \Docker\API\Exception\TaskLogsInternalServerErrorException
+ * @throws \Docker\API\Exception\TaskLogsServiceUnavailableException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function taskLogs(string $id, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\TaskLogs($id, $queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param array $queryParameters {
+ * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to
+ process on the secrets list.
+
+ Available filters:
+
+ - `id=`
+ - `label= or label==value`
+ - `name=`
+ - `names=`
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\SecretListInternalServerErrorException
+ * @throws \Docker\API\Exception\SecretListServiceUnavailableException
+ *
+ * @return null|\Docker\API\Model\Secret[]|\Psr\Http\Message\ResponseInterface
+ */
+ public function secretList(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SecretList($queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param \Docker\API\Model\SecretsCreatePostBody $body
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\SecretListInternalServerErrorException
- * @throws \Docker\API\Exception\SecretListServiceUnavailableException
- *
- * @return null|\Docker\API\Model\Secret[]|\Psr\Http\Message\ResponseInterface
- */
- public function secretList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SecretList($queryParameters), $fetch);
- }
-
- /**
- * @param \Docker\API\Model\SecretsCreatePostBody $body
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\SecretCreateConflictException
* @throws \Docker\API\Exception\SecretCreateInternalServerErrorException
* @throws \Docker\API\Exception\SecretCreateServiceUnavailableException
@@ -2026,13 +2264,13 @@ public function secretList(array $queryParameters = [], string $fetch = self::FE
*/
public function secretCreate(\Docker\API\Model\SecretsCreatePostBody $body, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SecretCreate($body), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SecretCreate($body), $fetch);
}
-
/**
- * @param string $id ID of the secret
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ *
*
+ * @param string $id ID of the secret
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \Docker\API\Exception\SecretDeleteNotFoundException
* @throws \Docker\API\Exception\SecretDeleteInternalServerErrorException
* @throws \Docker\API\Exception\SecretDeleteServiceUnavailableException
@@ -2041,13 +2279,13 @@ public function secretCreate(\Docker\API\Model\SecretsCreatePostBody $body, stri
*/
public function secretDelete(string $id, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SecretDelete($id), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SecretDelete($id), $fetch);
}
-
/**
- * @param string $id ID of the secret
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ *
*
+ * @param string $id ID of the secret
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \Docker\API\Exception\SecretInspectNotFoundException
* @throws \Docker\API\Exception\SecretInspectInternalServerErrorException
* @throws \Docker\API\Exception\SecretInspectServiceUnavailableException
@@ -2056,53 +2294,63 @@ public function secretDelete(string $id, string $fetch = self::FETCH_OBJECT)
*/
public function secretInspect(string $id, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SecretInspect($id), $fetch);
- }
-
- /**
- * @param string $id The ID or name of the secret
- * @param \Docker\API\Model\SecretSpec $body The spec of the secret to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the [SecretInspect endpoint](#operation/SecretInspect) response values.
- * @param array $queryParameters {
- *
- * @var int $version The version number of the secret object being updated. This is required to avoid conflicting writes.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\SecretUpdateBadRequestException
- * @throws \Docker\API\Exception\SecretUpdateNotFoundException
- * @throws \Docker\API\Exception\SecretUpdateInternalServerErrorException
- * @throws \Docker\API\Exception\SecretUpdateServiceUnavailableException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function secretUpdate(string $id, \Docker\API\Model\SecretSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SecretUpdate($id, $body, $queryParameters), $fetch);
- }
-
- /**
- * @param array $queryParameters {
- *
- * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the configs list. Available filters:
-
- * }
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SecretInspect($id), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string $id The ID or name of the secret
+ * @param \Docker\API\Model\SecretSpec $body The spec of the secret to update. Currently, only the Labels field
+ can be updated. All other fields must remain unchanged from the
+ [SecretInspect endpoint](#operation/SecretInspect) response values.
+
+ * @param array $queryParameters {
+ * @var int $version The version number of the secret object being updated. This is
+ required to avoid conflicting writes.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\SecretUpdateBadRequestException
+ * @throws \Docker\API\Exception\SecretUpdateNotFoundException
+ * @throws \Docker\API\Exception\SecretUpdateInternalServerErrorException
+ * @throws \Docker\API\Exception\SecretUpdateServiceUnavailableException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function secretUpdate(string $id, \Docker\API\Model\SecretSpec $body, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\SecretUpdate($id, $body, $queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param array $queryParameters {
+ * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to
+ process on the configs list.
+
+ Available filters:
+
+ - `id=`
+ - `label= or label==value`
+ - `name=`
+ - `names=`
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ConfigListInternalServerErrorException
+ * @throws \Docker\API\Exception\ConfigListServiceUnavailableException
+ *
+ * @return null|\Docker\API\Model\Config[]|\Psr\Http\Message\ResponseInterface
+ */
+ public function configList(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ConfigList($queryParameters), $fetch);
+ }
+ /**
+ *
+ *
+ * @param \Docker\API\Model\ConfigsCreatePostBody $body
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ConfigListInternalServerErrorException
- * @throws \Docker\API\Exception\ConfigListServiceUnavailableException
- *
- * @return null|\Docker\API\Model\Config[]|\Psr\Http\Message\ResponseInterface
- */
- public function configList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ConfigList($queryParameters), $fetch);
- }
-
- /**
- * @param \Docker\API\Model\ConfigsCreatePostBody $body
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\ConfigCreateConflictException
* @throws \Docker\API\Exception\ConfigCreateInternalServerErrorException
* @throws \Docker\API\Exception\ConfigCreateServiceUnavailableException
@@ -2111,13 +2359,13 @@ public function configList(array $queryParameters = [], string $fetch = self::FE
*/
public function configCreate(\Docker\API\Model\ConfigsCreatePostBody $body, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ConfigCreate($body), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ConfigCreate($body), $fetch);
}
-
/**
- * @param string $id ID of the config
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ *
*
+ * @param string $id ID of the config
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \Docker\API\Exception\ConfigDeleteNotFoundException
* @throws \Docker\API\Exception\ConfigDeleteInternalServerErrorException
* @throws \Docker\API\Exception\ConfigDeleteServiceUnavailableException
@@ -2126,13 +2374,13 @@ public function configCreate(\Docker\API\Model\ConfigsCreatePostBody $body, stri
*/
public function configDelete(string $id, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ConfigDelete($id), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ConfigDelete($id), $fetch);
}
-
/**
- * @param string $id ID of the config
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ *
*
+ * @param string $id ID of the config
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \Docker\API\Exception\ConfigInspectNotFoundException
* @throws \Docker\API\Exception\ConfigInspectInternalServerErrorException
* @throws \Docker\API\Exception\ConfigInspectServiceUnavailableException
@@ -2141,50 +2389,49 @@ public function configDelete(string $id, string $fetch = self::FETCH_OBJECT)
*/
public function configInspect(string $id, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ConfigInspect($id), $fetch);
- }
-
- /**
- * @param string $id The ID or name of the config
- * @param \Docker\API\Model\ConfigSpec $body The spec of the config to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the [ConfigInspect endpoint](#operation/ConfigInspect) response values.
- * @param array $queryParameters {
- *
- * @var int $version The version number of the config object being updated. This is required to avoid conflicting writes.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ConfigUpdateBadRequestException
- * @throws \Docker\API\Exception\ConfigUpdateNotFoundException
- * @throws \Docker\API\Exception\ConfigUpdateInternalServerErrorException
- * @throws \Docker\API\Exception\ConfigUpdateServiceUnavailableException
- *
- * @return null|\Psr\Http\Message\ResponseInterface
- */
- public function configUpdate(string $id, \Docker\API\Model\ConfigSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ConfigUpdate($id, $body, $queryParameters), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ConfigInspect($id), $fetch);
+ }
+ /**
+ *
+ *
+ * @param string $id The ID or name of the config
+ * @param \Docker\API\Model\ConfigSpec $body The spec of the config to update. Currently, only the Labels field
+ can be updated. All other fields must remain unchanged from the
+ [ConfigInspect endpoint](#operation/ConfigInspect) response values.
+
+ * @param array $queryParameters {
+ * @var int $version The version number of the config object being updated. This is
+ required to avoid conflicting writes.
+
+ * }
+ * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
+ * @throws \Docker\API\Exception\ConfigUpdateBadRequestException
+ * @throws \Docker\API\Exception\ConfigUpdateNotFoundException
+ * @throws \Docker\API\Exception\ConfigUpdateInternalServerErrorException
+ * @throws \Docker\API\Exception\ConfigUpdateServiceUnavailableException
+ *
+ * @return null|\Psr\Http\Message\ResponseInterface
+ */
+ public function configUpdate(string $id, \Docker\API\Model\ConfigSpec $body, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT)
+ {
+ return $this->executeEndpoint(new \Docker\API\Endpoint\ConfigUpdate($id, $body, $queryParameters), $fetch);
}
-
/**
* Return image digest and platform information by contacting the registry.
*
- * @param string $name Image name or id
+ * @param string $name Image name or id
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\DistributionInspectUnauthorizedException
* @throws \Docker\API\Exception\DistributionInspectInternalServerErrorException
*
- * @return null|\Docker\API\Model\DistributionNameJsonGetResponse200|\Psr\Http\Message\ResponseInterface
+ * @return null|\Docker\API\Model\DistributionInspect|\Psr\Http\Message\ResponseInterface
*/
public function distributionInspect(string $name, string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\DistributionInspect($name), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\DistributionInspect($name), $fetch);
}
-
/**
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
* @throws \Docker\API\Exception\SessionBadRequestException
* @throws \Docker\API\Exception\SessionInternalServerErrorException
*
@@ -2192,22 +2439,25 @@ public function distributionInspect(string $name, string $fetch = self::FETCH_OB
*/
public function session(string $fetch = self::FETCH_OBJECT)
{
- return $this->executePsr7Endpoint(new \Docker\API\Endpoint\Session(), $fetch);
+ return $this->executeEndpoint(new \Docker\API\Endpoint\Session(), $fetch);
}
-
- public static function create($httpClient = null)
+ public static function create($httpClient = null, array $additionalPlugins = array(), array $additionalNormalizers = array())
{
if (null === $httpClient) {
- $httpClient = \Http\Discovery\HttpClientDiscovery::find();
- $plugins = [];
- $uri = \Http\Discovery\UriFactoryDiscovery::find()->createUri('v1.36');
- $plugins[] = new \Http\Client\Common\Plugin\AddPathPlugin($uri);
+ $httpClient = \Http\Discovery\Psr18ClientDiscovery::find();
+ $plugins = array();
+ if (count($additionalPlugins) > 0) {
+ $plugins = array_merge($plugins, $additionalPlugins);
+ }
$httpClient = new \Http\Client\Common\PluginClient($httpClient, $plugins);
}
- $messageFactory = \Http\Discovery\MessageFactoryDiscovery::find();
- $streamFactory = \Http\Discovery\StreamFactoryDiscovery::find();
- $serializer = new \Symfony\Component\Serializer\Serializer(\Docker\API\Normalizer\NormalizerFactory::create(), [new \Symfony\Component\Serializer\Encoder\JsonEncoder(new \Symfony\Component\Serializer\Encoder\JsonEncode(), new \Symfony\Component\Serializer\Encoder\JsonDecode())]);
-
- return new static($httpClient, $messageFactory, $serializer, $streamFactory);
+ $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory();
+ $streamFactory = \Http\Discovery\Psr17FactoryDiscovery::findStreamFactory();
+ $normalizers = array(new \Symfony\Component\Serializer\Normalizer\ArrayDenormalizer(), new \Docker\API\Normalizer\JaneObjectNormalizer());
+ if (count($additionalNormalizers) > 0) {
+ $normalizers = array_merge($normalizers, $additionalNormalizers);
+ }
+ $serializer = new \Symfony\Component\Serializer\Serializer($normalizers, array(new \Symfony\Component\Serializer\Encoder\JsonEncoder(new \Symfony\Component\Serializer\Encoder\JsonEncode(), new \Symfony\Component\Serializer\Encoder\JsonDecode(array('json_decode_associative' => true)))));
+ return new static($httpClient, $requestFactory, $serializer, $streamFactory);
}
-}
+}
\ No newline at end of file
diff --git a/src/ClientAsync.php b/src/ClientAsync.php
deleted file mode 100644
index 8ae78372..00000000
--- a/src/ClientAsync.php
+++ /dev/null
@@ -1,2207 +0,0 @@
-
- */
- public function containerList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerList($queryParameters), $fetch);
- }
-
- /**
- * @param \Docker\API\Model\ContainersCreatePostBody $body Container to create
- * @param array $queryParameters {
- *
- * @var string $name Assign the specified name to the container. Must match `/?[a-zA-Z0-9_-]+`.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerCreateBadRequestException
- * @throws \Docker\API\Exception\ContainerCreateNotFoundException
- * @throws \Docker\API\Exception\ContainerCreateConflictException
- * @throws \Docker\API\Exception\ContainerCreateInternalServerErrorException
- *
- * @return \Amp\Promise
- */
- public function containerCreate(\Docker\API\Model\ContainersCreatePostBody $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerCreate($body, $queryParameters), $fetch);
- }
-
- /**
- * Return low-level information about a container.
- *
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var bool $size Return the size of container as fields `SizeRw` and `SizeRootFs`
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerInspectNotFoundException
- * @throws \Docker\API\Exception\ContainerInspectInternalServerErrorException
- *
- * @return \Amp\Promise
- */
- public function containerInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerInspect($id, $queryParameters), $fetch);
- }
-
- /**
- * On Unix systems, this is done by running the `ps` command. This endpoint is not supported on Windows.
- *
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var string $ps_args The arguments to pass to `ps`. For example, `aux`
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerTopNotFoundException
- * @throws \Docker\API\Exception\ContainerTopInternalServerErrorException
- *
- * @return \Amp\Promise
- */
- public function containerTop(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerTop($id, $queryParameters), $fetch);
- }
-
- /**
- * Get `stdout` and `stderr` logs from a container.
-
- Note: This endpoint works only for containers with the `json-file` or `journald` logging driver.
-
- *
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var bool $follow return the logs as a stream
-
- * @var bool $stdout Return logs from `stdout`
- * @var bool $stderr Return logs from `stderr`
- * @var int $since Only return logs since this time, as a UNIX timestamp
- * @var int $until Only return logs before this time, as a UNIX timestamp
- * @var bool $timestamps Add timestamps to every log line
- * @var string $tail Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerLogsNotFoundException
- * @throws \Docker\API\Exception\ContainerLogsInternalServerErrorException
- *
- * @return \Amp\Promise
- */
- public function containerLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerLogs($id, $queryParameters), $fetch);
- }
-
- /**
- * Returns which files in a container's filesystem have been added, deleted,.
- or modified. The `Kind` of modification can be one of:
-
- - `0`: Modified
- - `1`: Added
- - `2`: Deleted
-
- *
- * @param string $id ID or name of the container
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerChangesNotFoundException
- * @throws \Docker\API\Exception\ContainerChangesInternalServerErrorException
- *
- * @return \Amp\Promise
- */
- public function containerChanges(string $id, string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerChanges($id), $fetch);
- }
-
- /**
- * Export the contents of a container as a tarball.
- *
- * @param string $id ID or name of the container
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerExportNotFoundException
- * @throws \Docker\API\Exception\ContainerExportInternalServerErrorException
- *
- * @return \Amp\Promise
- */
- public function containerExport(string $id, string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerExport($id), $fetch);
- }
-
- /**
- * This endpoint returns a live stream of a container’s resource usage.
- statistics.
-
- The `precpu_stats` is the CPU statistic of last read, which is used
- for calculating the CPU usage percentage. It is not the same as 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.
-
- *
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var bool $stream Stream the output. If false, the stats will be output once and then it will disconnect.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerStatsNotFoundException
- * @throws \Docker\API\Exception\ContainerStatsInternalServerErrorException
- *
- * @return \Amp\Promise
- */
- public function containerStats(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerStats($id, $queryParameters), $fetch);
- }
-
- /**
- * Resize the TTY for a container. You must restart the container for the resize to take effect.
- *
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var int $h Height of the tty session in characters
- * @var int $w Width of the tty session in characters
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerResizeNotFoundException
- * @throws \Docker\API\Exception\ContainerResizeInternalServerErrorException
- *
- * @return \Amp\Promise
- */
- public function containerResize(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerResize($id, $queryParameters), $fetch);
- }
-
- /**
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var string $detachKeys Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerStartNotFoundException
- * @throws \Docker\API\Exception\ContainerStartInternalServerErrorException
- *
- * @return \Amp\Promise
- */
- public function containerStart(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerStart($id, $queryParameters), $fetch);
- }
-
- /**
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var int $t Number of seconds to wait before killing the container
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerStopNotFoundException
- * @throws \Docker\API\Exception\ContainerStopInternalServerErrorException
- *
- * @return \Amp\Promise
- */
- public function containerStop(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerStop($id, $queryParameters), $fetch);
- }
-
- /**
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var int $t Number of seconds to wait before killing the container
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerRestartNotFoundException
- * @throws \Docker\API\Exception\ContainerRestartInternalServerErrorException
- *
- * @return \Amp\Promise
- */
- public function containerRestart(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerRestart($id, $queryParameters), $fetch);
- }
-
- /**
- * Send a POSIX signal to a container, defaulting to killing to the container.
- *
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`)
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerKillNotFoundException
- * @throws \Docker\API\Exception\ContainerKillInternalServerErrorException
- *
- * @return \Amp\Promise
- */
- public function containerKill(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerKill($id, $queryParameters), $fetch);
- }
-
- /**
- * Change various configuration options of a container without having to recreate it.
- *
- * @param string $id ID or name of the container
- * @param \Docker\API\Model\ContainersIdUpdatePostBody $update
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerUpdateNotFoundException
- * @throws \Docker\API\Exception\ContainerUpdateInternalServerErrorException
- *
- * @return \Amp\Promise
- */
- public function containerUpdate(string $id, \Docker\API\Model\ContainersIdUpdatePostBody $update, string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerUpdate($id, $update), $fetch);
- }
-
- /**
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var string $name New name for the container
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerRenameNotFoundException
- * @throws \Docker\API\Exception\ContainerRenameConflictException
- * @throws \Docker\API\Exception\ContainerRenameInternalServerErrorException
- *
- * @return \Amp\Promise
- */
- public function containerRename(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerRename($id, $queryParameters), $fetch);
- }
-
- /**
- * Use the cgroups freezer to suspend all processes in a container.
-
- Traditionally, when suspending a process the `SIGSTOP` signal is used, which is observable by the process being suspended. With the cgroups freezer the process is unaware, and unable to capture, that it is being suspended, and subsequently resumed.
-
- *
- * @param string $id ID or name of the container
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerPauseNotFoundException
- * @throws \Docker\API\Exception\ContainerPauseInternalServerErrorException
- *
- * @return \Amp\Promise
- */
- public function containerPause(string $id, string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerPause($id), $fetch);
- }
-
- /**
- * Resume a container which has been paused.
- *
- * @param string $id ID or name of the container
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerUnpauseNotFoundException
- * @throws \Docker\API\Exception\ContainerUnpauseInternalServerErrorException
- *
- * @return \Amp\Promise
- */
- public function containerUnpause(string $id, string $fetch = self::FETCH_OBJECT)
- {
- return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerUnpause($id), $fetch);
- }
-
- /**
- * 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.
-
- See [the documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) for more details.
-
- ### 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.docker.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 Docker 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 Docker 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.docker.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`.
-
- *
- * @param string $id ID or name of the container
- * @param array $queryParameters {
- *
- * @var string $detachKeys Override the key sequence for detaching a container.Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
- * @var bool $logs replay previous logs from the container
-
- * @var bool $stream Stream attached streams from the time the request was made onwards
- * @var bool $stdin Attach to `stdin`
- * @var bool $stdout Attach to `stdout`
- * @var bool $stderr Attach to `stderr`
- * }
- *
- * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
- *
- * @throws \Docker\API\Exception\ContainerAttachBadRequestException
- * @throws \Docker\API\Exception\ContainerAttachNotFoundException
- * @throws \Docker\API\Exception\ContainerAttachInternalServerErrorException
- *
- * @return \Amp\Promise