github.com/getong/docker@v1.13.1/api/swagger.yaml (about) 1 # A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API. 2 # 3 # This is used for generating API documentation and the types used by the 4 # client/server. See api/README.md for more information. 5 # 6 # Some style notes: 7 # - This file is used by ReDoc, which allows GitHub Flavored Markdown in 8 # descriptions. 9 # - There is no maximum line length, for ease of editing and pretty diffs. 10 # - operationIds are in the format "NounVerb", with a singular noun. 11 12 swagger: "2.0" 13 schemes: 14 - "http" 15 - "https" 16 produces: 17 - "application/json" 18 - "text/plain" 19 consumes: 20 - "application/json" 21 - "text/plain" 22 basePath: "/v1.26" 23 info: 24 title: "Docker Engine API" 25 version: "1.26" 26 x-logo: 27 url: "https://docs.docker.com/images/logo-docker-main.png" 28 description: | 29 The Engine API is an HTTP API served by Docker Engine. It is the API the Docker client uses to communicate with the Engine, so everything the Docker client can do can be done with the API. 30 31 Most of the client's commands map directly to API endpoints (e.g. `docker ps` is `GET /containers/json`). The notable exception is running containers, which consists of several API calls. 32 33 # Errors 34 35 The API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format: 36 37 ``` 38 { 39 "message": "page not found" 40 } 41 ``` 42 43 # Versioning 44 45 The API is usually changed in each release of Docker, so API calls are versioned to ensure that clients don't break. 46 47 For Docker Engine >= 1.13.1, the API version is 1.26. To lock to this version, you prefix the URL with `/v1.26`. For example, calling `/info` is the same as calling `/v1.26/info`. 48 49 Engine releases in the near future should support this version of the API, so your client will continue to work even if it is talking to a newer Engine. 50 51 In previous versions of Docker, it was possible to access the API without providing a version. This behaviour is now deprecated will be removed in a future version of Docker. 52 53 The API uses an open schema model, which means server may add extra properties to responses. Likewise, the server will ignore any extra query parameters and request body properties. When you write clients, you need to ignore additional properties in responses to ensure they do not break when talking to newer Docker daemons. 54 55 This documentation is for version 1.26 of the API, which was introduced with Docker 1.13.1. Use this table to find documentation for previous versions of the API: 56 57 Docker version | API version | Changes 58 ----------------|-------------|--------- 59 1.13.0 | [1.25](https://docs.docker.com/engine/api/v1.25/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-25-api-changes) 60 1.12.x | [1.24](https://docs.docker.com/engine/api/v1.24/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-24-api-changes) 61 1.11.x | [1.23](https://docs.docker.com/engine/api/v1.23/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-23-api-changes) 62 1.10.x | [1.22](https://docs.docker.com/engine/api/v1.22/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-22-api-changes) 63 1.9.x | [1.21](https://docs.docker.com/engine/api/v1.21/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-21-api-changes) 64 1.8.x | [1.20](https://docs.docker.com/engine/api/v1.20/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-20-api-changes) 65 1.7.x | [1.19](https://docs.docker.com/engine/api/v1.19/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-19-api-changes) 66 1.6.x | [1.18](https://docs.docker.com/engine/api/v1.18/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-18-api-changes) 67 68 # Authentication 69 70 Authentication for registries is handled client side. The client has to send authentication details to various endpoints that need to communicate with registries, such as `POST /images/(name)/push`. These are sent as `X-Registry-Auth` header as a Base64 encoded (JSON) string with the following structure: 71 72 ``` 73 { 74 "username": "string", 75 "password": "string", 76 "email": "string", 77 "serveraddress": "string" 78 } 79 ``` 80 81 The `serveraddress` is a domain/IP without a protocol. Throughout this structure, double quotes are required. 82 83 If you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth), you can just pass this instead of credentials: 84 85 ``` 86 { 87 "identitytoken": "9cbaf023786cd7..." 88 } 89 ``` 90 91 # The tags on paths define the menu sections in the ReDoc documentation, so 92 # the usage of tags must make sense for that: 93 # - They should be singular, not plural. 94 # - There should not be too many tags, or the menu becomes unwieldly. For 95 # example, it is preferable to add a path to the "System" tag instead of 96 # creating a tag with a single path in it. 97 # - The order of tags in this list defines the order in the menu. 98 tags: 99 # Primary objects 100 - name: "Container" 101 x-displayName: "Containers" 102 description: | 103 Create and manage containers. 104 - name: "Image" 105 x-displayName: "Images" 106 - name: "Network" 107 x-displayName: "Networks" 108 description: | 109 Networks are user-defined networks that containers can be attached to. See the [networking documentation](https://docs.docker.com/engine/userguide/networking/) for more information. 110 - name: "Volume" 111 x-displayName: "Volumes" 112 description: | 113 Create and manage persistent storage that can be attached to containers. 114 - name: "Exec" 115 x-displayName: "Exec" 116 description: | 117 Run new commands inside running containers. See the [command-line reference](https://docs.docker.com/engine/reference/commandline/exec/) for more information. 118 119 To exec a command in a container, you first need to create an exec instance, then start it. These two API endpoints are wrapped up in a single command-line command, `docker exec`. 120 - name: "Secret" 121 x-displayName: "Secrets" 122 # Swarm things 123 - name: "Swarm" 124 x-displayName: "Swarm" 125 description: | 126 Engines can be clustered together in a swarm. See [the swarm mode documentation](https://docs.docker.com/engine/swarm/) for more information. 127 - name: "Node" 128 x-displayName: "Nodes" 129 description: | 130 Nodes are instances of the Engine participating in a swarm. Swarm mode must be enabled for these endpoints to work. 131 - name: "Service" 132 x-displayName: "Services" 133 description: | 134 Services are the definitions of tasks to run on a swarm. Swarm mode must be enabled for these endpoints to work. 135 - name: "Task" 136 x-displayName: "Tasks" 137 description: | 138 A task is a container running on a swarm. It is the atomic scheduling unit of swarm. Swarm mode must be enabled for these endpoints to work. 139 # System things 140 - name: "Plugin" 141 x-displayName: "Plugins" 142 - name: "System" 143 x-displayName: "System" 144 145 definitions: 146 Port: 147 type: "object" 148 description: "An open port on a container" 149 required: [PrivatePort, Type] 150 properties: 151 IP: 152 type: "string" 153 format: "ip-address" 154 PrivatePort: 155 type: "integer" 156 format: "uint16" 157 x-nullable: false 158 description: "Port on the container" 159 PublicPort: 160 type: "integer" 161 format: "uint16" 162 description: "Port exposed on the host" 163 Type: 164 type: "string" 165 x-nullable: false 166 enum: ["tcp", "udp"] 167 example: 168 PrivatePort: 8080 169 PublicPort: 80 170 Type: "tcp" 171 172 MountPoint: 173 type: "object" 174 description: "A mount point inside a container" 175 properties: 176 Type: 177 type: "string" 178 Name: 179 type: "string" 180 Source: 181 type: "string" 182 Destination: 183 type: "string" 184 Driver: 185 type: "string" 186 Mode: 187 type: "string" 188 RW: 189 type: "boolean" 190 Propagation: 191 type: "string" 192 193 DeviceMapping: 194 type: "object" 195 description: "A device mapping between the host and container" 196 properties: 197 PathOnHost: 198 type: "string" 199 PathInContainer: 200 type: "string" 201 CgroupPermissions: 202 type: "string" 203 example: 204 PathOnHost: "/dev/deviceName" 205 PathInContainer: "/dev/deviceName" 206 CgroupPermissions: "mrw" 207 208 ThrottleDevice: 209 type: "object" 210 properties: 211 Path: 212 description: "Device path" 213 type: "string" 214 Rate: 215 description: "Rate" 216 type: "integer" 217 format: "int64" 218 minimum: 0 219 220 Mount: 221 type: "object" 222 properties: 223 Target: 224 description: "Container path." 225 type: "string" 226 Source: 227 description: "Mount source (e.g. a volume name, a host path)." 228 Type: 229 description: | 230 The mount type. Available types: 231 232 - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. 233 - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. 234 - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. 235 type: "string" 236 enum: 237 - "bind" 238 - "volume" 239 - "tmpfs" 240 ReadOnly: 241 description: "Whether the mount should be read-only." 242 type: "boolean" 243 BindOptions: 244 description: "Optional configuration for the `bind` type." 245 type: "object" 246 properties: 247 Propagation: 248 description: "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`." 249 enum: 250 - "private" 251 - "rprivate" 252 - "shared" 253 - "rshared" 254 - "slave" 255 - "rslave" 256 VolumeOptions: 257 description: "Optional configuration for the `volume` type." 258 type: "object" 259 properties: 260 NoCopy: 261 description: "Populate volume with data from the target." 262 type: "boolean" 263 default: false 264 Labels: 265 description: "User-defined key/value metadata." 266 type: "object" 267 additionalProperties: 268 type: "string" 269 DriverConfig: 270 description: "Map of driver specific options" 271 type: "object" 272 properties: 273 Name: 274 description: "Name of the driver to use to create the volume." 275 type: "string" 276 Options: 277 description: "key/value map of driver specific options." 278 type: "object" 279 additionalProperties: 280 type: "string" 281 TmpfsOptions: 282 description: "Optional configuration for the `tmpfs` type." 283 type: "object" 284 properties: 285 SizeBytes: 286 description: "The size for the tmpfs mount in bytes." 287 type: "integer" 288 format: "int64" 289 Mode: 290 description: "The permission mode for the tmpfs mount in an integer." 291 type: "integer" 292 RestartPolicy: 293 description: | 294 The behavior to apply when the container exits. The default is not to restart. 295 296 An ever increasing delay (double the previous delay, starting at 100ms) is added before each restart to prevent flooding the server. 297 type: "object" 298 properties: 299 Name: 300 type: "string" 301 description: | 302 - `always` Always restart 303 - `unless-stopped` Restart always except when the user has manually stopped the container 304 - `on-failure` Restart only when the container exit code is non-zero 305 enum: 306 - "always" 307 - "unless-stopped" 308 - "on-failure" 309 MaximumRetryCount: 310 type: "integer" 311 description: "If `on-failure` is used, the number of times to retry before giving up" 312 default: {} 313 314 Resources: 315 description: "A container's resources (cgroups config, ulimits, etc)" 316 type: "object" 317 properties: 318 # Applicable to all platforms 319 CpuShares: 320 description: "An integer value representing this container's relative CPU weight versus other containers." 321 type: "integer" 322 Memory: 323 description: "Memory limit in bytes." 324 type: "integer" 325 default: 0 326 # Applicable to UNIX platforms 327 CgroupParent: 328 description: "Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist." 329 type: "string" 330 BlkioWeight: 331 description: "Block IO weight (relative weight)." 332 type: "integer" 333 minimum: 0 334 maximum: 1000 335 BlkioWeightDevice: 336 description: | 337 Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. 338 type: "array" 339 items: 340 type: "object" 341 properties: 342 Path: 343 type: "string" 344 Weight: 345 type: "integer" 346 minimum: 0 347 BlkioDeviceReadBps: 348 description: | 349 Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. 350 type: "array" 351 items: 352 $ref: "#/definitions/ThrottleDevice" 353 BlkioDeviceWriteBps: 354 description: | 355 Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. 356 type: "array" 357 items: 358 $ref: "#/definitions/ThrottleDevice" 359 BlkioDeviceReadIOps: 360 description: | 361 Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. 362 type: "array" 363 items: 364 $ref: "#/definitions/ThrottleDevice" 365 BlkioDeviceWriteIOps: 366 description: | 367 Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. 368 type: "array" 369 items: 370 $ref: "#/definitions/ThrottleDevice" 371 CpuPeriod: 372 description: "The length of a CPU period in microseconds." 373 type: "integer" 374 format: "int64" 375 CpuQuota: 376 description: "Microseconds of CPU time that the container can get in a CPU period." 377 type: "integer" 378 format: "int64" 379 CpuRealtimePeriod: 380 description: "The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks." 381 type: "integer" 382 format: "int64" 383 CpuRealtimeRuntime: 384 description: "The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks." 385 type: "integer" 386 format: "int64" 387 CpusetCpus: 388 description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)" 389 type: "string" 390 CpusetMems: 391 description: "Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems." 392 type: "string" 393 Devices: 394 description: "A list of devices to add to the container." 395 type: "array" 396 items: 397 $ref: "#/definitions/DeviceMapping" 398 DiskQuota: 399 description: "Disk limit (in bytes)." 400 type: "integer" 401 format: "int64" 402 KernelMemory: 403 description: "Kernel memory limit in bytes." 404 type: "integer" 405 format: "int64" 406 MemoryReservation: 407 description: "Memory soft limit in bytes." 408 type: "integer" 409 format: "int64" 410 MemorySwap: 411 description: "Total memory limit (memory + swap). Set as `-1` to enable unlimited swap." 412 type: "integer" 413 format: "int64" 414 MemorySwappiness: 415 description: "Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100." 416 type: "integer" 417 format: "int64" 418 minimum: 0 419 maximum: 100 420 NanoCPUs: 421 description: "CPU quota in units of 10<sup>-9</sup> CPUs." 422 type: "integer" 423 format: "int64" 424 OomKillDisable: 425 description: "Disable OOM Killer for the container." 426 type: "boolean" 427 PidsLimit: 428 description: "Tune a container's pids limit. Set -1 for unlimited." 429 type: "integer" 430 format: "int64" 431 Ulimits: 432 description: | 433 A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" 434 type: "array" 435 items: 436 type: "object" 437 properties: 438 Name: 439 description: "Name of ulimit" 440 type: "string" 441 Soft: 442 description: "Soft limit" 443 type: "integer" 444 Hard: 445 description: "Hard limit" 446 type: "integer" 447 # Applicable to Windows 448 CpuCount: 449 description: | 450 The number of usable CPUs (Windows only). 451 452 On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. 453 type: "integer" 454 format: "int64" 455 CpuPercent: 456 description: | 457 The usable percentage of the available CPUs (Windows only). 458 459 On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. 460 type: "integer" 461 format: "int64" 462 IOMaximumIOps: 463 description: "Maximum IOps for the container system drive (Windows only)" 464 type: "integer" 465 format: "int64" 466 IOMaximumBandwidth: 467 description: "Maximum IO in bytes per second for the container system drive (Windows only)" 468 type: "integer" 469 format: "int64" 470 471 HostConfig: 472 description: "Container configuration that depends on the host we are running on" 473 allOf: 474 - $ref: "#/definitions/Resources" 475 - type: "object" 476 properties: 477 # Applicable to all platforms 478 Binds: 479 type: "array" 480 description: | 481 A list of volume bindings for this container. Each volume binding is a string in one of these forms: 482 483 - `host-src:container-dest` to bind-mount a host path into the container. Both `host-src`, and `container-dest` must be an _absolute_ path. 484 - `host-src:container-dest:ro` to make the bind-mount read-only inside the container. Both `host-src`, and `container-dest` must be an _absolute_ path. 485 - `volume-name:container-dest` to bind-mount a volume managed by a volume driver into the container. `container-dest` must be an _absolute_ path. 486 - `volume-name:container-dest:ro` to mount the volume read-only inside the container. `container-dest` must be an _absolute_ path. 487 items: 488 type: "string" 489 ContainerIDFile: 490 type: "string" 491 description: "Path to a file where the container ID is written" 492 LogConfig: 493 type: "object" 494 description: "The logging configuration for this container" 495 properties: 496 Type: 497 type: "string" 498 enum: 499 - "json-file" 500 - "syslog" 501 - "journald" 502 - "gelf" 503 - "fluentd" 504 - "awslogs" 505 - "splunk" 506 - "etwlogs" 507 - "none" 508 Config: 509 type: "object" 510 additionalProperties: 511 type: "string" 512 NetworkMode: 513 type: "string" 514 description: "Network mode to use for this container. Supported standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. Any other value is taken 515 as a custom network's name to which this container should connect to." 516 PortBindings: 517 type: "object" 518 description: "A map of exposed container ports and the host port they should map to." 519 additionalProperties: 520 type: "object" 521 properties: 522 HostIp: 523 type: "string" 524 description: "The host IP address" 525 HostPort: 526 type: "string" 527 description: "The host port number, as a string" 528 RestartPolicy: 529 $ref: "#/definitions/RestartPolicy" 530 AutoRemove: 531 type: "boolean" 532 description: "Automatically remove the container when the container's process exits. This has no effect if `RestartPolicy` is set." 533 VolumeDriver: 534 type: "string" 535 description: "Driver that this container uses to mount volumes." 536 VolumesFrom: 537 type: "array" 538 description: "A list of volumes to inherit from another container, specified in the form `<container name>[:<ro|rw>]`." 539 items: 540 type: "string" 541 Mounts: 542 description: "Specification for mounts to be added to the container." 543 type: "array" 544 items: 545 $ref: "#/definitions/Mount" 546 547 # Applicable to UNIX platforms 548 CapAdd: 549 type: "array" 550 description: "A list of kernel capabilities to add to the container." 551 items: 552 type: "string" 553 CapDrop: 554 type: "array" 555 description: "A list of kernel capabilities to drop from the container." 556 items: 557 type: "string" 558 Dns: 559 type: "array" 560 description: "A list of DNS servers for the container to use." 561 items: 562 type: "string" 563 DnsOptions: 564 type: "array" 565 description: "A list of DNS options." 566 items: 567 type: "string" 568 DnsSearch: 569 type: "array" 570 description: "A list of DNS search domains." 571 items: 572 type: "string" 573 ExtraHosts: 574 type: "array" 575 description: | 576 A list of hostnames/IP mappings to add to the container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. 577 items: 578 type: "string" 579 GroupAdd: 580 type: "array" 581 description: "A list of additional groups that the container process will run as." 582 items: 583 type: "string" 584 IpcMode: 585 type: "string" 586 description: "IPC namespace to use for the container." 587 Cgroup: 588 type: "string" 589 description: "Cgroup to use for the container." 590 Links: 591 type: "array" 592 description: "A list of links for the container in the form `container_name:alias`." 593 items: 594 type: "string" 595 OomScoreAdj: 596 type: "integer" 597 description: "An integer value containing the score given to the container in order to tune OOM killer preferences." 598 PidMode: 599 type: "string" 600 description: | 601 Set the PID (Process) Namespace mode for the container. It can be either: 602 603 - `"container:<name|id>"`: joins another container's PID namespace 604 - `"host"`: use the host's PID namespace inside the container 605 Privileged: 606 type: "boolean" 607 description: "Gives the container full access to the host." 608 PublishAllPorts: 609 type: "boolean" 610 description: "Allocates a random host port for all of a container's exposed ports." 611 ReadonlyRootfs: 612 type: "boolean" 613 description: "Mount the container's root filesystem as read only." 614 SecurityOpt: 615 type: "array" 616 description: "A list of string values to customize labels for MLS 617 systems, such as SELinux." 618 items: 619 type: "string" 620 StorageOpt: 621 type: "object" 622 description: | 623 Storage driver options for this container, in the form `{"size": "120G"}`. 624 additionalProperties: 625 type: "string" 626 Tmpfs: 627 type: "object" 628 description: | 629 A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options. For example: `{ "/run": "rw,noexec,nosuid,size=65536k" }`. 630 additionalProperties: 631 type: "string" 632 UTSMode: 633 type: "string" 634 description: "UTS namespace to use for the container." 635 UsernsMode: 636 type: "string" 637 description: "Sets the usernamespace mode for the container when usernamespace remapping option is enabled." 638 ShmSize: 639 type: "integer" 640 description: "Size of `/dev/shm` in bytes. If omitted, the system uses 64MB." 641 minimum: 0 642 Sysctls: 643 type: "object" 644 description: | 645 A list of kernel parameters (sysctls) to set in the container. For example: `{"net.ipv4.ip_forward": "1"}` 646 additionalProperties: 647 type: "string" 648 Runtime: 649 type: "string" 650 description: "Runtime to use with this container." 651 # Applicable to Windows 652 ConsoleSize: 653 type: "array" 654 description: "Initial console size, as an `[height, width]` array. (Windows only)" 655 minItems: 2 656 maxItems: 2 657 items: 658 type: "integer" 659 minimum: 0 660 Isolation: 661 type: "string" 662 description: "Isolation technology of the container. (Windows only)" 663 enum: 664 - "default" 665 - "process" 666 - "hyperv" 667 668 Config: 669 description: "Configuration for a container that is portable between hosts" 670 type: "object" 671 properties: 672 Hostname: 673 description: "The hostname to use for the container, as a valid RFC 1123 hostname." 674 type: "string" 675 Domainname: 676 description: "The domain name to use for the container." 677 type: "string" 678 User: 679 description: "The user that commands are run as inside the container." 680 type: "string" 681 AttachStdin: 682 description: "Whether to attach to `stdin`." 683 type: "boolean" 684 default: false 685 AttachStdout: 686 description: "Whether to attach to `stdout`." 687 type: "boolean" 688 default: true 689 AttachStderr: 690 description: "Whether to attach to `stderr`." 691 type: "boolean" 692 default: true 693 ExposedPorts: 694 description: | 695 An object mapping ports to an empty object in the form: 696 697 `{"<port>/<tcp|udp>": {}}` 698 type: "object" 699 additionalProperties: 700 type: "object" 701 enum: 702 - {} 703 default: {} 704 Tty: 705 description: "Attach standard streams to a TTY, including `stdin` if it is not closed." 706 type: "boolean" 707 default: false 708 OpenStdin: 709 description: "Open `stdin`" 710 type: "boolean" 711 default: false 712 StdinOnce: 713 description: "Close `stdin` after one attached client disconnects" 714 type: "boolean" 715 default: false 716 Env: 717 description: | 718 A list of environment variables to set inside the container in the form `["VAR=value", ...]` 719 type: "array" 720 items: 721 type: "string" 722 Cmd: 723 description: "Command to run specified as a string or an array of strings." 724 type: 725 - "array" 726 - "string" 727 items: 728 type: "string" 729 Healthcheck: 730 description: "A test to perform to check that the container is healthy." 731 type: "object" 732 properties: 733 Test: 734 description: | 735 The test to perform. Possible values are: 736 737 - `{}` inherit healthcheck from image or parent image 738 - `{"NONE"}` disable healthcheck 739 - `{"CMD", args...}` exec arguments directly 740 - `{"CMD-SHELL", command}` run command with system's default shell 741 type: "array" 742 items: 743 type: "string" 744 Interval: 745 description: "The time to wait between checks in nanoseconds. 0 means inherit." 746 type: "integer" 747 Timeout: 748 description: "The time to wait before considering the check to have hung. 0 means inherit." 749 type: "integer" 750 Retries: 751 description: "The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit." 752 type: "integer" 753 ArgsEscaped: 754 description: "Command is already escaped (Windows only)" 755 type: "boolean" 756 Image: 757 description: "The name of the image to use when creating the container" 758 type: "string" 759 Volumes: 760 description: "An object mapping mount point paths inside the container to empty objects." 761 type: "object" 762 properties: 763 additionalProperties: 764 type: "object" 765 enum: 766 - {} 767 default: {} 768 WorkingDir: 769 description: "The working directory for commands to run in." 770 type: "string" 771 Entrypoint: 772 description: | 773 The entry point for the container as a string or an array of strings. 774 775 If the array consists of exactly one empty string (`[""]`) then the entry point is reset to system default (i.e., the entry point used by docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). 776 type: 777 - "array" 778 - "string" 779 items: 780 type: "string" 781 NetworkDisabled: 782 description: "Disable networking for the container." 783 type: "boolean" 784 MacAddress: 785 description: "MAC address of the container." 786 type: "string" 787 OnBuild: 788 description: "`ONBUILD` metadata that were defined in the image's `Dockerfile`." 789 type: "array" 790 items: 791 type: "string" 792 Labels: 793 description: "User-defined key/value metadata." 794 type: "object" 795 additionalProperties: 796 type: "string" 797 StopSignal: 798 description: "Signal to stop a container as a string or unsigned integer." 799 type: "string" 800 default: "SIGTERM" 801 StopTimeout: 802 description: "Timeout to stop a container in seconds." 803 type: "integer" 804 default: 10 805 Shell: 806 description: "Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell." 807 type: "array" 808 items: 809 type: "string" 810 811 NetworkConfig: 812 description: "TODO: check is correct" 813 type: "object" 814 properties: 815 Bridge: 816 type: "string" 817 Gateway: 818 type: "string" 819 Address: 820 type: "string" 821 IPPrefixLen: 822 type: "integer" 823 MacAddress: 824 type: "string" 825 PortMapping: 826 type: "string" 827 Ports: 828 type: "array" 829 items: 830 $ref: "#/definitions/Port" 831 832 GraphDriver: 833 description: "Information about this container's graph driver." 834 type: "object" 835 properties: 836 Name: 837 type: "string" 838 Data: 839 type: "object" 840 additionalProperties: 841 type: "string" 842 843 Image: 844 type: "object" 845 properties: 846 Id: 847 type: "string" 848 RepoTags: 849 type: "array" 850 items: 851 type: "string" 852 RepoDigests: 853 type: "array" 854 items: 855 type: "string" 856 Parent: 857 type: "string" 858 Comment: 859 type: "string" 860 Created: 861 type: "string" 862 Container: 863 type: "string" 864 ContainerConfig: 865 $ref: "#/definitions/Config" 866 DockerVersion: 867 type: "string" 868 Author: 869 type: "string" 870 Config: 871 $ref: "#/definitions/Config" 872 Architecture: 873 type: "string" 874 Os: 875 type: "string" 876 Size: 877 type: "integer" 878 format: "int64" 879 VirtualSize: 880 type: "integer" 881 format: "int64" 882 GraphDriver: 883 $ref: "#/definitions/GraphDriver" 884 RootFS: 885 type: "object" 886 properties: 887 Type: 888 type: "string" 889 Layers: 890 type: "array" 891 items: 892 type: "string" 893 BaseLayer: 894 type: "string" 895 896 ImageSummary: 897 type: "object" 898 required: 899 - Id 900 - ParentId 901 - RepoTags 902 - RepoDigests 903 - Created 904 - Size 905 - SharedSize 906 - VirtualSize 907 - Labels 908 - Containers 909 properties: 910 Id: 911 type: "string" 912 x-nullable: false 913 ParentId: 914 type: "string" 915 x-nullable: false 916 RepoTags: 917 type: "array" 918 x-nullable: false 919 items: 920 type: "string" 921 RepoDigests: 922 type: "array" 923 x-nullable: false 924 items: 925 type: "string" 926 Created: 927 type: "integer" 928 x-nullable: false 929 Size: 930 type: "integer" 931 x-nullable: false 932 SharedSize: 933 type: "integer" 934 x-nullable: false 935 VirtualSize: 936 type: "integer" 937 x-nullable: false 938 Labels: 939 type: "object" 940 x-nullable: false 941 additionalProperties: 942 type: "string" 943 Containers: 944 x-nullable: false 945 type: "integer" 946 947 AuthConfig: 948 type: "object" 949 properties: 950 username: 951 type: "string" 952 password: 953 type: "string" 954 email: 955 type: "string" 956 serveraddress: 957 type: "string" 958 example: 959 username: "hannibal" 960 password: "xxxx" 961 serveraddress: "https://index.docker.io/v1/" 962 963 ProcessConfig: 964 type: "object" 965 properties: 966 privileged: 967 type: "boolean" 968 user: 969 type: "string" 970 tty: 971 type: "boolean" 972 entrypoint: 973 type: "string" 974 arguments: 975 type: "array" 976 items: 977 type: "string" 978 979 Volume: 980 type: "object" 981 required: [Name, Driver, Mountpoint, Labels, Scope, Options] 982 properties: 983 Name: 984 type: "string" 985 description: "Name of the volume." 986 x-nullable: false 987 Driver: 988 type: "string" 989 description: "Name of the volume driver used by the volume." 990 x-nullable: false 991 Mountpoint: 992 type: "string" 993 description: "Mount path of the volume on the host." 994 x-nullable: false 995 Status: 996 type: "object" 997 description: | 998 Low-level details about the volume, provided by the volume driver. 999 Details are returned as a map with key/value pairs: 1000 `{"key":"value","key2":"value2"}`. 1001 1002 The `Status` field is optional, and is omitted if the volume driver 1003 does not support this feature. 1004 additionalProperties: 1005 type: "object" 1006 Labels: 1007 type: "object" 1008 description: "User-defined key/value metadata." 1009 x-nullable: false 1010 additionalProperties: 1011 type: "string" 1012 Scope: 1013 type: "string" 1014 description: "The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level." 1015 default: "local" 1016 x-nullable: false 1017 enum: ["local", "global"] 1018 Options: 1019 type: "object" 1020 description: "The driver specific options used when creating the volume." 1021 additionalProperties: 1022 type: "string" 1023 UsageData: 1024 type: "object" 1025 required: [Size, RefCount] 1026 properties: 1027 Size: 1028 type: "integer" 1029 description: "The disk space used by the volume (local driver only)" 1030 default: -1 1031 x-nullable: false 1032 RefCount: 1033 type: "integer" 1034 default: -1 1035 description: "The number of containers referencing this volume." 1036 x-nullable: false 1037 1038 example: 1039 Name: "tardis" 1040 Driver: "custom" 1041 Mountpoint: "/var/lib/docker/volumes/tardis" 1042 Status: 1043 hello: "world" 1044 Labels: 1045 com.example.some-label: "some-value" 1046 com.example.some-other-label: "some-other-value" 1047 Scope: "local" 1048 1049 Network: 1050 type: "object" 1051 properties: 1052 Name: 1053 type: "string" 1054 Id: 1055 type: "string" 1056 Created: 1057 type: "string" 1058 format: "dateTime" 1059 Scope: 1060 type: "string" 1061 Driver: 1062 type: "string" 1063 EnableIPv6: 1064 type: "boolean" 1065 IPAM: 1066 $ref: "#/definitions/IPAM" 1067 Internal: 1068 type: "boolean" 1069 Containers: 1070 type: "object" 1071 additionalProperties: 1072 $ref: "#/definitions/NetworkContainer" 1073 Options: 1074 type: "object" 1075 additionalProperties: 1076 type: "string" 1077 Labels: 1078 type: "object" 1079 additionalProperties: 1080 type: "string" 1081 example: 1082 Name: "net01" 1083 Id: "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99" 1084 Created: "2016-10-19T04:33:30.360899459Z" 1085 Scope: "local" 1086 Driver: "bridge" 1087 EnableIPv6: false 1088 IPAM: 1089 Driver: "default" 1090 Config: 1091 - Subnet: "172.19.0.0/16" 1092 Gateway: "172.19.0.1" 1093 Options: 1094 foo: "bar" 1095 Internal: false 1096 Containers: 1097 19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c: 1098 Name: "test" 1099 EndpointID: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" 1100 MacAddress: "02:42:ac:13:00:02" 1101 IPv4Address: "172.19.0.2/16" 1102 IPv6Address: "" 1103 Options: 1104 com.docker.network.bridge.default_bridge: "true" 1105 com.docker.network.bridge.enable_icc: "true" 1106 com.docker.network.bridge.enable_ip_masquerade: "true" 1107 com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" 1108 com.docker.network.bridge.name: "docker0" 1109 com.docker.network.driver.mtu: "1500" 1110 Labels: 1111 com.example.some-label: "some-value" 1112 com.example.some-other-label: "some-other-value" 1113 IPAM: 1114 type: "object" 1115 properties: 1116 Driver: 1117 description: "Name of the IPAM driver to use." 1118 type: "string" 1119 default: "default" 1120 Config: 1121 description: "List of IPAM configuration options, specified as a map: `{\"Subnet\": <CIDR>, \"IPRange\": <CIDR>, \"Gateway\": <IP address>, \"AuxAddress\": <device_name:IP address>}`" 1122 type: "array" 1123 items: 1124 type: "object" 1125 additionalProperties: 1126 type: "string" 1127 Options: 1128 description: "Driver-specific options, specified as a map." 1129 type: "array" 1130 items: 1131 type: "object" 1132 additionalProperties: 1133 type: "string" 1134 NetworkContainer: 1135 type: "object" 1136 properties: 1137 EndpointID: 1138 type: "string" 1139 MacAddress: 1140 type: "string" 1141 IPv4Address: 1142 type: "string" 1143 IPv6Address: 1144 type: "string" 1145 1146 BuildInfo: 1147 type: "object" 1148 properties: 1149 id: 1150 type: "string" 1151 stream: 1152 type: "string" 1153 error: 1154 type: "string" 1155 errorDetail: 1156 $ref: "#/definitions/ErrorDetail" 1157 status: 1158 type: "string" 1159 progress: 1160 type: "string" 1161 progressDetail: 1162 $ref: "#/definitions/ProgressDetail" 1163 1164 CreateImageInfo: 1165 type: "object" 1166 properties: 1167 error: 1168 type: "string" 1169 status: 1170 type: "string" 1171 progress: 1172 type: "string" 1173 progressDetail: 1174 $ref: "#/definitions/ProgressDetail" 1175 1176 PushImageInfo: 1177 type: "object" 1178 properties: 1179 error: 1180 type: "string" 1181 status: 1182 type: "string" 1183 progress: 1184 type: "string" 1185 progressDetail: 1186 $ref: "#/definitions/ProgressDetail" 1187 ErrorDetail: 1188 type: "object" 1189 properties: 1190 code: 1191 type: "integer" 1192 message: 1193 type: "string" 1194 ProgressDetail: 1195 type: "object" 1196 properties: 1197 code: 1198 type: "integer" 1199 message: 1200 type: "integer" 1201 1202 ErrorResponse: 1203 description: "Represents an error." 1204 type: "object" 1205 required: ["message"] 1206 properties: 1207 message: 1208 description: "The error message." 1209 type: "string" 1210 x-nullable: false 1211 example: 1212 message: "Something went wrong." 1213 1214 IdResponse: 1215 description: "Response to an API call that returns just an Id" 1216 type: "object" 1217 required: ["Id"] 1218 properties: 1219 Id: 1220 description: "The id of the newly created object." 1221 type: "string" 1222 x-nullable: false 1223 1224 EndpointSettings: 1225 description: "Configuration for a network endpoint." 1226 type: "object" 1227 properties: 1228 IPAMConfig: 1229 description: "IPAM configurations for the endpoint" 1230 type: "object" 1231 properties: 1232 IPv4Address: 1233 type: "string" 1234 IPv6Address: 1235 type: "string" 1236 LinkLocalIPs: 1237 type: "array" 1238 items: 1239 type: "string" 1240 Links: 1241 type: "array" 1242 items: 1243 type: "string" 1244 Aliases: 1245 type: "array" 1246 items: 1247 type: "string" 1248 NetworkID: 1249 type: "string" 1250 EndpointID: 1251 type: "string" 1252 Gateway: 1253 type: "string" 1254 IPAddress: 1255 type: "string" 1256 IPPrefixLen: 1257 type: "integer" 1258 IPv6Gateway: 1259 type: "string" 1260 GlobalIPv6Address: 1261 type: "string" 1262 GlobalIPv6PrefixLen: 1263 type: "integer" 1264 format: "int64" 1265 MacAddress: 1266 type: "string" 1267 1268 PluginMount: 1269 type: "object" 1270 x-nullable: false 1271 required: [Name, Description, Settable, Source, Destination, Type, Options] 1272 properties: 1273 Name: 1274 type: "string" 1275 x-nullable: false 1276 Description: 1277 type: "string" 1278 x-nullable: false 1279 Settable: 1280 type: "array" 1281 items: 1282 type: "string" 1283 Source: 1284 type: "string" 1285 Destination: 1286 type: "string" 1287 x-nullable: false 1288 Type: 1289 type: "string" 1290 x-nullable: false 1291 Options: 1292 type: "array" 1293 items: 1294 type: "string" 1295 1296 PluginDevice: 1297 type: "object" 1298 required: [Name, Description, Settable, Path] 1299 x-nullable: false 1300 properties: 1301 Name: 1302 type: "string" 1303 x-nullable: false 1304 Description: 1305 type: "string" 1306 x-nullable: false 1307 Settable: 1308 type: "array" 1309 items: 1310 type: "string" 1311 Path: 1312 type: "string" 1313 1314 PluginEnv: 1315 type: "object" 1316 x-nullable: false 1317 required: [Name, Description, Settable, Value] 1318 properties: 1319 Name: 1320 x-nullable: false 1321 type: "string" 1322 Description: 1323 x-nullable: false 1324 type: "string" 1325 Settable: 1326 type: "array" 1327 items: 1328 type: "string" 1329 Value: 1330 type: "string" 1331 1332 PluginInterfaceType: 1333 type: "object" 1334 x-nullable: false 1335 required: [Prefix, Capability, Version] 1336 properties: 1337 Prefix: 1338 type: "string" 1339 x-nullable: false 1340 Capability: 1341 type: "string" 1342 x-nullable: false 1343 Version: 1344 type: "string" 1345 x-nullable: false 1346 1347 Plugin: 1348 description: "A plugin for the Engine API" 1349 type: "object" 1350 required: [Settings, Enabled, Config, Name] 1351 properties: 1352 Id: 1353 type: "string" 1354 Name: 1355 type: "string" 1356 x-nullable: false 1357 Enabled: 1358 description: "True when the plugin is running. False when the plugin is not running, only installed." 1359 type: "boolean" 1360 x-nullable: false 1361 Settings: 1362 description: "Settings that can be modified by users." 1363 type: "object" 1364 x-nullable: false 1365 required: [Args, Devices, Env, Mounts] 1366 properties: 1367 Mounts: 1368 type: "array" 1369 items: 1370 $ref: "#/definitions/PluginMount" 1371 Env: 1372 type: "array" 1373 items: 1374 type: "string" 1375 Args: 1376 type: "array" 1377 items: 1378 type: "string" 1379 Devices: 1380 type: "array" 1381 items: 1382 $ref: "#/definitions/PluginDevice" 1383 PluginReference: 1384 description: "plugin remote reference used to push/pull the plugin" 1385 type: "string" 1386 x-nullable: false 1387 Config: 1388 description: "The config of a plugin." 1389 type: "object" 1390 x-nullable: false 1391 required: 1392 - Description 1393 - Documentation 1394 - Interface 1395 - Entrypoint 1396 - WorkDir 1397 - Network 1398 - Linux 1399 - PropagatedMount 1400 - Mounts 1401 - Env 1402 - Args 1403 properties: 1404 Description: 1405 type: "string" 1406 x-nullable: false 1407 Documentation: 1408 type: "string" 1409 x-nullable: false 1410 Interface: 1411 description: "The interface between Docker and the plugin" 1412 x-nullable: false 1413 type: "object" 1414 required: [Types, Socket] 1415 properties: 1416 Types: 1417 type: "array" 1418 items: 1419 $ref: "#/definitions/PluginInterfaceType" 1420 Socket: 1421 type: "string" 1422 x-nullable: false 1423 Entrypoint: 1424 type: "array" 1425 items: 1426 type: "string" 1427 WorkDir: 1428 type: "string" 1429 x-nullable: false 1430 User: 1431 type: "object" 1432 x-nullable: false 1433 properties: 1434 UID: 1435 type: "integer" 1436 format: "uint32" 1437 GID: 1438 type: "integer" 1439 format: "uint32" 1440 Network: 1441 type: "object" 1442 x-nullable: false 1443 required: [Type] 1444 properties: 1445 Type: 1446 x-nullable: false 1447 type: "string" 1448 Linux: 1449 type: "object" 1450 x-nullable: false 1451 required: [Capabilities, AllowAllDevices, Devices] 1452 properties: 1453 Capabilities: 1454 type: "array" 1455 items: 1456 type: "string" 1457 AllowAllDevices: 1458 type: "boolean" 1459 x-nullable: false 1460 Devices: 1461 type: "array" 1462 items: 1463 $ref: "#/definitions/PluginDevice" 1464 PropagatedMount: 1465 type: "string" 1466 x-nullable: false 1467 Mounts: 1468 type: "array" 1469 items: 1470 $ref: "#/definitions/PluginMount" 1471 Env: 1472 type: "array" 1473 items: 1474 $ref: "#/definitions/PluginEnv" 1475 Args: 1476 type: "object" 1477 x-nullable: false 1478 required: [Name, Description, Settable, Value] 1479 properties: 1480 Name: 1481 x-nullable: false 1482 type: "string" 1483 Description: 1484 x-nullable: false 1485 type: "string" 1486 Settable: 1487 type: "array" 1488 items: 1489 type: "string" 1490 Value: 1491 type: "array" 1492 items: 1493 type: "string" 1494 rootfs: 1495 type: "object" 1496 properties: 1497 type: 1498 type: "string" 1499 diff_ids: 1500 type: "array" 1501 items: 1502 type: "string" 1503 example: 1504 Id: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" 1505 Name: "tiborvass/sample-volume-plugin" 1506 Tag: "latest" 1507 Active: true 1508 Settings: 1509 Env: 1510 - "DEBUG=0" 1511 Args: null 1512 Devices: null 1513 Config: 1514 Description: "A sample volume plugin for Docker" 1515 Documentation: "https://docs.docker.com/engine/extend/plugins/" 1516 Interface: 1517 Types: 1518 - "docker.volumedriver/1.0" 1519 Socket: "plugins.sock" 1520 Entrypoint: 1521 - "/usr/bin/sample-volume-plugin" 1522 - "/data" 1523 WorkDir: "" 1524 User: {} 1525 Network: 1526 Type: "" 1527 Linux: 1528 Capabilities: null 1529 AllowAllDevices: false 1530 Devices: null 1531 Mounts: null 1532 PropagatedMount: "/data" 1533 Env: 1534 - Name: "DEBUG" 1535 Description: "If set, prints debug messages" 1536 Settable: null 1537 Value: "0" 1538 Args: 1539 Name: "args" 1540 Description: "command line arguments" 1541 Settable: null 1542 Value: [] 1543 1544 NodeSpec: 1545 type: "object" 1546 properties: 1547 Name: 1548 description: "Name for the node." 1549 type: "string" 1550 Labels: 1551 description: "User-defined key/value metadata." 1552 type: "object" 1553 additionalProperties: 1554 type: "string" 1555 Role: 1556 description: "Role of the node." 1557 type: "string" 1558 enum: 1559 - "worker" 1560 - "manager" 1561 Availability: 1562 description: "Availability of the node." 1563 type: "string" 1564 enum: 1565 - "active" 1566 - "pause" 1567 - "drain" 1568 example: 1569 Availability: "active" 1570 Name: "node-name" 1571 Role: "manager" 1572 Labels: 1573 foo: "bar" 1574 Node: 1575 type: "object" 1576 properties: 1577 ID: 1578 type: "string" 1579 Version: 1580 type: "object" 1581 properties: 1582 Index: 1583 type: "integer" 1584 format: "int64" 1585 CreatedAt: 1586 type: "string" 1587 format: "dateTime" 1588 UpdatedAt: 1589 type: "string" 1590 format: "dateTime" 1591 Spec: 1592 $ref: "#/definitions/NodeSpec" 1593 Description: 1594 type: "object" 1595 properties: 1596 Hostname: 1597 type: "string" 1598 Platform: 1599 type: "object" 1600 properties: 1601 Architecture: 1602 type: "string" 1603 OS: 1604 type: "string" 1605 Resources: 1606 type: "object" 1607 properties: 1608 NanoCPUs: 1609 type: "integer" 1610 format: "int64" 1611 MemoryBytes: 1612 type: "integer" 1613 format: "int64" 1614 Engine: 1615 type: "object" 1616 properties: 1617 EngineVersion: 1618 type: "string" 1619 Labels: 1620 type: "object" 1621 additionalProperties: 1622 type: "string" 1623 Plugins: 1624 type: "array" 1625 items: 1626 type: "object" 1627 properties: 1628 Type: 1629 type: "string" 1630 Name: 1631 type: "string" 1632 example: 1633 ID: "24ifsmvkjbyhk" 1634 Version: 1635 Index: 8 1636 CreatedAt: "2016-06-07T20:31:11.853781916Z" 1637 UpdatedAt: "2016-06-07T20:31:11.999868824Z" 1638 Spec: 1639 Name: "my-node" 1640 Role: "manager" 1641 Availability: "active" 1642 Labels: 1643 foo: "bar" 1644 Description: 1645 Hostname: "bf3067039e47" 1646 Platform: 1647 Architecture: "x86_64" 1648 OS: "linux" 1649 Resources: 1650 NanoCPUs: 4000000000 1651 MemoryBytes: 8272408576 1652 Engine: 1653 EngineVersion: "1.13.0" 1654 Labels: 1655 foo: "bar" 1656 Plugins: 1657 - Type: "Volume" 1658 Name: "local" 1659 - Type: "Network" 1660 Name: "bridge" 1661 - Type: "Network" 1662 Name: "null" 1663 - Type: "Network" 1664 Name: "overlay" 1665 Status: 1666 State: "ready" 1667 Addr: "172.17.0.2" 1668 ManagerStatus: 1669 Leader: true 1670 Reachability: "reachable" 1671 Addr: "172.17.0.2:2377" 1672 SwarmSpec: 1673 description: "User modifiable swarm configuration." 1674 type: "object" 1675 properties: 1676 Name: 1677 description: "Name of the swarm." 1678 type: "string" 1679 Labels: 1680 description: "User-defined key/value metadata." 1681 type: "object" 1682 additionalProperties: 1683 type: "string" 1684 Orchestration: 1685 description: "Orchestration configuration." 1686 type: "object" 1687 properties: 1688 TaskHistoryRetentionLimit: 1689 description: "The number of historic tasks to keep per instance or node. If negative, never remove completed or failed tasks." 1690 type: "integer" 1691 format: "int64" 1692 Raft: 1693 description: "Raft configuration." 1694 type: "object" 1695 properties: 1696 SnapshotInterval: 1697 description: "The number of log entries between snapshots." 1698 type: "integer" 1699 format: "int64" 1700 KeepOldSnapshots: 1701 description: "The number of snapshots to keep beyond the current snapshot." 1702 type: "integer" 1703 format: "int64" 1704 LogEntriesForSlowFollowers: 1705 description: "The number of log entries to keep around to sync up slow followers after a snapshot is created." 1706 type: "integer" 1707 format: "int64" 1708 ElectionTick: 1709 description: | 1710 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`. 1711 1712 A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed. 1713 type: "integer" 1714 HeartbeatTick: 1715 description: | 1716 The number of ticks between heartbeats. Every HeartbeatTick ticks, the leader will send a heartbeat to the followers. 1717 1718 A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed. 1719 type: "integer" 1720 Dispatcher: 1721 description: "Dispatcher configuration." 1722 type: "object" 1723 properties: 1724 HeartbeatPeriod: 1725 description: "The delay for an agent to send a heartbeat to the dispatcher." 1726 type: "integer" 1727 format: "int64" 1728 CAConfig: 1729 description: "CA configuration." 1730 type: "object" 1731 properties: 1732 NodeCertExpiry: 1733 description: "The duration node certificates are issued for." 1734 type: "integer" 1735 format: "int64" 1736 ExternalCAs: 1737 description: "Configuration for forwarding signing requests to an external certificate authority." 1738 type: "array" 1739 items: 1740 type: "object" 1741 properties: 1742 Protocol: 1743 description: "Protocol for communication with the external CA (currently only `cfssl` is supported)." 1744 type: "string" 1745 enum: 1746 - "cfssl" 1747 default: "cfssl" 1748 URL: 1749 description: "URL where certificate signing requests should be sent." 1750 type: "string" 1751 Options: 1752 description: "An object with key/value pairs that are interpreted as protocol-specific options for the external CA driver." 1753 type: "object" 1754 additionalProperties: 1755 type: "string" 1756 EncryptionConfig: 1757 description: "Parameters related to encryption-at-rest." 1758 type: "object" 1759 properties: 1760 AutoLockManagers: 1761 description: "If set, generate a key and use it to lock data stored on the managers." 1762 type: "boolean" 1763 TaskDefaults: 1764 description: "Defaults for creating tasks in this cluster." 1765 type: "object" 1766 properties: 1767 LogDriver: 1768 description: | 1769 The log driver to use for tasks created in the orchestrator if unspecified by a service. 1770 1771 Updating this value will only have an affect on new tasks. Old tasks will continue use their previously configured log driver until recreated. 1772 type: "object" 1773 properties: 1774 Name: 1775 type: "string" 1776 Options: 1777 type: "object" 1778 additionalProperties: 1779 type: "string" 1780 example: 1781 Name: "default" 1782 Orchestration: 1783 TaskHistoryRetentionLimit: 10 1784 Raft: 1785 SnapshotInterval: 10000 1786 LogEntriesForSlowFollowers: 500 1787 HeartbeatTick: 1 1788 ElectionTick: 3 1789 Dispatcher: 1790 HeartbeatPeriod: 5000000000 1791 CAConfig: 1792 NodeCertExpiry: 7776000000000000 1793 JoinTokens: 1794 Worker: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx" 1795 Manager: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" 1796 EncryptionConfig: 1797 AutoLockManagers: false 1798 # The Swarm information for `GET /info`. It is the same as `GET /swarm`, but 1799 # without `JoinTokens`. 1800 ClusterInfo: 1801 type: "object" 1802 properties: 1803 ID: 1804 description: "The ID of the swarm." 1805 type: "string" 1806 Version: 1807 type: "object" 1808 properties: 1809 Index: 1810 type: "integer" 1811 format: "int64" 1812 CreatedAt: 1813 type: "string" 1814 format: "dateTime" 1815 UpdatedAt: 1816 type: "string" 1817 format: "dateTime" 1818 Spec: 1819 $ref: "#/definitions/SwarmSpec" 1820 TaskSpec: 1821 description: "User modifiable task configuration." 1822 type: "object" 1823 properties: 1824 ContainerSpec: 1825 type: "object" 1826 properties: 1827 Image: 1828 description: "The image name to use for the container." 1829 type: "string" 1830 Command: 1831 description: "The command to be run in the image." 1832 type: "array" 1833 items: 1834 type: "string" 1835 Args: 1836 description: "Arguments to the command." 1837 type: "array" 1838 items: 1839 type: "string" 1840 Env: 1841 description: "A list of environment variables in the form `VAR=value`." 1842 type: "array" 1843 items: 1844 type: "string" 1845 Dir: 1846 description: "The working directory for commands to run in." 1847 type: "string" 1848 User: 1849 description: "The user inside the container." 1850 type: "string" 1851 Labels: 1852 description: "User-defined key/value data." 1853 type: "object" 1854 additionalProperties: 1855 type: "string" 1856 TTY: 1857 description: "Whether a pseudo-TTY should be allocated." 1858 type: "boolean" 1859 Mounts: 1860 description: "Specification for mounts to be added to containers created as part of the service." 1861 type: "array" 1862 items: 1863 $ref: "#/definitions/Mount" 1864 StopGracePeriod: 1865 description: "Amount of time to wait for the container to terminate before forcefully killing it." 1866 type: "integer" 1867 format: "int64" 1868 DNSConfig: 1869 description: "Specification for DNS related configurations in resolver configuration file (`resolv.conf`)." 1870 type: "object" 1871 properties: 1872 Nameservers: 1873 description: "The IP addresses of the name servers." 1874 type: "array" 1875 items: 1876 type: "string" 1877 Search: 1878 description: "A search list for host-name lookup." 1879 type: "array" 1880 items: 1881 type: "string" 1882 Options: 1883 description: "A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.)." 1884 type: "array" 1885 items: 1886 type: "string" 1887 Resources: 1888 description: "Resource requirements which apply to each individual container created as part of the service." 1889 type: "object" 1890 properties: 1891 Limits: 1892 description: "Define resources limits." 1893 type: "object" 1894 properties: 1895 NanoCPUs: 1896 description: "CPU limit in units of 10<sup>-9</sup> CPU shares." 1897 type: "integer" 1898 format: "int64" 1899 MemoryBytes: 1900 description: "Memory limit in Bytes." 1901 type: "integer" 1902 format: "int64" 1903 Reservation: 1904 description: "Define resources reservation." 1905 properties: 1906 NanoCPUs: 1907 description: "CPU reservation in units of 10<sup>-9</sup> CPU shares." 1908 type: "integer" 1909 format: "int64" 1910 MemoryBytes: 1911 description: "Memory reservation in Bytes." 1912 type: "integer" 1913 format: "int64" 1914 RestartPolicy: 1915 description: "Specification for the restart policy which applies to containers created as part of this service." 1916 type: "object" 1917 properties: 1918 Condition: 1919 description: "Condition for restart." 1920 type: "string" 1921 enum: 1922 - "none" 1923 - "on-failure" 1924 - "any" 1925 Delay: 1926 description: "Delay between restart attempts." 1927 type: "integer" 1928 format: "int64" 1929 MaxAttempts: 1930 description: "Maximum attempts to restart a given container before giving up (default value is 0, which is ignored)." 1931 type: "integer" 1932 format: "int64" 1933 default: 0 1934 Window: 1935 description: "Windows is the time window used to evaluate the restart policy (default value is 0, which is unbounded)." 1936 type: "integer" 1937 format: "int64" 1938 default: 0 1939 Placement: 1940 type: "object" 1941 properties: 1942 Constraints: 1943 description: "An array of constraints." 1944 type: "array" 1945 items: 1946 type: "string" 1947 ForceUpdate: 1948 description: "A counter that triggers an update even if no relevant parameters have been changed." 1949 type: "integer" 1950 Networks: 1951 type: "array" 1952 items: 1953 type: "object" 1954 properties: 1955 Target: 1956 type: "string" 1957 Aliases: 1958 type: "array" 1959 items: 1960 type: "string" 1961 LogDriver: 1962 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." 1963 type: "object" 1964 properties: 1965 Name: 1966 type: "string" 1967 Options: 1968 type: "object" 1969 additionalProperties: 1970 type: "string" 1971 TaskState: 1972 type: "string" 1973 enum: 1974 - "new" 1975 - "allocated" 1976 - "pending" 1977 - "assigned" 1978 - "accepted" 1979 - "preparing" 1980 - "ready" 1981 - "starting" 1982 - "running" 1983 - "complete" 1984 - "shutdown" 1985 - "failed" 1986 - "rejected" 1987 Task: 1988 type: "object" 1989 properties: 1990 ID: 1991 description: "The ID of the task." 1992 type: "string" 1993 Version: 1994 type: "object" 1995 properties: 1996 Index: 1997 type: "integer" 1998 format: "int64" 1999 CreatedAt: 2000 type: "string" 2001 format: "dateTime" 2002 UpdatedAt: 2003 type: "string" 2004 format: "dateTime" 2005 Name: 2006 description: "Name of the task." 2007 type: "string" 2008 Labels: 2009 description: "User-defined key/value metadata." 2010 type: "object" 2011 additionalProperties: 2012 type: "string" 2013 Spec: 2014 $ref: "#/definitions/TaskSpec" 2015 ServiceID: 2016 description: "The ID of the service this task is part of." 2017 type: "string" 2018 Slot: 2019 type: "integer" 2020 NodeID: 2021 description: "The ID of the node that this task is on." 2022 type: "string" 2023 Status: 2024 type: "object" 2025 properties: 2026 Timestamp: 2027 type: "string" 2028 format: "dateTime" 2029 State: 2030 $ref: "#/definitions/TaskState" 2031 Message: 2032 type: "string" 2033 Err: 2034 type: "string" 2035 ContainerStatus: 2036 type: "object" 2037 properties: 2038 ContainerID: 2039 type: "string" 2040 PID: 2041 type: "integer" 2042 ExitCode: 2043 type: "integer" 2044 DesiredState: 2045 $ref: "#/definitions/TaskState" 2046 example: 2047 ID: "0kzzo1i0y4jz6027t0k7aezc7" 2048 Version: 2049 Index: 71 2050 CreatedAt: "2016-06-07T21:07:31.171892745Z" 2051 UpdatedAt: "2016-06-07T21:07:31.376370513Z" 2052 Spec: 2053 ContainerSpec: 2054 Image: "redis" 2055 Resources: 2056 Limits: {} 2057 Reservations: {} 2058 RestartPolicy: 2059 Condition: "any" 2060 MaxAttempts: 0 2061 Placement: {} 2062 ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" 2063 Slot: 1 2064 NodeID: "60gvrl6tm78dmak4yl7srz94v" 2065 Status: 2066 Timestamp: "2016-06-07T21:07:31.290032978Z" 2067 State: "running" 2068 Message: "started" 2069 ContainerStatus: 2070 ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" 2071 PID: 677 2072 DesiredState: "running" 2073 NetworksAttachments: 2074 - Network: 2075 ID: "4qvuz4ko70xaltuqbt8956gd1" 2076 Version: 2077 Index: 18 2078 CreatedAt: "2016-06-07T20:31:11.912919752Z" 2079 UpdatedAt: "2016-06-07T21:07:29.955277358Z" 2080 Spec: 2081 Name: "ingress" 2082 Labels: 2083 com.docker.swarm.internal: "true" 2084 DriverConfiguration: {} 2085 IPAMOptions: 2086 Driver: {} 2087 Configs: 2088 - Subnet: "10.255.0.0/16" 2089 Gateway: "10.255.0.1" 2090 DriverState: 2091 Name: "overlay" 2092 Options: 2093 com.docker.network.driver.overlay.vxlanid_list: "256" 2094 IPAMOptions: 2095 Driver: 2096 Name: "default" 2097 Configs: 2098 - Subnet: "10.255.0.0/16" 2099 Gateway: "10.255.0.1" 2100 Addresses: 2101 - "10.255.0.10/16" 2102 ServiceSpec: 2103 description: "User modifiable configuration for a service." 2104 properties: 2105 Name: 2106 description: "Name of the service." 2107 type: "string" 2108 Labels: 2109 description: "User-defined key/value metadata." 2110 type: "object" 2111 additionalProperties: 2112 type: "string" 2113 TaskTemplate: 2114 $ref: "#/definitions/TaskSpec" 2115 Mode: 2116 description: "Scheduling mode for the service." 2117 type: "object" 2118 properties: 2119 Replicated: 2120 type: "object" 2121 properties: 2122 Replicas: 2123 type: "integer" 2124 format: "int64" 2125 Global: 2126 type: "object" 2127 UpdateConfig: 2128 description: "Specification for the update strategy of the service." 2129 type: "object" 2130 properties: 2131 Parallelism: 2132 description: "Maximum number of tasks to be updated in one iteration (0 means unlimited parallelism)." 2133 type: "integer" 2134 format: "int64" 2135 Delay: 2136 description: "Amount of time between updates, in nanoseconds." 2137 type: "integer" 2138 format: "int64" 2139 FailureAction: 2140 description: "Action to take if an updated task fails to run, or stops running during the update." 2141 type: "string" 2142 enum: 2143 - "continue" 2144 - "pause" 2145 Monitor: 2146 description: "Amount of time to monitor each updated task for failures, in nanoseconds." 2147 type: "integer" 2148 format: "int64" 2149 MaxFailureRatio: 2150 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." 2151 type: "number" 2152 default: 0 2153 Networks: 2154 description: "Array of network names or IDs to attach the service to." 2155 type: "array" 2156 items: 2157 type: "object" 2158 properties: 2159 Target: 2160 type: "string" 2161 Aliases: 2162 type: "array" 2163 items: 2164 type: "string" 2165 EndpointSpec: 2166 $ref: "#/definitions/EndpointSpec" 2167 EndpointPortConfig: 2168 type: "object" 2169 properties: 2170 Name: 2171 type: "string" 2172 Protocol: 2173 type: "string" 2174 enum: 2175 - "tcp" 2176 - "udp" 2177 TargetPort: 2178 description: "The port inside the container." 2179 type: "integer" 2180 PublishedPort: 2181 description: "The port on the swarm hosts." 2182 type: "integer" 2183 EndpointSpec: 2184 description: "Properties that can be configured to access and load balance a service." 2185 type: "object" 2186 properties: 2187 Mode: 2188 description: "The mode of resolution to use for internal load balancing 2189 between tasks." 2190 type: "string" 2191 enum: 2192 - "vip" 2193 - "dnsrr" 2194 default: "vip" 2195 Ports: 2196 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." 2197 type: "array" 2198 items: 2199 $ref: "#/definitions/EndpointPortConfig" 2200 Service: 2201 type: "object" 2202 properties: 2203 ID: 2204 type: "string" 2205 Version: 2206 type: "object" 2207 properties: 2208 Index: 2209 type: "integer" 2210 format: "int64" 2211 CreatedAt: 2212 type: "string" 2213 format: "dateTime" 2214 UpdatedAt: 2215 type: "string" 2216 format: "dateTime" 2217 Spec: 2218 $ref: "#/definitions/ServiceSpec" 2219 Endpoint: 2220 type: "object" 2221 properties: 2222 Spec: 2223 $ref: "#/definitions/EndpointSpec" 2224 Ports: 2225 type: "array" 2226 items: 2227 $ref: "#/definitions/EndpointPortConfig" 2228 VirtualIPs: 2229 type: "array" 2230 items: 2231 type: "object" 2232 properties: 2233 NetworkID: 2234 type: "string" 2235 Addr: 2236 type: "string" 2237 UpdateStatus: 2238 description: "The status of a service update." 2239 type: "object" 2240 properties: 2241 State: 2242 type: "string" 2243 enum: 2244 - "updating" 2245 - "paused" 2246 - "completed" 2247 StartedAt: 2248 type: "string" 2249 format: "dateTime" 2250 CompletedAt: 2251 type: "string" 2252 format: "dateTime" 2253 Message: 2254 type: "string" 2255 example: 2256 ID: "9mnpnzenvg8p8tdbtq4wvbkcz" 2257 Version: 2258 Index: 19 2259 CreatedAt: "2016-06-07T21:05:51.880065305Z" 2260 UpdatedAt: "2016-06-07T21:07:29.962229872Z" 2261 Spec: 2262 Name: "hopeful_cori" 2263 TaskTemplate: 2264 ContainerSpec: 2265 Image: "redis" 2266 Resources: 2267 Limits: {} 2268 Reservations: {} 2269 RestartPolicy: 2270 Condition: "any" 2271 MaxAttempts: 0 2272 Placement: {} 2273 ForceUpdate: 0 2274 Mode: 2275 Replicated: 2276 Replicas: 1 2277 UpdateConfig: 2278 Parallelism: 1 2279 FailureAction: "pause" 2280 Monitor: 15000000000 2281 MaxFailureRatio: 0.15 2282 EndpointSpec: 2283 Mode: "vip" 2284 Ports: 2285 - 2286 Protocol: "tcp" 2287 TargetPort: 6379 2288 PublishedPort: 30001 2289 Endpoint: 2290 Spec: 2291 Mode: "vip" 2292 Ports: 2293 - 2294 Protocol: "tcp" 2295 TargetPort: 6379 2296 PublishedPort: 30001 2297 Ports: 2298 - 2299 Protocol: "tcp" 2300 TargetPort: 6379 2301 PublishedPort: 30001 2302 VirtualIPs: 2303 - 2304 NetworkID: "4qvuz4ko70xaltuqbt8956gd1" 2305 Addr: "10.255.0.2/16" 2306 - 2307 NetworkID: "4qvuz4ko70xaltuqbt8956gd1" 2308 Addr: "10.255.0.3/16" 2309 ImageDeleteResponse: 2310 type: "object" 2311 properties: 2312 Untagged: 2313 description: "The image ID of an image that was untagged" 2314 type: "string" 2315 Deleted: 2316 description: "The image ID of an image that was deleted" 2317 type: "string" 2318 ServiceUpdateResponse: 2319 type: "object" 2320 properties: 2321 Warnings: 2322 description: "Optional warning messages" 2323 type: "array" 2324 items: 2325 type: "string" 2326 example: 2327 Warning: "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" 2328 ContainerSummary: 2329 type: "array" 2330 items: 2331 type: "object" 2332 properties: 2333 Id: 2334 description: "The ID of this container" 2335 type: "string" 2336 x-go-name: "ID" 2337 Names: 2338 description: "The names that this container has been given" 2339 type: "array" 2340 items: 2341 type: "string" 2342 Image: 2343 description: "The name of the image used when creating this container" 2344 type: "string" 2345 ImageID: 2346 description: "The ID of the image that this container was created from" 2347 type: "string" 2348 Command: 2349 description: "Command to run when starting the container" 2350 type: "string" 2351 Created: 2352 description: "When the container was created" 2353 type: "integer" 2354 format: "int64" 2355 Ports: 2356 description: "The ports exposed by this container" 2357 type: "array" 2358 items: 2359 $ref: "#/definitions/Port" 2360 SizeRw: 2361 description: "The size of files that have been created or changed by this container" 2362 type: "integer" 2363 format: "int64" 2364 SizeRootFs: 2365 description: "The total size of all the files in this container" 2366 type: "integer" 2367 format: "int64" 2368 Labels: 2369 description: "User-defined key/value metadata." 2370 type: "object" 2371 additionalProperties: 2372 type: "string" 2373 State: 2374 description: "The state of this container (e.g. `Exited`)" 2375 type: "string" 2376 Status: 2377 description: "Additional human-readable status of this container (e.g. `Exit 0`)" 2378 type: "string" 2379 HostConfig: 2380 type: "object" 2381 properties: 2382 NetworkMode: 2383 type: "string" 2384 NetworkSettings: 2385 description: "A summary of the container's network settings" 2386 type: "object" 2387 properties: 2388 Networks: 2389 type: "object" 2390 additionalProperties: 2391 $ref: "#/definitions/EndpointSettings" 2392 Mounts: 2393 type: "array" 2394 items: 2395 $ref: "#/definitions/Mount" 2396 SecretSpec: 2397 type: "object" 2398 properties: 2399 Name: 2400 description: "User-defined name of the secret." 2401 type: "string" 2402 Labels: 2403 description: "User-defined key/value metadata." 2404 type: "object" 2405 additionalProperties: 2406 type: "string" 2407 Data: 2408 description: "Base64-url-safe-encoded secret data" 2409 type: "array" 2410 items: 2411 type: "string" 2412 Secret: 2413 type: "object" 2414 properties: 2415 ID: 2416 type: "string" 2417 Version: 2418 type: "object" 2419 properties: 2420 Index: 2421 type: "integer" 2422 format: "int64" 2423 CreatedAt: 2424 type: "string" 2425 format: "dateTime" 2426 UpdatedAt: 2427 type: "string" 2428 format: "dateTime" 2429 Spec: 2430 $ref: "#/definitions/ServiceSpec" 2431 paths: 2432 /containers/json: 2433 get: 2434 summary: "List containers" 2435 operationId: "ContainerList" 2436 produces: 2437 - "application/json" 2438 parameters: 2439 - name: "all" 2440 in: "query" 2441 description: "Return all containers. By default, only running containers are shown" 2442 type: "boolean" 2443 default: false 2444 - name: "limit" 2445 in: "query" 2446 description: "Return this number of most recently created containers, including non-running ones." 2447 type: "integer" 2448 - name: "size" 2449 in: "query" 2450 description: "Return the size of container as fields `SizeRw` and `SizeRootFs`." 2451 type: "boolean" 2452 default: false 2453 - name: "filters" 2454 in: "query" 2455 description: | 2456 Filters to process on the container list, encoded as JSON (a `map[string][]string`). For example, `{"status": ["paused"]}` will only return paused containers. 2457 2458 Available filters: 2459 - `exited=<int>` containers with exit code of `<int>` 2460 - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) 2461 - `label=key` or `label="key=value"` of a container label 2462 - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) 2463 - `id=<ID>` a container's ID 2464 - `name=<name>` a container's name 2465 - `is-task=`(`true`|`false`) 2466 - `ancestor`=(`<image-name>[:<tag>]`, `<image id>`, or `<image@digest>`) 2467 - `before`=(`<container id>` or `<container name>`) 2468 - `since`=(`<container id>` or `<container name>`) 2469 - `volume`=(`<volume name>` or `<mount point destination>`) 2470 - `network`=(`<network id>` or `<network name>`) 2471 - `health`=(`starting`|`healthy`|`unhealthy`|`none`) 2472 type: "string" 2473 responses: 2474 200: 2475 description: "no error" 2476 schema: 2477 $ref: "#/definitions/ContainerSummary" 2478 examples: 2479 application/json: 2480 - Id: "8dfafdbc3a40" 2481 Names: 2482 - "/boring_feynman" 2483 Image: "ubuntu:latest" 2484 ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82" 2485 Command: "echo 1" 2486 Created: 1367854155 2487 State: "Exited" 2488 Status: "Exit 0" 2489 Ports: 2490 - PrivatePort: 2222 2491 PublicPort: 3333 2492 Type: "tcp" 2493 Labels: 2494 com.example.vendor: "Acme" 2495 com.example.license: "GPL" 2496 com.example.version: "1.0" 2497 SizeRw: 12288 2498 SizeRootFs: 0 2499 HostConfig: 2500 NetworkMode: "default" 2501 NetworkSettings: 2502 Networks: 2503 bridge: 2504 NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812" 2505 EndpointID: "2cdc4edb1ded3631c81f57966563e5c8525b81121bb3706a9a9a3ae102711f3f" 2506 Gateway: "172.17.0.1" 2507 IPAddress: "172.17.0.2" 2508 IPPrefixLen: 16 2509 IPv6Gateway: "" 2510 GlobalIPv6Address: "" 2511 GlobalIPv6PrefixLen: 0 2512 MacAddress: "02:42:ac:11:00:02" 2513 Mounts: 2514 - Name: "fac362...80535" 2515 Source: "/data" 2516 Destination: "/data" 2517 Driver: "local" 2518 Mode: "ro,Z" 2519 RW: false 2520 Propagation: "" 2521 - Id: "9cd87474be90" 2522 Names: 2523 - "/coolName" 2524 Image: "ubuntu:latest" 2525 ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82" 2526 Command: "echo 222222" 2527 Created: 1367854155 2528 State: "Exited" 2529 Status: "Exit 0" 2530 Ports: [] 2531 Labels: {} 2532 SizeRw: 12288 2533 SizeRootFs: 0 2534 HostConfig: 2535 NetworkMode: "default" 2536 NetworkSettings: 2537 Networks: 2538 bridge: 2539 NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812" 2540 EndpointID: "88eaed7b37b38c2a3f0c4bc796494fdf51b270c2d22656412a2ca5d559a64d7a" 2541 Gateway: "172.17.0.1" 2542 IPAddress: "172.17.0.8" 2543 IPPrefixLen: 16 2544 IPv6Gateway: "" 2545 GlobalIPv6Address: "" 2546 GlobalIPv6PrefixLen: 0 2547 MacAddress: "02:42:ac:11:00:08" 2548 Mounts: [] 2549 - Id: "3176a2479c92" 2550 Names: 2551 - "/sleepy_dog" 2552 Image: "ubuntu:latest" 2553 ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82" 2554 Command: "echo 3333333333333333" 2555 Created: 1367854154 2556 State: "Exited" 2557 Status: "Exit 0" 2558 Ports: [] 2559 Labels: {} 2560 SizeRw: 12288 2561 SizeRootFs: 0 2562 HostConfig: 2563 NetworkMode: "default" 2564 NetworkSettings: 2565 Networks: 2566 bridge: 2567 NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812" 2568 EndpointID: "8b27c041c30326d59cd6e6f510d4f8d1d570a228466f956edf7815508f78e30d" 2569 Gateway: "172.17.0.1" 2570 IPAddress: "172.17.0.6" 2571 IPPrefixLen: 16 2572 IPv6Gateway: "" 2573 GlobalIPv6Address: "" 2574 GlobalIPv6PrefixLen: 0 2575 MacAddress: "02:42:ac:11:00:06" 2576 Mounts: [] 2577 - Id: "4cb07b47f9fb" 2578 Names: 2579 - "/running_cat" 2580 Image: "ubuntu:latest" 2581 ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82" 2582 Command: "echo 444444444444444444444444444444444" 2583 Created: 1367854152 2584 State: "Exited" 2585 Status: "Exit 0" 2586 Ports: [] 2587 Labels: {} 2588 SizeRw: 12288 2589 SizeRootFs: 0 2590 HostConfig: 2591 NetworkMode: "default" 2592 NetworkSettings: 2593 Networks: 2594 bridge: 2595 NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812" 2596 EndpointID: "d91c7b2f0644403d7ef3095985ea0e2370325cd2332ff3a3225c4247328e66e9" 2597 Gateway: "172.17.0.1" 2598 IPAddress: "172.17.0.5" 2599 IPPrefixLen: 16 2600 IPv6Gateway: "" 2601 GlobalIPv6Address: "" 2602 GlobalIPv6PrefixLen: 0 2603 MacAddress: "02:42:ac:11:00:05" 2604 Mounts: [] 2605 400: 2606 description: "bad parameter" 2607 schema: 2608 $ref: "#/definitions/ErrorResponse" 2609 500: 2610 description: "server error" 2611 schema: 2612 $ref: "#/definitions/ErrorResponse" 2613 tags: ["Container"] 2614 /containers/create: 2615 post: 2616 summary: "Create a container" 2617 operationId: "ContainerCreate" 2618 consumes: 2619 - "application/json" 2620 - "application/octet-stream" 2621 produces: 2622 - "application/json" 2623 parameters: 2624 - name: "name" 2625 in: "query" 2626 description: "Assign the specified name to the container. Must match `/?[a-zA-Z0-9_-]+`." 2627 type: "string" 2628 pattern: "/?[a-zA-Z0-9_-]+" 2629 - name: "body" 2630 in: "body" 2631 description: "Container to create" 2632 schema: 2633 allOf: 2634 - $ref: "#/definitions/Config" 2635 - type: "object" 2636 properties: 2637 HostConfig: 2638 $ref: "#/definitions/HostConfig" 2639 NetworkingConfig: 2640 description: "This container's networking configuration." 2641 type: "object" 2642 properties: 2643 EndpointsConfig: 2644 description: "A mapping of network name to endpoint configuration for that network." 2645 type: "object" 2646 additionalProperties: 2647 $ref: "#/definitions/EndpointSettings" 2648 example: 2649 Hostname: "" 2650 Domainname: "" 2651 User: "" 2652 AttachStdin: false 2653 AttachStdout: true 2654 AttachStderr: true 2655 Tty: false 2656 OpenStdin: false 2657 StdinOnce: false 2658 Env: 2659 - "FOO=bar" 2660 - "BAZ=quux" 2661 Cmd: 2662 - "date" 2663 Entrypoint: "" 2664 Image: "ubuntu" 2665 Labels: 2666 com.example.vendor: "Acme" 2667 com.example.license: "GPL" 2668 com.example.version: "1.0" 2669 Volumes: 2670 /volumes/data: {} 2671 WorkingDir: "" 2672 NetworkDisabled: false 2673 MacAddress: "12:34:56:78:9a:bc" 2674 ExposedPorts: 2675 22/tcp: {} 2676 StopSignal: "SIGTERM" 2677 StopTimeout: 10 2678 HostConfig: 2679 Binds: 2680 - "/tmp:/tmp" 2681 Links: 2682 - "redis3:redis" 2683 Memory: 0 2684 MemorySwap: 0 2685 MemoryReservation: 0 2686 KernelMemory: 0 2687 NanoCPUs: 500000 2688 CpuPercent: 80 2689 CpuShares: 512 2690 CpuPeriod: 100000 2691 CpuRealtimePeriod: 1000000 2692 CpuRealtimeRuntime: 10000 2693 CpuQuota: 50000 2694 CpusetCpus: "0,1" 2695 CpusetMems: "0,1" 2696 MaximumIOps: 0 2697 MaximumIOBps: 0 2698 BlkioWeight: 300 2699 BlkioWeightDevice: 2700 - {} 2701 BlkioDeviceReadBps: 2702 - {} 2703 BlkioDeviceReadIOps: 2704 - {} 2705 BlkioDeviceWriteBps: 2706 - {} 2707 BlkioDeviceWriteIOps: 2708 - {} 2709 MemorySwappiness: 60 2710 OomKillDisable: false 2711 OomScoreAdj: 500 2712 PidMode: "" 2713 PidsLimit: -1 2714 PortBindings: 2715 22/tcp: 2716 - HostPort: "11022" 2717 PublishAllPorts: false 2718 Privileged: false 2719 ReadonlyRootfs: false 2720 Dns: 2721 - "8.8.8.8" 2722 DnsOptions: 2723 - "" 2724 DnsSearch: 2725 - "" 2726 VolumesFrom: 2727 - "parent" 2728 - "other:ro" 2729 CapAdd: 2730 - "NET_ADMIN" 2731 CapDrop: 2732 - "MKNOD" 2733 GroupAdd: 2734 - "newgroup" 2735 RestartPolicy: 2736 Name: "" 2737 MaximumRetryCount: 0 2738 AutoRemove: true 2739 NetworkMode: "bridge" 2740 Devices: [] 2741 Ulimits: 2742 - {} 2743 LogConfig: 2744 Type: "json-file" 2745 Config: {} 2746 SecurityOpt: [] 2747 StorageOpt: {} 2748 CgroupParent: "" 2749 VolumeDriver: "" 2750 ShmSize: 67108864 2751 NetworkingConfig: 2752 EndpointsConfig: 2753 isolated_nw: 2754 IPAMConfig: 2755 IPv4Address: "172.20.30.33" 2756 IPv6Address: "2001:db8:abcd::3033" 2757 LinkLocalIPs: 2758 - "169.254.34.68" 2759 - "fe80::3468" 2760 Links: 2761 - "container_1" 2762 - "container_2" 2763 Aliases: 2764 - "server_x" 2765 - "server_y" 2766 2767 required: true 2768 responses: 2769 201: 2770 description: "Container created successfully" 2771 schema: 2772 type: "object" 2773 required: [Id, Warnings] 2774 properties: 2775 Id: 2776 description: "The ID of the created container" 2777 type: "string" 2778 x-nullable: false 2779 Warnings: 2780 description: "Warnings encountered when creating the container" 2781 type: "array" 2782 x-nullable: false 2783 items: 2784 type: "string" 2785 examples: 2786 application/json: 2787 Id: "e90e34656806" 2788 Warnings: [] 2789 400: 2790 description: "bad parameter" 2791 schema: 2792 $ref: "#/definitions/ErrorResponse" 2793 404: 2794 description: "no such container" 2795 schema: 2796 $ref: "#/definitions/ErrorResponse" 2797 examples: 2798 application/json: 2799 message: "No such container: c2ada9df5af8" 2800 406: 2801 description: "impossible to attach" 2802 schema: 2803 $ref: "#/definitions/ErrorResponse" 2804 409: 2805 description: "conflict" 2806 schema: 2807 $ref: "#/definitions/ErrorResponse" 2808 500: 2809 description: "server error" 2810 schema: 2811 $ref: "#/definitions/ErrorResponse" 2812 tags: ["Container"] 2813 /containers/{id}/json: 2814 get: 2815 summary: "Inspect a container" 2816 description: "Return low-level information about a container." 2817 operationId: "ContainerInspect" 2818 produces: 2819 - "application/json" 2820 responses: 2821 200: 2822 description: "no error" 2823 schema: 2824 type: "object" 2825 properties: 2826 Id: 2827 description: "The ID of the container" 2828 type: "string" 2829 Created: 2830 description: "The time the container was created" 2831 type: "string" 2832 Path: 2833 description: "The path to the command being run" 2834 type: "string" 2835 Args: 2836 description: "The arguments to the command being run" 2837 type: "array" 2838 items: 2839 type: "string" 2840 State: 2841 description: "The state of the container." 2842 type: "object" 2843 properties: 2844 Status: 2845 description: "The status of the container. For example, `running` or `exited`." 2846 type: "string" 2847 Running: 2848 description: "Whether this container is running." 2849 type: "boolean" 2850 Paused: 2851 description: "Whether this container is paused." 2852 type: "boolean" 2853 Restarting: 2854 description: "Whether this container is restarting." 2855 type: "boolean" 2856 OOMKilled: 2857 description: "Whether this container has been killed because it ran out of memory." 2858 type: "boolean" 2859 Dead: 2860 type: "boolean" 2861 Pid: 2862 description: "The process ID of this container" 2863 type: "integer" 2864 ExitCode: 2865 description: "The last exit code of this container" 2866 type: "integer" 2867 Error: 2868 type: "string" 2869 StartedAt: 2870 description: "The time when this container was last started." 2871 type: "string" 2872 FinishedAt: 2873 description: "The time when this container last exited." 2874 type: "string" 2875 Image: 2876 description: "The container's image" 2877 type: "string" 2878 ResolvConfPath: 2879 type: "string" 2880 HostnamePath: 2881 type: "string" 2882 HostsPath: 2883 type: "string" 2884 LogPath: 2885 type: "string" 2886 Node: 2887 description: "TODO" 2888 type: "object" 2889 Name: 2890 type: "string" 2891 RestartCount: 2892 type: "integer" 2893 Driver: 2894 type: "string" 2895 MountLabel: 2896 type: "string" 2897 ProcessLabel: 2898 type: "string" 2899 AppArmorProfile: 2900 type: "string" 2901 ExecIDs: 2902 type: "string" 2903 HostConfig: 2904 $ref: "#/definitions/HostConfig" 2905 GraphDriver: 2906 $ref: "#/definitions/GraphDriver" 2907 SizeRw: 2908 description: "The size of files that have been created or changed by this container." 2909 type: "integer" 2910 format: "int64" 2911 SizeRootFs: 2912 description: "The total size of all the files in this container." 2913 type: "integer" 2914 format: "int64" 2915 Mounts: 2916 type: "array" 2917 items: 2918 $ref: "#/definitions/MountPoint" 2919 Config: 2920 $ref: "#/definitions/Config" 2921 NetworkSettings: 2922 $ref: "#/definitions/NetworkConfig" 2923 examples: 2924 application/json: 2925 AppArmorProfile: "" 2926 Args: 2927 - "-c" 2928 - "exit 9" 2929 Config: 2930 AttachStderr: true 2931 AttachStdin: false 2932 AttachStdout: true 2933 Cmd: 2934 - "/bin/sh" 2935 - "-c" 2936 - "exit 9" 2937 Domainname: "" 2938 Env: 2939 - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 2940 Hostname: "ba033ac44011" 2941 Image: "ubuntu" 2942 Labels: 2943 com.example.vendor: "Acme" 2944 com.example.license: "GPL" 2945 com.example.version: "1.0" 2946 MacAddress: "" 2947 NetworkDisabled: false 2948 OpenStdin: false 2949 StdinOnce: false 2950 Tty: false 2951 User: "" 2952 Volumes: 2953 /volumes/data: {} 2954 WorkingDir: "" 2955 StopSignal: "SIGTERM" 2956 StopTimeout: 10 2957 Created: "2015-01-06T15:47:31.485331387Z" 2958 Driver: "devicemapper" 2959 HostConfig: 2960 MaximumIOps: 0 2961 MaximumIOBps: 0 2962 BlkioWeight: 0 2963 BlkioWeightDevice: 2964 - {} 2965 BlkioDeviceReadBps: 2966 - {} 2967 BlkioDeviceWriteBps: 2968 - {} 2969 BlkioDeviceReadIOps: 2970 - {} 2971 BlkioDeviceWriteIOps: 2972 - {} 2973 ContainerIDFile: "" 2974 CpusetCpus: "" 2975 CpusetMems: "" 2976 CpuPercent: 80 2977 CpuShares: 0 2978 CpuPeriod: 100000 2979 CpuRealtimePeriod: 1000000 2980 CpuRealtimeRuntime: 10000 2981 Devices: [] 2982 IpcMode: "" 2983 LxcConf: [] 2984 Memory: 0 2985 MemorySwap: 0 2986 MemoryReservation: 0 2987 KernelMemory: 0 2988 OomKillDisable: false 2989 OomScoreAdj: 500 2990 NetworkMode: "bridge" 2991 PidMode: "" 2992 PortBindings: {} 2993 Privileged: false 2994 ReadonlyRootfs: false 2995 PublishAllPorts: false 2996 RestartPolicy: 2997 MaximumRetryCount: 2 2998 Name: "on-failure" 2999 LogConfig: 3000 Type: "json-file" 3001 Sysctls: 3002 net.ipv4.ip_forward: "1" 3003 Ulimits: 3004 - {} 3005 VolumeDriver: "" 3006 ShmSize: 67108864 3007 HostnamePath: "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname" 3008 HostsPath: "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts" 3009 LogPath: "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log" 3010 Id: "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39" 3011 Image: "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2" 3012 MountLabel: "" 3013 Name: "/boring_euclid" 3014 NetworkSettings: 3015 Bridge: "" 3016 SandboxID: "" 3017 HairpinMode: false 3018 LinkLocalIPv6Address: "" 3019 LinkLocalIPv6PrefixLen: 0 3020 SandboxKey: "" 3021 SecondaryIPAddresses: null 3022 SecondaryIPv6Addresses: null 3023 EndpointID: "" 3024 Gateway: "" 3025 GlobalIPv6Address: "" 3026 GlobalIPv6PrefixLen: 0 3027 IPAddress: "" 3028 IPPrefixLen: 0 3029 IPv6Gateway: "" 3030 MacAddress: "" 3031 Networks: 3032 bridge: 3033 NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812" 3034 EndpointID: "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d" 3035 Gateway: "172.17.0.1" 3036 IPAddress: "172.17.0.2" 3037 IPPrefixLen: 16 3038 IPv6Gateway: "" 3039 GlobalIPv6Address: "" 3040 GlobalIPv6PrefixLen: 0 3041 MacAddress: "02:42:ac:12:00:02" 3042 Path: "/bin/sh" 3043 ProcessLabel: "" 3044 ResolvConfPath: "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf" 3045 RestartCount: 1 3046 State: 3047 Error: "" 3048 ExitCode: 9 3049 FinishedAt: "2015-01-06T15:47:32.080254511Z" 3050 OOMKilled: false 3051 Dead: false 3052 Paused: false 3053 Pid: 0 3054 Restarting: false 3055 Running: true 3056 StartedAt: "2015-01-06T15:47:32.072697474Z" 3057 Status: "running" 3058 Mounts: 3059 - Name: "fac362...80535" 3060 Source: "/data" 3061 Destination: "/data" 3062 Driver: "local" 3063 Mode: "ro,Z" 3064 RW: false 3065 Propagation: "" 3066 404: 3067 description: "no such container" 3068 schema: 3069 $ref: "#/definitions/ErrorResponse" 3070 examples: 3071 application/json: 3072 message: "No such container: c2ada9df5af8" 3073 500: 3074 description: "server error" 3075 schema: 3076 $ref: "#/definitions/ErrorResponse" 3077 parameters: 3078 - name: "id" 3079 in: "path" 3080 required: true 3081 description: "ID or name of the container" 3082 type: "string" 3083 - name: "size" 3084 in: "query" 3085 type: "boolean" 3086 default: false 3087 description: "Return the size of container as fields `SizeRw` and `SizeRootFs`" 3088 tags: ["Container"] 3089 /containers/{id}/top: 3090 get: 3091 summary: "List processes running inside a container" 3092 description: "On Unix systems, this is done by running the `ps` command. This endpoint is not supported on Windows." 3093 operationId: "ContainerTop" 3094 responses: 3095 200: 3096 description: "no error" 3097 schema: 3098 type: "object" 3099 properties: 3100 Titles: 3101 description: "The ps column titles" 3102 type: "array" 3103 items: 3104 type: "string" 3105 Processes: 3106 description: "Each process running in the container, where each is process is an array of values corresponding to the titles" 3107 type: "array" 3108 items: 3109 type: "array" 3110 items: 3111 type: "string" 3112 examples: 3113 application/json: 3114 Titles: 3115 - "UID" 3116 - "PID" 3117 - "PPID" 3118 - "C" 3119 - "STIME" 3120 - "TTY" 3121 - "TIME" 3122 - "CMD" 3123 Processes: 3124 - 3125 - "root" 3126 - "13642" 3127 - "882" 3128 - "0" 3129 - "17:03" 3130 - "pts/0" 3131 - "00:00:00" 3132 - "/bin/bash" 3133 - 3134 - "root" 3135 - "13735" 3136 - "13642" 3137 - "0" 3138 - "17:06" 3139 - "pts/0" 3140 - "00:00:00" 3141 - "sleep 10" 3142 404: 3143 description: "no such container" 3144 schema: 3145 $ref: "#/definitions/ErrorResponse" 3146 examples: 3147 application/json: 3148 message: "No such container: c2ada9df5af8" 3149 500: 3150 description: "server error" 3151 schema: 3152 $ref: "#/definitions/ErrorResponse" 3153 parameters: 3154 - name: "id" 3155 in: "path" 3156 required: true 3157 description: "ID or name of the container" 3158 type: "string" 3159 - name: "ps_args" 3160 in: "query" 3161 description: "The arguments to pass to `ps`. For example, `aux`" 3162 type: "string" 3163 default: "-ef" 3164 tags: ["Container"] 3165 /containers/{id}/logs: 3166 get: 3167 summary: "Get container logs" 3168 description: | 3169 Get `stdout` and `stderr` logs from a container. 3170 3171 Note: This endpoint works only for containers with the `json-file` or `journald` logging driver. 3172 operationId: "ContainerLogs" 3173 responses: 3174 101: 3175 description: "logs returned as a stream" 3176 schema: 3177 type: "string" 3178 format: "binary" 3179 200: 3180 description: "logs returned as a string in response body" 3181 schema: 3182 type: "string" 3183 404: 3184 description: "no such container" 3185 schema: 3186 $ref: "#/definitions/ErrorResponse" 3187 examples: 3188 application/json: 3189 message: "No such container: c2ada9df5af8" 3190 500: 3191 description: "server error" 3192 schema: 3193 $ref: "#/definitions/ErrorResponse" 3194 parameters: 3195 - name: "id" 3196 in: "path" 3197 required: true 3198 description: "ID or name of the container" 3199 type: "string" 3200 - name: "follow" 3201 in: "query" 3202 description: | 3203 Return the logs as a stream. 3204 3205 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). 3206 type: "boolean" 3207 default: false 3208 - name: "stdout" 3209 in: "query" 3210 description: "Return logs from `stdout`" 3211 type: "boolean" 3212 default: false 3213 - name: "stderr" 3214 in: "query" 3215 description: "Return logs from `stderr`" 3216 type: "boolean" 3217 default: false 3218 - name: "since" 3219 in: "query" 3220 description: "Only return logs since this time, as a UNIX timestamp" 3221 type: "integer" 3222 default: 0 3223 - name: "timestamps" 3224 in: "query" 3225 description: "Add timestamps to every log line" 3226 type: "boolean" 3227 default: false 3228 - name: "tail" 3229 in: "query" 3230 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." 3231 type: "string" 3232 default: "all" 3233 tags: ["Container"] 3234 /containers/{id}/changes: 3235 get: 3236 summary: "Get changes on a container’s filesystem" 3237 description: | 3238 Returns which files in a container's filesystem have been added, deleted, or modified. The `Kind` of modification can be one of: 3239 3240 - `0`: Modified 3241 - `1`: Added 3242 - `2`: Deleted 3243 operationId: "ContainerChanges" 3244 produces: 3245 - "application/json" 3246 responses: 3247 200: 3248 description: "no error" 3249 schema: 3250 type: "array" 3251 items: 3252 type: "object" 3253 properties: 3254 Path: 3255 description: "Path to file that has changed" 3256 type: "string" 3257 Kind: 3258 description: "Kind of change" 3259 type: "integer" 3260 enum: 3261 - 0 3262 - 1 3263 - 2 3264 examples: 3265 application/json: 3266 - Path: "/dev" 3267 Kind: 0 3268 - Path: "/dev/kmsg" 3269 Kind: 1 3270 - Path: "/test" 3271 Kind: 1 3272 404: 3273 description: "no such container" 3274 schema: 3275 $ref: "#/definitions/ErrorResponse" 3276 examples: 3277 application/json: 3278 message: "No such container: c2ada9df5af8" 3279 500: 3280 description: "server error" 3281 schema: 3282 $ref: "#/definitions/ErrorResponse" 3283 parameters: 3284 - name: "id" 3285 in: "path" 3286 required: true 3287 description: "ID or name of the container" 3288 type: "string" 3289 tags: ["Container"] 3290 /containers/{id}/export: 3291 get: 3292 summary: "Export a container" 3293 description: "Export the contents of a container as a tarball." 3294 operationId: "ContainerExport" 3295 produces: 3296 - "application/octet-stream" 3297 responses: 3298 200: 3299 description: "no error" 3300 404: 3301 description: "no such container" 3302 schema: 3303 $ref: "#/definitions/ErrorResponse" 3304 examples: 3305 application/json: 3306 message: "No such container: c2ada9df5af8" 3307 500: 3308 description: "server error" 3309 schema: 3310 $ref: "#/definitions/ErrorResponse" 3311 parameters: 3312 - name: "id" 3313 in: "path" 3314 required: true 3315 description: "ID or name of the container" 3316 type: "string" 3317 tags: ["Container"] 3318 /containers/{id}/stats: 3319 get: 3320 summary: "Get container stats based on resource usage" 3321 description: | 3322 This endpoint returns a live stream of a container’s resource usage statistics. 3323 3324 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. 3325 operationId: "ContainerStats" 3326 produces: 3327 - "application/json" 3328 responses: 3329 200: 3330 description: "no error" 3331 schema: 3332 type: "object" 3333 examples: 3334 application/json: 3335 read: "2015-01-08T22:57:31.547920715Z" 3336 pids_stats: 3337 current: 3 3338 networks: 3339 eth0: 3340 rx_bytes: 5338 3341 rx_dropped: 0 3342 rx_errors: 0 3343 rx_packets: 36 3344 tx_bytes: 648 3345 tx_dropped: 0 3346 tx_errors: 0 3347 tx_packets: 8 3348 eth5: 3349 rx_bytes: 4641 3350 rx_dropped: 0 3351 rx_errors: 0 3352 rx_packets: 26 3353 tx_bytes: 690 3354 tx_dropped: 0 3355 tx_errors: 0 3356 tx_packets: 9 3357 memory_stats: 3358 stats: 3359 total_pgmajfault: 0 3360 cache: 0 3361 mapped_file: 0 3362 total_inactive_file: 0 3363 pgpgout: 414 3364 rss: 6537216 3365 total_mapped_file: 0 3366 writeback: 0 3367 unevictable: 0 3368 pgpgin: 477 3369 total_unevictable: 0 3370 pgmajfault: 0 3371 total_rss: 6537216 3372 total_rss_huge: 6291456 3373 total_writeback: 0 3374 total_inactive_anon: 0 3375 rss_huge: 6291456 3376 hierarchical_memory_limit: 67108864 3377 total_pgfault: 964 3378 total_active_file: 0 3379 active_anon: 6537216 3380 total_active_anon: 6537216 3381 total_pgpgout: 414 3382 total_cache: 0 3383 inactive_anon: 0 3384 active_file: 0 3385 pgfault: 964 3386 inactive_file: 0 3387 total_pgpgin: 477 3388 max_usage: 6651904 3389 usage: 6537216 3390 failcnt: 0 3391 limit: 67108864 3392 blkio_stats: {} 3393 cpu_stats: 3394 cpu_usage: 3395 percpu_usage: 3396 - 8646879 3397 - 24472255 3398 - 36438778 3399 - 30657443 3400 usage_in_usermode: 50000000 3401 total_usage: 100215355 3402 usage_in_kernelmode: 30000000 3403 system_cpu_usage: 739306590000000 3404 throttling_data: 3405 periods: 0 3406 throttled_periods: 0 3407 throttled_time: 0 3408 precpu_stats: 3409 cpu_usage: 3410 percpu_usage: 3411 - 8646879 3412 - 24350896 3413 - 36438778 3414 - 30657443 3415 usage_in_usermode: 50000000 3416 total_usage: 100093996 3417 usage_in_kernelmode: 30000000 3418 system_cpu_usage: 9492140000000 3419 throttling_data: 3420 periods: 0 3421 throttled_periods: 0 3422 throttled_time: 0 3423 404: 3424 description: "no such container" 3425 schema: 3426 $ref: "#/definitions/ErrorResponse" 3427 examples: 3428 application/json: 3429 message: "No such container: c2ada9df5af8" 3430 500: 3431 description: "server error" 3432 schema: 3433 $ref: "#/definitions/ErrorResponse" 3434 parameters: 3435 - name: "id" 3436 in: "path" 3437 required: true 3438 description: "ID or name of the container" 3439 type: "string" 3440 - name: "stream" 3441 in: "query" 3442 description: "Stream the output. If false, the stats will be output once and then it will disconnect." 3443 type: "boolean" 3444 default: true 3445 tags: ["Container"] 3446 /containers/{id}/resize: 3447 post: 3448 summary: "Resize a container TTY" 3449 description: "Resize the TTY for a container. You must restart the container for the resize to take effect." 3450 operationId: "ContainerResize" 3451 consumes: 3452 - "application/octet-stream" 3453 produces: 3454 - "text/plain" 3455 responses: 3456 200: 3457 description: "no error" 3458 404: 3459 description: "no such container" 3460 schema: 3461 $ref: "#/definitions/ErrorResponse" 3462 examples: 3463 application/json: 3464 message: "No such container: c2ada9df5af8" 3465 500: 3466 description: "cannot resize container" 3467 schema: 3468 $ref: "#/definitions/ErrorResponse" 3469 parameters: 3470 - name: "id" 3471 in: "path" 3472 required: true 3473 description: "ID or name of the container" 3474 type: "string" 3475 - name: "h" 3476 in: "query" 3477 description: "Height of the tty session in characters" 3478 type: "integer" 3479 - name: "w" 3480 in: "query" 3481 description: "Width of the tty session in characters" 3482 type: "integer" 3483 tags: ["Container"] 3484 /containers/{id}/start: 3485 post: 3486 summary: "Start a container" 3487 operationId: "ContainerStart" 3488 responses: 3489 204: 3490 description: "no error" 3491 304: 3492 description: "container already started" 3493 schema: 3494 $ref: "#/definitions/ErrorResponse" 3495 404: 3496 description: "no such container" 3497 schema: 3498 $ref: "#/definitions/ErrorResponse" 3499 examples: 3500 application/json: 3501 message: "No such container: c2ada9df5af8" 3502 500: 3503 description: "server error" 3504 schema: 3505 $ref: "#/definitions/ErrorResponse" 3506 parameters: 3507 - name: "id" 3508 in: "path" 3509 required: true 3510 description: "ID or name of the container" 3511 type: "string" 3512 - name: "detachKeys" 3513 in: "query" 3514 description: "Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`." 3515 type: "string" 3516 tags: ["Container"] 3517 /containers/{id}/stop: 3518 post: 3519 summary: "Stop a container" 3520 operationId: "ContainerStop" 3521 responses: 3522 204: 3523 description: "no error" 3524 304: 3525 description: "container already stopped" 3526 schema: 3527 $ref: "#/definitions/ErrorResponse" 3528 404: 3529 description: "no such container" 3530 schema: 3531 $ref: "#/definitions/ErrorResponse" 3532 examples: 3533 application/json: 3534 message: "No such container: c2ada9df5af8" 3535 500: 3536 description: "server error" 3537 schema: 3538 $ref: "#/definitions/ErrorResponse" 3539 parameters: 3540 - name: "id" 3541 in: "path" 3542 required: true 3543 description: "ID or name of the container" 3544 type: "string" 3545 - name: "t" 3546 in: "query" 3547 description: "Number of seconds to wait before killing the container" 3548 type: "integer" 3549 tags: ["Container"] 3550 /containers/{id}/restart: 3551 post: 3552 summary: "Restart a container" 3553 operationId: "ContainerRestart" 3554 responses: 3555 204: 3556 description: "no error" 3557 404: 3558 description: "no such container" 3559 schema: 3560 $ref: "#/definitions/ErrorResponse" 3561 examples: 3562 application/json: 3563 message: "No such container: c2ada9df5af8" 3564 500: 3565 description: "server error" 3566 schema: 3567 $ref: "#/definitions/ErrorResponse" 3568 parameters: 3569 - name: "id" 3570 in: "path" 3571 required: true 3572 description: "ID or name of the container" 3573 type: "string" 3574 - name: "t" 3575 in: "query" 3576 description: "Number of seconds to wait before killing the container" 3577 type: "integer" 3578 tags: ["Container"] 3579 /containers/{id}/kill: 3580 post: 3581 summary: "Kill a container" 3582 description: "Send a POSIX signal to a container, defaulting to killing to the container." 3583 operationId: "ContainerKill" 3584 responses: 3585 204: 3586 description: "no error" 3587 404: 3588 description: "no such container" 3589 schema: 3590 $ref: "#/definitions/ErrorResponse" 3591 examples: 3592 application/json: 3593 message: "No such container: c2ada9df5af8" 3594 500: 3595 description: "server error" 3596 schema: 3597 $ref: "#/definitions/ErrorResponse" 3598 parameters: 3599 - name: "id" 3600 in: "path" 3601 required: true 3602 description: "ID or name of the container" 3603 type: "string" 3604 - name: "signal" 3605 in: "query" 3606 description: "Signal to send to the container as an integer or string (e.g. `SIGINT`)" 3607 type: "string" 3608 default: "SIGKILL" 3609 tags: ["Container"] 3610 /containers/{id}/update: 3611 post: 3612 summary: "Update a container" 3613 description: "Change various configuration options of a container without having to recreate it." 3614 operationId: "ContainerUpdate" 3615 consumes: ["application/json"] 3616 produces: ["application/json"] 3617 responses: 3618 200: 3619 description: "The container has been updated." 3620 schema: 3621 type: "object" 3622 properties: 3623 Warnings: 3624 type: "array" 3625 items: 3626 type: "string" 3627 404: 3628 description: "no such container" 3629 schema: 3630 $ref: "#/definitions/ErrorResponse" 3631 examples: 3632 application/json: 3633 message: "No such container: c2ada9df5af8" 3634 500: 3635 description: "server error" 3636 schema: 3637 $ref: "#/definitions/ErrorResponse" 3638 parameters: 3639 - name: "id" 3640 in: "path" 3641 required: true 3642 description: "ID or name of the container" 3643 type: "string" 3644 - name: "update" 3645 in: "body" 3646 required: true 3647 schema: 3648 allOf: 3649 - $ref: "#/definitions/Resources" 3650 - type: "object" 3651 properties: 3652 RestartPolicy: 3653 $ref: "#/definitions/RestartPolicy" 3654 example: 3655 BlkioWeight: 300 3656 CpuShares: 512 3657 CpuPeriod: 100000 3658 CpuQuota: 50000 3659 CpuRealtimePeriod: 1000000 3660 CpuRealtimeRuntime: 10000 3661 CpusetCpus: "0,1" 3662 CpusetMems: "0" 3663 Memory: 314572800 3664 MemorySwap: 514288000 3665 MemoryReservation: 209715200 3666 KernelMemory: 52428800 3667 RestartPolicy: 3668 MaximumRetryCount: 4 3669 Name: "on-failure" 3670 tags: ["Container"] 3671 /containers/{id}/rename: 3672 post: 3673 summary: "Rename a container" 3674 operationId: "ContainerRename" 3675 responses: 3676 204: 3677 description: "no error" 3678 404: 3679 description: "no such container" 3680 schema: 3681 $ref: "#/definitions/ErrorResponse" 3682 examples: 3683 application/json: 3684 message: "No such container: c2ada9df5af8" 3685 409: 3686 description: "name already in use" 3687 schema: 3688 $ref: "#/definitions/ErrorResponse" 3689 500: 3690 description: "server error" 3691 schema: 3692 $ref: "#/definitions/ErrorResponse" 3693 parameters: 3694 - name: "id" 3695 in: "path" 3696 required: true 3697 description: "ID or name of the container" 3698 type: "string" 3699 - name: "name" 3700 in: "query" 3701 required: true 3702 description: "New name for the container" 3703 type: "string" 3704 tags: ["Container"] 3705 /containers/{id}/pause: 3706 post: 3707 summary: "Pause a container" 3708 description: | 3709 Use the cgroups freezer to suspend all processes in a container. 3710 3711 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. 3712 operationId: "ContainerPause" 3713 responses: 3714 204: 3715 description: "no error" 3716 404: 3717 description: "no such container" 3718 schema: 3719 $ref: "#/definitions/ErrorResponse" 3720 examples: 3721 application/json: 3722 message: "No such container: c2ada9df5af8" 3723 500: 3724 description: "server error" 3725 schema: 3726 $ref: "#/definitions/ErrorResponse" 3727 parameters: 3728 - name: "id" 3729 in: "path" 3730 required: true 3731 description: "ID or name of the container" 3732 type: "string" 3733 tags: ["Container"] 3734 /containers/{id}/unpause: 3735 post: 3736 summary: "Unpause a container" 3737 description: "Resume a container which has been paused." 3738 operationId: "ContainerUnpause" 3739 responses: 3740 204: 3741 description: "no error" 3742 404: 3743 description: "no such container" 3744 schema: 3745 $ref: "#/definitions/ErrorResponse" 3746 examples: 3747 application/json: 3748 message: "No such container: c2ada9df5af8" 3749 500: 3750 description: "server error" 3751 schema: 3752 $ref: "#/definitions/ErrorResponse" 3753 parameters: 3754 - name: "id" 3755 in: "path" 3756 required: true 3757 description: "ID or name of the container" 3758 type: "string" 3759 tags: ["Container"] 3760 /containers/{id}/attach: 3761 post: 3762 summary: "Attach to a container" 3763 description: | 3764 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. 3765 3766 Either the `stream` or `logs` parameter must be `true` for this endpoint to do anything. 3767 3768 See [the documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) for more details. 3769 3770 ### Hijacking 3771 3772 This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, and `stderr` on the same socket. 3773 3774 This is the response from the daemon for an attach request: 3775 3776 ``` 3777 HTTP/1.1 200 OK 3778 Content-Type: application/vnd.docker.raw-stream 3779 3780 [STREAM] 3781 ``` 3782 3783 After the headers and two new lines, the TCP connection can now be used for raw, bidirectional communication between the client and server. 3784 3785 To hint potential proxies about connection hijacking, the Docker client can also optionally send connection upgrade headers. 3786 3787 For example, the client sends this request to upgrade the connection: 3788 3789 ``` 3790 POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 3791 Upgrade: tcp 3792 Connection: Upgrade 3793 ``` 3794 3795 The Docker daemon will respond with a `101 UPGRADED` response, and will similarly follow with the raw stream: 3796 3797 ``` 3798 HTTP/1.1 101 UPGRADED 3799 Content-Type: application/vnd.docker.raw-stream 3800 Connection: Upgrade 3801 Upgrade: tcp 3802 3803 [STREAM] 3804 ``` 3805 3806 ### Stream format 3807 3808 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. 3809 3810 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`). 3811 3812 It is encoded on the first eight bytes like this: 3813 3814 ```go 3815 header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} 3816 ``` 3817 3818 `STREAM_TYPE` can be: 3819 3820 - 0: `stdin` (is written on `stdout`) 3821 - 1: `stdout` 3822 - 2: `stderr` 3823 3824 `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size encoded as big endian. 3825 3826 Following the header is the payload, which is the specified number of bytes of `STREAM_TYPE`. 3827 3828 The simplest way to implement this protocol is the following: 3829 3830 1. Read 8 bytes. 3831 2. Choose `stdout` or `stderr` depending on the first byte. 3832 3. Extract the frame size from the last four bytes. 3833 4. Read the extracted size and output it on the correct output. 3834 5. Goto 1. 3835 3836 ### Stream format when using a TTY 3837 3838 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`. 3839 3840 operationId: "ContainerAttach" 3841 produces: 3842 - "application/vnd.docker.raw-stream" 3843 responses: 3844 101: 3845 description: "no error, hints proxy about hijacking" 3846 200: 3847 description: "no error, no upgrade header found" 3848 400: 3849 description: "bad parameter" 3850 schema: 3851 $ref: "#/definitions/ErrorResponse" 3852 404: 3853 description: "no such container" 3854 schema: 3855 $ref: "#/definitions/ErrorResponse" 3856 examples: 3857 application/json: 3858 message: "No such container: c2ada9df5af8" 3859 500: 3860 description: "server error" 3861 schema: 3862 $ref: "#/definitions/ErrorResponse" 3863 parameters: 3864 - name: "id" 3865 in: "path" 3866 required: true 3867 description: "ID or name of the container" 3868 type: "string" 3869 - name: "detachKeys" 3870 in: "query" 3871 description: "Override the key sequence for detaching a container.Format is a single character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`." 3872 type: "string" 3873 - name: "logs" 3874 in: "query" 3875 description: | 3876 Replay previous logs from the container. 3877 3878 This is useful for attaching to a container that has started and you want to output everything since the container started. 3879 3880 If `stream` is also enabled, once all the previous output has been returned, it will seamlessly transition into streaming current output. 3881 type: "boolean" 3882 default: false 3883 - name: "stream" 3884 in: "query" 3885 description: "Stream attached streams from the the time the request was made onwards" 3886 type: "boolean" 3887 default: false 3888 - name: "stdin" 3889 in: "query" 3890 description: "Attach to `stdin`" 3891 type: "boolean" 3892 default: false 3893 - name: "stdout" 3894 in: "query" 3895 description: "Attach to `stdout`" 3896 type: "boolean" 3897 default: false 3898 - name: "stderr" 3899 in: "query" 3900 description: "Attach to `stderr`" 3901 type: "boolean" 3902 default: false 3903 tags: ["Container"] 3904 /containers/{id}/attach/ws: 3905 get: 3906 summary: "Attach to a container via a websocket" 3907 operationId: "ContainerAttachWebsocket" 3908 responses: 3909 101: 3910 description: "no error, hints proxy about hijacking" 3911 200: 3912 description: "no error, no upgrade header found" 3913 400: 3914 description: "bad parameter" 3915 schema: 3916 $ref: "#/definitions/ErrorResponse" 3917 404: 3918 description: "no such container" 3919 schema: 3920 $ref: "#/definitions/ErrorResponse" 3921 examples: 3922 application/json: 3923 message: "No such container: c2ada9df5af8" 3924 500: 3925 description: "server error" 3926 schema: 3927 $ref: "#/definitions/ErrorResponse" 3928 parameters: 3929 - name: "id" 3930 in: "path" 3931 required: true 3932 description: "ID or name of the container" 3933 type: "string" 3934 - name: "detachKeys" 3935 in: "query" 3936 description: "Override the key sequence for detaching a container.Format is a single character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,`, or `_`." 3937 type: "string" 3938 - name: "logs" 3939 in: "query" 3940 description: "Return logs" 3941 type: "boolean" 3942 default: false 3943 - name: "stream" 3944 in: "query" 3945 description: "Return stream" 3946 type: "boolean" 3947 default: false 3948 - name: "stdin" 3949 in: "query" 3950 description: "Attach to `stdin`" 3951 type: "boolean" 3952 default: false 3953 - name: "stdout" 3954 in: "query" 3955 description: "Attach to `stdout`" 3956 type: "boolean" 3957 default: false 3958 - name: "stderr" 3959 in: "query" 3960 description: "Attach to `stderr`" 3961 type: "boolean" 3962 default: false 3963 tags: ["Container"] 3964 /containers/{id}/wait: 3965 post: 3966 summary: "Wait for a container" 3967 description: "Block until a container stops, then returns the exit code." 3968 operationId: "ContainerWait" 3969 produces: ["application/json"] 3970 responses: 3971 200: 3972 description: "The container has exit." 3973 schema: 3974 type: "object" 3975 required: [StatusCode] 3976 properties: 3977 StatusCode: 3978 description: "Exit code of the container" 3979 type: "integer" 3980 x-nullable: false 3981 404: 3982 description: "no such container" 3983 schema: 3984 $ref: "#/definitions/ErrorResponse" 3985 examples: 3986 application/json: 3987 message: "No such container: c2ada9df5af8" 3988 500: 3989 description: "server error" 3990 schema: 3991 $ref: "#/definitions/ErrorResponse" 3992 parameters: 3993 - name: "id" 3994 in: "path" 3995 required: true 3996 description: "ID or name of the container" 3997 type: "string" 3998 tags: ["Container"] 3999 /containers/{id}: 4000 delete: 4001 summary: "Remove a container" 4002 operationId: "ContainerDelete" 4003 responses: 4004 204: 4005 description: "no error" 4006 400: 4007 description: "bad parameter" 4008 schema: 4009 $ref: "#/definitions/ErrorResponse" 4010 404: 4011 description: "no such container" 4012 schema: 4013 $ref: "#/definitions/ErrorResponse" 4014 examples: 4015 application/json: 4016 message: "No such container: c2ada9df5af8" 4017 500: 4018 description: "server error" 4019 schema: 4020 $ref: "#/definitions/ErrorResponse" 4021 parameters: 4022 - name: "id" 4023 in: "path" 4024 required: true 4025 description: "ID or name of the container" 4026 type: "string" 4027 - name: "v" 4028 in: "query" 4029 description: "Remove the volumes associated with the container." 4030 type: "boolean" 4031 default: false 4032 - name: "force" 4033 in: "query" 4034 description: "If the container is running, kill it before removing it." 4035 type: "boolean" 4036 default: false 4037 tags: ["Container"] 4038 /containers/{id}/archive: 4039 head: 4040 summary: "Get information about files in a container" 4041 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." 4042 operationId: "ContainerArchiveHead" 4043 responses: 4044 200: 4045 description: "no error" 4046 headers: 4047 X-Docker-Container-Path-Stat: 4048 type: "string" 4049 description: "TODO" 4050 400: 4051 description: "Bad parameter" 4052 schema: 4053 allOf: 4054 - $ref: "#/definitions/ErrorResponse" 4055 - type: "object" 4056 properties: 4057 message: 4058 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)." 4059 type: "string" 4060 x-nullable: false 4061 404: 4062 description: "Container or path does not exist" 4063 schema: 4064 $ref: "#/definitions/ErrorResponse" 4065 examples: 4066 application/json: 4067 message: "No such container: c2ada9df5af8" 4068 500: 4069 description: "Server error" 4070 schema: 4071 $ref: "#/definitions/ErrorResponse" 4072 parameters: 4073 - name: "id" 4074 in: "path" 4075 required: true 4076 description: "ID or name of the container" 4077 type: "string" 4078 - name: "path" 4079 in: "query" 4080 required: true 4081 description: "Resource in the container’s filesystem to archive." 4082 type: "string" 4083 tags: ["Container"] 4084 get: 4085 summary: "Get an archive of a filesystem resource in a container" 4086 description: "Get an tar archive of a resource in the filesystem of container id." 4087 operationId: "ContainerGetArchive" 4088 produces: 4089 - "application/x-tar" 4090 responses: 4091 200: 4092 description: "no error" 4093 400: 4094 description: "Bad parameter" 4095 schema: 4096 allOf: 4097 - $ref: "#/definitions/ErrorResponse" 4098 - type: "object" 4099 properties: 4100 message: 4101 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)." 4102 type: "string" 4103 x-nullable: false 4104 404: 4105 description: "Container or path does not exist" 4106 schema: 4107 $ref: "#/definitions/ErrorResponse" 4108 examples: 4109 application/json: 4110 message: "No such container: c2ada9df5af8" 4111 500: 4112 description: "server error" 4113 schema: 4114 $ref: "#/definitions/ErrorResponse" 4115 parameters: 4116 - name: "id" 4117 in: "path" 4118 required: true 4119 description: "ID or name of the container" 4120 type: "string" 4121 - name: "path" 4122 in: "query" 4123 required: true 4124 description: "Resource in the container’s filesystem to archive." 4125 type: "string" 4126 tags: ["Container"] 4127 put: 4128 summary: "Extract an archive of files or folders to a directory in a container" 4129 description: "Upload a tar archive to be extracted to a path in the filesystem of container id." 4130 operationId: "ContainerPutArchive" 4131 consumes: 4132 - "application/x-tar" 4133 - "application/octet-stream" 4134 responses: 4135 200: 4136 description: "The content was extracted successfully" 4137 400: 4138 description: "Bad parameter" 4139 schema: 4140 $ref: "#/definitions/ErrorResponse" 4141 403: 4142 description: "Permission denied, the volume or container rootfs is marked as read-only." 4143 schema: 4144 $ref: "#/definitions/ErrorResponse" 4145 404: 4146 description: "No such container or path does not exist inside the container" 4147 schema: 4148 $ref: "#/definitions/ErrorResponse" 4149 examples: 4150 application/json: 4151 message: "No such container: c2ada9df5af8" 4152 500: 4153 description: "Server error" 4154 schema: 4155 $ref: "#/definitions/ErrorResponse" 4156 parameters: 4157 - name: "id" 4158 in: "path" 4159 required: true 4160 description: "ID or name of the container" 4161 type: "string" 4162 - name: "path" 4163 in: "query" 4164 required: true 4165 description: "Path to a directory in the container to extract the archive’s contents into. " 4166 type: "string" 4167 - name: "noOverwriteDirNonDir" 4168 in: "query" 4169 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." 4170 type: "string" 4171 - name: "inputStream" 4172 in: "body" 4173 required: true 4174 description: "The input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz." 4175 schema: 4176 type: "string" 4177 tags: ["Container"] 4178 /containers/prune: 4179 post: 4180 summary: "Delete stopped containers" 4181 produces: 4182 - "application/json" 4183 operationId: "ContainerPrune" 4184 parameters: 4185 - name: "filters" 4186 in: "query" 4187 description: | 4188 Filters to process on the prune list, encoded as JSON (a `map[string][]string`). 4189 4190 Available filters: 4191 type: "string" 4192 responses: 4193 200: 4194 description: "No error" 4195 schema: 4196 type: "object" 4197 properties: 4198 ContainersDeleted: 4199 description: "Container IDs that were deleted" 4200 type: "array" 4201 items: 4202 type: "string" 4203 SpaceReclaimed: 4204 description: "Disk space reclaimed in bytes" 4205 type: "integer" 4206 format: "int64" 4207 500: 4208 description: "Server error" 4209 schema: 4210 $ref: "#/definitions/ErrorResponse" 4211 tags: ["Container"] 4212 /images/json: 4213 get: 4214 summary: "List Images" 4215 description: "Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image." 4216 operationId: "ImageList" 4217 produces: 4218 - "application/json" 4219 responses: 4220 200: 4221 description: "Summary image data for the images matching the query" 4222 schema: 4223 type: "array" 4224 items: 4225 $ref: "#/definitions/ImageSummary" 4226 examples: 4227 application/json: 4228 - Id: "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" 4229 ParentId: "" 4230 RepoTags: 4231 - "ubuntu:12.04" 4232 - "ubuntu:precise" 4233 RepoDigests: 4234 - "ubuntu@sha256:992069aee4016783df6345315302fa59681aae51a8eeb2f889dea59290f21787" 4235 Created: 1474925151 4236 Size: 103579269 4237 VirtualSize: 103579269 4238 SharedSize: 0 4239 Labels: {} 4240 Containers: 2 4241 - Id: "sha256:3e314f95dcace0f5e4fd37b10862fe8398e3c60ed36600bc0ca5fda78b087175" 4242 ParentId: "" 4243 RepoTags: 4244 - "ubuntu:12.10" 4245 - "ubuntu:quantal" 4246 RepoDigests: 4247 - "ubuntu@sha256:002fba3e3255af10be97ea26e476692a7ebed0bb074a9ab960b2e7a1526b15d7" 4248 - "ubuntu@sha256:68ea0200f0b90df725d99d823905b04cf844f6039ef60c60bf3e019915017bd3" 4249 Created: 1403128455 4250 Size: 172064416 4251 VirtualSize: 172064416 4252 SharedSize: 0 4253 Labels: {} 4254 Containers: 5 4255 500: 4256 description: "server error" 4257 schema: 4258 $ref: "#/definitions/ErrorResponse" 4259 parameters: 4260 - name: "all" 4261 in: "query" 4262 description: "Show all images. Only images from a final layer (no children) are shown by default." 4263 type: "boolean" 4264 default: false 4265 - name: "filters" 4266 in: "query" 4267 description: | 4268 A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. 4269 4270 Available filters: 4271 - `dangling=true` 4272 - `label=key` or `label="key=value"` of an image label 4273 - `before`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) 4274 - `since`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) 4275 - `reference`=(`<image-name>[:<tag>]`) 4276 type: "string" 4277 - name: "digests" 4278 in: "query" 4279 description: "Show digest information as a `RepoDigests` field on each image." 4280 type: "boolean" 4281 default: false 4282 tags: ["Image"] 4283 /build: 4284 post: 4285 summary: "Build an image" 4286 description: | 4287 Build an image from a tar archive with a `Dockerfile` in it. 4288 4289 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/). 4290 4291 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. 4292 4293 The build is canceled if the client drops the connection by quitting or being killed. 4294 operationId: "ImageBuild" 4295 consumes: 4296 - "application/octet-stream" 4297 produces: 4298 - "application/json" 4299 parameters: 4300 - name: "inputStream" 4301 in: "body" 4302 description: "A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz." 4303 schema: 4304 type: "string" 4305 format: "binary" 4306 - name: "dockerfile" 4307 in: "query" 4308 description: "Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`." 4309 type: "string" 4310 default: "Dockerfile" 4311 - name: "t" 4312 in: "query" 4313 description: "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." 4314 type: "string" 4315 - name: "remote" 4316 in: "query" 4317 description: "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." 4318 type: "string" 4319 - name: "q" 4320 in: "query" 4321 description: "Suppress verbose build output." 4322 type: "boolean" 4323 default: false 4324 - name: "nocache" 4325 in: "query" 4326 description: "Do not use the cache when building the image." 4327 type: "boolean" 4328 default: false 4329 - name: "cachefrom" 4330 in: "query" 4331 description: "JSON array of images used for build cache resolution." 4332 type: "string" 4333 - name: "pull" 4334 in: "query" 4335 description: "Attempt to pull the image even if an older image exists locally." 4336 type: "string" 4337 - name: "rm" 4338 in: "query" 4339 description: "Remove intermediate containers after a successful build." 4340 type: "boolean" 4341 default: true 4342 - name: "forcerm" 4343 in: "query" 4344 description: "Always remove intermediate containers, even upon failure." 4345 type: "boolean" 4346 default: false 4347 - name: "memory" 4348 in: "query" 4349 description: "Set memory limit for build." 4350 type: "integer" 4351 - name: "memswap" 4352 in: "query" 4353 description: "Total memory (memory + swap). Set as `-1` to disable swap." 4354 type: "integer" 4355 - name: "cpushares" 4356 in: "query" 4357 description: "CPU shares (relative weight)." 4358 type: "integer" 4359 - name: "cpusetcpus" 4360 in: "query" 4361 description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)." 4362 type: "string" 4363 - name: "cpuperiod" 4364 in: "query" 4365 description: "The length of a CPU period in microseconds." 4366 type: "integer" 4367 - name: "cpuquota" 4368 in: "query" 4369 description: "Microseconds of CPU time that the container can get in a CPU period." 4370 type: "integer" 4371 - name: "buildargs" 4372 in: "query" 4373 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)" 4374 type: "integer" 4375 - name: "shmsize" 4376 in: "query" 4377 description: "Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB." 4378 type: "integer" 4379 - name: "squash" 4380 in: "query" 4381 description: "Squash the resulting images layers into a single layer. *(Experimental release only.)*" 4382 type: "boolean" 4383 - name: "labels" 4384 in: "query" 4385 description: "Arbitrary key/value labels to set on the image, as a JSON map of string pairs." 4386 type: "string" 4387 - name: "networkmode" 4388 in: "query" 4389 description: "Sets the networking mode for the run commands during 4390 build. Supported standard values are: `bridge`, `host`, `none`, and 4391 `container:<name|id>`. Any other value is taken as a custom network's 4392 name to which this container should connect to." 4393 type: "string" 4394 - name: "Content-type" 4395 in: "header" 4396 type: "string" 4397 enum: 4398 - "application/tar" 4399 default: "application/tar" 4400 - name: "X-Registry-Config" 4401 in: "header" 4402 description: | 4403 This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to. 4404 4405 The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example: 4406 4407 ``` 4408 { 4409 "docker.example.com": { 4410 "username": "janedoe", 4411 "password": "hunter2" 4412 }, 4413 "https://index.docker.io/v1/": { 4414 "username": "mobydock", 4415 "password": "conta1n3rize14" 4416 } 4417 } 4418 ``` 4419 4420 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. 4421 type: "string" 4422 responses: 4423 200: 4424 description: "no error" 4425 400: 4426 description: "Bad parameter" 4427 schema: 4428 $ref: "#/definitions/ErrorResponse" 4429 500: 4430 description: "server error" 4431 schema: 4432 $ref: "#/definitions/ErrorResponse" 4433 tags: ["Image"] 4434 /images/create: 4435 post: 4436 summary: "Create an image" 4437 description: "Create an image by either pulling it from a registry or importing it." 4438 operationId: "ImageCreate" 4439 consumes: 4440 - "text/plain" 4441 - "application/octet-stream" 4442 produces: 4443 - "application/json" 4444 responses: 4445 200: 4446 description: "no error" 4447 404: 4448 description: "repository does not exist or no read access" 4449 schema: 4450 $ref: "#/definitions/ErrorResponse" 4451 500: 4452 description: "server error" 4453 schema: 4454 $ref: "#/definitions/ErrorResponse" 4455 parameters: 4456 - name: "fromImage" 4457 in: "query" 4458 description: "Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed." 4459 type: "string" 4460 - name: "fromSrc" 4461 in: "query" 4462 description: "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image." 4463 type: "string" 4464 - name: "repo" 4465 in: "query" 4466 description: "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image." 4467 type: "string" 4468 - name: "tag" 4469 in: "query" 4470 description: "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled." 4471 type: "string" 4472 - name: "inputImage" 4473 in: "body" 4474 description: "Image content if the value `-` has been specified in fromSrc query parameter" 4475 schema: 4476 type: "string" 4477 required: false 4478 - name: "X-Registry-Auth" 4479 in: "header" 4480 description: "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)" 4481 type: "string" 4482 tags: ["Image"] 4483 /images/{name}/json: 4484 get: 4485 summary: "Inspect an image" 4486 description: "Return low-level information about an image." 4487 operationId: "ImageInspect" 4488 produces: 4489 - "application/json" 4490 responses: 4491 200: 4492 description: "No error" 4493 schema: 4494 $ref: "#/definitions/Image" 4495 examples: 4496 application/json: 4497 Id: "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" 4498 Container: "cb91e48a60d01f1e27028b4fc6819f4f290b3cf12496c8176ec714d0d390984a" 4499 Comment: "" 4500 Os: "linux" 4501 Architecture: "amd64" 4502 Parent: "sha256:91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c" 4503 ContainerConfig: 4504 Tty: false 4505 Hostname: "e611e15f9c9d" 4506 Domainname: "" 4507 AttachStdout: false 4508 PublishService: "" 4509 AttachStdin: false 4510 OpenStdin: false 4511 StdinOnce: false 4512 NetworkDisabled: false 4513 OnBuild: [] 4514 Image: "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c" 4515 User: "" 4516 WorkingDir: "" 4517 MacAddress: "" 4518 AttachStderr: false 4519 Labels: 4520 com.example.license: "GPL" 4521 com.example.version: "1.0" 4522 com.example.vendor: "Acme" 4523 Env: 4524 - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 4525 Cmd: 4526 - "/bin/sh" 4527 - "-c" 4528 - "#(nop) LABEL com.example.vendor=Acme com.example.license=GPL com.example.version=1.0" 4529 DockerVersion: "1.9.0-dev" 4530 VirtualSize: 188359297 4531 Size: 0 4532 Author: "" 4533 Created: "2015-09-10T08:30:53.26995814Z" 4534 GraphDriver: 4535 Name: "aufs" 4536 RepoDigests: 4537 - "localhost:5000/test/busybox/example@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf" 4538 RepoTags: 4539 - "example:1.0" 4540 - "example:latest" 4541 - "example:stable" 4542 Config: 4543 Image: "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c" 4544 NetworkDisabled: false 4545 OnBuild: [] 4546 StdinOnce: false 4547 PublishService: "" 4548 AttachStdin: false 4549 OpenStdin: false 4550 Domainname: "" 4551 AttachStdout: false 4552 Tty: false 4553 Hostname: "e611e15f9c9d" 4554 Cmd: 4555 - "/bin/bash" 4556 Env: 4557 - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 4558 Labels: 4559 com.example.vendor: "Acme" 4560 com.example.version: "1.0" 4561 com.example.license: "GPL" 4562 MacAddress: "" 4563 AttachStderr: false 4564 WorkingDir: "" 4565 User: "" 4566 RootFS: 4567 Type: "layers" 4568 Layers: 4569 - "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6" 4570 - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" 4571 404: 4572 description: "No such image" 4573 schema: 4574 $ref: "#/definitions/ErrorResponse" 4575 examples: 4576 application/json: 4577 message: "No such image: someimage (tag: latest)" 4578 500: 4579 description: "Server error" 4580 schema: 4581 $ref: "#/definitions/ErrorResponse" 4582 parameters: 4583 - name: "name" 4584 in: "path" 4585 description: "Image name or id" 4586 type: "string" 4587 required: true 4588 tags: ["Image"] 4589 /images/{name}/history: 4590 get: 4591 summary: "Get the history of an image" 4592 description: "Return parent layers of an image." 4593 operationId: "ImageHistory" 4594 produces: 4595 - "application/json" 4596 responses: 4597 200: 4598 description: "No error" 4599 schema: 4600 type: "array" 4601 items: 4602 type: "object" 4603 properties: 4604 Id: 4605 type: "string" 4606 Created: 4607 type: "integer" 4608 format: "int64" 4609 CreatedBy: 4610 type: "string" 4611 Tags: 4612 type: "array" 4613 items: 4614 type: "string" 4615 Size: 4616 type: "integer" 4617 format: "int64" 4618 Comment: 4619 type: "string" 4620 examples: 4621 application/json: 4622 - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" 4623 Created: 1398108230 4624 CreatedBy: "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /" 4625 Tags: 4626 - "ubuntu:lucid" 4627 - "ubuntu:10.04" 4628 Size: 182964289 4629 Comment: "" 4630 - Id: "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8" 4631 Created: 1398108222 4632 CreatedBy: "/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/" 4633 Tags: [] 4634 Size: 0 4635 Comment: "" 4636 - Id: "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158" 4637 Created: 1371157430 4638 CreatedBy: "" 4639 Tags: 4640 - "scratch12:latest" 4641 - "scratch:latest" 4642 Size: 0 4643 Comment: "Imported from -" 4644 404: 4645 description: "No such image" 4646 schema: 4647 $ref: "#/definitions/ErrorResponse" 4648 500: 4649 description: "Server error" 4650 schema: 4651 $ref: "#/definitions/ErrorResponse" 4652 parameters: 4653 - name: "name" 4654 in: "path" 4655 description: "Image name or ID" 4656 type: "string" 4657 required: true 4658 tags: ["Image"] 4659 /images/{name}/push: 4660 post: 4661 summary: "Push an image" 4662 description: | 4663 Push an image to a registry. 4664 4665 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`. 4666 4667 The push is cancelled if the HTTP connection is closed. 4668 operationId: "ImagePush" 4669 consumes: 4670 - "application/octet-stream" 4671 responses: 4672 200: 4673 description: "No error" 4674 404: 4675 description: "No such image" 4676 schema: 4677 $ref: "#/definitions/ErrorResponse" 4678 500: 4679 description: "Server error" 4680 schema: 4681 $ref: "#/definitions/ErrorResponse" 4682 parameters: 4683 - name: "name" 4684 in: "path" 4685 description: "Image name or ID." 4686 type: "string" 4687 required: true 4688 - name: "tag" 4689 in: "query" 4690 description: "The tag to associate with the image on the registry." 4691 type: "string" 4692 - name: "X-Registry-Auth" 4693 in: "header" 4694 description: "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)" 4695 type: "string" 4696 required: true 4697 tags: ["Image"] 4698 /images/{name}/tag: 4699 post: 4700 summary: "Tag an image" 4701 description: "Tag an image so that it becomes part of a repository." 4702 operationId: "ImageTag" 4703 responses: 4704 201: 4705 description: "No error" 4706 400: 4707 description: "Bad parameter" 4708 schema: 4709 $ref: "#/definitions/ErrorResponse" 4710 404: 4711 description: "No such image" 4712 schema: 4713 $ref: "#/definitions/ErrorResponse" 4714 409: 4715 description: "Conflict" 4716 schema: 4717 $ref: "#/definitions/ErrorResponse" 4718 500: 4719 description: "Server error" 4720 schema: 4721 $ref: "#/definitions/ErrorResponse" 4722 parameters: 4723 - name: "name" 4724 in: "path" 4725 description: "Image name or ID to tag." 4726 type: "string" 4727 required: true 4728 - name: "repo" 4729 in: "query" 4730 description: "The repository to tag in. For example, `someuser/someimage`." 4731 type: "string" 4732 - name: "tag" 4733 in: "query" 4734 description: "The name of the new tag." 4735 type: "string" 4736 tags: ["Image"] 4737 /images/{name}: 4738 delete: 4739 summary: "Remove an image" 4740 description: | 4741 Remove an image, along with any untagged parent images that were referenced by that image. 4742 4743 Images can't be removed if they have descendant images, are being used by a running container or are being used by a build. 4744 operationId: "ImageDelete" 4745 produces: 4746 - "application/json" 4747 responses: 4748 200: 4749 description: "No error" 4750 schema: 4751 type: "array" 4752 items: 4753 $ref: "#/definitions/ImageDeleteResponse" 4754 examples: 4755 application/json: 4756 - Untagged: "3e2f21a89f" 4757 - Deleted: "3e2f21a89f" 4758 - Deleted: "53b4f83ac9" 4759 404: 4760 description: "No such image" 4761 schema: 4762 $ref: "#/definitions/ErrorResponse" 4763 409: 4764 description: "Conflict" 4765 schema: 4766 $ref: "#/definitions/ErrorResponse" 4767 500: 4768 description: "Server error" 4769 schema: 4770 $ref: "#/definitions/ErrorResponse" 4771 parameters: 4772 - name: "name" 4773 in: "path" 4774 description: "Image name or ID" 4775 type: "string" 4776 required: true 4777 - name: "force" 4778 in: "query" 4779 description: "Remove the image even if it is being used by stopped containers or has other tags" 4780 type: "boolean" 4781 default: false 4782 - name: "noprune" 4783 in: "query" 4784 description: "Do not delete untagged parent images" 4785 type: "boolean" 4786 default: false 4787 tags: ["Image"] 4788 /images/search: 4789 get: 4790 summary: "Search images" 4791 description: "Search for an image on Docker Hub." 4792 operationId: "ImageSearch" 4793 produces: 4794 - "application/json" 4795 responses: 4796 200: 4797 description: "No error" 4798 schema: 4799 type: "array" 4800 items: 4801 type: "object" 4802 properties: 4803 description: 4804 type: "string" 4805 is_official: 4806 type: "boolean" 4807 is_automated: 4808 type: "boolean" 4809 name: 4810 type: "string" 4811 star_count: 4812 type: "integer" 4813 examples: 4814 application/json: 4815 - description: "" 4816 is_official: false 4817 is_automated: false 4818 name: "wma55/u1210sshd" 4819 star_count: 0 4820 - description: "" 4821 is_official: false 4822 is_automated: false 4823 name: "jdswinbank/sshd" 4824 star_count: 0 4825 - description: "" 4826 is_official: false 4827 is_automated: false 4828 name: "vgauthier/sshd" 4829 star_count: 0 4830 500: 4831 description: "Server error" 4832 schema: 4833 $ref: "#/definitions/ErrorResponse" 4834 parameters: 4835 - name: "term" 4836 in: "query" 4837 description: "Term to search" 4838 type: "string" 4839 required: true 4840 - name: "limit" 4841 in: "query" 4842 description: "Maximum number of results to return" 4843 type: "integer" 4844 - name: "filters" 4845 in: "query" 4846 description: | 4847 A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: 4848 4849 - `stars=<number>` 4850 - `is-automated=(true|false)` 4851 - `is-official=(true|false)` 4852 type: "string" 4853 tags: ["Image"] 4854 /images/prune: 4855 post: 4856 summary: "Delete unused images" 4857 produces: 4858 - "application/json" 4859 operationId: "ImagePrune" 4860 parameters: 4861 - name: "filters" 4862 in: "query" 4863 description: | 4864 Filters to process on the prune list, encoded as JSON (a `map[string][]string`). 4865 4866 Available filters: 4867 - `dangling=<boolean>` When set to `true` (or `1`), prune only 4868 unused *and* untagged images. When set to `false` 4869 (or `0`), all unused images are pruned. 4870 type: "string" 4871 responses: 4872 200: 4873 description: "No error" 4874 schema: 4875 type: "object" 4876 properties: 4877 ImagesDeleted: 4878 description: "Images that were deleted" 4879 type: "array" 4880 items: 4881 $ref: "#/definitions/ImageDeleteResponse" 4882 SpaceReclaimed: 4883 description: "Disk space reclaimed in bytes" 4884 type: "integer" 4885 format: "int64" 4886 500: 4887 description: "Server error" 4888 schema: 4889 $ref: "#/definitions/ErrorResponse" 4890 tags: ["Image"] 4891 /auth: 4892 post: 4893 summary: "Check auth configuration" 4894 description: "Validate credentials for a registry and, if available, get an identity token for accessing the registry without password." 4895 operationId: "SystemAuth" 4896 consumes: ["application/json"] 4897 produces: ["application/json"] 4898 responses: 4899 200: 4900 description: "An identity token was generated successfully." 4901 schema: 4902 type: "object" 4903 required: [Status] 4904 properties: 4905 Status: 4906 description: "The status of the authentication" 4907 type: "string" 4908 x-nullable: false 4909 IdentityToken: 4910 description: "An opaque token used to authenticate a user after a successful login" 4911 type: "string" 4912 x-nullable: false 4913 examples: 4914 application/json: 4915 Status: "Login Succeeded" 4916 IdentityToken: "9cbaf023786cd7..." 4917 204: 4918 description: "No error" 4919 500: 4920 description: "Server error" 4921 schema: 4922 $ref: "#/definitions/ErrorResponse" 4923 parameters: 4924 - name: "authConfig" 4925 in: "body" 4926 description: "Authentication to check" 4927 schema: 4928 $ref: "#/definitions/AuthConfig" 4929 tags: ["System"] 4930 /info: 4931 get: 4932 summary: "Get system information" 4933 operationId: "SystemInfo" 4934 produces: 4935 - "application/json" 4936 responses: 4937 200: 4938 description: "No error" 4939 schema: 4940 type: "object" 4941 properties: 4942 Architecture: 4943 type: "string" 4944 Containers: 4945 type: "integer" 4946 ContainersRunning: 4947 type: "integer" 4948 ContainersStopped: 4949 type: "integer" 4950 ContainersPaused: 4951 type: "integer" 4952 CpuCfsPeriod: 4953 type: "boolean" 4954 CpuCfsQuota: 4955 type: "boolean" 4956 Debug: 4957 type: "boolean" 4958 DiscoveryBackend: 4959 type: "string" 4960 DockerRootDir: 4961 type: "string" 4962 Driver: 4963 type: "string" 4964 DriverStatus: 4965 type: "array" 4966 items: 4967 type: "array" 4968 items: 4969 type: "string" 4970 SystemStatus: 4971 type: "array" 4972 items: 4973 type: "array" 4974 items: 4975 type: "string" 4976 Plugins: 4977 type: "object" 4978 properties: 4979 Volume: 4980 type: "array" 4981 items: 4982 type: "string" 4983 Network: 4984 type: "array" 4985 items: 4986 type: "string" 4987 ExperimentalBuild: 4988 type: "boolean" 4989 HttpProxy: 4990 type: "string" 4991 HttpsProxy: 4992 type: "string" 4993 ID: 4994 type: "string" 4995 IPv4Forwarding: 4996 type: "boolean" 4997 Images: 4998 type: "integer" 4999 IndexServerAddress: 5000 type: "string" 5001 InitPath: 5002 type: "string" 5003 InitSha1: 5004 type: "string" 5005 KernelVersion: 5006 type: "string" 5007 Labels: 5008 type: "array" 5009 items: 5010 type: "string" 5011 MemTotal: 5012 type: "integer" 5013 MemoryLimit: 5014 type: "boolean" 5015 NCPU: 5016 type: "integer" 5017 NEventsListener: 5018 type: "integer" 5019 NFd: 5020 type: "integer" 5021 NGoroutines: 5022 type: "integer" 5023 Name: 5024 type: "string" 5025 NoProxy: 5026 type: "string" 5027 OomKillDisable: 5028 type: "boolean" 5029 OSType: 5030 type: "string" 5031 OomScoreAdj: 5032 type: "integer" 5033 OperatingSystem: 5034 type: "string" 5035 RegistryConfig: 5036 type: "object" 5037 properties: 5038 IndexConfigs: 5039 type: "object" 5040 additionalProperties: 5041 type: "object" 5042 properties: 5043 Mirrors: 5044 type: "array" 5045 items: 5046 type: "string" 5047 Name: 5048 type: "string" 5049 Official: 5050 type: "boolean" 5051 Secure: 5052 type: "boolean" 5053 InsecureRegistryCIDRs: 5054 type: "array" 5055 items: 5056 type: "string" 5057 SwapLimit: 5058 type: "boolean" 5059 SystemTime: 5060 type: "string" 5061 ServerVersion: 5062 type: "string" 5063 examples: 5064 application/json: 5065 Architecture: "x86_64" 5066 ClusterStore: "etcd://localhost:2379" 5067 CgroupDriver: "cgroupfs" 5068 Containers: 11 5069 ContainersRunning: 7 5070 ContainersStopped: 3 5071 ContainersPaused: 1 5072 CpuCfsPeriod: true 5073 CpuCfsQuota: true 5074 Debug: false 5075 DockerRootDir: "/var/lib/docker" 5076 Driver: "btrfs" 5077 DriverStatus: 5078 - 5079 - "" 5080 ExperimentalBuild: false 5081 HttpProxy: "http://test:test@localhost:8080" 5082 HttpsProxy: "https://test:test@localhost:8080" 5083 ID: "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS" 5084 IPv4Forwarding: true 5085 Images: 16 5086 IndexServerAddress: "https://index.docker.io/v1/" 5087 InitPath: "/usr/bin/docker" 5088 InitSha1: "" 5089 KernelMemory: true 5090 KernelVersion: "3.12.0-1-amd64" 5091 Labels: 5092 - "storage=ssd" 5093 MemTotal: 2099236864 5094 MemoryLimit: true 5095 NCPU: 1 5096 NEventsListener: 0 5097 NFd: 11 5098 NGoroutines: 21 5099 Name: "prod-server-42" 5100 NoProxy: "9.81.1.160" 5101 OomKillDisable: true 5102 OSType: "linux" 5103 OperatingSystem: "Boot2Docker" 5104 Plugins: 5105 Volume: 5106 - "local" 5107 Network: 5108 - "null" 5109 - "host" 5110 - "bridge" 5111 RegistryConfig: 5112 IndexConfigs: 5113 docker.io: 5114 Name: "docker.io" 5115 Official: true 5116 Secure: true 5117 InsecureRegistryCIDRs: 5118 - "127.0.0.0/8" 5119 SecurityOptions: 5120 - Key: "Name" 5121 Value: "seccomp" 5122 - Key: "Profile" 5123 Value: "default" 5124 - Key: "Name" 5125 Value: "apparmor" 5126 - Key: "Name" 5127 Value: "selinux" 5128 - Key: "Name" 5129 Value: "userns" 5130 ServerVersion: "1.9.0" 5131 SwapLimit: false 5132 SystemStatus: 5133 - 5134 - "State" 5135 - "Healthy" 5136 SystemTime: "2015-03-10T11:11:23.730591467-07:00" 5137 500: 5138 description: "Server error" 5139 schema: 5140 $ref: "#/definitions/ErrorResponse" 5141 tags: ["System"] 5142 /version: 5143 get: 5144 summary: "Get version" 5145 description: "Returns the version of Docker that is running and various information about the system that Docker is running on." 5146 operationId: "SystemVersion" 5147 produces: 5148 - "application/json" 5149 responses: 5150 200: 5151 description: "no error" 5152 schema: 5153 type: "object" 5154 properties: 5155 Version: 5156 type: "string" 5157 ApiVersion: 5158 type: "string" 5159 MinAPIVersion: 5160 type: "string" 5161 GitCommit: 5162 type: "string" 5163 GoVersion: 5164 type: "string" 5165 Os: 5166 type: "string" 5167 Arch: 5168 type: "string" 5169 KernelVersion: 5170 type: "string" 5171 Experimental: 5172 type: "boolean" 5173 BuildTime: 5174 type: "string" 5175 examples: 5176 application/json: 5177 Version: "1.13.0" 5178 Os: "linux" 5179 KernelVersion: "3.19.0-23-generic" 5180 GoVersion: "go1.6.3" 5181 GitCommit: "deadbee" 5182 Arch: "amd64" 5183 ApiVersion: "1.25" 5184 MinAPIVersion: "1.12" 5185 BuildTime: "2016-06-14T07:09:13.444803460+00:00" 5186 Experimental: true 5187 500: 5188 description: "server error" 5189 schema: 5190 $ref: "#/definitions/ErrorResponse" 5191 tags: ["System"] 5192 /_ping: 5193 get: 5194 summary: "Ping" 5195 description: "This is a dummy endpoint you can use to test if the server is accessible." 5196 operationId: "SystemPing" 5197 produces: 5198 - "text/plain" 5199 responses: 5200 200: 5201 description: "no error" 5202 schema: 5203 type: "string" 5204 example: "OK" 5205 500: 5206 description: "server error" 5207 schema: 5208 $ref: "#/definitions/ErrorResponse" 5209 tags: ["System"] 5210 /commit: 5211 post: 5212 summary: "Create a new image from a container" 5213 operationId: "ImageCommit" 5214 consumes: 5215 - "application/json" 5216 produces: 5217 - "application/json" 5218 responses: 5219 201: 5220 description: "no error" 5221 schema: 5222 $ref: "#/definitions/IdResponse" 5223 404: 5224 description: "no such container" 5225 schema: 5226 $ref: "#/definitions/ErrorResponse" 5227 examples: 5228 application/json: 5229 message: "No such container: c2ada9df5af8" 5230 500: 5231 description: "server error" 5232 schema: 5233 $ref: "#/definitions/ErrorResponse" 5234 parameters: 5235 - name: "containerConfig" 5236 in: "body" 5237 description: "The container configuration" 5238 schema: 5239 $ref: "#/definitions/Config" 5240 - name: "container" 5241 in: "query" 5242 description: "The ID or name of the container to commit" 5243 type: "string" 5244 - name: "repo" 5245 in: "query" 5246 description: "Repository name for the created image" 5247 type: "string" 5248 - name: "tag" 5249 in: "query" 5250 description: "Tag name for the create image" 5251 type: "string" 5252 - name: "comment" 5253 in: "query" 5254 description: "Commit message" 5255 type: "string" 5256 - name: "author" 5257 in: "query" 5258 description: "Author of the image (e.g., `John Hannibal Smith <hannibal@a-team.com>`)" 5259 type: "string" 5260 - name: "pause" 5261 in: "query" 5262 description: "Whether to pause the container before committing" 5263 type: "boolean" 5264 default: true 5265 - name: "changes" 5266 in: "query" 5267 description: "`Dockerfile` instructions to apply while committing" 5268 type: "string" 5269 tags: ["Image"] 5270 /events: 5271 get: 5272 summary: "Monitor events" 5273 description: | 5274 Stream real-time events from the server. 5275 5276 Various objects within Docker report events when something happens to them. 5277 5278 Containers report these events: `attach, commit, copy, create, destroy, detach, die, exec_create, exec_detach, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause, update` 5279 5280 Images report these events: `delete, import, load, pull, push, save, tag, untag` 5281 5282 Volumes report these events: `create, mount, unmount, destroy` 5283 5284 Networks report these events: `create, connect, disconnect, destroy` 5285 5286 The Docker daemon reports these events: `reload` 5287 5288 operationId: "SystemEvents" 5289 produces: 5290 - "application/json" 5291 responses: 5292 200: 5293 description: "no error" 5294 schema: 5295 type: "object" 5296 properties: 5297 Type: 5298 description: "The type of object emitting the event" 5299 type: "string" 5300 Action: 5301 description: "The type of event" 5302 type: "string" 5303 Actor: 5304 type: "object" 5305 properties: 5306 ID: 5307 description: "The ID of the object emitting the event" 5308 type: "string" 5309 Attributes: 5310 description: "Various key/value attributes of the object, depending on its type" 5311 type: "object" 5312 additionalProperties: 5313 type: "string" 5314 time: 5315 description: "Timestamp of event" 5316 type: "integer" 5317 timeNano: 5318 description: "Timestamp of event, with nanosecond accuracy" 5319 type: "integer" 5320 format: "int64" 5321 examples: 5322 application/json: 5323 Type: "container" 5324 Action: "create" 5325 Actor: 5326 ID: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" 5327 Attributes: 5328 com.example.some-label: "some-label-value" 5329 image: "alpine" 5330 name: "my-container" 5331 time: 1461943101 5332 500: 5333 description: "server error" 5334 schema: 5335 $ref: "#/definitions/ErrorResponse" 5336 parameters: 5337 - name: "since" 5338 in: "query" 5339 description: "Show events created since this timestamp then stream new events." 5340 type: "string" 5341 - name: "until" 5342 in: "query" 5343 description: "Show events created until this timestamp then stop streaming." 5344 type: "string" 5345 - name: "filters" 5346 in: "query" 5347 description: | 5348 A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: 5349 5350 - `container=<string>` container name or ID 5351 - `event=<string>` event type 5352 - `image=<string>` image name or ID 5353 - `label=<string>` image or container label 5354 - `type=<string>` object to filter by, one of `container`, `image`, `volume`, `network`, or `daemon` 5355 - `volume=<string>` volume name or ID 5356 - `network=<string>` network name or ID 5357 - `daemon=<string>` daemon name or ID 5358 type: "string" 5359 tags: ["System"] 5360 /system/df: 5361 get: 5362 summary: "Get data usage information" 5363 operationId: "SystemDataUsage" 5364 responses: 5365 200: 5366 description: "no error" 5367 schema: 5368 type: "object" 5369 properties: 5370 LayersSize: 5371 type: "integer" 5372 format: "int64" 5373 Images: 5374 type: "array" 5375 items: 5376 $ref: "#/definitions/ImageSummary" 5377 Containers: 5378 type: "array" 5379 items: 5380 $ref: "#/definitions/ContainerSummary" 5381 Volumes: 5382 type: "array" 5383 items: 5384 $ref: "#/definitions/Volume" 5385 example: 5386 LayersSize: 1092588 5387 Images: 5388 - 5389 Id: "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749" 5390 ParentId: "" 5391 RepoTags: 5392 - "busybox:latest" 5393 RepoDigests: 5394 - "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" 5395 Created: 1466724217 5396 Size: 1092588 5397 SharedSize: 0 5398 VirtualSize: 1092588 5399 Labels: {} 5400 Containers: 1 5401 Containers: 5402 - 5403 Id: "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148" 5404 Names: 5405 - "/top" 5406 Image: "busybox" 5407 ImageID: "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749" 5408 Command: "top" 5409 Created: 1472592424 5410 Ports: [] 5411 SizeRootFs: 1092588 5412 Labels: {} 5413 State: "exited" 5414 Status: "Exited (0) 56 minutes ago" 5415 HostConfig: 5416 NetworkMode: "default" 5417 NetworkSettings: 5418 Networks: 5419 bridge: 5420 IPAMConfig: null 5421 Links: null 5422 Aliases: null 5423 NetworkID: "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92" 5424 EndpointID: "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a" 5425 Gateway: "172.18.0.1" 5426 IPAddress: "172.18.0.2" 5427 IPPrefixLen: 16 5428 IPv6Gateway: "" 5429 GlobalIPv6Address: "" 5430 GlobalIPv6PrefixLen: 0 5431 MacAddress: "02:42:ac:12:00:02" 5432 Mounts: [] 5433 Volumes: 5434 - 5435 Name: "my-volume" 5436 Driver: "local" 5437 Mountpoint: "" 5438 Labels: null 5439 Scope: "" 5440 Options: null 5441 UsageData: 5442 Size: 0 5443 RefCount: 0 5444 500: 5445 description: "server error" 5446 schema: 5447 $ref: "#/definitions/ErrorResponse" 5448 tags: ["System"] 5449 /images/{name}/get: 5450 get: 5451 summary: "Export an image" 5452 description: | 5453 Get a tarball containing all images and metadata for a repository. 5454 5455 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. 5456 5457 ### Image tarball format 5458 5459 An image tarball contains one directory per image layer (named using its long ID), each containing these files: 5460 5461 - `VERSION`: currently `1.0` - the file format version 5462 - `json`: detailed layer information, similar to `docker inspect layer_id` 5463 - `layer.tar`: A tarfile containing the filesystem changes in this layer 5464 5465 The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions. 5466 5467 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. 5468 5469 ```json 5470 { 5471 "hello-world": { 5472 "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" 5473 } 5474 } 5475 ``` 5476 operationId: "ImageGet" 5477 produces: 5478 - "application/x-tar" 5479 responses: 5480 200: 5481 description: "no error" 5482 schema: 5483 type: "string" 5484 format: "binary" 5485 500: 5486 description: "server error" 5487 schema: 5488 $ref: "#/definitions/ErrorResponse" 5489 parameters: 5490 - name: "name" 5491 in: "path" 5492 description: "Image name or ID" 5493 type: "string" 5494 required: true 5495 tags: ["Image"] 5496 /images/get: 5497 get: 5498 summary: "Export several images" 5499 description: | 5500 Get a tarball containing all images and metadata for several image repositories. 5501 5502 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. 5503 5504 For details on the format, see [the export image endpoint](#operation/ImageGet). 5505 operationId: "ImageGetAll" 5506 produces: 5507 - "application/x-tar" 5508 responses: 5509 200: 5510 description: "no error" 5511 schema: 5512 type: "string" 5513 format: "binary" 5514 500: 5515 description: "server error" 5516 schema: 5517 $ref: "#/definitions/ErrorResponse" 5518 parameters: 5519 - name: "names" 5520 in: "query" 5521 description: "Image names to filter by" 5522 type: "array" 5523 items: 5524 type: "string" 5525 tags: ["Image"] 5526 /images/load: 5527 post: 5528 summary: "Import images" 5529 description: | 5530 Load a set of images and tags into a repository. 5531 5532 For details on the format, see [the export image endpoint](#operation/ImageGet). 5533 operationId: "ImageLoad" 5534 consumes: 5535 - "application/x-tar" 5536 produces: 5537 - "application/json" 5538 responses: 5539 200: 5540 description: "no error" 5541 500: 5542 description: "server error" 5543 schema: 5544 $ref: "#/definitions/ErrorResponse" 5545 parameters: 5546 - name: "imagesTarball" 5547 in: "body" 5548 description: "Tar archive containing images" 5549 schema: 5550 type: "string" 5551 format: "binary" 5552 - name: "quiet" 5553 in: "query" 5554 description: "Suppress progress details during load." 5555 type: "boolean" 5556 default: false 5557 tags: ["Image"] 5558 /containers/{id}/exec: 5559 post: 5560 summary: "Create an exec instance" 5561 description: "Run a command inside a running container." 5562 operationId: "ContainerExec" 5563 consumes: 5564 - "application/json" 5565 produces: 5566 - "application/json" 5567 responses: 5568 201: 5569 description: "no error" 5570 schema: 5571 $ref: "#/definitions/IdResponse" 5572 404: 5573 description: "no such container" 5574 schema: 5575 $ref: "#/definitions/ErrorResponse" 5576 examples: 5577 application/json: 5578 message: "No such container: c2ada9df5af8" 5579 409: 5580 description: "container is paused" 5581 schema: 5582 $ref: "#/definitions/ErrorResponse" 5583 500: 5584 description: "Server error" 5585 schema: 5586 $ref: "#/definitions/ErrorResponse" 5587 parameters: 5588 - name: "execConfig" 5589 in: "body" 5590 description: "Exec configuration" 5591 schema: 5592 type: "object" 5593 properties: 5594 AttachStdin: 5595 type: "boolean" 5596 description: "Attach to `stdin` of the exec command." 5597 AttachStdout: 5598 type: "boolean" 5599 description: "Attach to `stdout` of the exec command." 5600 AttachStderr: 5601 type: "boolean" 5602 description: "Attach to `stderr` of the exec command." 5603 DetachKeys: 5604 type: "string" 5605 description: "Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`." 5606 Tty: 5607 type: "boolean" 5608 description: "Allocate a pseudo-TTY." 5609 Env: 5610 description: "A list of environment variables in the form `[\"VAR=value\", ...]`." 5611 type: "array" 5612 items: 5613 type: "string" 5614 Cmd: 5615 type: "array" 5616 description: "Command to run, as a string or array of strings." 5617 items: 5618 type: "string" 5619 Privileged: 5620 type: "boolean" 5621 description: "Runs the exec process with extended privileges." 5622 default: false 5623 User: 5624 type: "string" 5625 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`." 5626 example: 5627 AttachStdin: false 5628 AttachStdout: true 5629 AttachStderr: true 5630 DetachKeys: "ctrl-p,ctrl-q" 5631 Tty: false 5632 Cmd: 5633 - "date" 5634 Env: 5635 - "FOO=bar" 5636 - "BAZ=quux" 5637 required: true 5638 - name: "id" 5639 in: "path" 5640 description: "ID or name of container" 5641 type: "string" 5642 required: true 5643 tags: ["Exec"] 5644 /exec/{id}/start: 5645 post: 5646 summary: "Start an exec instance" 5647 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." 5648 operationId: "ExecStart" 5649 consumes: 5650 - "application/json" 5651 produces: 5652 - "application/vnd.docker.raw-stream" 5653 responses: 5654 200: 5655 description: "No error" 5656 404: 5657 description: "No such exec instance" 5658 schema: 5659 $ref: "#/definitions/ErrorResponse" 5660 409: 5661 description: "Container is stopped or paused" 5662 schema: 5663 $ref: "#/definitions/ErrorResponse" 5664 parameters: 5665 - name: "execStartConfig" 5666 in: "body" 5667 schema: 5668 type: "object" 5669 properties: 5670 Detach: 5671 type: "boolean" 5672 description: "Detach from the command." 5673 Tty: 5674 type: "boolean" 5675 description: "Allocate a pseudo-TTY." 5676 example: 5677 Detach: false 5678 Tty: false 5679 - name: "id" 5680 in: "path" 5681 description: "Exec instance ID" 5682 required: true 5683 type: "string" 5684 tags: ["Exec"] 5685 /exec/{id}/resize: 5686 post: 5687 summary: "Resize an exec instance" 5688 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." 5689 operationId: "ExecResize" 5690 responses: 5691 201: 5692 description: "No error" 5693 404: 5694 description: "No such exec instance" 5695 schema: 5696 $ref: "#/definitions/ErrorResponse" 5697 parameters: 5698 - name: "id" 5699 in: "path" 5700 description: "Exec instance ID" 5701 required: true 5702 type: "string" 5703 - name: "h" 5704 in: "query" 5705 description: "Height of the TTY session in characters" 5706 type: "integer" 5707 - name: "w" 5708 in: "query" 5709 description: "Width of the TTY session in characters" 5710 type: "integer" 5711 tags: ["Exec"] 5712 /exec/{id}/json: 5713 get: 5714 summary: "Inspect an exec instance" 5715 description: "Return low-level information about an exec instance." 5716 operationId: "ExecInspect" 5717 produces: 5718 - "application/json" 5719 responses: 5720 200: 5721 description: "No error" 5722 schema: 5723 type: "object" 5724 properties: 5725 ID: 5726 type: "string" 5727 Running: 5728 type: "boolean" 5729 ExitCode: 5730 type: "integer" 5731 ProcessConfig: 5732 $ref: "#/definitions/ProcessConfig" 5733 OpenStdin: 5734 type: "boolean" 5735 OpenStderr: 5736 type: "boolean" 5737 OpenStdout: 5738 type: "boolean" 5739 ContainerID: 5740 type: "string" 5741 Pid: 5742 type: "integer" 5743 description: "The system process ID for the exec process." 5744 examples: 5745 application/json: 5746 CanRemove: false 5747 ContainerID: "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126" 5748 DetachKeys: "" 5749 ExitCode: 2 5750 ID: "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b" 5751 OpenStderr: true 5752 OpenStdin: true 5753 OpenStdout: true 5754 ProcessConfig: 5755 arguments: 5756 - "-c" 5757 - "exit 2" 5758 entrypoint: "sh" 5759 privileged: false 5760 tty: true 5761 user: "1000" 5762 Running: false 5763 Pid: 42000 5764 404: 5765 description: "No such exec instance" 5766 schema: 5767 $ref: "#/definitions/ErrorResponse" 5768 500: 5769 description: "Server error" 5770 schema: 5771 $ref: "#/definitions/ErrorResponse" 5772 parameters: 5773 - name: "id" 5774 in: "path" 5775 description: "Exec instance ID" 5776 required: true 5777 type: "string" 5778 tags: ["Exec"] 5779 5780 /volumes: 5781 get: 5782 summary: "List volumes" 5783 operationId: "VolumeList" 5784 produces: ["application/json"] 5785 responses: 5786 200: 5787 description: "Summary volume data that matches the query" 5788 schema: 5789 type: "object" 5790 required: [Volumes, Warnings] 5791 properties: 5792 Volumes: 5793 type: "array" 5794 x-nullable: false 5795 description: "List of volumes" 5796 items: 5797 $ref: "#/definitions/Volume" 5798 Warnings: 5799 type: "array" 5800 x-nullable: false 5801 description: "Warnings that occurred when fetching the list of volumes" 5802 items: 5803 type: "string" 5804 5805 examples: 5806 application/json: 5807 Volumes: 5808 - Name: "tardis" 5809 Driver: "local" 5810 Mountpoint: "/var/lib/docker/volumes/tardis" 5811 Labels: 5812 com.example.some-label: "some-value" 5813 com.example.some-other-label: "some-other-value" 5814 Scope: "local" 5815 Options: 5816 device: "tmpfs" 5817 o: "size=100m,uid=1000" 5818 type: "tmpfs" 5819 Warnings: [] 5820 500: 5821 description: "Server error" 5822 schema: 5823 $ref: "#/definitions/ErrorResponse" 5824 parameters: 5825 - name: "filters" 5826 in: "query" 5827 description: | 5828 JSON encoded value of the filters (a `map[string][]string`) to 5829 process on the volumes list. Available filters: 5830 5831 - `name=<volume-name>` Matches all or part of a volume name. 5832 - `dangling=<boolean>` When set to `true` (or `1`), returns all 5833 volumes that are not in use by a container. When set to `false` 5834 (or `0`), only volumes that are in use by one or more 5835 containers are returned. 5836 - `driver=<volume-driver-name>` Matches all or part of a volume 5837 driver name. 5838 type: "string" 5839 format: "json" 5840 tags: ["Volume"] 5841 5842 /volumes/create: 5843 post: 5844 summary: "Create a volume" 5845 operationId: "VolumeCreate" 5846 consumes: ["application/json"] 5847 produces: ["application/json"] 5848 responses: 5849 201: 5850 description: "The volume was created successfully" 5851 schema: 5852 $ref: "#/definitions/Volume" 5853 500: 5854 description: "Server error" 5855 schema: 5856 $ref: "#/definitions/ErrorResponse" 5857 parameters: 5858 - name: "volumeConfig" 5859 in: "body" 5860 required: true 5861 description: "Volume configuration" 5862 schema: 5863 type: "object" 5864 properties: 5865 Name: 5866 description: "The new volume's name. If not specified, Docker generates a name." 5867 type: "string" 5868 x-nullable: false 5869 Driver: 5870 description: "Name of the volume driver to use." 5871 type: "string" 5872 default: "local" 5873 x-nullable: false 5874 DriverOpts: 5875 description: "A mapping of driver options and values. These options are passed directly to the driver and are driver specific." 5876 type: "object" 5877 additionalProperties: 5878 type: "string" 5879 Labels: 5880 description: "User-defined key/value metadata." 5881 type: "object" 5882 additionalProperties: 5883 type: "string" 5884 example: 5885 Name: "tardis" 5886 Labels: 5887 com.example.some-label: "some-value" 5888 com.example.some-other-label: "some-other-value" 5889 Driver: "custom" 5890 tags: ["Volume"] 5891 5892 /volumes/{name}: 5893 get: 5894 summary: "Inspect a volume" 5895 operationId: "VolumeInspect" 5896 produces: ["application/json"] 5897 responses: 5898 200: 5899 description: "No error" 5900 schema: 5901 $ref: "#/definitions/Volume" 5902 404: 5903 description: "No such volume" 5904 schema: 5905 $ref: "#/definitions/ErrorResponse" 5906 500: 5907 description: "Server error" 5908 schema: 5909 $ref: "#/definitions/ErrorResponse" 5910 parameters: 5911 - name: "name" 5912 in: "path" 5913 required: true 5914 description: "Volume name or ID" 5915 type: "string" 5916 tags: ["Volume"] 5917 5918 delete: 5919 summary: "Remove a volume" 5920 description: "Instruct the driver to remove the volume." 5921 operationId: "VolumeDelete" 5922 responses: 5923 204: 5924 description: "The volume was removed" 5925 404: 5926 description: "No such volume or volume driver" 5927 schema: 5928 $ref: "#/definitions/ErrorResponse" 5929 409: 5930 description: "Volume is in use and cannot be removed" 5931 schema: 5932 $ref: "#/definitions/ErrorResponse" 5933 500: 5934 description: "Server error" 5935 schema: 5936 $ref: "#/definitions/ErrorResponse" 5937 parameters: 5938 - name: "name" 5939 in: "path" 5940 required: true 5941 description: "Volume name or ID" 5942 type: "string" 5943 - name: "force" 5944 in: "query" 5945 description: "Force the removal of the volume" 5946 type: "boolean" 5947 default: false 5948 tags: ["Volume"] 5949 /volumes/prune: 5950 post: 5951 summary: "Delete unused volumes" 5952 produces: 5953 - "application/json" 5954 operationId: "VolumePrune" 5955 parameters: 5956 - name: "filters" 5957 in: "query" 5958 description: | 5959 Filters to process on the prune list, encoded as JSON (a `map[string][]string`). 5960 5961 Available filters: 5962 type: "string" 5963 responses: 5964 200: 5965 description: "No error" 5966 schema: 5967 type: "object" 5968 properties: 5969 VolumesDeleted: 5970 description: "Volumes that were deleted" 5971 type: "array" 5972 items: 5973 type: "string" 5974 SpaceReclaimed: 5975 description: "Disk space reclaimed in bytes" 5976 type: "integer" 5977 format: "int64" 5978 500: 5979 description: "Server error" 5980 schema: 5981 $ref: "#/definitions/ErrorResponse" 5982 tags: ["Volume"] 5983 /networks: 5984 get: 5985 summary: "List networks" 5986 operationId: "NetworkList" 5987 produces: 5988 - "application/json" 5989 responses: 5990 200: 5991 description: "No error" 5992 schema: 5993 type: "array" 5994 items: 5995 $ref: "#/definitions/Network" 5996 examples: 5997 application/json: 5998 - Name: "bridge" 5999 Id: "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566" 6000 Created: "2016-10-19T06:21:00.416543526Z" 6001 Scope: "local" 6002 Driver: "bridge" 6003 EnableIPv6: false 6004 Internal: false 6005 IPAM: 6006 Driver: "default" 6007 Config: 6008 - 6009 Subnet: "172.17.0.0/16" 6010 Containers: 6011 39b69226f9d79f5634485fb236a23b2fe4e96a0a94128390a7fbbcc167065867: 6012 EndpointID: "ed2419a97c1d9954d05b46e462e7002ea552f216e9b136b80a7db8d98b442eda" 6013 MacAddress: "02:42:ac:11:00:02" 6014 IPv4Address: "172.17.0.2/16" 6015 IPv6Address: "" 6016 Options: 6017 com.docker.network.bridge.default_bridge: "true" 6018 com.docker.network.bridge.enable_icc: "true" 6019 com.docker.network.bridge.enable_ip_masquerade: "true" 6020 com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" 6021 com.docker.network.bridge.name: "docker0" 6022 com.docker.network.driver.mtu: "1500" 6023 - Name: "none" 6024 Id: "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794" 6025 Created: "0001-01-01T00:00:00Z" 6026 Scope: "local" 6027 Driver: "null" 6028 EnableIPv6: false 6029 Internal: false 6030 IPAM: 6031 Driver: "default" 6032 Config: [] 6033 Containers: {} 6034 Options: {} 6035 - Name: "host" 6036 Id: "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e" 6037 Created: "0001-01-01T00:00:00Z" 6038 Scope: "local" 6039 Driver: "host" 6040 EnableIPv6: false 6041 Internal: false 6042 IPAM: 6043 Driver: "default" 6044 Config: [] 6045 Containers: {} 6046 Options: {} 6047 500: 6048 description: "Server error" 6049 schema: 6050 $ref: "#/definitions/ErrorResponse" 6051 parameters: 6052 - name: "filters" 6053 in: "query" 6054 description: | 6055 JSON encoded value of the filters (a `map[string][]string`) to process on the networks list. Available filters: 6056 6057 - `driver=<driver-name>` Matches a network's driver. 6058 - `id=<network-id>` Matches all or part of a network ID. 6059 - `label=<key>` or `label=<key>=<value>` of a network label. 6060 - `name=<network-name>` Matches all or part of a network name. 6061 - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. 6062 type: "string" 6063 tags: ["Network"] 6064 6065 /networks/{id}: 6066 get: 6067 summary: "Inspect a network" 6068 operationId: "NetworkInspect" 6069 produces: 6070 - "application/json" 6071 responses: 6072 200: 6073 description: "No error" 6074 schema: 6075 $ref: "#/definitions/Network" 6076 404: 6077 description: "Network not found" 6078 schema: 6079 $ref: "#/definitions/ErrorResponse" 6080 parameters: 6081 - name: "id" 6082 in: "path" 6083 description: "Network ID or name" 6084 required: true 6085 type: "string" 6086 tags: ["Network"] 6087 6088 delete: 6089 summary: "Remove a network" 6090 operationId: "NetworkDelete" 6091 responses: 6092 204: 6093 description: "No error" 6094 404: 6095 description: "no such network" 6096 schema: 6097 $ref: "#/definitions/ErrorResponse" 6098 500: 6099 description: "Server error" 6100 schema: 6101 $ref: "#/definitions/ErrorResponse" 6102 parameters: 6103 - name: "id" 6104 in: "path" 6105 description: "Network ID or name" 6106 required: true 6107 type: "string" 6108 tags: ["Network"] 6109 6110 /networks/create: 6111 post: 6112 summary: "Create a network" 6113 operationId: "NetworkCreate" 6114 consumes: 6115 - "application/json" 6116 produces: 6117 - "application/json" 6118 responses: 6119 201: 6120 description: "No error" 6121 schema: 6122 type: "object" 6123 properties: 6124 Id: 6125 description: "The ID of the created network." 6126 type: "string" 6127 Warning: 6128 type: "string" 6129 example: 6130 Id: "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30" 6131 Warning: "" 6132 403: 6133 description: "operation not supported for pre-defined networks" 6134 schema: 6135 $ref: "#/definitions/ErrorResponse" 6136 404: 6137 description: "plugin not found" 6138 schema: 6139 $ref: "#/definitions/ErrorResponse" 6140 500: 6141 description: "Server error" 6142 schema: 6143 $ref: "#/definitions/ErrorResponse" 6144 parameters: 6145 - name: "networkConfig" 6146 in: "body" 6147 description: "Network configuration" 6148 required: true 6149 schema: 6150 type: "object" 6151 required: ["Name"] 6152 properties: 6153 Name: 6154 description: "The network's name." 6155 type: "string" 6156 CheckDuplicate: 6157 description: "Check for networks with duplicate names." 6158 type: "boolean" 6159 Driver: 6160 description: "Name of the network driver plugin to use." 6161 type: "string" 6162 default: "bridge" 6163 Internal: 6164 description: "Restrict external access to the network." 6165 type: "boolean" 6166 IPAM: 6167 description: "Optional custom IP scheme for the network." 6168 $ref: "#/definitions/IPAM" 6169 EnableIPv6: 6170 description: "Enable IPv6 on the network." 6171 type: "boolean" 6172 Options: 6173 description: "Network specific options to be used by the drivers." 6174 type: "object" 6175 additionalProperties: 6176 type: "string" 6177 Labels: 6178 description: "User-defined key/value metadata." 6179 type: "object" 6180 additionalProperties: 6181 type: "string" 6182 example: 6183 Name: "isolated_nw" 6184 CheckDuplicate: false 6185 Driver: "bridge" 6186 EnableIPv6: true 6187 IPAM: 6188 Driver: "default" 6189 Config: 6190 - Subnet: "172.20.0.0/16" 6191 IPRange: "172.20.10.0/24" 6192 Gateway: "172.20.10.11" 6193 - Subnet: "2001:db8:abcd::/64" 6194 Gateway: "2001:db8:abcd::1011" 6195 Options: 6196 foo: "bar" 6197 Internal: true 6198 Options: 6199 com.docker.network.bridge.default_bridge: "true" 6200 com.docker.network.bridge.enable_icc: "true" 6201 com.docker.network.bridge.enable_ip_masquerade: "true" 6202 com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" 6203 com.docker.network.bridge.name: "docker0" 6204 com.docker.network.driver.mtu: "1500" 6205 Labels: 6206 com.example.some-label: "some-value" 6207 com.example.some-other-label: "some-other-value" 6208 tags: ["Network"] 6209 6210 /networks/{id}/connect: 6211 post: 6212 summary: "Connect a container to a network" 6213 operationId: "NetworkConnect" 6214 consumes: 6215 - "application/octet-stream" 6216 responses: 6217 200: 6218 description: "No error" 6219 403: 6220 description: "Operation not supported for swarm scoped networks" 6221 schema: 6222 $ref: "#/definitions/ErrorResponse" 6223 404: 6224 description: "Network or container not found" 6225 schema: 6226 $ref: "#/definitions/ErrorResponse" 6227 500: 6228 description: "Server error" 6229 schema: 6230 $ref: "#/definitions/ErrorResponse" 6231 parameters: 6232 - name: "id" 6233 in: "path" 6234 description: "Network ID or name" 6235 required: true 6236 type: "string" 6237 - name: "container" 6238 in: "body" 6239 required: true 6240 schema: 6241 type: "object" 6242 properties: 6243 Container: 6244 type: "string" 6245 description: "The ID or name of the container to connect to the network." 6246 EndpointConfig: 6247 $ref: "#/definitions/EndpointSettings" 6248 example: 6249 Container: "3613f73ba0e4" 6250 EndpointConfig: 6251 IPAMConfig: 6252 IPv4Address: "172.24.56.89" 6253 IPv6Address: "2001:db8::5689" 6254 tags: ["Network"] 6255 6256 /networks/{id}/disconnect: 6257 post: 6258 summary: "Disconnect a container from a network" 6259 operationId: "NetworkDisconnect" 6260 consumes: 6261 - "application/json" 6262 responses: 6263 200: 6264 description: "No error" 6265 403: 6266 description: "Operation not supported for swarm scoped networks" 6267 schema: 6268 $ref: "#/definitions/ErrorResponse" 6269 404: 6270 description: "Network or container not found" 6271 schema: 6272 $ref: "#/definitions/ErrorResponse" 6273 500: 6274 description: "Server error" 6275 schema: 6276 $ref: "#/definitions/ErrorResponse" 6277 parameters: 6278 - name: "id" 6279 in: "path" 6280 description: "Network ID or name" 6281 required: true 6282 type: "string" 6283 - name: "container" 6284 in: "body" 6285 required: true 6286 schema: 6287 type: "object" 6288 properties: 6289 Container: 6290 type: "string" 6291 description: "The ID or name of the container to disconnect from the network." 6292 Force: 6293 type: "boolean" 6294 description: "Force the container to disconnect from the network." 6295 tags: ["Network"] 6296 /networks/prune: 6297 post: 6298 summary: "Delete unused networks" 6299 consumes: 6300 - "application/json" 6301 produces: 6302 - "application/json" 6303 operationId: "NetworkPrune" 6304 parameters: 6305 - name: "filters" 6306 in: "query" 6307 description: | 6308 Filters to process on the prune list, encoded as JSON (a `map[string][]string`). 6309 6310 Available filters: 6311 type: "string" 6312 responses: 6313 200: 6314 description: "No error" 6315 schema: 6316 type: "object" 6317 properties: 6318 NetworksDeleted: 6319 description: "Networks that were deleted" 6320 type: "array" 6321 items: 6322 type: "string" 6323 500: 6324 description: "Server error" 6325 schema: 6326 $ref: "#/definitions/ErrorResponse" 6327 tags: ["Network"] 6328 /plugins: 6329 get: 6330 summary: "List plugins" 6331 operationId: "PluginList" 6332 description: "Returns information about installed plugins." 6333 produces: ["application/json"] 6334 responses: 6335 200: 6336 description: "No error" 6337 schema: 6338 type: "array" 6339 items: 6340 $ref: "#/definitions/Plugin" 6341 example: 6342 - Id: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" 6343 Name: "tiborvass/sample-volume-plugin" 6344 Tag: "latest" 6345 Active: true 6346 Settings: 6347 Env: 6348 - "DEBUG=0" 6349 Args: null 6350 Devices: null 6351 Config: 6352 Description: "A sample volume plugin for Docker" 6353 Documentation: "https://docs.docker.com/engine/extend/plugins/" 6354 Interface: 6355 Types: 6356 - "docker.volumedriver/1.0" 6357 Socket: "plugins.sock" 6358 Entrypoint: 6359 - "/usr/bin/sample-volume-plugin" 6360 - "/data" 6361 WorkDir: "" 6362 User: {} 6363 Network: 6364 Type: "" 6365 Linux: 6366 Capabilities: null 6367 AllowAllDevices: false 6368 Devices: null 6369 Mounts: null 6370 PropagatedMount: "/data" 6371 Env: 6372 - Name: "DEBUG" 6373 Description: "If set, prints debug messages" 6374 Settable: null 6375 Value: "0" 6376 Args: 6377 Name: "args" 6378 Description: "command line arguments" 6379 Settable: null 6380 Value: [] 6381 500: 6382 description: "Server error" 6383 schema: 6384 $ref: "#/definitions/ErrorResponse" 6385 tags: ["Plugin"] 6386 6387 /plugins/privileges: 6388 get: 6389 summary: "Get plugin privileges" 6390 operationId: "GetPluginPrivileges" 6391 responses: 6392 200: 6393 description: "no error" 6394 schema: 6395 type: "array" 6396 items: 6397 description: "Describes a permission the user has to accept upon installing the plugin." 6398 type: "object" 6399 properties: 6400 Name: 6401 type: "string" 6402 Description: 6403 type: "string" 6404 Value: 6405 type: "array" 6406 items: 6407 type: "string" 6408 example: 6409 - Name: "network" 6410 Description: "" 6411 Value: 6412 - "host" 6413 - Name: "mount" 6414 Description: "" 6415 Value: 6416 - "/data" 6417 - Name: "device" 6418 Description: "" 6419 Value: 6420 - "/dev/cpu_dma_latency" 6421 500: 6422 description: "server error" 6423 schema: 6424 $ref: "#/definitions/ErrorResponse" 6425 parameters: 6426 - name: "name" 6427 in: "query" 6428 description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." 6429 required: true 6430 type: "string" 6431 tags: 6432 - "Plugin" 6433 6434 /plugins/pull: 6435 post: 6436 summary: "Install a plugin" 6437 operationId: "PluginPull" 6438 description: | 6439 Pulls and installs a plugin. After the plugin is installed, it can be enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable). 6440 produces: 6441 - "application/json" 6442 responses: 6443 204: 6444 description: "no error" 6445 500: 6446 description: "server error" 6447 schema: 6448 $ref: "#/definitions/ErrorResponse" 6449 parameters: 6450 - name: "remote" 6451 in: "query" 6452 description: | 6453 Remote reference for plugin to install. 6454 6455 The `:latest` tag is optional, and is used as the default if omitted. 6456 required: true 6457 type: "string" 6458 - name: "name" 6459 in: "query" 6460 description: | 6461 Local name for the pulled plugin. 6462 6463 The `:latest` tag is optional, and is used as the default if omitted. 6464 required: false 6465 type: "string" 6466 - name: "X-Registry-Auth" 6467 in: "header" 6468 description: "A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)" 6469 type: "string" 6470 - name: "body" 6471 in: "body" 6472 schema: 6473 type: "array" 6474 items: 6475 description: "Describes a permission accepted by the user upon installing the plugin." 6476 type: "object" 6477 properties: 6478 Name: 6479 type: "string" 6480 Description: 6481 type: "string" 6482 Value: 6483 type: "array" 6484 items: 6485 type: "string" 6486 example: 6487 - Name: "network" 6488 Description: "" 6489 Value: 6490 - "host" 6491 - Name: "mount" 6492 Description: "" 6493 Value: 6494 - "/data" 6495 - Name: "device" 6496 Description: "" 6497 Value: 6498 - "/dev/cpu_dma_latency" 6499 tags: ["Plugin"] 6500 /plugins/{name}/json: 6501 get: 6502 summary: "Inspect a plugin" 6503 operationId: "PluginInspect" 6504 responses: 6505 200: 6506 description: "no error" 6507 schema: 6508 $ref: "#/definitions/Plugin" 6509 404: 6510 description: "plugin is not installed" 6511 schema: 6512 $ref: "#/definitions/ErrorResponse" 6513 500: 6514 description: "server error" 6515 schema: 6516 $ref: "#/definitions/ErrorResponse" 6517 parameters: 6518 - name: "name" 6519 in: "path" 6520 description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." 6521 required: true 6522 type: "string" 6523 tags: ["Plugin"] 6524 /plugins/{name}: 6525 delete: 6526 summary: "Remove a plugin" 6527 operationId: "PluginDelete" 6528 responses: 6529 200: 6530 description: "no error" 6531 schema: 6532 $ref: "#/definitions/Plugin" 6533 404: 6534 description: "plugin is not installed" 6535 schema: 6536 $ref: "#/definitions/ErrorResponse" 6537 500: 6538 description: "server error" 6539 schema: 6540 $ref: "#/definitions/ErrorResponse" 6541 parameters: 6542 - name: "name" 6543 in: "path" 6544 description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." 6545 required: true 6546 type: "string" 6547 - name: "force" 6548 in: "query" 6549 description: "Disable the plugin before removing. This may result in issues if the plugin is in use by a container." 6550 type: "boolean" 6551 default: false 6552 tags: ["Plugin"] 6553 /plugins/{name}/enable: 6554 post: 6555 summary: "Enable a plugin" 6556 operationId: "PluginEnable" 6557 responses: 6558 200: 6559 description: "no error" 6560 500: 6561 description: "server error" 6562 schema: 6563 $ref: "#/definitions/ErrorResponse" 6564 parameters: 6565 - name: "name" 6566 in: "path" 6567 description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." 6568 required: true 6569 type: "string" 6570 - name: "timeout" 6571 in: "query" 6572 description: "Set the HTTP client timeout (in seconds)" 6573 type: "integer" 6574 default: 0 6575 tags: ["Plugin"] 6576 /plugins/{name}/disable: 6577 post: 6578 summary: "Disable a plugin" 6579 operationId: "PluginDisable" 6580 responses: 6581 200: 6582 description: "no error" 6583 500: 6584 description: "server error" 6585 schema: 6586 $ref: "#/definitions/ErrorResponse" 6587 parameters: 6588 - name: "name" 6589 in: "path" 6590 description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." 6591 required: true 6592 type: "string" 6593 tags: ["Plugin"] 6594 /plugins/{name}/upgrade: 6595 post: 6596 summary: "Upgrade a plugin" 6597 operationId: "PluginUpgrade" 6598 responses: 6599 204: 6600 description: "no error" 6601 404: 6602 description: "plugin not installed" 6603 schema: 6604 $ref: "#/definitions/ErrorResponse" 6605 500: 6606 description: "server error" 6607 schema: 6608 $ref: "#/definitions/ErrorResponse" 6609 parameters: 6610 - name: "name" 6611 in: "path" 6612 description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." 6613 required: true 6614 type: "string" 6615 - name: "remote" 6616 in: "query" 6617 description: | 6618 Remote reference to upgrade to. 6619 6620 The `:latest` tag is optional, and is used as the default if omitted. 6621 required: true 6622 type: "string" 6623 - name: "X-Registry-Auth" 6624 in: "header" 6625 description: "A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)" 6626 type: "string" 6627 - name: "body" 6628 in: "body" 6629 schema: 6630 type: "array" 6631 items: 6632 description: "Describes a permission accepted by the user upon installing the plugin." 6633 type: "object" 6634 properties: 6635 Name: 6636 type: "string" 6637 Description: 6638 type: "string" 6639 Value: 6640 type: "array" 6641 items: 6642 type: "string" 6643 example: 6644 - Name: "network" 6645 Description: "" 6646 Value: 6647 - "host" 6648 - Name: "mount" 6649 Description: "" 6650 Value: 6651 - "/data" 6652 - Name: "device" 6653 Description: "" 6654 Value: 6655 - "/dev/cpu_dma_latency" 6656 tags: ["Plugin"] 6657 /plugins/create: 6658 post: 6659 summary: "Create a plugin" 6660 operationId: "PluginCreate" 6661 consumes: 6662 - "application/x-tar" 6663 responses: 6664 204: 6665 description: "no error" 6666 500: 6667 description: "server error" 6668 schema: 6669 $ref: "#/definitions/ErrorResponse" 6670 parameters: 6671 - name: "name" 6672 in: "query" 6673 description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." 6674 required: true 6675 type: "string" 6676 - name: "tarContext" 6677 in: "body" 6678 description: "Path to tar containing plugin rootfs and manifest" 6679 schema: 6680 type: "string" 6681 format: "binary" 6682 tags: ["Plugin"] 6683 /plugins/{name}/push: 6684 post: 6685 summary: "Push a plugin" 6686 operationId: "PluginPush" 6687 description: | 6688 Push a plugin to the registry. 6689 parameters: 6690 - name: "name" 6691 in: "path" 6692 description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." 6693 required: true 6694 type: "string" 6695 responses: 6696 200: 6697 description: "no error" 6698 404: 6699 description: "plugin not installed" 6700 schema: 6701 $ref: "#/definitions/ErrorResponse" 6702 500: 6703 description: "server error" 6704 schema: 6705 $ref: "#/definitions/ErrorResponse" 6706 tags: ["Plugin"] 6707 /plugins/{name}/set: 6708 post: 6709 summary: "Configure a plugin" 6710 operationId: "PluginSet" 6711 consumes: 6712 - "application/json" 6713 parameters: 6714 - name: "name" 6715 in: "path" 6716 description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." 6717 required: true 6718 type: "string" 6719 - name: "body" 6720 in: "body" 6721 schema: 6722 type: "array" 6723 items: 6724 type: "string" 6725 example: ["DEBUG=1"] 6726 responses: 6727 204: 6728 description: "No error" 6729 404: 6730 description: "Plugin not installed" 6731 schema: 6732 $ref: "#/definitions/ErrorResponse" 6733 500: 6734 description: "Server error" 6735 schema: 6736 $ref: "#/definitions/ErrorResponse" 6737 tags: ["Plugin"] 6738 /nodes: 6739 get: 6740 summary: "List nodes" 6741 operationId: "NodeList" 6742 responses: 6743 200: 6744 description: "no error" 6745 schema: 6746 type: "array" 6747 items: 6748 $ref: "#/definitions/Node" 6749 500: 6750 description: "server error" 6751 schema: 6752 $ref: "#/definitions/ErrorResponse" 6753 parameters: 6754 - name: "filters" 6755 in: "query" 6756 description: | 6757 Filters to process on the nodes list, encoded as JSON (a `map[string][]string`). 6758 6759 Available filters: 6760 - `id=<node id>` 6761 - `label=<engine label>` 6762 - `membership=`(`accepted`|`pending`)` 6763 - `name=<node name>` 6764 - `role=`(`manager`|`worker`)` 6765 type: "string" 6766 tags: ["Node"] 6767 /nodes/{id}: 6768 get: 6769 summary: "Inspect a node" 6770 operationId: "NodeInspect" 6771 responses: 6772 200: 6773 description: "no error" 6774 schema: 6775 $ref: "#/definitions/Node" 6776 404: 6777 description: "no such node" 6778 schema: 6779 $ref: "#/definitions/ErrorResponse" 6780 500: 6781 description: "server error" 6782 schema: 6783 $ref: "#/definitions/ErrorResponse" 6784 parameters: 6785 - name: "id" 6786 in: "path" 6787 description: "The ID or name of the node" 6788 type: "string" 6789 required: true 6790 tags: ["Node"] 6791 delete: 6792 summary: "Delete a node" 6793 operationId: "NodeDelete" 6794 responses: 6795 200: 6796 description: "no error" 6797 404: 6798 description: "no such node" 6799 schema: 6800 $ref: "#/definitions/ErrorResponse" 6801 500: 6802 description: "server error" 6803 schema: 6804 $ref: "#/definitions/ErrorResponse" 6805 parameters: 6806 - name: "id" 6807 in: "path" 6808 description: "The ID or name of the node" 6809 type: "string" 6810 required: true 6811 - name: "force" 6812 in: "query" 6813 description: "Force remove a node from the swarm" 6814 default: false 6815 type: "boolean" 6816 tags: ["Node"] 6817 /nodes/{id}/update: 6818 post: 6819 summary: "Update a node" 6820 operationId: "NodeUpdate" 6821 responses: 6822 200: 6823 description: "no error" 6824 404: 6825 description: "no such node" 6826 schema: 6827 $ref: "#/definitions/ErrorResponse" 6828 500: 6829 description: "server error" 6830 schema: 6831 $ref: "#/definitions/ErrorResponse" 6832 parameters: 6833 - name: "id" 6834 in: "path" 6835 description: "The ID of the node" 6836 type: "string" 6837 required: true 6838 - name: "body" 6839 in: "body" 6840 schema: 6841 $ref: "#/definitions/NodeSpec" 6842 - name: "version" 6843 in: "query" 6844 description: "The version number of the node object being updated. This is required to avoid conflicting writes." 6845 type: "integer" 6846 format: "int64" 6847 required: true 6848 tags: ["Node"] 6849 /swarm: 6850 get: 6851 summary: "Inspect swarm" 6852 operationId: "SwarmInspect" 6853 responses: 6854 200: 6855 description: "no error" 6856 schema: 6857 allOf: 6858 - $ref: "#/definitions/ClusterInfo" 6859 - type: "object" 6860 properties: 6861 JoinTokens: 6862 description: "The tokens workers and managers need to join the swarm." 6863 type: "object" 6864 properties: 6865 Worker: 6866 description: "The token workers can use to join the swarm." 6867 type: "string" 6868 Manager: 6869 description: "The token managers can use to join the swarm." 6870 type: "string" 6871 example: 6872 CreatedAt: "2016-08-15T16:00:20.349727406Z" 6873 Spec: 6874 Dispatcher: 6875 HeartbeatPeriod: 5000000000 6876 Orchestration: 6877 TaskHistoryRetentionLimit: 10 6878 CAConfig: 6879 NodeCertExpiry: 7776000000000000 6880 Raft: 6881 LogEntriesForSlowFollowers: 500 6882 HeartbeatTick: 1 6883 SnapshotInterval: 10000 6884 ElectionTick: 3 6885 TaskDefaults: {} 6886 EncryptionConfig: 6887 AutoLockManagers: false 6888 Name: "default" 6889 JoinTokens: 6890 Worker: "SWMTKN-1-1h8aps2yszaiqmz2l3oc5392pgk8e49qhx2aj3nyv0ui0hez2a-6qmn92w6bu3jdvnglku58u11a" 6891 Manager: "SWMTKN-1-1h8aps2yszaiqmz2l3oc5392pgk8e49qhx2aj3nyv0ui0hez2a-8llk83c4wm9lwioey2s316r9l" 6892 ID: "70ilmkj2f6sp2137c753w2nmt" 6893 UpdatedAt: "2016-08-15T16:32:09.623207604Z" 6894 Version: 6895 Index: 51 6896 500: 6897 description: "server error" 6898 schema: 6899 $ref: "#/definitions/ErrorResponse" 6900 tags: ["Swarm"] 6901 /swarm/init: 6902 post: 6903 summary: "Initialize a new swarm" 6904 operationId: "SwarmInit" 6905 produces: 6906 - "application/json" 6907 - "text/plain" 6908 responses: 6909 200: 6910 description: "no error" 6911 schema: 6912 description: "The node ID" 6913 type: "string" 6914 example: "7v2t30z9blmxuhnyo6s4cpenp" 6915 400: 6916 description: "bad parameter" 6917 schema: 6918 $ref: "#/definitions/ErrorResponse" 6919 406: 6920 description: "node is already part of a swarm" 6921 schema: 6922 $ref: "#/definitions/ErrorResponse" 6923 500: 6924 description: "server error" 6925 schema: 6926 $ref: "#/definitions/ErrorResponse" 6927 parameters: 6928 - name: "body" 6929 in: "body" 6930 required: true 6931 schema: 6932 type: "object" 6933 properties: 6934 ListenAddr: 6935 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." 6936 type: "string" 6937 AdvertiseAddr: 6938 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." 6939 type: "string" 6940 ForceNewCluster: 6941 description: "Force creation of a new swarm." 6942 type: "boolean" 6943 Spec: 6944 $ref: "#/definitions/SwarmSpec" 6945 example: 6946 ListenAddr: "0.0.0.0:2377" 6947 AdvertiseAddr: "192.168.1.1:2377" 6948 ForceNewCluster: false 6949 Spec: 6950 Orchestration: {} 6951 Raft: {} 6952 Dispatcher: {} 6953 CAConfig: {} 6954 EncryptionConfig: 6955 AutoLockManagers: false 6956 tags: ["Swarm"] 6957 /swarm/join: 6958 post: 6959 summary: "Join an existing swarm" 6960 operationId: "SwarmJoin" 6961 responses: 6962 200: 6963 description: "no error" 6964 400: 6965 description: "bad parameter" 6966 schema: 6967 $ref: "#/definitions/ErrorResponse" 6968 500: 6969 description: "server error" 6970 schema: 6971 $ref: "#/definitions/ErrorResponse" 6972 503: 6973 description: "node is already part of a swarm" 6974 schema: 6975 $ref: "#/definitions/ErrorResponse" 6976 parameters: 6977 - name: "body" 6978 in: "body" 6979 required: true 6980 schema: 6981 type: "object" 6982 properties: 6983 ListenAddr: 6984 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)." 6985 type: "string" 6986 AdvertiseAddr: 6987 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." 6988 type: "string" 6989 RemoteAddrs: 6990 description: "Addresses of manager nodes already participating in the swarm." 6991 type: "string" 6992 JoinToken: 6993 description: "Secret token for joining this swarm." 6994 type: "string" 6995 example: 6996 ListenAddr: "0.0.0.0:2377" 6997 AdvertiseAddr: "192.168.1.1:2377" 6998 RemoteAddrs: 6999 - "node1:2377" 7000 JoinToken: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" 7001 tags: ["Swarm"] 7002 /swarm/leave: 7003 post: 7004 summary: "Leave a swarm" 7005 operationId: "SwarmLeave" 7006 responses: 7007 200: 7008 description: "no error" 7009 500: 7010 description: "server error" 7011 schema: 7012 $ref: "#/definitions/ErrorResponse" 7013 503: 7014 description: "node is not part of a swarm" 7015 schema: 7016 $ref: "#/definitions/ErrorResponse" 7017 parameters: 7018 - name: "force" 7019 description: "Force leave swarm, even if this is the last manager or that it will break the cluster." 7020 in: "query" 7021 type: "boolean" 7022 default: false 7023 tags: ["Swarm"] 7024 /swarm/update: 7025 post: 7026 summary: "Update a swarm" 7027 operationId: "SwarmUpdate" 7028 responses: 7029 200: 7030 description: "no error" 7031 400: 7032 description: "bad parameter" 7033 schema: 7034 $ref: "#/definitions/ErrorResponse" 7035 500: 7036 description: "server error" 7037 schema: 7038 $ref: "#/definitions/ErrorResponse" 7039 503: 7040 description: "node is not part of a swarm" 7041 schema: 7042 $ref: "#/definitions/ErrorResponse" 7043 parameters: 7044 - name: "body" 7045 in: "body" 7046 required: true 7047 schema: 7048 $ref: "#/definitions/SwarmSpec" 7049 - name: "version" 7050 in: "query" 7051 description: "The version number of the swarm object being updated. This is required to avoid conflicting writes." 7052 type: "integer" 7053 format: "int64" 7054 required: true 7055 - name: "rotateWorkerToken" 7056 in: "query" 7057 description: "Rotate the worker join token." 7058 type: "boolean" 7059 default: false 7060 - name: "rotateManagerToken" 7061 in: "query" 7062 description: "Rotate the manager join token." 7063 type: "boolean" 7064 default: false 7065 - name: "rotateManagerUnlockKey" 7066 in: "query" 7067 description: "Rotate the manager unlock key." 7068 type: "boolean" 7069 default: false 7070 tags: ["Swarm"] 7071 /swarm/unlockkey: 7072 get: 7073 summary: "Get the unlock key" 7074 operationId: "SwarmUnlockkey" 7075 consumes: 7076 - "application/json" 7077 responses: 7078 200: 7079 description: "no error" 7080 schema: 7081 type: "object" 7082 properties: 7083 UnlockKey: 7084 description: "The swarm's unlock key." 7085 type: "string" 7086 example: 7087 UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" 7088 500: 7089 description: "server error" 7090 schema: 7091 $ref: "#/definitions/ErrorResponse" 7092 tags: ["Swarm"] 7093 /swarm/unlock: 7094 post: 7095 summary: "Unlock a locked manager" 7096 operationId: "SwarmUnlock" 7097 consumes: 7098 - "application/json" 7099 produces: 7100 - "application/json" 7101 parameters: 7102 - name: "body" 7103 in: "body" 7104 required: true 7105 schema: 7106 type: "object" 7107 properties: 7108 UnlockKey: 7109 description: "The swarm's unlock key." 7110 type: "string" 7111 example: 7112 UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" 7113 responses: 7114 200: 7115 description: "no error" 7116 500: 7117 description: "server error" 7118 schema: 7119 $ref: "#/definitions/ErrorResponse" 7120 tags: ["Swarm"] 7121 /services: 7122 get: 7123 summary: "List services" 7124 operationId: "ServiceList" 7125 responses: 7126 200: 7127 description: "no error" 7128 schema: 7129 type: "array" 7130 items: 7131 $ref: "#/definitions/Service" 7132 500: 7133 description: "server error" 7134 schema: 7135 $ref: "#/definitions/ErrorResponse" 7136 parameters: 7137 - name: "filters" 7138 in: "query" 7139 type: "string" 7140 description: | 7141 A JSON encoded value of the filters (a `map[string][]string`) to process on the services list. Available filters: 7142 7143 - `id=<service id>` 7144 - `name=<service name>` 7145 - `label=<service label>` 7146 tags: ["Service"] 7147 /services/create: 7148 post: 7149 summary: "Create a service" 7150 operationId: "ServiceCreate" 7151 consumes: 7152 - "application/json" 7153 produces: 7154 - "application/json" 7155 responses: 7156 201: 7157 description: "no error" 7158 schema: 7159 type: "object" 7160 properties: 7161 ID: 7162 description: "The ID of the created service." 7163 type: "string" 7164 Warning: 7165 description: "Optional warning message" 7166 type: "string" 7167 example: 7168 ID: "ak7w3gjqoa3kuz8xcpnyy0pvl" 7169 Warning: "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" 7170 403: 7171 description: "network is not eligible for services" 7172 schema: 7173 $ref: "#/definitions/ErrorResponse" 7174 409: 7175 description: "name conflicts with an existing service" 7176 schema: 7177 $ref: "#/definitions/ErrorResponse" 7178 500: 7179 description: "server error" 7180 schema: 7181 $ref: "#/definitions/ErrorResponse" 7182 503: 7183 description: "server error or node is not part of a swarm" 7184 schema: 7185 $ref: "#/definitions/ErrorResponse" 7186 parameters: 7187 - name: "body" 7188 in: "body" 7189 required: true 7190 schema: 7191 allOf: 7192 - $ref: "#/definitions/ServiceSpec" 7193 - type: "object" 7194 example: 7195 Name: "web" 7196 TaskTemplate: 7197 ContainerSpec: 7198 Image: "nginx:alpine" 7199 Mounts: 7200 - 7201 ReadOnly: true 7202 Source: "web-data" 7203 Target: "/usr/share/nginx/html" 7204 Type: "volume" 7205 VolumeOptions: 7206 DriverConfig: {} 7207 Labels: 7208 com.example.something: "something-value" 7209 User: "33" 7210 DNSConfig: 7211 Nameservers: ["8.8.8.8"] 7212 Search: ["example.org"] 7213 Options: ["timeout:3"] 7214 LogDriver: 7215 Name: "json-file" 7216 Options: 7217 max-file: "3" 7218 max-size: "10M" 7219 Placement: {} 7220 Resources: 7221 Limits: 7222 MemoryBytes: 104857600 7223 Reservations: {} 7224 RestartPolicy: 7225 Condition: "on-failure" 7226 Delay: 10000000000 7227 MaxAttempts: 10 7228 Mode: 7229 Replicated: 7230 Replicas: 4 7231 UpdateConfig: 7232 Delay: 30000000000 7233 Parallelism: 2 7234 FailureAction: "pause" 7235 EndpointSpec: 7236 Ports: 7237 - 7238 Protocol: "tcp" 7239 PublishedPort: 8080 7240 TargetPort: 80 7241 Labels: 7242 foo: "bar" 7243 - name: "X-Registry-Auth" 7244 in: "header" 7245 description: "A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)" 7246 type: "string" 7247 tags: ["Service"] 7248 /services/{id}: 7249 get: 7250 summary: "Inspect a service" 7251 operationId: "ServiceInspect" 7252 responses: 7253 200: 7254 description: "no error" 7255 schema: 7256 $ref: "#/definitions/Service" 7257 404: 7258 description: "no such service" 7259 schema: 7260 $ref: "#/definitions/ErrorResponse" 7261 500: 7262 description: "server error" 7263 schema: 7264 $ref: "#/definitions/ErrorResponse" 7265 parameters: 7266 - name: "id" 7267 in: "path" 7268 description: "ID or name of service." 7269 required: true 7270 type: "string" 7271 tags: ["Service"] 7272 delete: 7273 summary: "Delete a service" 7274 operationId: "ServiceDelete" 7275 responses: 7276 200: 7277 description: "no error" 7278 404: 7279 description: "no such service" 7280 schema: 7281 $ref: "#/definitions/ErrorResponse" 7282 500: 7283 description: "server error" 7284 schema: 7285 $ref: "#/definitions/ErrorResponse" 7286 parameters: 7287 - name: "id" 7288 in: "path" 7289 description: "ID or name of service." 7290 required: true 7291 type: "string" 7292 tags: ["Service"] 7293 /services/{id}/update: 7294 post: 7295 summary: "Update a service" 7296 operationId: "ServiceUpdate" 7297 consumes: ["application/json"] 7298 produces: ["application/json"] 7299 responses: 7300 200: 7301 description: "no error" 7302 schema: 7303 $ref: "#/definitions/ImageDeleteResponse" 7304 404: 7305 description: "no such service" 7306 schema: 7307 $ref: "#/definitions/ErrorResponse" 7308 500: 7309 description: "server error" 7310 schema: 7311 $ref: "#/definitions/ErrorResponse" 7312 parameters: 7313 - name: "id" 7314 in: "path" 7315 description: "ID or name of service." 7316 required: true 7317 type: "string" 7318 - name: "body" 7319 in: "body" 7320 required: true 7321 schema: 7322 allOf: 7323 - $ref: "#/definitions/ServiceSpec" 7324 - type: "object" 7325 example: 7326 Name: "top" 7327 TaskTemplate: 7328 ContainerSpec: 7329 Image: "busybox" 7330 Args: 7331 - "top" 7332 Resources: 7333 Limits: {} 7334 Reservations: {} 7335 RestartPolicy: 7336 Condition: "any" 7337 MaxAttempts: 0 7338 Placement: {} 7339 ForceUpdate: 0 7340 Mode: 7341 Replicated: 7342 Replicas: 1 7343 UpdateConfig: 7344 Parallelism: 1 7345 Monitor: 15000000000 7346 MaxFailureRatio: 0.15 7347 EndpointSpec: 7348 Mode: "vip" 7349 7350 - name: "version" 7351 in: "query" 7352 description: "The version number of the service object being updated. This is required to avoid conflicting writes." 7353 required: true 7354 type: "integer" 7355 - name: "registryAuthFrom" 7356 in: "query" 7357 type: "string" 7358 description: "If the X-Registry-Auth header is not specified, this 7359 parameter indicates where to find registry authorization credentials. The 7360 valid values are `spec` and `previous-spec`." 7361 default: "spec" 7362 - name: "X-Registry-Auth" 7363 in: "header" 7364 description: "A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)" 7365 type: "string" 7366 7367 tags: ["Service"] 7368 /services/{id}/logs: 7369 get: 7370 summary: "Get service logs" 7371 description: | 7372 Get `stdout` and `stderr` logs from a service. 7373 7374 **Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers. 7375 operationId: "ServiceLogs" 7376 produces: 7377 - "application/vnd.docker.raw-stream" 7378 - "application/json" 7379 responses: 7380 101: 7381 description: "logs returned as a stream" 7382 schema: 7383 type: "string" 7384 format: "binary" 7385 200: 7386 description: "logs returned as a string in response body" 7387 schema: 7388 type: "string" 7389 404: 7390 description: "no such container" 7391 schema: 7392 $ref: "#/definitions/ErrorResponse" 7393 examples: 7394 application/json: 7395 message: "No such container: c2ada9df5af8" 7396 500: 7397 description: "server error" 7398 schema: 7399 $ref: "#/definitions/ErrorResponse" 7400 parameters: 7401 - name: "id" 7402 in: "path" 7403 required: true 7404 description: "ID or name of the container" 7405 type: "string" 7406 - name: "details" 7407 in: "query" 7408 description: "Show extra details provided to logs." 7409 type: "boolean" 7410 default: false 7411 - name: "follow" 7412 in: "query" 7413 description: | 7414 Return the logs as a stream. 7415 7416 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). 7417 type: "boolean" 7418 default: false 7419 - name: "stdout" 7420 in: "query" 7421 description: "Return logs from `stdout`" 7422 type: "boolean" 7423 default: false 7424 - name: "stderr" 7425 in: "query" 7426 description: "Return logs from `stderr`" 7427 type: "boolean" 7428 default: false 7429 - name: "since" 7430 in: "query" 7431 description: "Only return logs since this time, as a UNIX timestamp" 7432 type: "integer" 7433 default: 0 7434 - name: "timestamps" 7435 in: "query" 7436 description: "Add timestamps to every log line" 7437 type: "boolean" 7438 default: false 7439 - name: "tail" 7440 in: "query" 7441 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." 7442 type: "string" 7443 default: "all" 7444 tags: ["Service"] 7445 /tasks: 7446 get: 7447 summary: "List tasks" 7448 operationId: "TaskList" 7449 produces: 7450 - "application/json" 7451 responses: 7452 200: 7453 description: "no error" 7454 schema: 7455 type: "array" 7456 items: 7457 $ref: "#/definitions/Task" 7458 example: 7459 - ID: "0kzzo1i0y4jz6027t0k7aezc7" 7460 Version: 7461 Index: 71 7462 CreatedAt: "2016-06-07T21:07:31.171892745Z" 7463 UpdatedAt: "2016-06-07T21:07:31.376370513Z" 7464 Spec: 7465 ContainerSpec: 7466 Image: "redis" 7467 Resources: 7468 Limits: {} 7469 Reservations: {} 7470 RestartPolicy: 7471 Condition: "any" 7472 MaxAttempts: 0 7473 Placement: {} 7474 ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" 7475 Slot: 1 7476 NodeID: "60gvrl6tm78dmak4yl7srz94v" 7477 Status: 7478 Timestamp: "2016-06-07T21:07:31.290032978Z" 7479 State: "running" 7480 Message: "started" 7481 ContainerStatus: 7482 ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" 7483 PID: 677 7484 DesiredState: "running" 7485 NetworksAttachments: 7486 - Network: 7487 ID: "4qvuz4ko70xaltuqbt8956gd1" 7488 Version: 7489 Index: 18 7490 CreatedAt: "2016-06-07T20:31:11.912919752Z" 7491 UpdatedAt: "2016-06-07T21:07:29.955277358Z" 7492 Spec: 7493 Name: "ingress" 7494 Labels: 7495 com.docker.swarm.internal: "true" 7496 DriverConfiguration: {} 7497 IPAMOptions: 7498 Driver: {} 7499 Configs: 7500 - Subnet: "10.255.0.0/16" 7501 Gateway: "10.255.0.1" 7502 DriverState: 7503 Name: "overlay" 7504 Options: 7505 com.docker.network.driver.overlay.vxlanid_list: "256" 7506 IPAMOptions: 7507 Driver: 7508 Name: "default" 7509 Configs: 7510 - Subnet: "10.255.0.0/16" 7511 Gateway: "10.255.0.1" 7512 Addresses: 7513 - "10.255.0.10/16" 7514 - ID: "1yljwbmlr8er2waf8orvqpwms" 7515 Version: 7516 Index: 30 7517 CreatedAt: "2016-06-07T21:07:30.019104782Z" 7518 UpdatedAt: "2016-06-07T21:07:30.231958098Z" 7519 Name: "hopeful_cori" 7520 Spec: 7521 ContainerSpec: 7522 Image: "redis" 7523 Resources: 7524 Limits: {} 7525 Reservations: {} 7526 RestartPolicy: 7527 Condition: "any" 7528 MaxAttempts: 0 7529 Placement: {} 7530 ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" 7531 Slot: 1 7532 NodeID: "60gvrl6tm78dmak4yl7srz94v" 7533 Status: 7534 Timestamp: "2016-06-07T21:07:30.202183143Z" 7535 State: "shutdown" 7536 Message: "shutdown" 7537 ContainerStatus: 7538 ContainerID: "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213" 7539 DesiredState: "shutdown" 7540 NetworksAttachments: 7541 - Network: 7542 ID: "4qvuz4ko70xaltuqbt8956gd1" 7543 Version: 7544 Index: 18 7545 CreatedAt: "2016-06-07T20:31:11.912919752Z" 7546 UpdatedAt: "2016-06-07T21:07:29.955277358Z" 7547 Spec: 7548 Name: "ingress" 7549 Labels: 7550 com.docker.swarm.internal: "true" 7551 DriverConfiguration: {} 7552 IPAMOptions: 7553 Driver: {} 7554 Configs: 7555 - Subnet: "10.255.0.0/16" 7556 Gateway: "10.255.0.1" 7557 DriverState: 7558 Name: "overlay" 7559 Options: 7560 com.docker.network.driver.overlay.vxlanid_list: "256" 7561 IPAMOptions: 7562 Driver: 7563 Name: "default" 7564 Configs: 7565 - Subnet: "10.255.0.0/16" 7566 Gateway: "10.255.0.1" 7567 Addresses: 7568 - "10.255.0.5/16" 7569 7570 500: 7571 description: "server error" 7572 schema: 7573 $ref: "#/definitions/ErrorResponse" 7574 parameters: 7575 - name: "filters" 7576 in: "query" 7577 type: "string" 7578 description: | 7579 A JSON encoded value of the filters (a `map[string][]string`) to process on the tasks list. Available filters: 7580 7581 - `id=<task id>` 7582 - `name=<task name>` 7583 - `service=<service name>` 7584 - `node=<node id or name>` 7585 - `label=key` or `label="key=value"` 7586 - `desired-state=(running | shutdown | accepted)` 7587 tags: ["Task"] 7588 /tasks/{id}: 7589 get: 7590 summary: "Inspect a task" 7591 operationId: "TaskInspect" 7592 produces: 7593 - "application/json" 7594 responses: 7595 200: 7596 description: "no error" 7597 schema: 7598 $ref: "#/definitions/Task" 7599 404: 7600 description: "no such task" 7601 schema: 7602 $ref: "#/definitions/ErrorResponse" 7603 500: 7604 description: "server error" 7605 schema: 7606 $ref: "#/definitions/ErrorResponse" 7607 parameters: 7608 - name: "id" 7609 in: "path" 7610 description: "ID of the task" 7611 required: true 7612 type: "string" 7613 tags: ["Task"] 7614 /secrets: 7615 get: 7616 summary: "List secrets" 7617 operationId: "SecretList" 7618 produces: 7619 - "application/json" 7620 responses: 7621 200: 7622 description: "no error" 7623 schema: 7624 type: "array" 7625 items: 7626 $ref: "#/definitions/Secret" 7627 example: 7628 - ID: "ktnbjxoalbkvbvedmg1urrz8h" 7629 Version: 7630 Index: 11 7631 CreatedAt: "2016-11-05T01:20:17.327670065Z" 7632 UpdatedAt: "2016-11-05T01:20:17.327670065Z" 7633 Spec: 7634 Name: "app-dev.crt" 7635 500: 7636 description: "server error" 7637 schema: 7638 $ref: "#/definitions/ErrorResponse" 7639 parameters: 7640 - name: "filters" 7641 in: "query" 7642 type: "string" 7643 description: | 7644 A JSON encoded value of the filters (a `map[string][]string`) to process on the secrets list. Available filters: 7645 7646 - `names=<secret name>` 7647 tags: ["Secret"] 7648 /secrets/create: 7649 post: 7650 summary: "Create a secret" 7651 operationId: "SecretCreate" 7652 consumes: 7653 - "application/json" 7654 produces: 7655 - "application/json" 7656 responses: 7657 201: 7658 description: "no error" 7659 schema: 7660 type: "object" 7661 properties: 7662 ID: 7663 description: "The ID of the created secret." 7664 type: "string" 7665 example: 7666 ID: "ktnbjxoalbkvbvedmg1urrz8h" 7667 406: 7668 description: "server error or node is not part of a swarm" 7669 schema: 7670 $ref: "#/definitions/ErrorResponse" 7671 409: 7672 description: "name conflicts with an existing object" 7673 schema: 7674 $ref: "#/definitions/ErrorResponse" 7675 500: 7676 description: "server error" 7677 schema: 7678 $ref: "#/definitions/ErrorResponse" 7679 parameters: 7680 - name: "body" 7681 in: "body" 7682 schema: 7683 allOf: 7684 - $ref: "#/definitions/SecretSpec" 7685 - type: "object" 7686 example: 7687 Name: "app-key.crt" 7688 Labels: 7689 foo: "bar" 7690 Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" 7691 tags: ["Secret"] 7692 /secrets/{id}: 7693 get: 7694 summary: "Inspect a secret" 7695 operationId: "SecretInspect" 7696 produces: 7697 - "application/json" 7698 responses: 7699 200: 7700 description: "no error" 7701 schema: 7702 $ref: "#/definitions/Secret" 7703 example: 7704 ID: "ktnbjxoalbkvbvedmg1urrz8h" 7705 Version: 7706 Index: 11 7707 CreatedAt: "2016-11-05T01:20:17.327670065Z" 7708 UpdatedAt: "2016-11-05T01:20:17.327670065Z" 7709 Spec: 7710 Name: "app-dev.crt" 7711 404: 7712 description: "secret not found" 7713 schema: 7714 $ref: "#/definitions/ErrorResponse" 7715 406: 7716 description: "node is not part of a swarm" 7717 schema: 7718 $ref: "#/definitions/ErrorResponse" 7719 500: 7720 description: "server error" 7721 schema: 7722 $ref: "#/definitions/ErrorResponse" 7723 parameters: 7724 - name: "id" 7725 in: "path" 7726 required: true 7727 type: "string" 7728 description: "ID of the secret" 7729 tags: ["Secret"] 7730 delete: 7731 summary: "Delete a secret" 7732 operationId: "SecretDelete" 7733 produces: 7734 - "application/json" 7735 responses: 7736 204: 7737 description: "no error" 7738 404: 7739 description: "secret not found" 7740 schema: 7741 $ref: "#/definitions/ErrorResponse" 7742 500: 7743 description: "server error" 7744 schema: 7745 $ref: "#/definitions/ErrorResponse" 7746 parameters: 7747 - name: "id" 7748 in: "path" 7749 required: true 7750 type: "string" 7751 description: "ID of the secret" 7752 tags: ["Secret"] 7753 /secrets/{id}/update: 7754 post: 7755 summary: "Update a Secret" 7756 operationId: "SecretUpdate" 7757 responses: 7758 200: 7759 description: "no error" 7760 404: 7761 description: "no such secret" 7762 schema: 7763 $ref: "#/definitions/ErrorResponse" 7764 500: 7765 description: "server error" 7766 schema: 7767 $ref: "#/definitions/ErrorResponse" 7768 parameters: 7769 - name: "id" 7770 in: "path" 7771 description: "The ID of the secret" 7772 type: "string" 7773 required: true 7774 - name: "body" 7775 in: "body" 7776 schema: 7777 $ref: "#/definitions/SecretSpec" 7778 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." 7779 - name: "version" 7780 in: "query" 7781 description: "The version number of the secret object being updated. This is required to avoid conflicting writes." 7782 type: "integer" 7783 format: "int64" 7784 required: true 7785 tags: ["Secret"]