diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..0afe225a --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: flavioheleno diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..e5fae30f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + # Maintain dependencies for PHP Packages + - package-ecosystem: "composer" + directory: "/" + schedule: + interval: "daily" diff --git a/.gitignore b/.gitignore index 8a52ffd1..b98b4400 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ vendor/ composer.lock -.php_cs.cache \ No newline at end of file +/.php-cs-fixer.cache diff --git a/.jane-openapi b/.jane-openapi index 16230b9d..85e86f26 100644 --- a/.jane-openapi +++ b/.jane-openapi @@ -1,9 +1,11 @@ 'src', - 'namespace' => 'Docker\\API', - 'openapi-file' => __DIR__ . '/docker-swagger.yaml', - 'async' => true, - 'strict' => false, -]; \ No newline at end of file + 'date-prefer-interface' => true, + 'directory' => __DIR__ . '/src', + 'namespace' => 'Docker\\API', + 'openapi-file' => __DIR__ . '/spec/v1.45.json', + 'reference' => true, + 'strict' => false, + 'date-input-format' => 'Y-m-d\TH:i:s.uuP', +]; diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 00000000..6e0b4608 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,44 @@ +in([ + __DIR__.'/src', + ]); + +$config = new \PhpCsFixer\Config(); +return $config + ->setRules([ + '@Symfony' => true, + '@Symfony:risky' => true, + '@PHP56Migration:risky' => true, + '@PHP70Migration' => true, + '@PHP70Migration:risky' => true, + '@PHP71Migration' => true, + '@PHP71Migration:risky' => true, + '@PHP73Migration' => true, + '@PHP74Migration' => true, + '@PHP74Migration:risky' => true, + '@PHP80Migration' => true, + '@PHP80Migration:risky' => true, + 'array_syntax' => [ + 'syntax' => 'short' + ], + 'align_multiline_comment' => true, + 'combine_consecutive_unsets' => true, + 'declare_strict_types' => true, + 'linebreak_after_opening_tag' => true, + 'modernize_types_casting' => true, + 'native_function_invocation' => true, + 'no_php4_constructor' => true, + 'ordered_imports' => true, + 'php_unit_strict' => true, + 'phpdoc_line_span' => true, + 'phpdoc_order' => true, + 'strict_comparison' => true, + 'strict_param' => true, + ]) + ->setRiskyAllowed(true) + ->setIndent(' ') + ->setLineEnding("\n") + ->setFinder($finder) +; diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..77be66a0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2017 Joel Wurtz and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md index 43e2521e..35ec10f1 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,10 @@ -# No longer maintained - -I'm backing off maintaining this library due to a lack of motivation, time and usage of docker, contact me on twitter https://twitter.com/joelwurtz if you wish to take over this repository (or just do a fork). - # Docker PHP Api -Generated API Client from OpenAPI specification of Docker, by Jane OpenAPI Client generator. +Generated API Client from OpenAPI specification of [Docker](https://www.docker.com/), by [Jane](https://github.com/janephp/janephp) OpenAPI Client generator. ## Usage -You should not use this library directly, please use the docker-php one instead. +You should not use this library directly, please use the [docker-php](https://github.com/docker-php/docker-php) one instead. ## Versioning @@ -20,4 +16,12 @@ This library does *not* respect semver and will instead follow Jane OpenAPI vers So 4.1.25.0 is the version 1.25 of Docker API generated with Jane OpenAPI in a 4.X version. -You should always fix the version, or at least the 3 first numbers (4.1.25.*) +You should always fix the version, or at least the 3 first numbers (4.1.25.\*) + +## Credits + +This library is a fork of the original [docker-php-api](https://github.com/docker-php/docker-php-api), created by [Joel Wurtz](https://github.com/joelwurtz). + +## License + +The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/composer.json b/composer.json index f901f8f1..cd5f9f6a 100644 --- a/composer.json +++ b/composer.json @@ -1,32 +1,73 @@ { - "name": "docker-php/docker-php-api", + "name": "beluga-php/docker-php-api", + "description": "Docker API generated files from OpenAPI Specification", "license": "MIT", "type": "library", - "description": "Docker API generated files from OpenAPI Specification", - "autoload": { - "psr-4": { - "Docker\\API\\": "src/" + "funding": [ + { + "type": "github", + "url": "https://github.com/flavioheleno" } - }, + ], "require": { - "php": ">=7.1", - "jane-php/open-api-runtime": "^4.0" + "php": ">=8.1", + "ext-mbstring": "*", + "jane-php/json-schema-runtime": "^7.5", + "jane-php/open-api-runtime": "^7.5", + "php-http/client-common": "^2.7", + "php-http/discovery": "^1.19", + "php-http/multipart-stream-builder": "^1.3", + "psr/http-client": "^1.0", + "psr/http-client-implementation": "*", + "psr/http-factory": "^1.0", + "psr/http-factory-implementation": "*", + "psr/http-message": "^2.0", + "psr/http-message-implementation": "*", + "symfony/deprecation-contracts": "^3.3", + "symfony/options-resolver": "^6.3 || ^7.0", + "symfony/serializer": "^6.3 || ^7.0", + "symfony/validator": "^6.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^6.0", - "friendsofphp/php-cs-fixer": "^2.9", - "jane-php/open-api": "^4.0", - "jane-php/json-schema": "^4.0", - "amphp/artax": "^3.0" + "ergebnis/composer-normalize": "^2.42", + "friendsofphp/php-cs-fixer": "^3.8", + "jane-php/open-api-3": "^7.4", + "roave/security-advisories": "dev-latest" + }, + "conflict": { + "docker-php/docker-php-api": "*" }, - "suggest": { - "amphp/artax": "To use the async api" + "minimum-stability": "dev", + "prefer-stable": true, + "autoload": { + "psr-4": { + "Docker\\API\\": "src/" + } + }, + "config": { + "allow-plugins": { + "ergebnis/composer-normalize": true, + "php-http/discovery": false + }, + "optimize-autoloader": true, + "preferred-install": "dist", + "sort-packages": true }, "extra": { "branch-alias": { - "4.1.36": "4.1.36.x-dev" + "6.1.36": "6.1.36.x-dev", + "6.1.41": "6.1.41.x-dev", + "7.1.41": "7.1.41.x-dev", + "7.1.42": "7.1.42.x-dev", + "dev-main": "7.1.43.x-dev" } }, - "minimum-stability": "dev", - "prefer-stable": true + "scripts": { + "generate": [ + "vendor/bin/jane-openapi generate", + "cat patches/*.patch | patch -s -p1" + ], + "lint": "vendor/bin/php-cs-fixer fix --dry-run --verbose --diff", + "lint-fix": "vendor/bin/php-cs-fixer fix --verbose" + } } diff --git a/docker-swagger.yaml b/docker-swagger.yaml deleted file mode 100644 index 5d77c604..00000000 --- a/docker-swagger.yaml +++ /dev/null @@ -1,10023 +0,0 @@ -# A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API. -# -# This is used for generating API documentation and the types used by the -# client/server. See api/README.md for more information. -# -# Some style notes: -# - This file is used by ReDoc, which allows GitHub Flavored Markdown in -# descriptions. -# - There is no maximum line length, for ease of editing and pretty diffs. -# - operationIds are in the format "NounVerb", with a singular noun. - -swagger: "2.0" -schemes: - - "http" - - "https" -produces: - - "application/json" - - "text/plain" -consumes: - - "application/json" - - "text/plain" -basePath: "/v1.36" -info: - title: "Docker Engine API" - version: "1.36" - x-logo: - url: "https://docs.docker.com/images/logo-docker-main.png" - description: | - 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. - - 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. - - # Errors - - 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: - - ``` - { - "message": "page not found" - } - ``` - - # Versioning - - The API is usually changed in each release, so API calls are versioned to - ensure that clients don't break. To lock to a specific version of the API, - you prefix the URL with its version, for example, call `/v1.30/info` to use - the v1.30 version of the `/info` endpoint. If the API version specified in - the URL is not supported by the daemon, a HTTP `400 Bad Request` error message - is returned. - - If you omit the version-prefix, the current version of the API (v1.36) is used. - For example, calling `/info` is the same as calling `/v1.36/info`. Using the - API without a version-prefix is deprecated and will be removed in a future release. - - 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. - - 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 - daemons. - - - # Authentication - - 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: - - ``` - { - "username": "string", - "password": "string", - "email": "string", - "serveraddress": "string" - } - ``` - - The `serveraddress` is a domain/IP without a protocol. Throughout this structure, double quotes are required. - - If you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth), you can just pass this instead of credentials: - - ``` - { - "identitytoken": "9cbaf023786cd7..." - } - ``` - -# The tags on paths define the menu sections in the ReDoc documentation, so -# the usage of tags must make sense for that: -# - They should be singular, not plural. -# - There should not be too many tags, or the menu becomes unwieldy. For -# example, it is preferable to add a path to the "System" tag instead of -# creating a tag with a single path in it. -# - The order of tags in this list defines the order in the menu. -tags: - # Primary objects - - name: "Container" - x-displayName: "Containers" - description: | - Create and manage containers. - - name: "Image" - x-displayName: "Images" - - name: "Network" - x-displayName: "Networks" - description: | - 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. - - name: "Volume" - x-displayName: "Volumes" - description: | - Create and manage persistent storage that can be attached to containers. - - name: "Exec" - x-displayName: "Exec" - description: | - Run new commands inside running containers. See the [command-line reference](https://docs.docker.com/engine/reference/commandline/exec/) for more information. - - 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`. - # Swarm things - - name: "Swarm" - x-displayName: "Swarm" - description: | - Engines can be clustered together in a swarm. See [the swarm mode documentation](https://docs.docker.com/engine/swarm/) for more information. - - name: "Node" - x-displayName: "Nodes" - description: | - Nodes are instances of the Engine participating in a swarm. Swarm mode must be enabled for these endpoints to work. - - name: "Service" - x-displayName: "Services" - description: | - Services are the definitions of tasks to run on a swarm. Swarm mode must be enabled for these endpoints to work. - - name: "Task" - x-displayName: "Tasks" - description: | - 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. - - name: "Secret" - x-displayName: "Secrets" - description: | - Secrets are sensitive data that can be used by services. Swarm mode must be enabled for these endpoints to work. - - name: "Config" - x-displayName: "Configs" - description: | - Configs are application configurations that can be used by services. Swarm mode must be enabled for these endpoints to work. - # System things - - name: "Plugin" - x-displayName: "Plugins" - - name: "System" - x-displayName: "System" - -definitions: - Port: - type: "object" - description: "An open port on a container" - required: [PrivatePort, Type] - properties: - IP: - type: "string" - format: "ip-address" - PrivatePort: - type: "integer" - format: "uint16" - x-nullable: false - description: "Port on the container" - PublicPort: - type: "integer" - format: "uint16" - description: "Port exposed on the host" - Type: - type: "string" - x-nullable: false - enum: ["tcp", "udp"] - example: - PrivatePort: 8080 - PublicPort: 80 - Type: "tcp" - - MountPoint: - type: "object" - description: "A mount point inside a container" - properties: - Type: - type: "string" - Name: - type: "string" - Source: - type: "string" - Destination: - type: "string" - Driver: - type: "string" - Mode: - type: "string" - RW: - type: "boolean" - Propagation: - type: "string" - - DeviceMapping: - type: "object" - description: "A device mapping between the host and container" - properties: - PathOnHost: - type: "string" - PathInContainer: - type: "string" - CgroupPermissions: - type: "string" - example: - PathOnHost: "/dev/deviceName" - PathInContainer: "/dev/deviceName" - CgroupPermissions: "mrw" - - ThrottleDevice: - type: "object" - properties: - Path: - description: "Device path" - type: "string" - Rate: - description: "Rate" - type: "integer" - format: "int64" - minimum: 0 - - Mount: - type: "object" - properties: - Target: - description: "Container path." - type: "string" - Source: - description: "Mount source (e.g. a volume name, a host path)." - type: "string" - Type: - description: | - The mount type. Available types: - - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. - - `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. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - ReadOnly: - description: "Whether the mount should be read-only." - type: "boolean" - Consistency: - description: "The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`." - type: "string" - BindOptions: - description: "Optional configuration for the `bind` type." - type: "object" - properties: - Propagation: - description: "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`." - type: "string" - enum: - - "private" - - "rprivate" - - "shared" - - "rshared" - - "slave" - - "rslave" - VolumeOptions: - description: "Optional configuration for the `volume` type." - type: "object" - properties: - NoCopy: - description: "Populate volume with data from the target." - type: "boolean" - default: false - Labels: - description: "User-defined key/value metadata." - type: "object" - additionalProperties: - type: "string" - DriverConfig: - description: "Map of driver specific options" - type: "object" - properties: - Name: - description: "Name of the driver to use to create the volume." - type: "string" - Options: - description: "key/value map of driver specific options." - type: "object" - additionalProperties: - type: "string" - TmpfsOptions: - description: "Optional configuration for the `tmpfs` type." - type: "object" - properties: - SizeBytes: - description: "The size for the tmpfs mount in bytes." - type: "integer" - format: "int64" - Mode: - description: "The permission mode for the tmpfs mount in an integer." - type: "integer" - - RestartPolicy: - description: | - The behavior to apply when the container exits. The default is not to restart. - - An ever increasing delay (double the previous delay, starting at 100ms) is added before each restart to prevent flooding the server. - type: "object" - properties: - Name: - type: "string" - description: | - - Empty string means not to restart - - `always` Always restart - - `unless-stopped` Restart always except when the user has manually stopped the container - - `on-failure` Restart only when the container exit code is non-zero - enum: - - "" - - "always" - - "unless-stopped" - - "on-failure" - MaximumRetryCount: - type: "integer" - description: "If `on-failure` is used, the number of times to retry before giving up" - - Resources: - description: "A container's resources (cgroups config, ulimits, etc)" - type: "object" - properties: - # Applicable to all platforms - CpuShares: - description: "An integer value representing this container's relative CPU weight versus other containers." - type: "integer" - Memory: - description: "Memory limit in bytes." - type: "integer" - format: "int64" - default: 0 - # Applicable to UNIX platforms - CgroupParent: - description: "Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist." - type: "string" - BlkioWeight: - description: "Block IO weight (relative weight)." - type: "integer" - minimum: 0 - maximum: 1000 - BlkioWeightDevice: - description: | - Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. - type: "array" - items: - type: "object" - properties: - Path: - type: "string" - Weight: - type: "integer" - minimum: 0 - BlkioDeviceReadBps: - description: | - Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. - type: "array" - items: - $ref: "#/definitions/ThrottleDevice" - BlkioDeviceWriteBps: - description: | - Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. - type: "array" - items: - $ref: "#/definitions/ThrottleDevice" - BlkioDeviceReadIOps: - description: | - Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. - type: "array" - items: - $ref: "#/definitions/ThrottleDevice" - BlkioDeviceWriteIOps: - description: | - Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. - type: "array" - items: - $ref: "#/definitions/ThrottleDevice" - CpuPeriod: - description: "The length of a CPU period in microseconds." - type: "integer" - format: "int64" - CpuQuota: - description: "Microseconds of CPU time that the container can get in a CPU period." - type: "integer" - format: "int64" - CpuRealtimePeriod: - description: "The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks." - type: "integer" - format: "int64" - CpuRealtimeRuntime: - description: "The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks." - type: "integer" - format: "int64" - CpusetCpus: - description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)" - type: "string" - example: "0-3" - CpusetMems: - description: "Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems." - type: "string" - Devices: - description: "A list of devices to add to the container." - type: "array" - items: - $ref: "#/definitions/DeviceMapping" - DeviceCgroupRules: - description: "a list of cgroup rules to apply to the container" - type: "array" - items: - type: "string" - example: "c 13:* rwm" - DiskQuota: - description: "Disk limit (in bytes)." - type: "integer" - format: "int64" - KernelMemory: - description: "Kernel memory limit in bytes." - type: "integer" - format: "int64" - MemoryReservation: - description: "Memory soft limit in bytes." - type: "integer" - format: "int64" - MemorySwap: - description: "Total memory limit (memory + swap). Set as `-1` to enable unlimited swap." - type: "integer" - format: "int64" - MemorySwappiness: - description: "Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100." - type: "integer" - format: "int64" - minimum: 0 - maximum: 100 - NanoCPUs: - description: "CPU quota in units of 10-9 CPUs." - type: "integer" - format: "int64" - OomKillDisable: - description: "Disable OOM Killer for the container." - type: "boolean" - PidsLimit: - description: "Tune a container's pids limit. Set -1 for unlimited." - type: "integer" - format: "int64" - Ulimits: - description: | - A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" - type: "array" - items: - type: "object" - properties: - Name: - description: "Name of ulimit" - type: "string" - Soft: - description: "Soft limit" - type: "integer" - Hard: - description: "Hard limit" - type: "integer" - # Applicable to Windows - CpuCount: - description: | - The number of usable CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - type: "integer" - format: "int64" - CpuPercent: - description: | - The usable percentage of the available CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - type: "integer" - format: "int64" - IOMaximumIOps: - description: "Maximum IOps for the container system drive (Windows only)" - type: "integer" - format: "int64" - IOMaximumBandwidth: - description: "Maximum IO in bytes per second for the container system drive (Windows only)" - type: "integer" - format: "int64" - - ResourceObject: - description: "An object describing the resources which can be advertised by a node and requested by a task" - type: "object" - properties: - NanoCPUs: - type: "integer" - format: "int64" - example: 4000000000 - MemoryBytes: - type: "integer" - format: "int64" - example: 8272408576 - GenericResources: - $ref: "#/definitions/GenericResources" - - GenericResources: - description: "User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`)" - type: "array" - items: - type: "object" - properties: - NamedResourceSpec: - type: "object" - properties: - Kind: - type: "string" - Value: - type: "string" - DiscreteResourceSpec: - type: "object" - properties: - Kind: - type: "string" - Value: - type: "integer" - format: "int64" - example: - - DiscreteResourceSpec: - Kind: "SSD" - Value: 3 - - NamedResourceSpec: - Kind: "GPU" - Value: "UUID1" - - NamedResourceSpec: - Kind: "GPU" - Value: "UUID2" - - HealthConfig: - description: "A test to perform to check that the container is healthy." - type: "object" - properties: - Test: - description: | - The test to perform. Possible values are: - - - `[]` inherit healthcheck from image or parent image - - `["NONE"]` disable healthcheck - - `["CMD", args...]` exec arguments directly - - `["CMD-SHELL", command]` run command with system's default shell - type: "array" - items: - type: "string" - Interval: - description: "The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit." - type: "integer" - Timeout: - description: "The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit." - type: "integer" - Retries: - description: "The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit." - type: "integer" - StartPeriod: - description: "Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit." - type: "integer" - - HostConfig: - description: "Container configuration that depends on the host we are running on" - allOf: - - $ref: "#/definitions/Resources" - - type: "object" - properties: - # Applicable to all platforms - Binds: - type: "array" - description: | - A list of volume bindings for this container. Each volume binding is a string in one of these forms: - - - `host-src:container-dest` to bind-mount a host path into the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `host-src:container-dest:ro` to make the bind mount read-only inside the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `volume-name:container-dest` to bind-mount a volume managed by a volume driver into the container. `container-dest` must be an _absolute_ path. - - `volume-name:container-dest:ro` to mount the volume read-only inside the container. `container-dest` must be an _absolute_ path. - items: - type: "string" - ContainerIDFile: - type: "string" - description: "Path to a file where the container ID is written" - LogConfig: - type: "object" - description: "The logging configuration for this container" - properties: - Type: - type: "string" - enum: - - "json-file" - - "syslog" - - "journald" - - "gelf" - - "fluentd" - - "awslogs" - - "splunk" - - "etwlogs" - - "none" - Config: - type: "object" - additionalProperties: - type: "string" - NetworkMode: - type: "string" - description: "Network mode to use for this container. Supported standard values are: `bridge`, `host`, `none`, and `container:`. Any other value is taken - as a custom network's name to which this container should connect to." - PortBindings: - $ref: "#/definitions/PortMap" - RestartPolicy: - $ref: "#/definitions/RestartPolicy" - AutoRemove: - type: "boolean" - description: "Automatically remove the container when the container's process exits. This has no effect if `RestartPolicy` is set." - VolumeDriver: - type: "string" - description: "Driver that this container uses to mount volumes." - VolumesFrom: - type: "array" - description: "A list of volumes to inherit from another container, specified in the form `[:]`." - items: - type: "string" - Mounts: - description: "Specification for mounts to be added to the container." - type: "array" - items: - $ref: "#/definitions/Mount" - - # Applicable to UNIX platforms - CapAdd: - type: "array" - description: "A list of kernel capabilities to add to the container." - items: - type: "string" - CapDrop: - type: "array" - description: "A list of kernel capabilities to drop from the container." - items: - type: "string" - Dns: - type: "array" - description: "A list of DNS servers for the container to use." - items: - type: "string" - DnsOptions: - type: "array" - description: "A list of DNS options." - items: - type: "string" - DnsSearch: - type: "array" - description: "A list of DNS search domains." - items: - type: "string" - ExtraHosts: - type: "array" - description: | - A list of hostnames/IP mappings to add to the container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. - items: - type: "string" - GroupAdd: - type: "array" - description: "A list of additional groups that the container process will run as." - items: - type: "string" - IpcMode: - type: "string" - description: | - IPC sharing mode for the container. Possible values are: - - - `"none"`: own private IPC namespace, with /dev/shm not mounted - - `"private"`: own private IPC namespace - - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers - - `"container:"`: join another (shareable) container's IPC namespace - - `"host"`: use the host system's IPC namespace - - If not specified, daemon default is used, which can either be `"private"` - or `"shareable"`, depending on daemon version and configuration. - Cgroup: - type: "string" - description: "Cgroup to use for the container." - Links: - type: "array" - description: "A list of links for the container in the form `container_name:alias`." - items: - type: "string" - OomScoreAdj: - type: "integer" - description: "An integer value containing the score given to the container in order to tune OOM killer preferences." - example: 500 - PidMode: - type: "string" - description: | - Set the PID (Process) Namespace mode for the container. It can be either: - - - `"container:"`: joins another container's PID namespace - - `"host"`: use the host's PID namespace inside the container - Privileged: - type: "boolean" - description: "Gives the container full access to the host." - PublishAllPorts: - type: "boolean" - description: | - Allocates an ephemeral host port for all of a container's - exposed ports. - - Ports are de-allocated when the container stops and allocated when the container starts. - The allocated port might be changed when restarting the container. - - The port is selected from the ephemeral port range that depends on the kernel. - For example, on Linux the range is defined by `/proc/sys/net/ipv4/ip_local_port_range`. - ReadonlyRootfs: - type: "boolean" - description: "Mount the container's root filesystem as read only." - SecurityOpt: - type: "array" - description: "A list of string values to customize labels for MLS - systems, such as SELinux." - items: - type: "string" - StorageOpt: - type: "object" - description: | - Storage driver options for this container, in the form `{"size": "120G"}`. - additionalProperties: - type: "string" - Tmpfs: - type: "object" - description: | - A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options. For example: `{ "/run": "rw,noexec,nosuid,size=65536k" }`. - additionalProperties: - type: "string" - UTSMode: - type: "string" - description: "UTS namespace to use for the container." - UsernsMode: - type: "string" - description: "Sets the usernamespace mode for the container when usernamespace remapping option is enabled." - ShmSize: - type: "integer" - description: "Size of `/dev/shm` in bytes. If omitted, the system uses 64MB." - minimum: 0 - Sysctls: - type: "object" - description: | - A list of kernel parameters (sysctls) to set in the container. For example: `{"net.ipv4.ip_forward": "1"}` - additionalProperties: - type: "string" - Runtime: - type: "string" - description: "Runtime to use with this container." - # Applicable to Windows - ConsoleSize: - type: "array" - description: "Initial console size, as an `[height, width]` array. (Windows only)" - minItems: 2 - maxItems: 2 - items: - type: "integer" - minimum: 0 - Isolation: - type: "string" - description: "Isolation technology of the container. (Windows only)" - enum: - - "default" - - "process" - - "hyperv" - - ContainerConfig: - description: "Configuration for a container that is portable between hosts" - type: "object" - properties: - Hostname: - description: "The hostname to use for the container, as a valid RFC 1123 hostname." - type: "string" - Domainname: - description: "The domain name to use for the container." - type: "string" - User: - description: "The user that commands are run as inside the container." - type: "string" - AttachStdin: - description: "Whether to attach to `stdin`." - type: "boolean" - default: false - AttachStdout: - description: "Whether to attach to `stdout`." - type: "boolean" - default: true - AttachStderr: - description: "Whether to attach to `stderr`." - type: "boolean" - default: true - ExposedPorts: - description: | - An object mapping ports to an empty object in the form: - - `{"/": {}}` - type: "object" - additionalProperties: - type: "object" - enum: - - {} - default: {} - Tty: - description: "Attach standard streams to a TTY, including `stdin` if it is not closed." - type: "boolean" - default: false - OpenStdin: - description: "Open `stdin`" - type: "boolean" - default: false - StdinOnce: - description: "Close `stdin` after one attached client disconnects" - type: "boolean" - default: false - Env: - description: | - A list of environment variables to set inside the container in the form `["VAR=value", ...]`. A variable without `=` is removed from the environment, rather than to have an empty value. - type: "array" - items: - type: "string" - Cmd: - description: "Command to run specified as a string or an array of strings." - type: "array" - items: - type: "string" - Healthcheck: - $ref: "#/definitions/HealthConfig" - ArgsEscaped: - description: "Command is already escaped (Windows only)" - type: "boolean" - Image: - description: "The name of the image to use when creating the container" - type: "string" - Volumes: - description: "An object mapping mount point paths inside the container to empty objects." - type: "object" - additionalProperties: - type: "object" - enum: - - {} - default: {} - WorkingDir: - description: "The working directory for commands to run in." - type: "string" - Entrypoint: - description: | - The entry point for the container as a string or an array of strings. - - If the array consists of exactly one empty string (`[""]`) then the entry point is reset to system default (i.e., the entry point used by docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). - type: "array" - items: - type: "string" - NetworkDisabled: - description: "Disable networking for the container." - type: "boolean" - MacAddress: - description: "MAC address of the container." - type: "string" - OnBuild: - description: "`ONBUILD` metadata that were defined in the image's `Dockerfile`." - type: "array" - items: - type: "string" - Labels: - description: "User-defined key/value metadata." - type: "object" - additionalProperties: - type: "string" - StopSignal: - description: "Signal to stop a container as a string or unsigned integer." - type: "string" - default: "SIGTERM" - StopTimeout: - description: "Timeout to stop a container in seconds." - type: "integer" - default: 10 - Shell: - description: "Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell." - type: "array" - items: - type: "string" - - NetworkSettings: - description: "NetworkSettings exposes the network settings in the API" - type: "object" - properties: - Bridge: - description: Name of the network'a bridge (for example, `docker0`). - type: "string" - example: "docker0" - SandboxID: - description: SandboxID uniquely represents a container's network stack. - type: "string" - example: "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3" - HairpinMode: - description: | - Indicates if hairpin NAT should be enabled on the virtual interface. - type: "boolean" - example: false - LinkLocalIPv6Address: - description: IPv6 unicast address using the link-local prefix. - type: "string" - example: "fe80::42:acff:fe11:1" - LinkLocalIPv6PrefixLen: - description: Prefix length of the IPv6 unicast address. - type: "integer" - example: "64" - Ports: - $ref: "#/definitions/PortMap" - SandboxKey: - description: SandboxKey identifies the sandbox - type: "string" - example: "/var/run/docker/netns/8ab54b426c38" - - # TODO is SecondaryIPAddresses actually used? - SecondaryIPAddresses: - description: "" - type: "array" - items: - $ref: "#/definitions/Address" - x-nullable: true - - # TODO is SecondaryIPv6Addresses actually used? - SecondaryIPv6Addresses: - description: "" - type: "array" - items: - $ref: "#/definitions/Address" - x-nullable: true - - # TODO properties below are part of DefaultNetworkSettings, which is - # marked as deprecated since Docker 1.9 and to be removed in Docker v17.12 - EndpointID: - description: | - EndpointID uniquely represents a service endpoint in a Sandbox. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - type: "string" - example: "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" - Gateway: - description: | - Gateway address for the default "bridge" network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - type: "string" - example: "172.17.0.1" - GlobalIPv6Address: - description: | - Global IPv6 address for the default "bridge" network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - type: "string" - example: "2001:db8::5689" - GlobalIPv6PrefixLen: - description: | - Mask length of the global IPv6 address. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - type: "integer" - example: 64 - IPAddress: - description: | - IPv4 address for the default "bridge" network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - type: "string" - example: "172.17.0.4" - IPPrefixLen: - description: | - Mask length of the IPv4 address. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - type: "integer" - example: 16 - IPv6Gateway: - description: | - IPv6 gateway address for this network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - type: "string" - example: "2001:db8:2::100" - MacAddress: - description: | - MAC address for the container on the default "bridge" network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - type: "string" - example: "02:42:ac:11:00:04" - Networks: - description: | - Information about all networks that the container is connected to. - type: "object" - additionalProperties: - $ref: "#/definitions/EndpointSettings" - - Address: - description: Address represents an IPv4 or IPv6 IP address. - type: "object" - properties: - Addr: - description: IP address. - type: "string" - PrefixLen: - description: Mask length of the IP address. - type: "integer" - - PortMap: - description: | - PortMap describes the mapping of container ports to host ports, using the - container's port-number and protocol as key in the format `/`, - for example, `80/udp`. - - If a container's port is mapped for both `tcp` and `udp`, two separate - entries are added to the mapping table. - type: "object" - additionalProperties: - type: "array" - items: - $ref: "#/definitions/PortBinding" - example: - "443/tcp": - - HostIp: "127.0.0.1" - HostPort: "4443" - "80/tcp": - - HostIp: "0.0.0.0" - HostPort: "80" - - HostIp: "0.0.0.0" - HostPort: "8080" - "80/udp": - - HostIp: "0.0.0.0" - HostPort: "80" - "53/udp": - - HostIp: "0.0.0.0" - HostPort: "53" - "2377/tcp": null - - PortBinding: - description: | - PortBinding represents a binding between a host IP address and a host - port. - type: "object" - x-nullable: true - properties: - HostIp: - description: "Host IP address that the container's port is mapped to." - type: "string" - example: "127.0.0.1" - HostPort: - description: "Host port number that the container's port is mapped to." - type: "string" - example: "4443" - - GraphDriverData: - description: "Information about a container's graph driver." - type: "object" - required: [Name, Data] - properties: - Name: - type: "string" - x-nullable: false - Data: - type: "object" - x-nullable: false - additionalProperties: - type: "string" - - Image: - type: "object" - required: - - Id - - Parent - - Comment - - Created - - Container - - DockerVersion - - Author - - Architecture - - Os - - Size - - VirtualSize - - GraphDriver - - RootFS - properties: - Id: - type: "string" - x-nullable: false - RepoTags: - type: "array" - items: - type: "string" - RepoDigests: - type: "array" - items: - type: "string" - Parent: - type: "string" - x-nullable: false - Comment: - type: "string" - x-nullable: false - Created: - type: "string" - x-nullable: false - Container: - type: "string" - x-nullable: false - ContainerConfig: - $ref: "#/definitions/ContainerConfig" - DockerVersion: - type: "string" - x-nullable: false - Author: - type: "string" - x-nullable: false - Config: - $ref: "#/definitions/ContainerConfig" - Architecture: - type: "string" - x-nullable: false - Os: - type: "string" - x-nullable: false - OsVersion: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - VirtualSize: - type: "integer" - format: "int64" - x-nullable: false - GraphDriver: - $ref: "#/definitions/GraphDriverData" - RootFS: - type: "object" - required: [Type] - properties: - Type: - type: "string" - x-nullable: false - Layers: - type: "array" - items: - type: "string" - BaseLayer: - type: "string" - Metadata: - type: "object" - properties: - LastTagTime: - type: "string" - format: "dateTime" - - ImageSummary: - type: "object" - required: - - Id - - ParentId - - RepoTags - - RepoDigests - - Created - - Size - - SharedSize - - VirtualSize - - Labels - - Containers - properties: - Id: - type: "string" - x-nullable: false - ParentId: - type: "string" - x-nullable: false - RepoTags: - type: "array" - x-nullable: false - items: - type: "string" - RepoDigests: - type: "array" - x-nullable: false - items: - type: "string" - Created: - type: "integer" - x-nullable: false - Size: - type: "integer" - x-nullable: false - SharedSize: - type: "integer" - x-nullable: false - VirtualSize: - type: "integer" - x-nullable: false - Labels: - type: "object" - x-nullable: false - additionalProperties: - type: "string" - Containers: - x-nullable: false - type: "integer" - - AuthConfig: - type: "object" - properties: - username: - type: "string" - password: - type: "string" - email: - type: "string" - serveraddress: - type: "string" - example: - username: "hannibal" - password: "xxxx" - serveraddress: "https://index.docker.io/v1/" - - ProcessConfig: - type: "object" - properties: - privileged: - type: "boolean" - user: - type: "string" - tty: - type: "boolean" - entrypoint: - type: "string" - arguments: - type: "array" - items: - type: "string" - - Volume: - type: "object" - required: [Name, Driver, Mountpoint, Labels, Scope, Options] - properties: - Name: - type: "string" - description: "Name of the volume." - x-nullable: false - Driver: - type: "string" - description: "Name of the volume driver used by the volume." - x-nullable: false - Mountpoint: - type: "string" - description: "Mount path of the volume on the host." - x-nullable: false - CreatedAt: - type: "string" - format: "dateTime" - description: "Date/Time the volume was created." - Status: - type: "object" - description: | - Low-level details about the volume, provided by the volume driver. - Details are returned as a map with key/value pairs: - `{"key":"value","key2":"value2"}`. - - The `Status` field is optional, and is omitted if the volume driver - does not support this feature. - additionalProperties: - type: "object" - Labels: - type: "object" - description: "User-defined key/value metadata." - x-nullable: false - additionalProperties: - type: "string" - Scope: - type: "string" - description: "The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level." - default: "local" - x-nullable: false - enum: ["local", "global"] - Options: - type: "object" - description: "The driver specific options used when creating the volume." - additionalProperties: - type: "string" - UsageData: - type: "object" - x-nullable: true - required: [Size, RefCount] - description: | - Usage details about the volume. This information is used by the - `GET /system/df` endpoint, and omitted in other endpoints. - properties: - Size: - type: "integer" - default: -1 - description: | - Amount of disk space used by the volume (in bytes). This information - is only available for volumes created with the `"local"` volume - driver. For volumes created with other volume drivers, this field - is set to `-1` ("not available") - x-nullable: false - RefCount: - type: "integer" - default: -1 - description: | - The number of containers referencing this volume. This field - is set to `-1` if the reference-count is not available. - x-nullable: false - - example: - Name: "tardis" - Driver: "custom" - Mountpoint: "/var/lib/docker/volumes/tardis" - Status: - hello: "world" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Scope: "local" - CreatedAt: "2016-06-07T20:31:11.853781916Z" - - Network: - type: "object" - properties: - Name: - type: "string" - Id: - type: "string" - Created: - type: "string" - format: "dateTime" - Scope: - type: "string" - Driver: - type: "string" - EnableIPv6: - type: "boolean" - IPAM: - $ref: "#/definitions/IPAM" - Internal: - type: "boolean" - Attachable: - type: "boolean" - Ingress: - type: "boolean" - Containers: - type: "object" - additionalProperties: - $ref: "#/definitions/NetworkContainer" - Options: - type: "object" - additionalProperties: - type: "string" - Labels: - type: "object" - additionalProperties: - type: "string" - example: - Name: "net01" - Id: "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99" - Created: "2016-10-19T04:33:30.360899459Z" - Scope: "local" - Driver: "bridge" - EnableIPv6: false - IPAM: - Driver: "default" - Config: - - Subnet: "172.19.0.0/16" - Gateway: "172.19.0.1" - Options: - foo: "bar" - Internal: false - Attachable: false - Ingress: false - Containers: - 19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c: - Name: "test" - EndpointID: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" - MacAddress: "02:42:ac:13:00:02" - IPv4Address: "172.19.0.2/16" - IPv6Address: "" - Options: - com.docker.network.bridge.default_bridge: "true" - com.docker.network.bridge.enable_icc: "true" - com.docker.network.bridge.enable_ip_masquerade: "true" - com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" - com.docker.network.bridge.name: "docker0" - com.docker.network.driver.mtu: "1500" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - IPAM: - type: "object" - properties: - Driver: - description: "Name of the IPAM driver to use." - type: "string" - default: "default" - Config: - description: "List of IPAM configuration options, specified as a map: `{\"Subnet\": , \"IPRange\": , \"Gateway\": , \"AuxAddress\": }`" - type: "array" - items: - type: "object" - additionalProperties: - type: "string" - Options: - description: "Driver-specific options, specified as a map." - type: "array" - items: - type: "object" - additionalProperties: - type: "string" - - NetworkContainer: - type: "object" - properties: - Name: - type: "string" - EndpointID: - type: "string" - MacAddress: - type: "string" - IPv4Address: - type: "string" - IPv6Address: - type: "string" - - BuildInfo: - type: "object" - properties: - id: - type: "string" - stream: - type: "string" - error: - type: "string" - errorDetail: - $ref: "#/definitions/ErrorDetail" - status: - type: "string" - progress: - type: "string" - progressDetail: - $ref: "#/definitions/ProgressDetail" - aux: - $ref: "#/definitions/ImageID" - - ImageID: - type: "object" - description: "Image ID or Digest" - properties: - ID: - type: "string" - example: - ID: "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" - - CreateImageInfo: - type: "object" - properties: - id: - type: "string" - error: - type: "string" - status: - type: "string" - progress: - type: "string" - progressDetail: - $ref: "#/definitions/ProgressDetail" - - PushImageInfo: - type: "object" - properties: - error: - type: "string" - status: - type: "string" - progress: - type: "string" - progressDetail: - $ref: "#/definitions/ProgressDetail" - - ErrorDetail: - type: "object" - properties: - code: - type: "integer" - message: - type: "string" - - ProgressDetail: - type: "object" - properties: - current: - type: "integer" - total: - type: "integer" - - ErrorResponse: - description: "Represents an error." - type: "object" - required: ["message"] - properties: - message: - description: "The error message." - type: "string" - x-nullable: false - example: - message: "Something went wrong." - - IdResponse: - description: "Response to an API call that returns just an Id" - type: "object" - required: ["Id"] - properties: - Id: - description: "The id of the newly created object." - type: "string" - x-nullable: false - - EndpointSettings: - description: "Configuration for a network endpoint." - type: "object" - properties: - # Configurations - IPAMConfig: - $ref: "#/definitions/EndpointIPAMConfig" - Links: - type: "array" - items: - type: "string" - example: - - "container_1" - - "container_2" - Aliases: - type: "array" - items: - type: "string" - example: - - "server_x" - - "server_y" - - # Operational data - NetworkID: - description: | - Unique ID of the network. - type: "string" - example: "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a" - EndpointID: - description: | - Unique ID for the service endpoint in a Sandbox. - type: "string" - example: "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" - Gateway: - description: | - Gateway address for this network. - type: "string" - example: "172.17.0.1" - IPAddress: - description: | - IPv4 address. - type: "string" - example: "172.17.0.4" - IPPrefixLen: - description: | - Mask length of the IPv4 address. - type: "integer" - example: 16 - IPv6Gateway: - description: | - IPv6 gateway address. - type: "string" - example: "2001:db8:2::100" - GlobalIPv6Address: - description: | - Global IPv6 address. - type: "string" - example: "2001:db8::5689" - GlobalIPv6PrefixLen: - description: | - Mask length of the global IPv6 address. - type: "integer" - format: "int64" - example: 64 - MacAddress: - description: | - MAC address for the endpoint on this network. - type: "string" - example: "02:42:ac:11:00:04" - DriverOpts: - description: | - DriverOpts is a mapping of driver options and values. These options - are passed directly to the driver and are driver specific. - type: "object" - x-nullable: true - additionalProperties: - type: "string" - example: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - - EndpointIPAMConfig: - description: | - EndpointIPAMConfig represents an endpoint's IPAM configuration. - type: "object" - x-nullable: true - properties: - IPv4Address: - type: "string" - example: "172.20.30.33" - IPv6Address: - type: "string" - example: "2001:db8:abcd::3033" - LinkLocalIPs: - type: "array" - items: - type: "string" - example: - - "169.254.34.68" - - "fe80::3468" - - PluginMount: - type: "object" - x-nullable: false - required: [Name, Description, Settable, Source, Destination, Type, Options] - properties: - Name: - type: "string" - x-nullable: false - example: "some-mount" - Description: - type: "string" - x-nullable: false - example: "This is a mount that's used by the plugin." - Settable: - type: "array" - items: - type: "string" - Source: - type: "string" - example: "/var/lib/docker/plugins/" - Destination: - type: "string" - x-nullable: false - example: "/mnt/state" - Type: - type: "string" - x-nullable: false - example: "bind" - Options: - type: "array" - items: - type: "string" - example: - - "rbind" - - "rw" - - PluginDevice: - type: "object" - required: [Name, Description, Settable, Path] - x-nullable: false - properties: - Name: - type: "string" - x-nullable: false - Description: - type: "string" - x-nullable: false - Settable: - type: "array" - items: - type: "string" - Path: - type: "string" - example: "/dev/fuse" - - PluginEnv: - type: "object" - x-nullable: false - required: [Name, Description, Settable, Value] - properties: - Name: - x-nullable: false - type: "string" - Description: - x-nullable: false - type: "string" - Settable: - type: "array" - items: - type: "string" - Value: - type: "string" - - PluginInterfaceType: - type: "object" - x-nullable: false - required: [Prefix, Capability, Version] - properties: - Prefix: - type: "string" - x-nullable: false - Capability: - type: "string" - x-nullable: false - Version: - type: "string" - x-nullable: false - - Plugin: - description: "A plugin for the Engine API" - type: "object" - required: [Settings, Enabled, Config, Name] - properties: - Id: - type: "string" - example: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" - Name: - type: "string" - x-nullable: false - example: "tiborvass/sample-volume-plugin" - Enabled: - description: "True if the plugin is running. False if the plugin is not running, only installed." - type: "boolean" - x-nullable: false - example: true - Settings: - description: "Settings that can be modified by users." - type: "object" - x-nullable: false - required: [Args, Devices, Env, Mounts] - properties: - Mounts: - type: "array" - items: - $ref: "#/definitions/PluginMount" - Env: - type: "array" - items: - type: "string" - example: - - "DEBUG=0" - Args: - type: "array" - items: - type: "string" - Devices: - type: "array" - items: - $ref: "#/definitions/PluginDevice" - PluginReference: - description: "plugin remote reference used to push/pull the plugin" - type: "string" - x-nullable: false - example: "localhost:5000/tiborvass/sample-volume-plugin:latest" - Config: - description: "The config of a plugin." - type: "object" - x-nullable: false - required: - - Description - - Documentation - - Interface - - Entrypoint - - WorkDir - - Network - - Linux - - PidHost - - PropagatedMount - - IpcHost - - Mounts - - Env - - Args - properties: - DockerVersion: - description: "Docker Version used to create the plugin" - type: "string" - x-nullable: false - example: "17.06.0-ce" - Description: - type: "string" - x-nullable: false - example: "A sample volume plugin for Docker" - Documentation: - type: "string" - x-nullable: false - example: "https://docs.docker.com/engine/extend/plugins/" - Interface: - description: "The interface between Docker and the plugin" - x-nullable: false - type: "object" - required: [Types, Socket] - properties: - Types: - type: "array" - items: - $ref: "#/definitions/PluginInterfaceType" - example: - - "docker.volumedriver/1.0" - Socket: - type: "string" - x-nullable: false - example: "plugins.sock" - Entrypoint: - type: "array" - items: - type: "string" - example: - - "/usr/bin/sample-volume-plugin" - - "/data" - WorkDir: - type: "string" - x-nullable: false - example: "/bin/" - User: - type: "object" - x-nullable: false - properties: - UID: - type: "integer" - format: "uint32" - example: 1000 - GID: - type: "integer" - format: "uint32" - example: 1000 - Network: - type: "object" - x-nullable: false - required: [Type] - properties: - Type: - x-nullable: false - type: "string" - example: "host" - Linux: - type: "object" - x-nullable: false - required: [Capabilities, AllowAllDevices, Devices] - properties: - Capabilities: - type: "array" - items: - type: "string" - example: - - "CAP_SYS_ADMIN" - - "CAP_SYSLOG" - AllowAllDevices: - type: "boolean" - x-nullable: false - example: false - Devices: - type: "array" - items: - $ref: "#/definitions/PluginDevice" - PropagatedMount: - type: "string" - x-nullable: false - example: "/mnt/volumes" - IpcHost: - type: "boolean" - x-nullable: false - example: false - PidHost: - type: "boolean" - x-nullable: false - example: false - Mounts: - type: "array" - items: - $ref: "#/definitions/PluginMount" - Env: - type: "array" - items: - $ref: "#/definitions/PluginEnv" - example: - - Name: "DEBUG" - Description: "If set, prints debug messages" - Settable: null - Value: "0" - Args: - type: "object" - x-nullable: false - required: [Name, Description, Settable, Value] - properties: - Name: - x-nullable: false - type: "string" - example: "args" - Description: - x-nullable: false - type: "string" - example: "command line arguments" - Settable: - type: "array" - items: - type: "string" - Value: - type: "array" - items: - type: "string" - rootfs: - type: "object" - properties: - type: - type: "string" - example: "layers" - diff_ids: - type: "array" - items: - type: "string" - example: - - "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887" - - "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" - - ObjectVersion: - description: | - The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - type: "object" - properties: - Index: - type: "integer" - format: "uint64" - example: 373531 - - NodeSpec: - type: "object" - properties: - Name: - description: "Name for the node." - type: "string" - example: "my-node" - Labels: - description: "User-defined key/value metadata." - type: "object" - additionalProperties: - type: "string" - Role: - description: "Role of the node." - type: "string" - enum: - - "worker" - - "manager" - example: "manager" - Availability: - description: "Availability of the node." - type: "string" - enum: - - "active" - - "pause" - - "drain" - example: "active" - example: - Availability: "active" - Name: "node-name" - Role: "manager" - Labels: - foo: "bar" - - Node: - type: "object" - properties: - ID: - type: "string" - example: "24ifsmvkjbyhk" - Version: - $ref: "#/definitions/ObjectVersion" - CreatedAt: - description: | - Date and time at which the node was added to the swarm in - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - type: "string" - format: "dateTime" - example: "2016-08-18T10:44:24.496525531Z" - UpdatedAt: - description: | - Date and time at which the node was last updated in - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - type: "string" - format: "dateTime" - example: "2017-08-09T07:09:37.632105588Z" - Spec: - $ref: "#/definitions/NodeSpec" - Description: - $ref: "#/definitions/NodeDescription" - Status: - $ref: "#/definitions/NodeStatus" - ManagerStatus: - $ref: "#/definitions/ManagerStatus" - - NodeDescription: - description: | - NodeDescription encapsulates the properties of the Node as reported by the - agent. - type: "object" - properties: - Hostname: - type: "string" - example: "bf3067039e47" - Platform: - $ref: "#/definitions/Platform" - Resources: - $ref: "#/definitions/ResourceObject" - Engine: - $ref: "#/definitions/EngineDescription" - TLSInfo: - $ref: "#/definitions/TLSInfo" - - Platform: - description: | - Platform represents the platform (Arch/OS). - type: "object" - properties: - Architecture: - description: | - Architecture represents the hardware architecture (for example, - `x86_64`). - type: "string" - example: "x86_64" - OS: - description: | - OS represents the Operating System (for example, `linux` or `windows`). - type: "string" - example: "linux" - - EngineDescription: - description: "EngineDescription provides information about an engine." - type: "object" - properties: - EngineVersion: - type: "string" - example: "17.06.0" - Labels: - type: "object" - additionalProperties: - type: "string" - example: - foo: "bar" - Plugins: - type: "array" - items: - type: "object" - properties: - Type: - type: "string" - Name: - type: "string" - example: - - Type: "Log" - Name: "awslogs" - - Type: "Log" - Name: "fluentd" - - Type: "Log" - Name: "gcplogs" - - Type: "Log" - Name: "gelf" - - Type: "Log" - Name: "journald" - - Type: "Log" - Name: "json-file" - - Type: "Log" - Name: "logentries" - - Type: "Log" - Name: "splunk" - - Type: "Log" - Name: "syslog" - - Type: "Network" - Name: "bridge" - - Type: "Network" - Name: "host" - - Type: "Network" - Name: "ipvlan" - - Type: "Network" - Name: "macvlan" - - Type: "Network" - Name: "null" - - Type: "Network" - Name: "overlay" - - Type: "Volume" - Name: "local" - - Type: "Volume" - Name: "localhost:5000/vieux/sshfs:latest" - - Type: "Volume" - Name: "vieux/sshfs:latest" - - TLSInfo: - description: "Information about the issuer of leaf TLS certificates and the trusted root CA certificate" - type: "object" - properties: - TrustRoot: - description: "The root CA certificate(s) that are used to validate leaf TLS certificates" - type: "string" - CertIssuerSubject: - description: "The base64-url-safe-encoded raw subject bytes of the issuer" - type: "string" - CertIssuerPublicKey: - description: "The base64-url-safe-encoded raw public key bytes of the issuer" - type: "string" - example: - TrustRoot: | - -----BEGIN CERTIFICATE----- - MIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw - EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0 - MzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH - A0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf - 3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB - Af8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO - PQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz - pxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H - -----END CERTIFICATE----- - CertIssuerSubject: "MBMxETAPBgNVBAMTCHN3YXJtLWNh" - CertIssuerPublicKey: "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A==" - - NodeStatus: - description: | - NodeStatus represents the status of a node. - - It provides the current status of the node, as seen by the manager. - type: "object" - properties: - State: - $ref: "#/definitions/NodeState" - Message: - type: "string" - example: "" - Addr: - description: "IP address of the node." - type: "string" - example: "172.17.0.2" - - NodeState: - description: "NodeState represents the state of a node." - type: "string" - enum: - - "unknown" - - "down" - - "ready" - - "disconnected" - example: "ready" - - ManagerStatus: - description: | - ManagerStatus represents the status of a manager. - - It provides the current status of a node's manager component, if the node - is a manager. - x-nullable: true - type: "object" - properties: - Leader: - type: "boolean" - default: false - example: true - Reachability: - $ref: "#/definitions/Reachability" - Addr: - description: | - The IP address and port at which the manager is reachable. - type: "string" - example: "10.0.0.46:2377" - - Reachability: - description: "Reachability represents the reachability of a node." - type: "string" - enum: - - "unknown" - - "unreachable" - - "reachable" - example: "reachable" - - SwarmSpec: - description: "User modifiable swarm configuration." - type: "object" - properties: - Name: - description: "Name of the swarm." - type: "string" - example: "default" - Labels: - description: "User-defined key/value metadata." - type: "object" - additionalProperties: - type: "string" - example: - com.example.corp.type: "production" - com.example.corp.department: "engineering" - Orchestration: - description: "Orchestration configuration." - type: "object" - x-nullable: true - properties: - TaskHistoryRetentionLimit: - description: "The number of historic tasks to keep per instance or node. If negative, never remove completed or failed tasks." - type: "integer" - format: "int64" - example: 10 - Raft: - description: "Raft configuration." - type: "object" - properties: - SnapshotInterval: - description: "The number of log entries between snapshots." - type: "integer" - format: "uint64" - example: 10000 - KeepOldSnapshots: - description: "The number of snapshots to keep beyond the current snapshot." - type: "integer" - format: "uint64" - LogEntriesForSlowFollowers: - description: "The number of log entries to keep around to sync up slow followers after a snapshot is created." - type: "integer" - format: "uint64" - example: 500 - ElectionTick: - description: | - The number of ticks that a follower will wait for a message from the leader before becoming a candidate and starting an election. `ElectionTick` must be greater than `HeartbeatTick`. - - A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed. - type: "integer" - example: 3 - HeartbeatTick: - description: | - The number of ticks between heartbeats. Every HeartbeatTick ticks, the leader will send a heartbeat to the followers. - - A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed. - type: "integer" - example: 1 - Dispatcher: - description: "Dispatcher configuration." - type: "object" - x-nullable: true - properties: - HeartbeatPeriod: - description: "The delay for an agent to send a heartbeat to the dispatcher." - type: "integer" - format: "int64" - example: 5000000000 - CAConfig: - description: "CA configuration." - type: "object" - x-nullable: true - properties: - NodeCertExpiry: - description: "The duration node certificates are issued for." - type: "integer" - format: "int64" - example: 7776000000000000 - ExternalCAs: - description: "Configuration for forwarding signing requests to an external certificate authority." - type: "array" - items: - type: "object" - properties: - Protocol: - description: "Protocol for communication with the external CA (currently only `cfssl` is supported)." - type: "string" - enum: - - "cfssl" - default: "cfssl" - URL: - description: "URL where certificate signing requests should be sent." - type: "string" - Options: - description: "An object with key/value pairs that are interpreted as protocol-specific options for the external CA driver." - type: "object" - additionalProperties: - type: "string" - CACert: - description: "The root CA certificate (in PEM format) this external CA uses to issue TLS certificates (assumed to be to the current swarm root CA certificate if not provided)." - type: "string" - SigningCACert: - description: "The desired signing CA certificate for all swarm node TLS leaf certificates, in PEM format." - type: "string" - SigningCAKey: - description: "The desired signing CA key for all swarm node TLS leaf certificates, in PEM format." - type: "string" - ForceRotate: - description: "An integer whose purpose is to force swarm to generate a new signing CA certificate and key, if none have been specified in `SigningCACert` and `SigningCAKey`" - format: "uint64" - type: "integer" - EncryptionConfig: - description: "Parameters related to encryption-at-rest." - type: "object" - properties: - AutoLockManagers: - description: "If set, generate a key and use it to lock data stored on the managers." - type: "boolean" - example: false - TaskDefaults: - description: "Defaults for creating tasks in this cluster." - type: "object" - properties: - LogDriver: - description: | - The log driver to use for tasks created in the orchestrator if - unspecified by a service. - - Updating this value only affects new tasks. Existing tasks continue - to use their previously configured log driver until recreated. - type: "object" - properties: - Name: - description: | - The log driver to use as a default for new tasks. - type: "string" - example: "json-file" - Options: - description: | - Driver-specific options for the selectd log driver, specified - as key/value pairs. - type: "object" - additionalProperties: - type: "string" - example: - "max-file": "10" - "max-size": "100m" - - # The Swarm information for `GET /info`. It is the same as `GET /swarm`, but - # without `JoinTokens`. - ClusterInfo: - description: | - ClusterInfo represents information about the swarm as is returned by the - "/info" endpoint. Join-tokens are not included. - x-nullable: true - type: "object" - properties: - ID: - description: "The ID of the swarm." - type: "string" - example: "abajmipo7b4xz5ip2nrla6b11" - Version: - $ref: "#/definitions/ObjectVersion" - CreatedAt: - description: | - Date and time at which the swarm was initialised in - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - type: "string" - format: "dateTime" - example: "2016-08-18T10:44:24.496525531Z" - UpdatedAt: - description: | - Date and time at which the swarm was last updated in - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - type: "string" - format: "dateTime" - example: "2017-08-09T07:09:37.632105588Z" - Spec: - $ref: "#/definitions/SwarmSpec" - TLSInfo: - $ref: "#/definitions/TLSInfo" - RootRotationInProgress: - description: "Whether there is currently a root CA rotation in progress for the swarm" - type: "boolean" - example: false - - JoinTokens: - description: | - JoinTokens contains the tokens workers and managers need to join the swarm. - type: "object" - properties: - Worker: - description: | - The token workers can use to join the swarm. - type: "string" - example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx" - Manager: - description: | - The token managers can use to join the swarm. - type: "string" - example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" - - Swarm: - type: "object" - allOf: - - $ref: "#/definitions/ClusterInfo" - - type: "object" - properties: - JoinTokens: - $ref: "#/definitions/JoinTokens" - - TaskSpec: - description: "User modifiable task configuration." - type: "object" - properties: - PluginSpec: - type: "object" - description: "Invalid when specified with `ContainerSpec`. *(Experimental release only.)*" - properties: - Name: - description: "The name or 'alias' to use for the plugin." - type: "string" - Remote: - description: "The plugin image reference to use." - type: "string" - Disabled: - description: "Disable the plugin once scheduled." - type: "boolean" - PluginPrivilege: - type: "array" - items: - description: "Describes a permission accepted by the user upon installing the plugin." - type: "object" - properties: - Name: - type: "string" - Description: - type: "string" - Value: - type: "array" - items: - type: "string" - ContainerSpec: - type: "object" - description: "Invalid when specified with `PluginSpec`." - properties: - Image: - description: "The image name to use for the container" - type: "string" - Labels: - description: "User-defined key/value data." - type: "object" - additionalProperties: - type: "string" - Command: - description: "The command to be run in the image." - type: "array" - items: - type: "string" - Args: - description: "Arguments to the command." - type: "array" - items: - type: "string" - Hostname: - description: "The hostname to use for the container, as a valid RFC 1123 hostname." - type: "string" - Env: - description: "A list of environment variables in the form `VAR=value`." - type: "array" - items: - type: "string" - Dir: - description: "The working directory for commands to run in." - type: "string" - User: - description: "The user inside the container." - type: "string" - Groups: - type: "array" - description: "A list of additional groups that the container process will run as." - items: - type: "string" - Privileges: - type: "object" - description: "Security options for the container" - properties: - CredentialSpec: - type: "object" - description: "CredentialSpec for managed service account (Windows only)" - properties: - File: - type: "string" - description: | - Load credential spec from this file. The file is read by the daemon, and must be present in the - `CredentialSpecs` subdirectory in the docker data directory, which defaults to - `C:\ProgramData\Docker\` on Windows. - - For example, specifying `spec.json` loads `C:\ProgramData\Docker\CredentialSpecs\spec.json`. - -


- - > **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive. - Registry: - type: "string" - description: | - Load credential spec from this value in the Windows registry. The specified registry value must be - located in: - - `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` - -


- - - > **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive. - SELinuxContext: - type: "object" - description: "SELinux labels of the container" - properties: - Disable: - type: "boolean" - description: "Disable SELinux" - User: - type: "string" - description: "SELinux user label" - Role: - type: "string" - description: "SELinux role label" - Type: - type: "string" - description: "SELinux type label" - Level: - type: "string" - description: "SELinux level label" - TTY: - description: "Whether a pseudo-TTY should be allocated." - type: "boolean" - OpenStdin: - description: "Open `stdin`" - type: "boolean" - ReadOnly: - description: "Mount the container's root filesystem as read only." - type: "boolean" - Mounts: - description: "Specification for mounts to be added to containers created as part of the service." - type: "array" - items: - $ref: "#/definitions/Mount" - StopSignal: - description: "Signal to stop the container." - type: "string" - StopGracePeriod: - description: "Amount of time to wait for the container to terminate before forcefully killing it." - type: "integer" - format: "int64" - HealthCheck: - $ref: "#/definitions/HealthConfig" - Hosts: - type: "array" - description: | - A list of hostname/IP mappings to add to the container's `hosts` - file. The format of extra hosts is specified in the - [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) - man page: - - IP_address canonical_hostname [aliases...] - items: - type: "string" - DNSConfig: - description: "Specification for DNS related configurations in resolver configuration file (`resolv.conf`)." - type: "object" - properties: - Nameservers: - description: "The IP addresses of the name servers." - type: "array" - items: - type: "string" - Search: - description: "A search list for host-name lookup." - type: "array" - items: - type: "string" - Options: - description: "A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.)." - type: "array" - items: - type: "string" - Secrets: - description: "Secrets contains references to zero or more secrets that will be exposed to the service." - type: "array" - items: - type: "object" - properties: - File: - description: "File represents a specific target that is backed by a file." - type: "object" - properties: - Name: - description: "Name represents the final filename in the filesystem." - type: "string" - UID: - description: "UID represents the file UID." - type: "string" - GID: - description: "GID represents the file GID." - type: "string" - Mode: - description: "Mode represents the FileMode of the file." - type: "integer" - format: "uint32" - SecretID: - description: "SecretID represents the ID of the specific secret that we're referencing." - type: "string" - SecretName: - description: | - SecretName is the name of the secret that this references, but this is just provided for - lookup/display purposes. The secret in the reference will be identified by its ID. - type: "string" - Configs: - description: "Configs contains references to zero or more configs that will be exposed to the service." - type: "array" - items: - type: "object" - properties: - File: - description: "File represents a specific target that is backed by a file." - type: "object" - properties: - Name: - description: "Name represents the final filename in the filesystem." - type: "string" - UID: - description: "UID represents the file UID." - type: "string" - GID: - description: "GID represents the file GID." - type: "string" - Mode: - description: "Mode represents the FileMode of the file." - type: "integer" - format: "uint32" - ConfigID: - description: "ConfigID represents the ID of the specific config that we're referencing." - type: "string" - ConfigName: - description: | - ConfigName is the name of the config that this references, but this is just provided for - lookup/display purposes. The config in the reference will be identified by its ID. - type: "string" - Isolation: - type: "string" - description: "Isolation technology of the containers running the service. (Windows only)" - enum: - - "default" - - "process" - - "hyperv" - Resources: - description: "Resource requirements which apply to each individual container created as part of the service." - type: "object" - properties: - Limits: - description: "Define resources limits." - $ref: "#/definitions/ResourceObject" - Reservation: - description: "Define resources reservation." - $ref: "#/definitions/ResourceObject" - RestartPolicy: - description: "Specification for the restart policy which applies to containers created as part of this service." - type: "object" - properties: - Condition: - description: "Condition for restart." - type: "string" - enum: - - "none" - - "on-failure" - - "any" - Delay: - description: "Delay between restart attempts." - type: "integer" - format: "int64" - MaxAttempts: - description: "Maximum attempts to restart a given container before giving up (default value is 0, which is ignored)." - type: "integer" - format: "int64" - default: 0 - Window: - description: "Windows is the time window used to evaluate the restart policy (default value is 0, which is unbounded)." - type: "integer" - format: "int64" - default: 0 - Placement: - type: "object" - properties: - Constraints: - description: "An array of constraints." - type: "array" - items: - type: "string" - example: - - "node.hostname!=node3.corp.example.com" - - "node.role!=manager" - - "node.labels.type==production" - Preferences: - description: "Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence." - type: "array" - items: - type: "object" - properties: - Spread: - type: "object" - properties: - SpreadDescriptor: - description: "label descriptor, such as engine.labels.az" - type: "string" - example: - - Spread: - SpreadDescriptor: "node.labels.datacenter" - - Spread: - SpreadDescriptor: "node.labels.rack" - Platforms: - description: | - Platforms stores all the platforms that the service's image can - run on. This field is used in the platform filter for scheduling. - If empty, then the platform filter is off, meaning there are no - scheduling restrictions. - type: "array" - items: - $ref: "#/definitions/Platform" - ForceUpdate: - description: "A counter that triggers an update even if no relevant parameters have been changed." - type: "integer" - Runtime: - description: "Runtime is the type of runtime specified for the task executor." - type: "string" - Networks: - type: "array" - items: - type: "object" - properties: - Target: - type: "string" - Aliases: - type: "array" - items: - type: "string" - LogDriver: - description: "Specifies the log driver to use for tasks created from this spec. If not present, the default one for the swarm will be used, finally falling back to the engine default if not specified." - type: "object" - properties: - Name: - type: "string" - Options: - type: "object" - additionalProperties: - type: "string" - - TaskState: - type: "string" - enum: - - "new" - - "allocated" - - "pending" - - "assigned" - - "accepted" - - "preparing" - - "ready" - - "starting" - - "running" - - "complete" - - "shutdown" - - "failed" - - "rejected" - - Task: - type: "object" - properties: - ID: - description: "The ID of the task." - type: "string" - Version: - $ref: "#/definitions/ObjectVersion" - CreatedAt: - type: "string" - format: "dateTime" - UpdatedAt: - type: "string" - format: "dateTime" - Name: - description: "Name of the task." - type: "string" - Labels: - description: "User-defined key/value metadata." - type: "object" - additionalProperties: - type: "string" - Spec: - $ref: "#/definitions/TaskSpec" - ServiceID: - description: "The ID of the service this task is part of." - type: "string" - Slot: - type: "integer" - NodeID: - description: "The ID of the node that this task is on." - type: "string" - AssignedGenericResources: - $ref: "#/definitions/GenericResources" - Status: - type: "object" - properties: - Timestamp: - type: "string" - format: "dateTime" - State: - $ref: "#/definitions/TaskState" - Message: - type: "string" - Err: - type: "string" - ContainerStatus: - type: "object" - properties: - ContainerID: - type: "string" - PID: - type: "integer" - ExitCode: - type: "integer" - DesiredState: - $ref: "#/definitions/TaskState" - example: - ID: "0kzzo1i0y4jz6027t0k7aezc7" - Version: - Index: 71 - CreatedAt: "2016-06-07T21:07:31.171892745Z" - UpdatedAt: "2016-06-07T21:07:31.376370513Z" - Spec: - ContainerSpec: - Image: "redis" - Resources: - Limits: {} - Reservations: {} - RestartPolicy: - Condition: "any" - MaxAttempts: 0 - Placement: {} - ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" - Slot: 1 - NodeID: "60gvrl6tm78dmak4yl7srz94v" - Status: - Timestamp: "2016-06-07T21:07:31.290032978Z" - State: "running" - Message: "started" - ContainerStatus: - ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" - PID: 677 - DesiredState: "running" - NetworksAttachments: - - Network: - ID: "4qvuz4ko70xaltuqbt8956gd1" - Version: - Index: 18 - CreatedAt: "2016-06-07T20:31:11.912919752Z" - UpdatedAt: "2016-06-07T21:07:29.955277358Z" - Spec: - Name: "ingress" - Labels: - com.docker.swarm.internal: "true" - DriverConfiguration: {} - IPAMOptions: - Driver: {} - Configs: - - Subnet: "10.255.0.0/16" - Gateway: "10.255.0.1" - DriverState: - Name: "overlay" - Options: - com.docker.network.driver.overlay.vxlanid_list: "256" - IPAMOptions: - Driver: - Name: "default" - Configs: - - Subnet: "10.255.0.0/16" - Gateway: "10.255.0.1" - Addresses: - - "10.255.0.10/16" - AssignedGenericResources: - - DiscreteResourceSpec: - Kind: "SSD" - Value: 3 - - NamedResourceSpec: - Kind: "GPU" - Value: "UUID1" - - NamedResourceSpec: - Kind: "GPU" - Value: "UUID2" - - ServiceSpec: - description: "User modifiable configuration for a service." - properties: - Name: - description: "Name of the service." - type: "string" - Labels: - description: "User-defined key/value metadata." - type: "object" - additionalProperties: - type: "string" - TaskTemplate: - $ref: "#/definitions/TaskSpec" - Mode: - description: "Scheduling mode for the service." - type: "object" - properties: - Replicated: - type: "object" - properties: - Replicas: - type: "integer" - format: "int64" - Global: - type: "object" - UpdateConfig: - description: "Specification for the update strategy of the service." - type: "object" - properties: - Parallelism: - description: "Maximum number of tasks to be updated in one iteration (0 means unlimited parallelism)." - type: "integer" - format: "int64" - Delay: - description: "Amount of time between updates, in nanoseconds." - type: "integer" - format: "int64" - FailureAction: - description: "Action to take if an updated task fails to run, or stops running during the update." - type: "string" - enum: - - "continue" - - "pause" - - "rollback" - Monitor: - description: "Amount of time to monitor each updated task for failures, in nanoseconds." - type: "integer" - format: "int64" - MaxFailureRatio: - description: "The fraction of tasks that may fail during an update before the failure action is invoked, specified as a floating point number between 0 and 1." - type: "number" - default: 0 - Order: - description: "The order of operations when rolling out an updated task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down." - type: "string" - enum: - - "stop-first" - - "start-first" - RollbackConfig: - description: "Specification for the rollback strategy of the service." - type: "object" - properties: - Parallelism: - description: "Maximum number of tasks to be rolled back in one iteration (0 means unlimited parallelism)." - type: "integer" - format: "int64" - Delay: - description: "Amount of time between rollback iterations, in nanoseconds." - type: "integer" - format: "int64" - FailureAction: - description: "Action to take if an rolled back task fails to run, or stops running during the rollback." - type: "string" - enum: - - "continue" - - "pause" - Monitor: - description: "Amount of time to monitor each rolled back task for failures, in nanoseconds." - type: "integer" - format: "int64" - MaxFailureRatio: - description: "The fraction of tasks that may fail during a rollback before the failure action is invoked, specified as a floating point number between 0 and 1." - type: "number" - default: 0 - Order: - description: "The order of operations when rolling back a task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down." - type: "string" - enum: - - "stop-first" - - "start-first" - Networks: - description: "Array of network names or IDs to attach the service to." - type: "array" - items: - type: "object" - properties: - Target: - type: "string" - Aliases: - type: "array" - items: - type: "string" - EndpointSpec: - $ref: "#/definitions/EndpointSpec" - - EndpointPortConfig: - type: "object" - properties: - Name: - type: "string" - Protocol: - type: "string" - enum: - - "tcp" - - "udp" - TargetPort: - description: "The port inside the container." - type: "integer" - PublishedPort: - description: "The port on the swarm hosts." - type: "integer" - PublishMode: - description: | - The mode in which port is published. - -


- - - "ingress" makes the target port accessible on on every node, - regardless of whether there is a task for the service running on - that node or not. - - "host" bypasses the routing mesh and publish the port directly on - the swarm node where that service is running. - - type: "string" - enum: - - "ingress" - - "host" - default: "ingress" - example: "ingress" - - EndpointSpec: - description: "Properties that can be configured to access and load balance a service." - type: "object" - properties: - Mode: - description: "The mode of resolution to use for internal load balancing between tasks." - type: "string" - enum: - - "vip" - - "dnsrr" - default: "vip" - Ports: - description: "List of exposed ports that this service is accessible on from the outside. Ports can only be provided if `vip` resolution mode is used." - type: "array" - items: - $ref: "#/definitions/EndpointPortConfig" - - Service: - type: "object" - properties: - ID: - type: "string" - Version: - $ref: "#/definitions/ObjectVersion" - CreatedAt: - type: "string" - format: "dateTime" - UpdatedAt: - type: "string" - format: "dateTime" - Spec: - $ref: "#/definitions/ServiceSpec" - Endpoint: - type: "object" - properties: - Spec: - $ref: "#/definitions/EndpointSpec" - Ports: - type: "array" - items: - $ref: "#/definitions/EndpointPortConfig" - VirtualIPs: - type: "array" - items: - type: "object" - properties: - NetworkID: - type: "string" - Addr: - type: "string" - UpdateStatus: - description: "The status of a service update." - type: "object" - properties: - State: - type: "string" - enum: - - "updating" - - "paused" - - "completed" - StartedAt: - type: "string" - format: "dateTime" - CompletedAt: - type: "string" - format: "dateTime" - Message: - type: "string" - example: - ID: "9mnpnzenvg8p8tdbtq4wvbkcz" - Version: - Index: 19 - CreatedAt: "2016-06-07T21:05:51.880065305Z" - UpdatedAt: "2016-06-07T21:07:29.962229872Z" - Spec: - Name: "hopeful_cori" - TaskTemplate: - ContainerSpec: - Image: "redis" - Resources: - Limits: {} - Reservations: {} - RestartPolicy: - Condition: "any" - MaxAttempts: 0 - Placement: {} - ForceUpdate: 0 - Mode: - Replicated: - Replicas: 1 - UpdateConfig: - Parallelism: 1 - Delay: 1000000000 - FailureAction: "pause" - Monitor: 15000000000 - MaxFailureRatio: 0.15 - RollbackConfig: - Parallelism: 1 - Delay: 1000000000 - FailureAction: "pause" - Monitor: 15000000000 - MaxFailureRatio: 0.15 - EndpointSpec: - Mode: "vip" - Ports: - - - Protocol: "tcp" - TargetPort: 6379 - PublishedPort: 30001 - Endpoint: - Spec: - Mode: "vip" - Ports: - - - Protocol: "tcp" - TargetPort: 6379 - PublishedPort: 30001 - Ports: - - - Protocol: "tcp" - TargetPort: 6379 - PublishedPort: 30001 - VirtualIPs: - - - NetworkID: "4qvuz4ko70xaltuqbt8956gd1" - Addr: "10.255.0.2/16" - - - NetworkID: "4qvuz4ko70xaltuqbt8956gd1" - Addr: "10.255.0.3/16" - - ImageDeleteResponseItem: - type: "object" - properties: - Untagged: - description: "The image ID of an image that was untagged" - type: "string" - Deleted: - description: "The image ID of an image that was deleted" - type: "string" - - ServiceUpdateResponse: - type: "object" - properties: - Warnings: - description: "Optional warning messages" - type: "array" - items: - type: "string" - example: - Warning: "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" - - ContainerSummary: - type: "array" - items: - type: "object" - properties: - Id: - description: "The ID of this container" - type: "string" - x-go-name: "ID" - Names: - description: "The names that this container has been given" - type: "array" - items: - type: "string" - Image: - description: "The name of the image used when creating this container" - type: "string" - ImageID: - description: "The ID of the image that this container was created from" - type: "string" - Command: - description: "Command to run when starting the container" - type: "string" - Created: - description: "When the container was created" - type: "integer" - format: "int64" - Ports: - description: "The ports exposed by this container" - type: "array" - items: - $ref: "#/definitions/Port" - SizeRw: - description: "The size of files that have been created or changed by this container" - type: "integer" - format: "int64" - SizeRootFs: - description: "The total size of all the files in this container" - type: "integer" - format: "int64" - Labels: - description: "User-defined key/value metadata." - type: "object" - additionalProperties: - type: "string" - State: - description: "The state of this container (e.g. `Exited`)" - type: "string" - Status: - description: "Additional human-readable status of this container (e.g. `Exit 0`)" - type: "string" - HostConfig: - type: "object" - properties: - NetworkMode: - type: "string" - NetworkSettings: - description: "A summary of the container's network settings" - type: "object" - properties: - Networks: - type: "object" - additionalProperties: - $ref: "#/definitions/EndpointSettings" - Mounts: - type: "array" - items: - $ref: "#/definitions/Mount" - - Driver: - description: "Driver represents a driver (network, logging, secrets)." - type: "object" - required: [Name] - properties: - Name: - description: "Name of the driver." - type: "string" - x-nullable: false - example: "some-driver" - Options: - description: "Key/value map of driver-specific options." - type: "object" - x-nullable: false - additionalProperties: - type: "string" - example: - OptionA: "value for driver-specific option A" - OptionB: "value for driver-specific option B" - - SecretSpec: - type: "object" - properties: - Name: - description: "User-defined name of the secret." - type: "string" - Labels: - description: "User-defined key/value metadata." - type: "object" - additionalProperties: - type: "string" - example: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Data: - description: | - Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)) - data to store as secret. - - This field is only used to _create_ a secret, and is not returned by - other endpoints. - type: "string" - example: "" - Driver: - description: "Name of the secrets driver used to fetch the secret's value from an external secret store" - $ref: "#/definitions/Driver" - - Secret: - type: "object" - properties: - ID: - type: "string" - example: "blt1owaxmitz71s9v5zh81zun" - Version: - $ref: "#/definitions/ObjectVersion" - CreatedAt: - type: "string" - format: "dateTime" - example: "2017-07-20T13:55:28.678958722Z" - UpdatedAt: - type: "string" - format: "dateTime" - example: "2017-07-20T13:55:28.678958722Z" - Spec: - $ref: "#/definitions/SecretSpec" - - ConfigSpec: - type: "object" - properties: - Name: - description: "User-defined name of the config." - type: "string" - Labels: - description: "User-defined key/value metadata." - type: "object" - additionalProperties: - type: "string" - Data: - description: | - Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)) - config data. - type: "string" - - Config: - type: "object" - properties: - ID: - type: "string" - Version: - $ref: "#/definitions/ObjectVersion" - CreatedAt: - type: "string" - format: "dateTime" - UpdatedAt: - type: "string" - format: "dateTime" - Spec: - $ref: "#/definitions/ConfigSpec" - - SystemInfo: - type: "object" - properties: - ID: - description: | - Unique identifier of the daemon. - -


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


- - > **Note**: The information returned in this field, including the - > formatting of values and labels, should not be considered stable, - > and may change without notice. - type: "array" - items: - type: "array" - items: - type: "string" - example: - - ["Backing Filesystem", "extfs"] - - ["Supports d_type", "true"] - - ["Native Overlay Diff", "true"] - DockerRootDir: - description: | - Root directory of persistent Docker state. - - Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` - on Windows. - type: "string" - example: "/var/lib/docker" - SystemStatus: - description: | - Status information about this node (standalone Swarm API). - -


- - > **Note**: The information returned in this field is only propagated - > by the Swarm standalone API, and is empty (`null`) when using - > built-in swarm mode. - type: "array" - items: - type: "array" - items: - type: "string" - example: - - ["Role", "primary"] - - ["State", "Healthy"] - - ["Strategy", "spread"] - - ["Filters", "health, port, containerslots, dependency, affinity, constraint, whitelist"] - - ["Nodes", "2"] - - [" swarm-agent-00", "192.168.99.102:2376"] - - [" └ ID", "5CT6:FBGO:RVGO:CZL4:PB2K:WCYN:2JSV:KSHH:GGFW:QOPG:6J5Q:IOZ2|192.168.99.102:2376"] - - [" └ Status", "Healthy"] - - [" └ Containers", "1 (1 Running, 0 Paused, 0 Stopped)"] - - [" └ Reserved CPUs", "0 / 1"] - - [" └ Reserved Memory", "0 B / 1.021 GiB"] - - [" └ Labels", "kernelversion=4.4.74-boot2docker, operatingsystem=Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017, ostype=linux, provider=virtualbox, storagedriver=aufs"] - - [" └ UpdatedAt", "2017-08-09T10:03:46Z"] - - [" └ ServerVersion", "17.06.0-ce"] - - [" swarm-manager", "192.168.99.101:2376"] - - [" └ ID", "TAMD:7LL3:SEF7:LW2W:4Q2X:WVFH:RTXX:JSYS:XY2P:JEHL:ZMJK:JGIW|192.168.99.101:2376"] - - [" └ Status", "Healthy"] - - [" └ Containers", "2 (2 Running, 0 Paused, 0 Stopped)"] - - [" └ Reserved CPUs", "0 / 1"] - - [" └ Reserved Memory", "0 B / 1.021 GiB"] - - [" └ Labels", "kernelversion=4.4.74-boot2docker, operatingsystem=Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017, ostype=linux, provider=virtualbox, storagedriver=aufs"] - - [" └ UpdatedAt", "2017-08-09T10:04:11Z"] - - [" └ ServerVersion", "17.06.0-ce"] - Plugins: - $ref: "#/definitions/PluginsInfo" - MemoryLimit: - description: "Indicates if the host has memory limit support enabled." - type: "boolean" - example: true - SwapLimit: - description: "Indicates if the host has memory swap limit support enabled." - type: "boolean" - example: true - KernelMemory: - description: "Indicates if the host has kernel memory limit support enabled." - type: "boolean" - example: true - CpuCfsPeriod: - description: "Indicates if CPU CFS(Completely Fair Scheduler) period is supported by the host." - type: "boolean" - example: true - CpuCfsQuota: - description: "Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by the host." - type: "boolean" - example: true - CPUShares: - description: "Indicates if CPU Shares limiting is supported by the host." - type: "boolean" - example: true - CPUSet: - description: | - Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. - - See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) - type: "boolean" - example: true - OomKillDisable: - description: "Indicates if OOM killer disable is supported on the host." - type: "boolean" - IPv4Forwarding: - description: "Indicates IPv4 forwarding is enabled." - type: "boolean" - example: true - BridgeNfIptables: - description: "Indicates if `bridge-nf-call-iptables` is available on the host." - type: "boolean" - example: true - BridgeNfIp6tables: - description: "Indicates if `bridge-nf-call-ip6tables` is available on the host." - type: "boolean" - example: true - Debug: - description: "Indicates if the daemon is running in debug-mode / with debug-level logging enabled." - type: "boolean" - example: true - NFd: - description: | - The total number of file Descriptors in use by the daemon process. - - This information is only returned if debug-mode is enabled. - type: "integer" - example: 64 - NGoroutines: - description: | - The number of goroutines that currently exist. - - This information is only returned if debug-mode is enabled. - type: "integer" - example: 174 - SystemTime: - description: | - Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) - format with nano-seconds. - type: "string" - example: "2017-08-08T20:28:29.06202363Z" - LoggingDriver: - description: | - The logging driver to use as a default for new containers. - type: "string" - CgroupDriver: - description: | - The driver to use for managing cgroups. - type: "string" - enum: ["cgroupfs", "systemd"] - default: "cgroupfs" - example: "cgroupfs" - NEventsListener: - description: "Number of event listeners subscribed." - type: "integer" - example: 30 - KernelVersion: - description: | - Kernel version of the host. - - On Linux, this information obtained from `uname`. On Windows this - information is queried from the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ - registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. - type: "string" - example: "4.9.38-moby" - OperatingSystem: - description: | - Name of the host's operating system, for example: "Ubuntu 16.04.2 LTS" - or "Windows Server 2016 Datacenter" - type: "string" - example: "Alpine Linux v3.5" - OSType: - description: | - Generic type of the operating system of the host, as returned by the - Go runtime (`GOOS`). - - Currently returned values are "linux" and "windows". A full list of - possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment). - type: "string" - example: "linux" - Architecture: - description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). - - A full list of possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment). - type: "string" - example: "x86_64" - NCPU: - description: | - The number of logical CPUs usable by the daemon. - - The number of available CPUs is checked by querying the operating - system when the daemon starts. Changes to operating system CPU - allocation after the daemon is started are not reflected. - type: "integer" - example: 4 - MemTotal: - description: | - Total amount of physical memory available on the host, in kilobytes (kB). - type: "integer" - format: "int64" - example: 2095882240 - - IndexServerAddress: - description: | - Address / URL of the index server that is used for image search, - and as a default for user authentication for Docker Hub and Docker Cloud. - default: "https://index.docker.io/v1/" - type: "string" - example: "https://index.docker.io/v1/" - RegistryConfig: - $ref: "#/definitions/RegistryServiceConfig" - GenericResources: - $ref: "#/definitions/GenericResources" - HttpProxy: - description: | - HTTP-proxy configured for the daemon. This value is obtained from the - [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. - - Containers do not automatically inherit this configuration. - type: "string" - example: "http://user:pass@proxy.corp.example.com:8080" - HttpsProxy: - description: | - HTTPS-proxy configured for the daemon. This value is obtained from the - [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. - - Containers do not automatically inherit this configuration. - type: "string" - example: "https://user:pass@proxy.corp.example.com:4443" - NoProxy: - description: | - Comma-separated list of domain extensions for which no proxy should be - used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) - environment variable. - - Containers do not automatically inherit this configuration. - type: "string" - example: "*.local, 169.254/16" - Name: - description: "Hostname of the host." - type: "string" - example: "node5.corp.example.com" - Labels: - description: | - User-defined labels (key/value metadata) as set on the daemon. - -


- - > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, - > set through the daemon configuration, and _node_ labels, set from a - > manager node in the Swarm. Node labels are not included in this - > field. Node labels can be retrieved using the `/nodes/(id)` endpoint - > on a manager node in the Swarm. - type: "array" - items: - type: "string" - example: ["storage=ssd", "production"] - ExperimentalBuild: - description: | - Indicates if experimental features are enabled on the daemon. - type: "boolean" - example: true - ServerVersion: - description: | - Version string of the daemon. - - > **Note**: the [standalone Swarm API](https://docs.docker.com/swarm/swarm-api/) - > returns the Swarm version instead of the daemon version, for example - > `swarm/1.2.8`. - type: "string" - example: "17.06.0-ce" - ClusterStore: - description: | - URL of the distributed storage backend. - - - The storage backend is used for multihost networking (to store - network and endpoint information) and by the node discovery mechanism. - -


- - > **Note**: This field is only propagated when using standalone Swarm - > mode, and overlay networking using an external k/v store. Overlay - > networks with Swarm mode enabled use the built-in raft store, and - > this field will be empty. - type: "string" - example: "consul://consul.corp.example.com:8600/some/path" - ClusterAdvertise: - description: | - The network endpoint that the Engine advertises for the purpose of - node discovery. ClusterAdvertise is a `host:port` combination on which - the daemon is reachable by other hosts. - -


- - > **Note**: This field is only propagated when using standalone Swarm - > mode, and overlay networking using an external k/v store. Overlay - > networks with Swarm mode enabled use the built-in raft store, and - > this field will be empty. - type: "string" - example: "node5.corp.example.com:8000" - Runtimes: - description: | - List of [OCI compliant](https://github.com/opencontainers/runtime-spec) - runtimes configured on the daemon. Keys hold the "name" used to - reference the runtime. - - The Docker daemon relies on an OCI compliant runtime (invoked via the - `containerd` daemon) as its interface to the Linux kernel namespaces, - cgroups, and SELinux. - - The default runtime is `runc`, and automatically configured. Additional - runtimes can be configured by the user and will be listed here. - type: "object" - additionalProperties: - $ref: "#/definitions/Runtime" - default: - runc: - path: "docker-runc" - example: - runc: - path: "docker-runc" - runc-master: - path: "/go/bin/runc" - custom: - path: "/usr/local/bin/my-oci-runtime" - runtimeArgs: ["--debug", "--systemd-cgroup=false"] - DefaultRuntime: - description: | - Name of the default OCI runtime that is used when starting containers. - - The default can be overridden per-container at create time. - type: "string" - default: "runc" - example: "runc" - Swarm: - $ref: "#/definitions/SwarmInfo" - LiveRestoreEnabled: - description: | - Indicates if live restore is enabled. - - If enabled, containers are kept running when the daemon is shutdown - or upon daemon start if running containers are detected. - type: "boolean" - default: false - example: false - Isolation: - description: | - Represents the isolation technology to use as a default for containers. - The supported values are platform-specific. - - If no isolation value is specified on daemon start, on Windows client, - the default is `hyperv`, and on Windows server, the default is `process`. - - This option is currently not used on other platforms. - default: "default" - type: "string" - enum: - - "default" - - "hyperv" - - "process" - InitBinary: - description: | - Name and, optional, path of the the `docker-init` binary. - - If the path is omitted, the daemon searches the host's `$PATH` for the - binary and uses the first result. - type: "string" - example: "docker-init" - ContainerdCommit: - $ref: "#/definitions/Commit" - RuncCommit: - $ref: "#/definitions/Commit" - InitCommit: - $ref: "#/definitions/Commit" - SecurityOptions: - description: | - List of security features that are enabled on the daemon, such as - apparmor, seccomp, SELinux, and user-namespaces (userns). - - Additional configuration options for each security feature may - be present, and are included as a comma-separated list of key/value - pairs. - type: "array" - items: - type: "string" - example: - - "name=apparmor" - - "name=seccomp,profile=default" - - "name=selinux" - - "name=userns" - - - # PluginsInfo is a temp struct holding Plugins name - # registered with docker daemon. It is used by Info struct - PluginsInfo: - description: | - Available plugins per type. - -


- - > **Note**: Only unmanaged (V1) plugins are included in this list. - > V1 plugins are "lazily" loaded, and are not returned in this list - > if there is no resource using the plugin. - type: "object" - properties: - Volume: - description: "Names of available volume-drivers, and network-driver plugins." - type: "array" - items: - type: "string" - example: ["local"] - Network: - description: "Names of available network-drivers, and network-driver plugins." - type: "array" - items: - type: "string" - example: ["bridge", "host", "ipvlan", "macvlan", "null", "overlay"] - Authorization: - description: "Names of available authorization plugins." - type: "array" - items: - type: "string" - example: ["img-authz-plugin", "hbm"] - Log: - description: "Names of available logging-drivers, and logging-driver plugins." - type: "array" - items: - type: "string" - example: ["awslogs", "fluentd", "gcplogs", "gelf", "journald", "json-file", "logentries", "splunk", "syslog"] - - - RegistryServiceConfig: - description: | - RegistryServiceConfig stores daemon registry services configuration. - type: "object" - x-nullable: true - properties: - AllowNondistributableArtifactsCIDRs: - description: | - List of IP ranges to which nondistributable artifacts can be pushed, - using the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632). - - Some images (for example, Windows base images) contain artifacts - whose distribution is restricted by license. When these images are - pushed to a registry, restricted artifacts are not included. - - This configuration override this behavior, and enables the daemon to - push nondistributable artifacts to all registries whose resolved IP - address is within the subnet described by the CIDR syntax. - - This option is useful when pushing images containing - nondistributable artifacts to a registry on an air-gapped network so - hosts on that network can pull the images without connecting to - another server. - - > **Warning**: Nondistributable artifacts typically have restrictions - > on how and where they can be distributed and shared. Only use this - > feature to push artifacts to private registries and ensure that you - > are in compliance with any terms that cover redistributing - > nondistributable artifacts. - - type: "array" - items: - type: "string" - example: ["::1/128", "127.0.0.0/8"] - AllowNondistributableArtifactsHostnames: - description: | - List of registry hostnames to which nondistributable artifacts can be - pushed, using the format `[:]` or `[:]`. - - Some images (for example, Windows base images) contain artifacts - whose distribution is restricted by license. When these images are - pushed to a registry, restricted artifacts are not included. - - This configuration override this behavior for the specified - registries. - - This option is useful when pushing images containing - nondistributable artifacts to a registry on an air-gapped network so - hosts on that network can pull the images without connecting to - another server. - - > **Warning**: Nondistributable artifacts typically have restrictions - > on how and where they can be distributed and shared. Only use this - > feature to push artifacts to private registries and ensure that you - > are in compliance with any terms that cover redistributing - > nondistributable artifacts. - type: "array" - items: - type: "string" - example: ["registry.internal.corp.example.com:3000", "[2001:db8:a0b:12f0::1]:443"] - InsecureRegistryCIDRs: - description: | - List of IP ranges of insecure registries, using the CIDR syntax - ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries - accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates - from unknown CAs) communication. - - By default, local registries (`127.0.0.0/8`) are configured as - insecure. All other registries are secure. Communicating with an - insecure registry is not possible if the daemon assumes that registry - is secure. - - This configuration override this behavior, insecure communication with - registries whose resolved IP address is within the subnet described by - the CIDR syntax. - - Registries can also be marked insecure by hostname. Those registries - are listed under `IndexConfigs` and have their `Secure` field set to - `false`. - - > **Warning**: Using this option can be useful when running a local - > registry, but introduces security vulnerabilities. This option - > should therefore ONLY be used for testing purposes. For increased - > security, users should add their CA to their system's list of trusted - > CAs instead of enabling this option. - type: "array" - items: - type: "string" - example: ["::1/128", "127.0.0.0/8"] - IndexConfigs: - type: "object" - additionalProperties: - $ref: "#/definitions/IndexInfo" - example: - "127.0.0.1:5000": - "Name": "127.0.0.1:5000" - "Mirrors": [] - "Secure": false - "Official": false - "[2001:db8:a0b:12f0::1]:80": - "Name": "[2001:db8:a0b:12f0::1]:80" - "Mirrors": [] - "Secure": false - "Official": false - "docker.io": - Name: "docker.io" - Mirrors: ["https://hub-mirror.corp.example.com:5000/"] - Secure: true - Official: true - "registry.internal.corp.example.com:3000": - Name: "registry.internal.corp.example.com:3000" - Mirrors: [] - Secure: false - Official: false - Mirrors: - description: | - List of registry URLs that act as a mirror for the official - (`docker.io`) registry. - - type: "array" - items: - type: "string" - example: - - "https://hub-mirror.corp.example.com:5000/" - - "https://[2001:db8:a0b:12f0::1]/" - - IndexInfo: - description: - IndexInfo contains information about a registry. - type: "object" - x-nullable: true - properties: - Name: - description: | - Name of the registry, such as "docker.io". - type: "string" - example: "docker.io" - Mirrors: - description: | - List of mirrors, expressed as URIs. - type: "array" - items: - type: "string" - example: - - "https://hub-mirror.corp.example.com:5000/" - - "https://registry-2.docker.io/" - - "https://registry-3.docker.io/" - Secure: - description: | - Indicates if the the registry is part of the list of insecure - registries. - - If `false`, the registry is insecure. Insecure registries accept - un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from - unknown CAs) communication. - - > **Warning**: Insecure registries can be useful when running a local - > registry. However, because its use creates security vulnerabilities - > it should ONLY be enabled for testing purposes. For increased - > security, users should add their CA to their system's list of - > trusted CAs instead of enabling this option. - type: "boolean" - example: true - Official: - description: | - Indicates whether this is an official registry (i.e., Docker Hub / docker.io) - type: "boolean" - example: true - - Runtime: - description: | - Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec) - runtime. - - The runtime is invoked by the daemon via the `containerd` daemon. OCI - runtimes act as an interface to the Linux kernel namespaces, cgroups, - and SELinux. - type: "object" - properties: - path: - description: | - Name and, optional, path, of the OCI executable binary. - - If the path is omitted, the daemon searches the host's `$PATH` for the - binary and uses the first result. - type: "string" - example: "/usr/local/bin/my-oci-runtime" - runtimeArgs: - description: | - List of command-line arguments to pass to the runtime when invoked. - type: "array" - x-nullable: true - items: - type: "string" - example: ["--debug", "--systemd-cgroup=false"] - - Commit: - description: | - Commit holds the Git-commit (SHA1) that a binary was built from, as - reported in the version-string of external tools, such as `containerd`, - or `runC`. - type: "object" - properties: - ID: - description: "Actual commit ID of external tool." - type: "string" - example: "cfb82a876ecc11b5ca0977d1733adbe58599088a" - Expected: - description: | - Commit ID of external tool expected by dockerd as set at build time. - type: "string" - example: "2d41c047c83e09a6d61d464906feb2a2f3c52aa4" - - SwarmInfo: - description: | - Represents generic information about swarm. - type: "object" - properties: - NodeID: - description: "Unique identifier of for this node in the swarm." - type: "string" - default: "" - example: "k67qz4598weg5unwwffg6z1m1" - NodeAddr: - description: | - IP address at which this node can be reached by other nodes in the - swarm. - type: "string" - default: "" - example: "10.0.0.46" - LocalNodeState: - $ref: "#/definitions/LocalNodeState" - ControlAvailable: - type: "boolean" - default: false - example: true - Error: - type: "string" - default: "" - RemoteManagers: - description: | - List of ID's and addresses of other managers in the swarm. - type: "array" - default: null - x-nullable: true - items: - $ref: "#/definitions/PeerNode" - example: - - NodeID: "71izy0goik036k48jg985xnds" - Addr: "10.0.0.158:2377" - - NodeID: "79y6h1o4gv8n120drcprv5nmc" - Addr: "10.0.0.159:2377" - - NodeID: "k67qz4598weg5unwwffg6z1m1" - Addr: "10.0.0.46:2377" - Nodes: - description: "Total number of nodes in the swarm." - type: "integer" - x-nullable: true - example: 4 - Managers: - description: "Total number of managers in the swarm." - type: "integer" - x-nullable: true - example: 3 - Cluster: - $ref: "#/definitions/ClusterInfo" - - LocalNodeState: - description: "Current local status of this node." - type: "string" - default: "" - enum: - - "" - - "inactive" - - "pending" - - "active" - - "error" - - "locked" - example: "active" - - PeerNode: - description: "Represents a peer-node in the swarm" - properties: - NodeID: - description: "Unique identifier of for this node in the swarm." - type: "string" - Addr: - description: | - IP address and ports at which this node can be reached. - type: "string" - -paths: - /containers/json: - get: - summary: "List containers" - description: | - Returns a list of containers. For details on the format, see [the inspect endpoint](#operation/ContainerInspect). - - Note that it uses a different, smaller representation of a container than inspecting a single container. For example, - the list of linked containers is not propagated . - operationId: "ContainerList" - produces: - - "application/json" - parameters: - - name: "all" - in: "query" - description: "Return all containers. By default, only running containers are shown" - type: "boolean" - default: false - - name: "limit" - in: "query" - description: "Return this number of most recently created containers, including non-running ones." - type: "integer" - - name: "size" - in: "query" - description: "Return the size of container as fields `SizeRw` and `SizeRootFs`." - type: "boolean" - default: false - - name: "filters" - in: "query" - description: | - Filters to process on the container list, encoded as JSON (a `map[string][]string`). For example, `{"status": ["paused"]}` will only return paused containers. Available filters: - - - `ancestor`=(`[:]`, ``, or ``) - - `before`=(`` or ``) - - `expose`=(`[/]`|`/[]`) - - `exited=` containers with exit code of `` - - `health`=(`starting`|`healthy`|`unhealthy`|`none`) - - `id=` a container's ID - - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) - - `is-task=`(`true`|`false`) - - `label=key` or `label="key=value"` of a container label - - `name=` a container's name - - `network`=(`` or ``) - - `publish`=(`[/]`|`/[]`) - - `since`=(`` or ``) - - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) - - `volume`=(`` or ``) - type: "string" - responses: - 200: - description: "no error" - schema: - $ref: "#/definitions/ContainerSummary" - examples: - application/json: - - Id: "8dfafdbc3a40" - Names: - - "/boring_feynman" - Image: "ubuntu:latest" - ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82" - Command: "echo 1" - Created: 1367854155 - State: "Exited" - Status: "Exit 0" - Ports: - - PrivatePort: 2222 - PublicPort: 3333 - Type: "tcp" - Labels: - com.example.vendor: "Acme" - com.example.license: "GPL" - com.example.version: "1.0" - SizeRw: 12288 - SizeRootFs: 0 - HostConfig: - NetworkMode: "default" - NetworkSettings: - Networks: - bridge: - NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812" - EndpointID: "2cdc4edb1ded3631c81f57966563e5c8525b81121bb3706a9a9a3ae102711f3f" - Gateway: "172.17.0.1" - IPAddress: "172.17.0.2" - IPPrefixLen: 16 - IPv6Gateway: "" - GlobalIPv6Address: "" - GlobalIPv6PrefixLen: 0 - MacAddress: "02:42:ac:11:00:02" - Mounts: - - Name: "fac362...80535" - Source: "/data" - Destination: "/data" - Driver: "local" - Mode: "ro,Z" - RW: false - Propagation: "" - - Id: "9cd87474be90" - Names: - - "/coolName" - Image: "ubuntu:latest" - ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82" - Command: "echo 222222" - Created: 1367854155 - State: "Exited" - Status: "Exit 0" - Ports: [] - Labels: {} - SizeRw: 12288 - SizeRootFs: 0 - HostConfig: - NetworkMode: "default" - NetworkSettings: - Networks: - bridge: - NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812" - EndpointID: "88eaed7b37b38c2a3f0c4bc796494fdf51b270c2d22656412a2ca5d559a64d7a" - Gateway: "172.17.0.1" - IPAddress: "172.17.0.8" - IPPrefixLen: 16 - IPv6Gateway: "" - GlobalIPv6Address: "" - GlobalIPv6PrefixLen: 0 - MacAddress: "02:42:ac:11:00:08" - Mounts: [] - - Id: "3176a2479c92" - Names: - - "/sleepy_dog" - Image: "ubuntu:latest" - ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82" - Command: "echo 3333333333333333" - Created: 1367854154 - State: "Exited" - Status: "Exit 0" - Ports: [] - Labels: {} - SizeRw: 12288 - SizeRootFs: 0 - HostConfig: - NetworkMode: "default" - NetworkSettings: - Networks: - bridge: - NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812" - EndpointID: "8b27c041c30326d59cd6e6f510d4f8d1d570a228466f956edf7815508f78e30d" - Gateway: "172.17.0.1" - IPAddress: "172.17.0.6" - IPPrefixLen: 16 - IPv6Gateway: "" - GlobalIPv6Address: "" - GlobalIPv6PrefixLen: 0 - MacAddress: "02:42:ac:11:00:06" - Mounts: [] - - Id: "4cb07b47f9fb" - Names: - - "/running_cat" - Image: "ubuntu:latest" - ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82" - Command: "echo 444444444444444444444444444444444" - Created: 1367854152 - State: "Exited" - Status: "Exit 0" - Ports: [] - Labels: {} - SizeRw: 12288 - SizeRootFs: 0 - HostConfig: - NetworkMode: "default" - NetworkSettings: - Networks: - bridge: - NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812" - EndpointID: "d91c7b2f0644403d7ef3095985ea0e2370325cd2332ff3a3225c4247328e66e9" - Gateway: "172.17.0.1" - IPAddress: "172.17.0.5" - IPPrefixLen: 16 - IPv6Gateway: "" - GlobalIPv6Address: "" - GlobalIPv6PrefixLen: 0 - MacAddress: "02:42:ac:11:00:05" - Mounts: [] - 400: - description: "bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["Container"] - /containers/create: - post: - summary: "Create a container" - operationId: "ContainerCreate" - consumes: - - "application/json" - - "application/octet-stream" - produces: - - "application/json" - parameters: - - name: "name" - in: "query" - description: "Assign the specified name to the container. Must match `/?[a-zA-Z0-9_-]+`." - type: "string" - pattern: "/?[a-zA-Z0-9_-]+" - - name: "body" - in: "body" - description: "Container to create" - schema: - allOf: - - $ref: "#/definitions/ContainerConfig" - - type: "object" - properties: - HostConfig: - $ref: "#/definitions/HostConfig" - NetworkingConfig: - description: "This container's networking configuration." - type: "object" - properties: - EndpointsConfig: - description: "A mapping of network name to endpoint configuration for that network." - type: "object" - additionalProperties: - $ref: "#/definitions/EndpointSettings" - example: - Hostname: "" - Domainname: "" - User: "" - AttachStdin: false - AttachStdout: true - AttachStderr: true - Tty: false - OpenStdin: false - StdinOnce: false - Env: - - "FOO=bar" - - "BAZ=quux" - Cmd: - - "date" - Entrypoint: "" - Image: "ubuntu" - Labels: - com.example.vendor: "Acme" - com.example.license: "GPL" - com.example.version: "1.0" - Volumes: - /volumes/data: {} - WorkingDir: "" - NetworkDisabled: false - MacAddress: "12:34:56:78:9a:bc" - ExposedPorts: - 22/tcp: {} - StopSignal: "SIGTERM" - StopTimeout: 10 - HostConfig: - Binds: - - "/tmp:/tmp" - Links: - - "redis3:redis" - Memory: 0 - MemorySwap: 0 - MemoryReservation: 0 - KernelMemory: 0 - NanoCPUs: 500000 - CpuPercent: 80 - CpuShares: 512 - CpuPeriod: 100000 - CpuRealtimePeriod: 1000000 - CpuRealtimeRuntime: 10000 - CpuQuota: 50000 - CpusetCpus: "0,1" - CpusetMems: "0,1" - MaximumIOps: 0 - MaximumIOBps: 0 - BlkioWeight: 300 - BlkioWeightDevice: - - {} - BlkioDeviceReadBps: - - {} - BlkioDeviceReadIOps: - - {} - BlkioDeviceWriteBps: - - {} - BlkioDeviceWriteIOps: - - {} - MemorySwappiness: 60 - OomKillDisable: false - OomScoreAdj: 500 - PidMode: "" - PidsLimit: -1 - PortBindings: - 22/tcp: - - HostPort: "11022" - PublishAllPorts: false - Privileged: false - ReadonlyRootfs: false - Dns: - - "8.8.8.8" - DnsOptions: - - "" - DnsSearch: - - "" - VolumesFrom: - - "parent" - - "other:ro" - CapAdd: - - "NET_ADMIN" - CapDrop: - - "MKNOD" - GroupAdd: - - "newgroup" - RestartPolicy: - Name: "" - MaximumRetryCount: 0 - AutoRemove: true - NetworkMode: "bridge" - Devices: [] - Ulimits: - - {} - LogConfig: - Type: "json-file" - Config: {} - SecurityOpt: [] - StorageOpt: {} - CgroupParent: "" - VolumeDriver: "" - ShmSize: 67108864 - NetworkingConfig: - EndpointsConfig: - isolated_nw: - IPAMConfig: - IPv4Address: "172.20.30.33" - IPv6Address: "2001:db8:abcd::3033" - LinkLocalIPs: - - "169.254.34.68" - - "fe80::3468" - Links: - - "container_1" - - "container_2" - Aliases: - - "server_x" - - "server_y" - - required: true - responses: - 201: - description: "Container created successfully" - schema: - type: "object" - title: "ContainerCreateResponse" - description: "OK response to ContainerCreate operation" - required: [Id, Warnings] - properties: - Id: - description: "The ID of the created container" - type: "string" - x-nullable: false - Warnings: - description: "Warnings encountered when creating the container" - type: "array" - x-nullable: false - items: - type: "string" - examples: - application/json: - Id: "e90e34656806" - Warnings: [] - 400: - description: "bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 409: - description: "conflict" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["Container"] - /containers/{id}/json: - get: - summary: "Inspect a container" - description: "Return low-level information about a container." - operationId: "ContainerInspect" - produces: - - "application/json" - responses: - 200: - description: "no error" - schema: - type: "object" - title: "ContainerInspectResponse" - properties: - Id: - description: "The ID of the container" - type: "string" - Created: - description: "The time the container was created" - type: "string" - Path: - description: "The path to the command being run" - type: "string" - Args: - description: "The arguments to the command being run" - type: "array" - items: - type: "string" - State: - description: "The state of the container." - type: "object" - properties: - Status: - description: | - The status of the container. For example, `"running"` or `"exited"`. - type: "string" - enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"] - Running: - description: | - Whether this container is running. - - Note that a running container can be _paused_. The `Running` and `Paused` - booleans are not mutually exclusive: - - When pausing a container (on Linux), the cgroups freezer is used to suspend - all processes in the container. Freezing the process requires the process to - be running. As a result, paused containers are both `Running` _and_ `Paused`. - - Use the `Status` field instead to determine if a container's state is "running". - type: "boolean" - Paused: - description: "Whether this container is paused." - type: "boolean" - Restarting: - description: "Whether this container is restarting." - type: "boolean" - OOMKilled: - description: "Whether this container has been killed because it ran out of memory." - type: "boolean" - Dead: - type: "boolean" - Pid: - description: "The process ID of this container" - type: "integer" - ExitCode: - description: "The last exit code of this container" - type: "integer" - Error: - type: "string" - StartedAt: - description: "The time when this container was last started." - type: "string" - FinishedAt: - description: "The time when this container last exited." - type: "string" - Image: - description: "The container's image" - type: "string" - ResolvConfPath: - type: "string" - HostnamePath: - type: "string" - HostsPath: - type: "string" - LogPath: - type: "string" - Node: - description: "TODO" - type: "object" - Name: - type: "string" - RestartCount: - type: "integer" - Driver: - type: "string" - MountLabel: - type: "string" - ProcessLabel: - type: "string" - AppArmorProfile: - type: "string" - ExecIDs: - type: "string" - HostConfig: - $ref: "#/definitions/HostConfig" - GraphDriver: - $ref: "#/definitions/GraphDriverData" - SizeRw: - description: "The size of files that have been created or changed by this container." - type: "integer" - format: "int64" - SizeRootFs: - description: "The total size of all the files in this container." - type: "integer" - format: "int64" - Mounts: - type: "array" - items: - $ref: "#/definitions/MountPoint" - Config: - $ref: "#/definitions/ContainerConfig" - NetworkSettings: - $ref: "#/definitions/NetworkSettings" - examples: - application/json: - AppArmorProfile: "" - Args: - - "-c" - - "exit 9" - Config: - AttachStderr: true - AttachStdin: false - AttachStdout: true - Cmd: - - "/bin/sh" - - "-c" - - "exit 9" - Domainname: "" - Env: - - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - Hostname: "ba033ac44011" - Image: "ubuntu" - Labels: - com.example.vendor: "Acme" - com.example.license: "GPL" - com.example.version: "1.0" - MacAddress: "" - NetworkDisabled: false - OpenStdin: false - StdinOnce: false - Tty: false - User: "" - Volumes: - /volumes/data: {} - WorkingDir: "" - StopSignal: "SIGTERM" - StopTimeout: 10 - Created: "2015-01-06T15:47:31.485331387Z" - Driver: "devicemapper" - HostConfig: - MaximumIOps: 0 - MaximumIOBps: 0 - BlkioWeight: 0 - BlkioWeightDevice: - - {} - BlkioDeviceReadBps: - - {} - BlkioDeviceWriteBps: - - {} - BlkioDeviceReadIOps: - - {} - BlkioDeviceWriteIOps: - - {} - ContainerIDFile: "" - CpusetCpus: "" - CpusetMems: "" - CpuPercent: 80 - CpuShares: 0 - CpuPeriod: 100000 - CpuRealtimePeriod: 1000000 - CpuRealtimeRuntime: 10000 - Devices: [] - IpcMode: "" - LxcConf: [] - Memory: 0 - MemorySwap: 0 - MemoryReservation: 0 - KernelMemory: 0 - OomKillDisable: false - OomScoreAdj: 500 - NetworkMode: "bridge" - PidMode: "" - PortBindings: {} - Privileged: false - ReadonlyRootfs: false - PublishAllPorts: false - RestartPolicy: - MaximumRetryCount: 2 - Name: "on-failure" - LogConfig: - Type: "json-file" - Sysctls: - net.ipv4.ip_forward: "1" - Ulimits: - - {} - VolumeDriver: "" - ShmSize: 67108864 - HostnamePath: "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname" - HostsPath: "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts" - LogPath: "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log" - Id: "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39" - Image: "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2" - MountLabel: "" - Name: "/boring_euclid" - NetworkSettings: - Bridge: "" - SandboxID: "" - HairpinMode: false - LinkLocalIPv6Address: "" - LinkLocalIPv6PrefixLen: 0 - SandboxKey: "" - EndpointID: "" - Gateway: "" - GlobalIPv6Address: "" - GlobalIPv6PrefixLen: 0 - IPAddress: "" - IPPrefixLen: 0 - IPv6Gateway: "" - MacAddress: "" - Networks: - bridge: - NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812" - EndpointID: "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d" - Gateway: "172.17.0.1" - IPAddress: "172.17.0.2" - IPPrefixLen: 16 - IPv6Gateway: "" - GlobalIPv6Address: "" - GlobalIPv6PrefixLen: 0 - MacAddress: "02:42:ac:12:00:02" - Path: "/bin/sh" - ProcessLabel: "" - ResolvConfPath: "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf" - RestartCount: 1 - State: - Error: "" - ExitCode: 9 - FinishedAt: "2015-01-06T15:47:32.080254511Z" - OOMKilled: false - Dead: false - Paused: false - Pid: 0 - Restarting: false - Running: true - StartedAt: "2015-01-06T15:47:32.072697474Z" - Status: "running" - Mounts: - - Name: "fac362...80535" - Source: "/data" - Destination: "/data" - Driver: "local" - Mode: "ro,Z" - RW: false - Propagation: "" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "size" - in: "query" - type: "boolean" - default: false - description: "Return the size of container as fields `SizeRw` and `SizeRootFs`" - tags: ["Container"] - /containers/{id}/top: - get: - summary: "List processes running inside a container" - description: "On Unix systems, this is done by running the `ps` command. This endpoint is not supported on Windows." - operationId: "ContainerTop" - responses: - 200: - description: "no error" - schema: - type: "object" - title: "ContainerTopResponse" - description: "OK response to ContainerTop operation" - properties: - Titles: - description: "The ps column titles" - type: "array" - items: - type: "string" - Processes: - description: "Each process running in the container, where each is process is an array of values corresponding to the titles" - type: "array" - items: - type: "array" - items: - type: "string" - examples: - application/json: - Titles: - - "UID" - - "PID" - - "PPID" - - "C" - - "STIME" - - "TTY" - - "TIME" - - "CMD" - Processes: - - - - "root" - - "13642" - - "882" - - "0" - - "17:03" - - "pts/0" - - "00:00:00" - - "/bin/bash" - - - - "root" - - "13735" - - "13642" - - "0" - - "17:06" - - "pts/0" - - "00:00:00" - - "sleep 10" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "ps_args" - in: "query" - description: "The arguments to pass to `ps`. For example, `aux`" - type: "string" - default: "-ef" - tags: ["Container"] - /containers/{id}/logs: - get: - summary: "Get container logs" - description: | - Get `stdout` and `stderr` logs from a container. - - Note: This endpoint works only for containers with the `json-file` or `journald` logging driver. - operationId: "ContainerLogs" - responses: - 101: - description: "logs returned as a stream" - schema: - type: "string" - format: "binary" - 200: - description: "logs returned as a string in response body" - schema: - type: "string" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "follow" - in: "query" - description: | - Return the logs as a stream. - - This will return a `101` HTTP response with a `Connection: upgrade` header, then hijack the HTTP connection to send raw output. For more information about hijacking and the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach). - type: "boolean" - default: false - - name: "stdout" - in: "query" - description: "Return logs from `stdout`" - type: "boolean" - default: false - - name: "stderr" - in: "query" - description: "Return logs from `stderr`" - type: "boolean" - default: false - - name: "since" - in: "query" - description: "Only return logs since this time, as a UNIX timestamp" - type: "integer" - default: 0 - - name: "until" - in: "query" - description: "Only return logs before this time, as a UNIX timestamp" - type: "integer" - default: 0 - - name: "timestamps" - in: "query" - description: "Add timestamps to every log line" - type: "boolean" - default: false - - name: "tail" - in: "query" - description: "Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines." - type: "string" - default: "all" - tags: ["Container"] - /containers/{id}/changes: - get: - summary: "Get changes on a container’s filesystem" - description: | - Returns which files in a container's filesystem have been added, deleted, - or modified. The `Kind` of modification can be one of: - - - `0`: Modified - - `1`: Added - - `2`: Deleted - operationId: "ContainerChanges" - produces: ["application/json"] - responses: - 200: - description: "The list of changes" - schema: - type: "array" - items: - type: "object" - x-go-name: "ContainerChangeResponseItem" - title: "ContainerChangeResponseItem" - description: "change item in response to ContainerChanges operation" - required: [Path, Kind] - properties: - Path: - description: "Path to file that has changed" - type: "string" - x-nullable: false - Kind: - description: "Kind of change" - type: "integer" - format: "uint8" - enum: [0, 1, 2] - x-nullable: false - examples: - application/json: - - Path: "/dev" - Kind: 0 - - Path: "/dev/kmsg" - Kind: 1 - - Path: "/test" - Kind: 1 - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - tags: ["Container"] - /containers/{id}/export: - get: - summary: "Export a container" - description: "Export the contents of a container as a tarball." - operationId: "ContainerExport" - produces: - - "application/octet-stream" - responses: - 200: - description: "no error" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - tags: ["Container"] - /containers/{id}/stats: - get: - summary: "Get container stats based on resource usage" - description: | - This endpoint returns a live stream of a container’s resource usage - statistics. - - The `precpu_stats` is the CPU statistic of last read, which is used - for calculating the CPU usage percentage. It is not the same as the - `cpu_stats` field. - - If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is - nil then for compatibility with older daemons the length of the - corresponding `cpu_usage.percpu_usage` array should be used. - operationId: "ContainerStats" - produces: ["application/json"] - responses: - 200: - description: "no error" - schema: - type: "object" - examples: - application/json: - read: "2015-01-08T22:57:31.547920715Z" - pids_stats: - current: 3 - networks: - eth0: - rx_bytes: 5338 - rx_dropped: 0 - rx_errors: 0 - rx_packets: 36 - tx_bytes: 648 - tx_dropped: 0 - tx_errors: 0 - tx_packets: 8 - eth5: - rx_bytes: 4641 - rx_dropped: 0 - rx_errors: 0 - rx_packets: 26 - tx_bytes: 690 - tx_dropped: 0 - tx_errors: 0 - tx_packets: 9 - memory_stats: - stats: - total_pgmajfault: 0 - cache: 0 - mapped_file: 0 - total_inactive_file: 0 - pgpgout: 414 - rss: 6537216 - total_mapped_file: 0 - writeback: 0 - unevictable: 0 - pgpgin: 477 - total_unevictable: 0 - pgmajfault: 0 - total_rss: 6537216 - total_rss_huge: 6291456 - total_writeback: 0 - total_inactive_anon: 0 - rss_huge: 6291456 - hierarchical_memory_limit: 67108864 - total_pgfault: 964 - total_active_file: 0 - active_anon: 6537216 - total_active_anon: 6537216 - total_pgpgout: 414 - total_cache: 0 - inactive_anon: 0 - active_file: 0 - pgfault: 964 - inactive_file: 0 - total_pgpgin: 477 - max_usage: 6651904 - usage: 6537216 - failcnt: 0 - limit: 67108864 - blkio_stats: {} - cpu_stats: - cpu_usage: - percpu_usage: - - 8646879 - - 24472255 - - 36438778 - - 30657443 - usage_in_usermode: 50000000 - total_usage: 100215355 - usage_in_kernelmode: 30000000 - system_cpu_usage: 739306590000000 - online_cpus: 4 - throttling_data: - periods: 0 - throttled_periods: 0 - throttled_time: 0 - precpu_stats: - cpu_usage: - percpu_usage: - - 8646879 - - 24350896 - - 36438778 - - 30657443 - usage_in_usermode: 50000000 - total_usage: 100093996 - usage_in_kernelmode: 30000000 - system_cpu_usage: 9492140000000 - online_cpus: 4 - throttling_data: - periods: 0 - throttled_periods: 0 - throttled_time: 0 - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "stream" - in: "query" - description: "Stream the output. If false, the stats will be output once and then it will disconnect." - type: "boolean" - default: true - tags: ["Container"] - /containers/{id}/resize: - post: - summary: "Resize a container TTY" - description: "Resize the TTY for a container. You must restart the container for the resize to take effect." - operationId: "ContainerResize" - consumes: - - "application/octet-stream" - produces: - - "text/plain" - responses: - 200: - description: "no error" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "cannot resize container" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "h" - in: "query" - description: "Height of the tty session in characters" - type: "integer" - - name: "w" - in: "query" - description: "Width of the tty session in characters" - type: "integer" - tags: ["Container"] - /containers/{id}/start: - post: - summary: "Start a container" - operationId: "ContainerStart" - responses: - 204: - description: "no error" - 304: - description: "container already started" - schema: - $ref: "#/definitions/ErrorResponse" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "detachKeys" - in: "query" - description: "Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`." - type: "string" - tags: ["Container"] - /containers/{id}/stop: - post: - summary: "Stop a container" - operationId: "ContainerStop" - responses: - 204: - description: "no error" - 304: - description: "container already stopped" - schema: - $ref: "#/definitions/ErrorResponse" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "t" - in: "query" - description: "Number of seconds to wait before killing the container" - type: "integer" - tags: ["Container"] - /containers/{id}/restart: - post: - summary: "Restart a container" - operationId: "ContainerRestart" - responses: - 204: - description: "no error" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "t" - in: "query" - description: "Number of seconds to wait before killing the container" - type: "integer" - tags: ["Container"] - /containers/{id}/kill: - post: - summary: "Kill a container" - description: "Send a POSIX signal to a container, defaulting to killing to the container." - operationId: "ContainerKill" - responses: - 204: - description: "no error" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "signal" - in: "query" - description: "Signal to send to the container as an integer or string (e.g. `SIGINT`)" - type: "string" - default: "SIGKILL" - tags: ["Container"] - /containers/{id}/update: - post: - summary: "Update a container" - description: "Change various configuration options of a container without having to recreate it." - operationId: "ContainerUpdate" - consumes: ["application/json"] - produces: ["application/json"] - responses: - 200: - description: "The container has been updated." - schema: - type: "object" - title: "ContainerUpdateResponse" - description: "OK response to ContainerUpdate operation" - properties: - Warnings: - type: "array" - items: - type: "string" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "update" - in: "body" - required: true - schema: - allOf: - - $ref: "#/definitions/Resources" - - type: "object" - properties: - RestartPolicy: - $ref: "#/definitions/RestartPolicy" - example: - BlkioWeight: 300 - CpuShares: 512 - CpuPeriod: 100000 - CpuQuota: 50000 - CpuRealtimePeriod: 1000000 - CpuRealtimeRuntime: 10000 - CpusetCpus: "0,1" - CpusetMems: "0" - Memory: 314572800 - MemorySwap: 514288000 - MemoryReservation: 209715200 - KernelMemory: 52428800 - RestartPolicy: - MaximumRetryCount: 4 - Name: "on-failure" - tags: ["Container"] - /containers/{id}/rename: - post: - summary: "Rename a container" - operationId: "ContainerRename" - responses: - 204: - description: "no error" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 409: - description: "name already in use" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "name" - in: "query" - required: true - description: "New name for the container" - type: "string" - tags: ["Container"] - /containers/{id}/pause: - post: - summary: "Pause a container" - description: | - Use the cgroups freezer to suspend all processes in a container. - - Traditionally, when suspending a process the `SIGSTOP` signal is used, which is observable by the process being suspended. With the cgroups freezer the process is unaware, and unable to capture, that it is being suspended, and subsequently resumed. - operationId: "ContainerPause" - responses: - 204: - description: "no error" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - tags: ["Container"] - /containers/{id}/unpause: - post: - summary: "Unpause a container" - description: "Resume a container which has been paused." - operationId: "ContainerUnpause" - responses: - 204: - description: "no error" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - tags: ["Container"] - /containers/{id}/attach: - post: - summary: "Attach to a container" - description: | - Attach to a container to read its output or send it input. You can attach to the same container multiple times and you can reattach to containers that have been detached. - - Either the `stream` or `logs` parameter must be `true` for this endpoint to do anything. - - See [the documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) for more details. - - ### Hijacking - - This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, and `stderr` on the same socket. - - This is the response from the daemon for an attach request: - - ``` - HTTP/1.1 200 OK - Content-Type: application/vnd.docker.raw-stream - - [STREAM] - ``` - - After the headers and two new lines, the TCP connection can now be used for raw, bidirectional communication between the client and server. - - To hint potential proxies about connection hijacking, the Docker client can also optionally send connection upgrade headers. - - For example, the client sends this request to upgrade the connection: - - ``` - POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 - Upgrade: tcp - Connection: Upgrade - ``` - - The Docker daemon will respond with a `101 UPGRADED` response, and will similarly follow with the raw stream: - - ``` - HTTP/1.1 101 UPGRADED - Content-Type: application/vnd.docker.raw-stream - Connection: Upgrade - Upgrade: tcp - - [STREAM] - ``` - - ### Stream format - - When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), the stream over the hijacked connected is multiplexed to separate out `stdout` and `stderr`. The stream consists of a series of frames, each containing a header and a payload. - - The header contains the information which the stream writes (`stdout` or `stderr`). It also contains the size of the associated frame encoded in the last four bytes (`uint32`). - - It is encoded on the first eight bytes like this: - - ```go - header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} - ``` - - `STREAM_TYPE` can be: - - - 0: `stdin` (is written on `stdout`) - - 1: `stdout` - - 2: `stderr` - - `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size encoded as big endian. - - Following the header is the payload, which is the specified number of bytes of `STREAM_TYPE`. - - The simplest way to implement this protocol is the following: - - 1. Read 8 bytes. - 2. Choose `stdout` or `stderr` depending on the first byte. - 3. Extract the frame size from the last four bytes. - 4. Read the extracted size and output it on the correct output. - 5. Goto 1. - - ### Stream format when using a TTY - - When the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate), the stream is not multiplexed. The data exchanged over the hijacked connection is simply the raw data from the process PTY and client's `stdin`. - - operationId: "ContainerAttach" - produces: - - "application/vnd.docker.raw-stream" - responses: - 101: - description: "no error, hints proxy about hijacking" - 200: - description: "no error, no upgrade header found" - 400: - description: "bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "detachKeys" - in: "query" - description: "Override the key sequence for detaching a container.Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`." - type: "string" - - name: "logs" - in: "query" - description: | - Replay previous logs from the container. - - This is useful for attaching to a container that has started and you want to output everything since the container started. - - If `stream` is also enabled, once all the previous output has been returned, it will seamlessly transition into streaming current output. - type: "boolean" - default: false - - name: "stream" - in: "query" - description: "Stream attached streams from the time the request was made onwards" - type: "boolean" - default: false - - name: "stdin" - in: "query" - description: "Attach to `stdin`" - type: "boolean" - default: false - - name: "stdout" - in: "query" - description: "Attach to `stdout`" - type: "boolean" - default: false - - name: "stderr" - in: "query" - description: "Attach to `stderr`" - type: "boolean" - default: false - tags: ["Container"] - /containers/{id}/attach/ws: - get: - summary: "Attach to a container via a websocket" - operationId: "ContainerAttachWebsocket" - responses: - 101: - description: "no error, hints proxy about hijacking" - 200: - description: "no error, no upgrade header found" - 400: - description: "bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "detachKeys" - in: "query" - description: "Override the key sequence for detaching a container.Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,`, or `_`." - type: "string" - - name: "logs" - in: "query" - description: "Return logs" - type: "boolean" - default: false - - name: "stream" - in: "query" - description: "Return stream" - type: "boolean" - default: false - - name: "stdin" - in: "query" - description: "Attach to `stdin`" - type: "boolean" - default: false - - name: "stdout" - in: "query" - description: "Attach to `stdout`" - type: "boolean" - default: false - - name: "stderr" - in: "query" - description: "Attach to `stderr`" - type: "boolean" - default: false - tags: ["Container"] - /containers/{id}/wait: - post: - summary: "Wait for a container" - description: "Block until a container stops, then returns the exit code." - operationId: "ContainerWait" - produces: ["application/json"] - responses: - 200: - description: "The container has exit." - schema: - type: "object" - title: "ContainerWaitResponse" - description: "OK response to ContainerWait operation" - required: [StatusCode] - properties: - StatusCode: - description: "Exit code of the container" - type: "integer" - x-nullable: false - Error: - description: "container waiting error, if any" - type: "object" - properties: - Message: - description: "Details of an error" - type: "string" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "condition" - in: "query" - description: "Wait until a container state reaches the given condition, either 'not-running' (default), 'next-exit', or 'removed'." - type: "string" - default: "not-running" - tags: ["Container"] - /containers/{id}: - delete: - summary: "Remove a container" - operationId: "ContainerDelete" - responses: - 204: - description: "no error" - 400: - description: "bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 409: - description: "conflict" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "You cannot remove a running container: c2ada9df5af8. Stop the container before attempting removal or force remove" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "v" - in: "query" - description: "Remove the volumes associated with the container." - type: "boolean" - default: false - - name: "force" - in: "query" - description: "If the container is running, kill it before removing it." - type: "boolean" - default: false - - name: "link" - in: "query" - description: "Remove the specified link associated with the container." - type: "boolean" - default: false - tags: ["Container"] - /containers/{id}/archive: - head: - summary: "Get information about files in a container" - description: "A response header `X-Docker-Container-Path-Stat` is return containing a base64 - encoded JSON object with some filesystem header information about the path." - operationId: "ContainerArchiveInfo" - responses: - 200: - description: "no error" - headers: - X-Docker-Container-Path-Stat: - type: "string" - description: "TODO" - 400: - description: "Bad parameter" - schema: - allOf: - - $ref: "#/definitions/ErrorResponse" - - type: "object" - properties: - message: - description: "The error message. Either \"must specify path parameter\" (path cannot be empty) or \"not a directory\" (path was asserted to be a directory but exists as a file)." - type: "string" - x-nullable: false - 404: - description: "Container or path does not exist" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "path" - in: "query" - required: true - description: "Resource in the container’s filesystem to archive." - type: "string" - tags: ["Container"] - get: - summary: "Get an archive of a filesystem resource in a container" - description: "Get a tar archive of a resource in the filesystem of container id." - operationId: "ContainerArchive" - produces: ["application/x-tar"] - responses: - 200: - description: "no error" - 400: - description: "Bad parameter" - schema: - allOf: - - $ref: "#/definitions/ErrorResponse" - - type: "object" - properties: - message: - description: "The error message. Either \"must specify path parameter\" (path cannot be empty) or \"not a directory\" (path was asserted to be a directory but exists as a file)." - type: "string" - x-nullable: false - 404: - description: "Container or path does not exist" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "path" - in: "query" - required: true - description: "Resource in the container’s filesystem to archive." - type: "string" - tags: ["Container"] - put: - summary: "Extract an archive of files or folders to a directory in a container" - description: "Upload a tar archive to be extracted to a path in the filesystem of container id." - operationId: "PutContainerArchive" - consumes: ["application/x-tar", "application/octet-stream"] - responses: - 200: - description: "The content was extracted successfully" - 400: - description: "Bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 403: - description: "Permission denied, the volume or container rootfs is marked as read-only." - schema: - $ref: "#/definitions/ErrorResponse" - 404: - description: "No such container or path does not exist inside the container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the container" - type: "string" - - name: "path" - in: "query" - required: true - description: "Path to a directory in the container to extract the archive’s contents into. " - type: "string" - - name: "noOverwriteDirNonDir" - in: "query" - description: "If “1”, “true”, or “True” then it will be an error if unpacking the given content would cause an existing directory to be replaced with a non-directory and vice versa." - type: "string" - - name: "inputStream" - in: "body" - required: true - description: "The input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz." - schema: - type: "string" - tags: ["Container"] - /containers/prune: - post: - summary: "Delete stopped containers" - produces: - - "application/json" - operationId: "ContainerPrune" - parameters: - - name: "filters" - in: "query" - description: | - Filters to process on the prune list, encoded as JSON (a `map[string][]string`). - - Available filters: - - `until=` Prune containers created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. - - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune containers with (or without, in case `label!=...` is used) the specified labels. - type: "string" - responses: - 200: - description: "No error" - schema: - type: "object" - title: "ContainerPruneResponse" - properties: - ContainersDeleted: - description: "Container IDs that were deleted" - type: "array" - items: - type: "string" - SpaceReclaimed: - description: "Disk space reclaimed in bytes" - type: "integer" - format: "int64" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["Container"] - /images/json: - get: - summary: "List Images" - 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." - operationId: "ImageList" - produces: - - "application/json" - responses: - 200: - description: "Summary image data for the images matching the query" - schema: - type: "array" - items: - $ref: "#/definitions/ImageSummary" - examples: - application/json: - - Id: "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" - ParentId: "" - RepoTags: - - "ubuntu:12.04" - - "ubuntu:precise" - RepoDigests: - - "ubuntu@sha256:992069aee4016783df6345315302fa59681aae51a8eeb2f889dea59290f21787" - Created: 1474925151 - Size: 103579269 - VirtualSize: 103579269 - SharedSize: 0 - Labels: {} - Containers: 2 - - Id: "sha256:3e314f95dcace0f5e4fd37b10862fe8398e3c60ed36600bc0ca5fda78b087175" - ParentId: "" - RepoTags: - - "ubuntu:12.10" - - "ubuntu:quantal" - RepoDigests: - - "ubuntu@sha256:002fba3e3255af10be97ea26e476692a7ebed0bb074a9ab960b2e7a1526b15d7" - - "ubuntu@sha256:68ea0200f0b90df725d99d823905b04cf844f6039ef60c60bf3e019915017bd3" - Created: 1403128455 - Size: 172064416 - VirtualSize: 172064416 - SharedSize: 0 - Labels: {} - Containers: 5 - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "all" - in: "query" - description: "Show all images. Only images from a final layer (no children) are shown by default." - type: "boolean" - default: false - - name: "filters" - in: "query" - description: | - A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: - - - `before`=(`[:]`, `` or ``) - - `dangling=true` - - `label=key` or `label="key=value"` of an image label - - `reference`=(`[:]`) - - `since`=(`[:]`, `` or ``) - type: "string" - - name: "digests" - in: "query" - description: "Show digest information as a `RepoDigests` field on each image." - type: "boolean" - default: false - tags: ["Image"] - /build: - post: - summary: "Build an image" - description: | - Build an image from a tar archive with a `Dockerfile` in it. - - The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/). - - The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. - - The build is canceled if the client drops the connection by quitting or being killed. - operationId: "ImageBuild" - consumes: - - "application/octet-stream" - produces: - - "application/json" - parameters: - - name: "inputStream" - in: "body" - description: "A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz." - schema: - type: "string" - format: "binary" - - name: "dockerfile" - in: "query" - description: "Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`." - type: "string" - default: "Dockerfile" - - name: "t" - in: "query" - 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." - type: "string" - - name: "extrahosts" - in: "query" - description: "Extra hosts to add to /etc/hosts" - type: "string" - - name: "remote" - in: "query" - 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." - type: "string" - - name: "q" - in: "query" - description: "Suppress verbose build output." - type: "boolean" - default: false - - name: "nocache" - in: "query" - description: "Do not use the cache when building the image." - type: "boolean" - default: false - - name: "cachefrom" - in: "query" - description: "JSON array of images used for build cache resolution." - type: "string" - - name: "pull" - in: "query" - description: "Attempt to pull the image even if an older image exists locally." - type: "string" - - name: "rm" - in: "query" - description: "Remove intermediate containers after a successful build." - type: "boolean" - default: true - - name: "forcerm" - in: "query" - description: "Always remove intermediate containers, even upon failure." - type: "boolean" - default: false - - name: "memory" - in: "query" - description: "Set memory limit for build." - type: "integer" - - name: "memswap" - in: "query" - description: "Total memory (memory + swap). Set as `-1` to disable swap." - type: "integer" - - name: "cpushares" - in: "query" - description: "CPU shares (relative weight)." - type: "integer" - - name: "cpusetcpus" - in: "query" - description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)." - type: "string" - - name: "cpuperiod" - in: "query" - description: "The length of a CPU period in microseconds." - type: "integer" - - name: "cpuquota" - in: "query" - description: "Microseconds of CPU time that the container can get in a CPU period." - type: "integer" - - name: "buildargs" - in: "query" - description: "JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values. [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg)" - type: "string" - - name: "shmsize" - in: "query" - description: "Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB." - type: "integer" - - name: "squash" - in: "query" - description: "Squash the resulting images layers into a single layer. *(Experimental release only.)*" - type: "boolean" - - name: "labels" - in: "query" - description: "Arbitrary key/value labels to set on the image, as a JSON map of string pairs." - type: "string" - - name: "networkmode" - in: "query" - description: "Sets the networking mode for the run commands during build. Supported standard values are: `bridge`, `host`, `none`, and `container:`. Any other value is taken as a custom network's name to which this container should connect to." - type: "string" - - name: "Content-type" - in: "header" - type: "string" - enum: - - "application/x-tar" - default: "application/x-tar" - - name: "X-Registry-Config" - in: "header" - description: | - This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to. - - The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example: - - ``` - { - "docker.example.com": { - "username": "janedoe", - "password": "hunter2" - }, - "https://index.docker.io/v1/": { - "username": "mobydock", - "password": "conta1n3rize14" - } - } - ``` - - Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a `https://` prefix and a `/v1/` suffix even though Docker will prefer to use the v2 registry API. - type: "string" - - name: "platform" - in: "query" - description: "Platform in the format os[/arch[/variant]]" - type: "string" - default: "" - responses: - 200: - description: "no error" - 400: - description: "Bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["Image"] - /build/prune: - post: - summary: "Delete builder cache" - produces: - - "application/json" - operationId: "BuildPrune" - responses: - 200: - description: "No error" - schema: - type: "object" - title: "BuildPruneResponse" - properties: - SpaceReclaimed: - description: "Disk space reclaimed in bytes" - type: "integer" - format: "int64" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["Image"] - /images/create: - post: - summary: "Create an image" - description: "Create an image by either pulling it from a registry or importing it." - operationId: "ImageCreate" - consumes: - - "text/plain" - - "application/octet-stream" - produces: - - "application/json" - responses: - 200: - description: "no error" - 404: - description: "repository does not exist or no read access" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "fromImage" - in: "query" - description: "Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed." - type: "string" - - name: "fromSrc" - in: "query" - description: "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image." - type: "string" - - name: "repo" - in: "query" - description: "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image." - type: "string" - - name: "tag" - in: "query" - description: "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled." - type: "string" - - name: "inputImage" - in: "body" - description: "Image content if the value `-` has been specified in fromSrc query parameter" - schema: - type: "string" - required: false - - name: "X-Registry-Auth" - in: "header" - description: "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)" - type: "string" - - name: "platform" - in: "query" - description: "Platform in the format os[/arch[/variant]]" - type: "string" - default: "" - tags: ["Image"] - /images/{name}/json: - get: - summary: "Inspect an image" - description: "Return low-level information about an image." - operationId: "ImageInspect" - produces: - - "application/json" - responses: - 200: - description: "No error" - schema: - $ref: "#/definitions/Image" - examples: - application/json: - Id: "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" - Container: "cb91e48a60d01f1e27028b4fc6819f4f290b3cf12496c8176ec714d0d390984a" - Comment: "" - Os: "linux" - Architecture: "amd64" - Parent: "sha256:91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c" - ContainerConfig: - Tty: false - Hostname: "e611e15f9c9d" - Domainname: "" - AttachStdout: false - PublishService: "" - AttachStdin: false - OpenStdin: false - StdinOnce: false - NetworkDisabled: false - OnBuild: [] - Image: "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c" - User: "" - WorkingDir: "" - MacAddress: "" - AttachStderr: false - Labels: - com.example.license: "GPL" - com.example.version: "1.0" - com.example.vendor: "Acme" - Env: - - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - Cmd: - - "/bin/sh" - - "-c" - - "#(nop) LABEL com.example.vendor=Acme com.example.license=GPL com.example.version=1.0" - DockerVersion: "1.9.0-dev" - VirtualSize: 188359297 - Size: 0 - Author: "" - Created: "2015-09-10T08:30:53.26995814Z" - GraphDriver: - Name: "aufs" - Data: {} - RepoDigests: - - "localhost:5000/test/busybox/example@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf" - RepoTags: - - "example:1.0" - - "example:latest" - - "example:stable" - Config: - Image: "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c" - NetworkDisabled: false - OnBuild: [] - StdinOnce: false - PublishService: "" - AttachStdin: false - OpenStdin: false - Domainname: "" - AttachStdout: false - Tty: false - Hostname: "e611e15f9c9d" - Cmd: - - "/bin/bash" - Env: - - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - Labels: - com.example.vendor: "Acme" - com.example.version: "1.0" - com.example.license: "GPL" - MacAddress: "" - AttachStderr: false - WorkingDir: "" - User: "" - RootFS: - Type: "layers" - Layers: - - "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6" - - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" - 404: - description: "No such image" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such image: someimage (tag: latest)" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "name" - in: "path" - description: "Image name or id" - type: "string" - required: true - tags: ["Image"] - /images/{name}/history: - get: - summary: "Get the history of an image" - description: "Return parent layers of an image." - operationId: "ImageHistory" - produces: ["application/json"] - responses: - 200: - description: "List of image layers" - schema: - type: "array" - items: - type: "object" - x-go-name: HistoryResponseItem - title: "HistoryResponseItem" - description: "individual image layer information in response to ImageHistory operation" - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false - examples: - application/json: - - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" - Created: 1398108230 - CreatedBy: "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /" - Tags: - - "ubuntu:lucid" - - "ubuntu:10.04" - Size: 182964289 - Comment: "" - - Id: "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8" - Created: 1398108222 - CreatedBy: "/bin/sh -c #(nop) MAINTAINER Tianon Gravi - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/" - Tags: [] - Size: 0 - Comment: "" - - Id: "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158" - Created: 1371157430 - CreatedBy: "" - Tags: - - "scratch12:latest" - - "scratch:latest" - Size: 0 - Comment: "Imported from -" - 404: - description: "No such image" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "name" - in: "path" - description: "Image name or ID" - type: "string" - required: true - tags: ["Image"] - /images/{name}/push: - post: - summary: "Push an image" - description: | - Push an image to a registry. - - If you wish to push an image on to a private registry, that image must already have a tag which references the registry. For example, `registry.example.com/myimage:latest`. - - The push is cancelled if the HTTP connection is closed. - operationId: "ImagePush" - consumes: - - "application/octet-stream" - responses: - 200: - description: "No error" - 404: - description: "No such image" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "name" - in: "path" - description: "Image name or ID." - type: "string" - required: true - - name: "tag" - in: "query" - description: "The tag to associate with the image on the registry." - type: "string" - - name: "X-Registry-Auth" - in: "header" - description: "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)" - type: "string" - required: true - tags: ["Image"] - /images/{name}/tag: - post: - summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." - operationId: "ImageTag" - responses: - 201: - description: "No error" - 400: - description: "Bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 404: - description: "No such image" - schema: - $ref: "#/definitions/ErrorResponse" - 409: - description: "Conflict" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "name" - in: "path" - description: "Image name or ID to tag." - type: "string" - required: true - - name: "repo" - in: "query" - description: "The repository to tag in. For example, `someuser/someimage`." - type: "string" - - name: "tag" - in: "query" - description: "The name of the new tag." - type: "string" - tags: ["Image"] - /images/{name}: - delete: - summary: "Remove an image" - description: | - Remove an image, along with any untagged parent images that were - referenced by that image. - - Images can't be removed if they have descendant images, are being - used by a running container or are being used by a build. - operationId: "ImageDelete" - produces: ["application/json"] - responses: - 200: - description: "The image was deleted successfully" - schema: - type: "array" - items: - $ref: "#/definitions/ImageDeleteResponseItem" - examples: - application/json: - - Untagged: "3e2f21a89f" - - Deleted: "3e2f21a89f" - - Deleted: "53b4f83ac9" - 404: - description: "No such image" - schema: - $ref: "#/definitions/ErrorResponse" - 409: - description: "Conflict" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "name" - in: "path" - description: "Image name or ID" - type: "string" - required: true - - name: "force" - in: "query" - description: "Remove the image even if it is being used by stopped containers or has other tags" - type: "boolean" - default: false - - name: "noprune" - in: "query" - description: "Do not delete untagged parent images" - type: "boolean" - default: false - tags: ["Image"] - /images/search: - get: - summary: "Search images" - description: "Search for an image on Docker Hub." - operationId: "ImageSearch" - produces: - - "application/json" - responses: - 200: - description: "No error" - schema: - type: "array" - items: - type: "object" - title: "ImageSearchResponseItem" - properties: - description: - type: "string" - is_official: - type: "boolean" - is_automated: - type: "boolean" - name: - type: "string" - star_count: - type: "integer" - examples: - application/json: - - description: "" - is_official: false - is_automated: false - name: "wma55/u1210sshd" - star_count: 0 - - description: "" - is_official: false - is_automated: false - name: "jdswinbank/sshd" - star_count: 0 - - description: "" - is_official: false - is_automated: false - name: "vgauthier/sshd" - star_count: 0 - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "term" - in: "query" - description: "Term to search" - type: "string" - required: true - - name: "limit" - in: "query" - description: "Maximum number of results to return" - type: "integer" - - name: "filters" - in: "query" - description: | - A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: - - - `is-automated=(true|false)` - - `is-official=(true|false)` - - `stars=` Matches images that has at least 'number' stars. - type: "string" - tags: ["Image"] - /images/prune: - post: - summary: "Delete unused images" - produces: - - "application/json" - operationId: "ImagePrune" - parameters: - - name: "filters" - in: "query" - description: | - Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: - - - `dangling=` When set to `true` (or `1`), prune only - unused *and* untagged images. When set to `false` - (or `0`), all unused images are pruned. - - `until=` Prune images created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. - - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune images with (or without, in case `label!=...` is used) the specified labels. - type: "string" - responses: - 200: - description: "No error" - schema: - type: "object" - title: "ImagePruneResponse" - properties: - ImagesDeleted: - description: "Images that were deleted" - type: "array" - items: - $ref: "#/definitions/ImageDeleteResponseItem" - SpaceReclaimed: - description: "Disk space reclaimed in bytes" - type: "integer" - format: "int64" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["Image"] - /auth: - post: - summary: "Check auth configuration" - description: "Validate credentials for a registry and, if available, get an identity token for accessing the registry without password." - operationId: "SystemAuth" - consumes: ["application/json"] - produces: ["application/json"] - responses: - 200: - description: "An identity token was generated successfully." - schema: - type: "object" - title: "SystemAuthResponse" - required: [Status] - properties: - Status: - description: "The status of the authentication" - type: "string" - x-nullable: false - IdentityToken: - description: "An opaque token used to authenticate a user after a successful login" - type: "string" - x-nullable: false - examples: - application/json: - Status: "Login Succeeded" - IdentityToken: "9cbaf023786cd7..." - 204: - description: "No error" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "authConfig" - in: "body" - description: "Authentication to check" - schema: - $ref: "#/definitions/AuthConfig" - tags: ["System"] - /info: - get: - summary: "Get system information" - operationId: "SystemInfo" - produces: - - "application/json" - responses: - 200: - description: "No error" - schema: - $ref: "#/definitions/SystemInfo" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["System"] - /version: - get: - summary: "Get version" - description: "Returns the version of Docker that is running and various information about the system that Docker is running on." - operationId: "SystemVersion" - produces: ["application/json"] - responses: - 200: - description: "no error" - schema: - type: "object" - title: "SystemVersionResponse" - properties: - Platform: - type: "object" - required: [Name] - properties: - Name: - type: "string" - Components: - type: "array" - items: - type: "object" - x-go-name: ComponentVersion - required: [Name, Version] - properties: - Name: - type: "string" - Version: - type: "string" - x-nullable: false - Details: - type: "object" - x-nullable: true - - Version: - type: "string" - ApiVersion: - type: "string" - MinAPIVersion: - type: "string" - GitCommit: - type: "string" - GoVersion: - type: "string" - Os: - type: "string" - Arch: - type: "string" - KernelVersion: - type: "string" - Experimental: - type: "boolean" - BuildTime: - type: "string" - examples: - application/json: - Version: "17.04.0" - Os: "linux" - KernelVersion: "3.19.0-23-generic" - GoVersion: "go1.7.5" - GitCommit: "deadbee" - Arch: "amd64" - ApiVersion: "1.27" - MinAPIVersion: "1.12" - BuildTime: "2016-06-14T07:09:13.444803460+00:00" - Experimental: true - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["System"] - /_ping: - get: - summary: "Ping" - description: "This is a dummy endpoint you can use to test if the server is accessible." - operationId: "SystemPing" - produces: ["text/plain"] - responses: - 200: - description: "no error" - schema: - type: "string" - example: "OK" - headers: - API-Version: - type: "string" - description: "Max API Version the server supports" - Docker-Experimental: - type: "boolean" - description: "If the server is running with experimental mode enabled" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["System"] - /commit: - post: - summary: "Create a new image from a container" - operationId: "ImageCommit" - consumes: - - "application/json" - produces: - - "application/json" - responses: - 201: - description: "no error" - schema: - $ref: "#/definitions/IdResponse" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "containerConfig" - in: "body" - description: "The container configuration" - schema: - $ref: "#/definitions/ContainerConfig" - - name: "container" - in: "query" - description: "The ID or name of the container to commit" - type: "string" - - name: "repo" - in: "query" - description: "Repository name for the created image" - type: "string" - - name: "tag" - in: "query" - description: "Tag name for the create image" - type: "string" - - name: "comment" - in: "query" - description: "Commit message" - type: "string" - - name: "author" - in: "query" - description: "Author of the image (e.g., `John Hannibal Smith `)" - type: "string" - - name: "pause" - in: "query" - description: "Whether to pause the container before committing" - type: "boolean" - default: true - - name: "changes" - in: "query" - description: "`Dockerfile` instructions to apply while committing" - type: "string" - tags: ["Image"] - /events: - get: - summary: "Monitor events" - description: | - Stream real-time events from the server. - - Various objects within Docker report events when something happens to them. - - Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, and `update` - - Images report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, and `untag` - - Volumes report these events: `create`, `mount`, `unmount`, and `destroy` - - Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, and `remove` - - The Docker daemon reports these events: `reload` - - Services report these events: `create`, `update`, and `remove` - - Nodes report these events: `create`, `update`, and `remove` - - Secrets report these events: `create`, `update`, and `remove` - - Configs report these events: `create`, `update`, and `remove` - - operationId: "SystemEvents" - produces: - - "application/json" - responses: - 200: - description: "no error" - schema: - type: "object" - title: "SystemEventsResponse" - properties: - Type: - description: "The type of object emitting the event" - type: "string" - Action: - description: "The type of event" - type: "string" - Actor: - type: "object" - properties: - ID: - description: "The ID of the object emitting the event" - type: "string" - Attributes: - description: "Various key/value attributes of the object, depending on its type" - type: "object" - additionalProperties: - type: "string" - time: - description: "Timestamp of event" - type: "integer" - timeNano: - description: "Timestamp of event, with nanosecond accuracy" - type: "integer" - format: "int64" - examples: - application/json: - Type: "container" - Action: "create" - Actor: - ID: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" - Attributes: - com.example.some-label: "some-label-value" - image: "alpine" - name: "my-container" - time: 1461943101 - 400: - description: "bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "since" - in: "query" - description: "Show events created since this timestamp then stream new events." - type: "string" - - name: "until" - in: "query" - description: "Show events created until this timestamp then stop streaming." - type: "string" - - name: "filters" - in: "query" - description: | - A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: - - - `config=` config name or ID - - `container=` container name or ID - - `daemon=` daemon name or ID - - `event=` event type - - `image=` image name or ID - - `label=` image or container label - - `network=` network name or ID - - `node=` node ID - - `plugin`= plugin name or ID - - `scope`= local or swarm - - `secret=` secret name or ID - - `service=` service name or ID - - `type=` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config` - - `volume=` volume name - type: "string" - tags: ["System"] - /system/df: - get: - summary: "Get data usage information" - operationId: "SystemDataUsage" - responses: - 200: - description: "no error" - schema: - type: "object" - title: "SystemDataUsageResponse" - properties: - LayersSize: - type: "integer" - format: "int64" - Images: - type: "array" - items: - $ref: "#/definitions/ImageSummary" - Containers: - type: "array" - items: - $ref: "#/definitions/ContainerSummary" - Volumes: - type: "array" - items: - $ref: "#/definitions/Volume" - example: - LayersSize: 1092588 - Images: - - - Id: "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749" - ParentId: "" - RepoTags: - - "busybox:latest" - RepoDigests: - - "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" - Created: 1466724217 - Size: 1092588 - SharedSize: 0 - VirtualSize: 1092588 - Labels: {} - Containers: 1 - Containers: - - - Id: "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148" - Names: - - "/top" - Image: "busybox" - ImageID: "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749" - Command: "top" - Created: 1472592424 - Ports: [] - SizeRootFs: 1092588 - Labels: {} - State: "exited" - Status: "Exited (0) 56 minutes ago" - HostConfig: - NetworkMode: "default" - NetworkSettings: - Networks: - bridge: - IPAMConfig: null - Links: null - Aliases: null - NetworkID: "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92" - EndpointID: "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a" - Gateway: "172.18.0.1" - IPAddress: "172.18.0.2" - IPPrefixLen: 16 - IPv6Gateway: "" - GlobalIPv6Address: "" - GlobalIPv6PrefixLen: 0 - MacAddress: "02:42:ac:12:00:02" - Mounts: [] - Volumes: - - - Name: "my-volume" - Driver: "local" - Mountpoint: "/var/lib/docker/volumes/my-volume/_data" - Labels: null - Scope: "local" - Options: null - UsageData: - Size: 10920104 - RefCount: 2 - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["System"] - /images/{name}/get: - get: - summary: "Export an image" - description: | - Get a tarball containing all images and metadata for a repository. - - If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced. - - ### Image tarball format - - An image tarball contains one directory per image layer (named using its long ID), each containing these files: - - - `VERSION`: currently `1.0` - the file format version - - `json`: detailed layer information, similar to `docker inspect layer_id` - - `layer.tar`: A tarfile containing the filesystem changes in this layer - - The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions. - - If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs. - - ```json - { - "hello-world": { - "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" - } - } - ``` - operationId: "ImageGet" - produces: - - "application/x-tar" - responses: - 200: - description: "no error" - schema: - type: "string" - format: "binary" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "name" - in: "path" - description: "Image name or ID" - type: "string" - required: true - tags: ["Image"] - /images/get: - get: - summary: "Export several images" - description: | - Get a tarball containing all images and metadata for several image repositories. - - For each value of the `names` parameter: if it is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned; if it is an image ID, similarly only that image (and its parents) are returned and there would be no names referenced in the 'repositories' file for this image ID. - - For details on the format, see [the export image endpoint](#operation/ImageGet). - operationId: "ImageGetAll" - produces: - - "application/x-tar" - responses: - 200: - description: "no error" - schema: - type: "string" - format: "binary" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "names" - in: "query" - description: "Image names to filter by" - type: "array" - items: - type: "string" - tags: ["Image"] - /images/load: - post: - summary: "Import images" - description: | - Load a set of images and tags into a repository. - - For details on the format, see [the export image endpoint](#operation/ImageGet). - operationId: "ImageLoad" - consumes: - - "application/x-tar" - produces: - - "application/json" - responses: - 200: - description: "no error" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "imagesTarball" - in: "body" - description: "Tar archive containing images" - schema: - type: "string" - format: "binary" - - name: "quiet" - in: "query" - description: "Suppress progress details during load." - type: "boolean" - default: false - tags: ["Image"] - /containers/{id}/exec: - post: - summary: "Create an exec instance" - description: "Run a command inside a running container." - operationId: "ContainerExec" - consumes: - - "application/json" - produces: - - "application/json" - responses: - 201: - description: "no error" - schema: - $ref: "#/definitions/IdResponse" - 404: - description: "no such container" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such container: c2ada9df5af8" - 409: - description: "container is paused" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "execConfig" - in: "body" - description: "Exec configuration" - schema: - type: "object" - properties: - AttachStdin: - type: "boolean" - description: "Attach to `stdin` of the exec command." - AttachStdout: - type: "boolean" - description: "Attach to `stdout` of the exec command." - AttachStderr: - type: "boolean" - description: "Attach to `stderr` of the exec command." - DetachKeys: - type: "string" - description: "Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`." - Tty: - type: "boolean" - description: "Allocate a pseudo-TTY." - Env: - description: "A list of environment variables in the form `[\"VAR=value\", ...]`." - type: "array" - items: - type: "string" - Cmd: - type: "array" - description: "Command to run, as a string or array of strings." - items: - type: "string" - Privileged: - type: "boolean" - description: "Runs the exec process with extended privileges." - default: false - User: - type: "string" - description: "The user, and optionally, group to run the exec process inside the container. Format is one of: `user`, `user:group`, `uid`, or `uid:gid`." - WorkingDir: - type: "string" - description: "The working directory for the exec process inside the container." - example: - AttachStdin: false - AttachStdout: true - AttachStderr: true - DetachKeys: "ctrl-p,ctrl-q" - Tty: false - Cmd: - - "date" - Env: - - "FOO=bar" - - "BAZ=quux" - required: true - - name: "id" - in: "path" - description: "ID or name of container" - type: "string" - required: true - tags: ["Exec"] - /exec/{id}/start: - post: - summary: "Start an exec instance" - description: "Starts a previously set up exec instance. If detach is true, this endpoint returns immediately after starting the command. Otherwise, it sets up an interactive session with the command." - operationId: "ExecStart" - consumes: - - "application/json" - produces: - - "application/vnd.docker.raw-stream" - responses: - 200: - description: "No error" - 404: - description: "No such exec instance" - schema: - $ref: "#/definitions/ErrorResponse" - 409: - description: "Container is stopped or paused" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "execStartConfig" - in: "body" - schema: - type: "object" - properties: - Detach: - type: "boolean" - description: "Detach from the command." - Tty: - type: "boolean" - description: "Allocate a pseudo-TTY." - example: - Detach: false - Tty: false - - name: "id" - in: "path" - description: "Exec instance ID" - required: true - type: "string" - tags: ["Exec"] - /exec/{id}/resize: - post: - summary: "Resize an exec instance" - description: "Resize the TTY session used by an exec instance. This endpoint only works if `tty` was specified as part of creating and starting the exec instance." - operationId: "ExecResize" - responses: - 201: - description: "No error" - 404: - description: "No such exec instance" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - description: "Exec instance ID" - required: true - type: "string" - - name: "h" - in: "query" - description: "Height of the TTY session in characters" - type: "integer" - - name: "w" - in: "query" - description: "Width of the TTY session in characters" - type: "integer" - tags: ["Exec"] - /exec/{id}/json: - get: - summary: "Inspect an exec instance" - description: "Return low-level information about an exec instance." - operationId: "ExecInspect" - produces: - - "application/json" - responses: - 200: - description: "No error" - schema: - type: "object" - title: "ExecInspectResponse" - properties: - CanRemove: - type: "boolean" - DetachKeys: - type: "string" - ID: - type: "string" - Running: - type: "boolean" - ExitCode: - type: "integer" - ProcessConfig: - $ref: "#/definitions/ProcessConfig" - OpenStdin: - type: "boolean" - OpenStderr: - type: "boolean" - OpenStdout: - type: "boolean" - ContainerID: - type: "string" - Pid: - type: "integer" - description: "The system process ID for the exec process." - examples: - application/json: - CanRemove: false - ContainerID: "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126" - DetachKeys: "" - ExitCode: 2 - ID: "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b" - OpenStderr: true - OpenStdin: true - OpenStdout: true - ProcessConfig: - arguments: - - "-c" - - "exit 2" - entrypoint: "sh" - privileged: false - tty: true - user: "1000" - Running: false - Pid: 42000 - 404: - description: "No such exec instance" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - description: "Exec instance ID" - required: true - type: "string" - tags: ["Exec"] - - /volumes: - get: - summary: "List volumes" - operationId: "VolumeList" - produces: ["application/json"] - responses: - 200: - description: "Summary volume data that matches the query" - schema: - type: "object" - title: "VolumeListResponse" - required: [Volumes, Warnings] - properties: - Volumes: - type: "array" - x-nullable: false - description: "List of volumes" - items: - $ref: "#/definitions/Volume" - Warnings: - type: "array" - x-nullable: false - description: "Warnings that occurred when fetching the list of volumes" - items: - type: "string" - - examples: - application/json: - Volumes: - - CreatedAt: "2017-07-19T12:00:26Z" - Name: "tardis" - Driver: "local" - Mountpoint: "/var/lib/docker/volumes/tardis" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Scope: "local" - Options: - device: "tmpfs" - o: "size=100m,uid=1000" - type: "tmpfs" - Warnings: [] - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "filters" - in: "query" - description: | - JSON encoded value of the filters (a `map[string][]string`) to - process on the volumes list. Available filters: - - - `dangling=` When set to `true` (or `1`), returns all - volumes that are not in use by a container. When set to `false` - (or `0`), only volumes that are in use by one or more - containers are returned. - - `driver=` Matches volumes based on their driver. - - `label=` or `label=:` Matches volumes based on - the presence of a `label` alone or a `label` and a value. - - `name=` Matches all or part of a volume name. - type: "string" - format: "json" - tags: ["Volume"] - - /volumes/create: - post: - summary: "Create a volume" - operationId: "VolumeCreate" - consumes: ["application/json"] - produces: ["application/json"] - responses: - 201: - description: "The volume was created successfully" - schema: - $ref: "#/definitions/Volume" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "volumeConfig" - in: "body" - required: true - description: "Volume configuration" - schema: - type: "object" - properties: - Name: - description: "The new volume's name. If not specified, Docker generates a name." - type: "string" - x-nullable: false - Driver: - description: "Name of the volume driver to use." - type: "string" - default: "local" - x-nullable: false - DriverOpts: - description: "A mapping of driver options and values. These options are passed directly to the driver and are driver specific." - type: "object" - additionalProperties: - type: "string" - Labels: - description: "User-defined key/value metadata." - type: "object" - additionalProperties: - type: "string" - example: - Name: "tardis" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Driver: "custom" - tags: ["Volume"] - - /volumes/{name}: - get: - summary: "Inspect a volume" - operationId: "VolumeInspect" - produces: ["application/json"] - responses: - 200: - description: "No error" - schema: - $ref: "#/definitions/Volume" - 404: - description: "No such volume" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "name" - in: "path" - required: true - description: "Volume name or ID" - type: "string" - tags: ["Volume"] - - delete: - summary: "Remove a volume" - description: "Instruct the driver to remove the volume." - operationId: "VolumeDelete" - responses: - 204: - description: "The volume was removed" - 404: - description: "No such volume or volume driver" - schema: - $ref: "#/definitions/ErrorResponse" - 409: - description: "Volume is in use and cannot be removed" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "name" - in: "path" - required: true - description: "Volume name or ID" - type: "string" - - name: "force" - in: "query" - description: "Force the removal of the volume" - type: "boolean" - default: false - tags: ["Volume"] - /volumes/prune: - post: - summary: "Delete unused volumes" - produces: - - "application/json" - operationId: "VolumePrune" - parameters: - - name: "filters" - in: "query" - description: | - Filters to process on the prune list, encoded as JSON (a `map[string][]string`). - - Available filters: - - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels. - type: "string" - responses: - 200: - description: "No error" - schema: - type: "object" - title: "VolumePruneResponse" - properties: - VolumesDeleted: - description: "Volumes that were deleted" - type: "array" - items: - type: "string" - SpaceReclaimed: - description: "Disk space reclaimed in bytes" - type: "integer" - format: "int64" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["Volume"] - /networks: - get: - summary: "List networks" - description: | - Returns a list of networks. For details on the format, see [the network inspect endpoint](#operation/NetworkInspect). - - Note that it uses a different, smaller representation of a network than inspecting a single network. For example, - the list of containers attached to the network is not propagated in API versions 1.28 and up. - operationId: "NetworkList" - produces: - - "application/json" - responses: - 200: - description: "No error" - schema: - type: "array" - items: - $ref: "#/definitions/Network" - examples: - application/json: - - Name: "bridge" - Id: "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566" - Created: "2016-10-19T06:21:00.416543526Z" - Scope: "local" - Driver: "bridge" - EnableIPv6: false - Internal: false - Attachable: false - Ingress: false - IPAM: - Driver: "default" - Config: - - - Subnet: "172.17.0.0/16" - Options: - com.docker.network.bridge.default_bridge: "true" - com.docker.network.bridge.enable_icc: "true" - com.docker.network.bridge.enable_ip_masquerade: "true" - com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" - com.docker.network.bridge.name: "docker0" - com.docker.network.driver.mtu: "1500" - - Name: "none" - Id: "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794" - Created: "0001-01-01T00:00:00Z" - Scope: "local" - Driver: "null" - EnableIPv6: false - Internal: false - Attachable: false - Ingress: false - IPAM: - Driver: "default" - Config: [] - Containers: {} - Options: {} - - Name: "host" - Id: "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e" - Created: "0001-01-01T00:00:00Z" - Scope: "local" - Driver: "host" - EnableIPv6: false - Internal: false - Attachable: false - Ingress: false - IPAM: - Driver: "default" - Config: [] - Containers: {} - Options: {} - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "filters" - in: "query" - description: | - JSON encoded value of the filters (a `map[string][]string`) to process on the networks list. Available filters: - - - `driver=` Matches a network's driver. - - `id=` Matches all or part of a network ID. - - `label=` or `label==` of a network label. - - `name=` Matches all or part of a network name. - - `scope=["swarm"|"global"|"local"]` Filters networks by scope (`swarm`, `global`, or `local`). - - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. - type: "string" - tags: ["Network"] - - /networks/{id}: - get: - summary: "Inspect a network" - operationId: "NetworkInspect" - produces: - - "application/json" - responses: - 200: - description: "No error" - schema: - $ref: "#/definitions/Network" - 404: - description: "Network not found" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - description: "Network ID or name" - required: true - type: "string" - - name: "verbose" - in: "query" - description: "Detailed inspect output for troubleshooting" - type: "boolean" - default: false - - name: "scope" - in: "query" - description: "Filter the network by scope (swarm, global, or local)" - type: "string" - tags: ["Network"] - - delete: - summary: "Remove a network" - operationId: "NetworkDelete" - responses: - 204: - description: "No error" - 403: - description: "operation not supported for pre-defined networks" - schema: - $ref: "#/definitions/ErrorResponse" - 404: - description: "no such network" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - description: "Network ID or name" - required: true - type: "string" - tags: ["Network"] - - /networks/create: - post: - summary: "Create a network" - operationId: "NetworkCreate" - consumes: - - "application/json" - produces: - - "application/json" - responses: - 201: - description: "No error" - schema: - type: "object" - title: "NetworkCreateResponse" - properties: - Id: - description: "The ID of the created network." - type: "string" - Warning: - type: "string" - example: - Id: "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30" - Warning: "" - 403: - description: "operation not supported for pre-defined networks" - schema: - $ref: "#/definitions/ErrorResponse" - 404: - description: "plugin not found" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "networkConfig" - in: "body" - description: "Network configuration" - required: true - schema: - type: "object" - required: ["Name"] - properties: - Name: - description: "The network's name." - type: "string" - CheckDuplicate: - description: "Check for networks with duplicate names. Since Network is primarily keyed based on a random ID and not on the name, and network name is strictly a user-friendly alias to the network which is uniquely identified using ID, there is no guaranteed way to check for duplicates. CheckDuplicate is there to provide a best effort checking of any networks which has the same name but it is not guaranteed to catch all name collisions." - type: "boolean" - Driver: - description: "Name of the network driver plugin to use." - type: "string" - default: "bridge" - Internal: - description: "Restrict external access to the network." - type: "boolean" - Attachable: - description: "Globally scoped network is manually attachable by regular containers from workers in swarm mode." - type: "boolean" - Ingress: - description: "Ingress network is the network which provides the routing-mesh in swarm mode." - type: "boolean" - IPAM: - description: "Optional custom IP scheme for the network." - $ref: "#/definitions/IPAM" - EnableIPv6: - description: "Enable IPv6 on the network." - type: "boolean" - Options: - description: "Network specific options to be used by the drivers." - type: "object" - additionalProperties: - type: "string" - Labels: - description: "User-defined key/value metadata." - type: "object" - additionalProperties: - type: "string" - example: - Name: "isolated_nw" - CheckDuplicate: false - Driver: "bridge" - EnableIPv6: true - IPAM: - Driver: "default" - Config: - - Subnet: "172.20.0.0/16" - IPRange: "172.20.10.0/24" - Gateway: "172.20.10.11" - - Subnet: "2001:db8:abcd::/64" - Gateway: "2001:db8:abcd::1011" - Options: - foo: "bar" - Internal: true - Attachable: false - Ingress: false - Options: - com.docker.network.bridge.default_bridge: "true" - com.docker.network.bridge.enable_icc: "true" - com.docker.network.bridge.enable_ip_masquerade: "true" - com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" - com.docker.network.bridge.name: "docker0" - com.docker.network.driver.mtu: "1500" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - tags: ["Network"] - - /networks/{id}/connect: - post: - summary: "Connect a container to a network" - operationId: "NetworkConnect" - consumes: - - "application/json" - responses: - 200: - description: "No error" - 403: - description: "Operation not supported for swarm scoped networks" - schema: - $ref: "#/definitions/ErrorResponse" - 404: - description: "Network or container not found" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - description: "Network ID or name" - required: true - type: "string" - - name: "container" - in: "body" - required: true - schema: - type: "object" - properties: - Container: - type: "string" - description: "The ID or name of the container to connect to the network." - EndpointConfig: - $ref: "#/definitions/EndpointSettings" - example: - Container: "3613f73ba0e4" - EndpointConfig: - IPAMConfig: - IPv4Address: "172.24.56.89" - IPv6Address: "2001:db8::5689" - tags: ["Network"] - - /networks/{id}/disconnect: - post: - summary: "Disconnect a container from a network" - operationId: "NetworkDisconnect" - consumes: - - "application/json" - responses: - 200: - description: "No error" - 403: - description: "Operation not supported for swarm scoped networks" - schema: - $ref: "#/definitions/ErrorResponse" - 404: - description: "Network or container not found" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - description: "Network ID or name" - required: true - type: "string" - - name: "container" - in: "body" - required: true - schema: - type: "object" - properties: - Container: - type: "string" - description: "The ID or name of the container to disconnect from the network." - Force: - type: "boolean" - description: "Force the container to disconnect from the network." - tags: ["Network"] - /networks/prune: - post: - summary: "Delete unused networks" - produces: - - "application/json" - operationId: "NetworkPrune" - parameters: - - name: "filters" - in: "query" - description: | - Filters to process on the prune list, encoded as JSON (a `map[string][]string`). - - Available filters: - - `until=` Prune networks created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. - - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune networks with (or without, in case `label!=...` is used) the specified labels. - type: "string" - responses: - 200: - description: "No error" - schema: - type: "object" - title: "NetworkPruneResponse" - properties: - NetworksDeleted: - description: "Networks that were deleted" - type: "array" - items: - type: "string" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["Network"] - /plugins: - get: - summary: "List plugins" - operationId: "PluginList" - description: "Returns information about installed plugins." - produces: ["application/json"] - responses: - 200: - description: "No error" - schema: - type: "array" - items: - $ref: "#/definitions/Plugin" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "filters" - in: "query" - type: "string" - description: | - A JSON encoded value of the filters (a `map[string][]string`) to process on the plugin list. Available filters: - - - `capability=` - - `enable=|` - tags: ["Plugin"] - - /plugins/privileges: - get: - summary: "Get plugin privileges" - operationId: "GetPluginPrivileges" - responses: - 200: - description: "no error" - schema: - type: "array" - items: - description: "Describes a permission the user has to accept upon installing the plugin." - type: "object" - title: "PluginPrivilegeItem" - properties: - Name: - type: "string" - Description: - type: "string" - Value: - type: "array" - items: - type: "string" - example: - - Name: "network" - Description: "" - Value: - - "host" - - Name: "mount" - Description: "" - Value: - - "/data" - - Name: "device" - Description: "" - Value: - - "/dev/cpu_dma_latency" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "remote" - in: "query" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." - required: true - type: "string" - tags: - - "Plugin" - - /plugins/pull: - post: - summary: "Install a plugin" - operationId: "PluginPull" - description: | - Pulls and installs a plugin. After the plugin is installed, it can be enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable). - produces: - - "application/json" - responses: - 204: - description: "no error" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "remote" - in: "query" - description: | - Remote reference for plugin to install. - - The `:latest` tag is optional, and is used as the default if omitted. - required: true - type: "string" - - name: "name" - in: "query" - description: | - Local name for the pulled plugin. - - The `:latest` tag is optional, and is used as the default if omitted. - required: false - type: "string" - - name: "X-Registry-Auth" - in: "header" - description: "A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)" - type: "string" - - name: "body" - in: "body" - schema: - type: "array" - items: - description: "Describes a permission accepted by the user upon installing the plugin." - type: "object" - properties: - Name: - type: "string" - Description: - type: "string" - Value: - type: "array" - items: - type: "string" - example: - - Name: "network" - Description: "" - Value: - - "host" - - Name: "mount" - Description: "" - Value: - - "/data" - - Name: "device" - Description: "" - Value: - - "/dev/cpu_dma_latency" - tags: ["Plugin"] - /plugins/{name}/json: - get: - summary: "Inspect a plugin" - operationId: "PluginInspect" - responses: - 200: - description: "no error" - schema: - $ref: "#/definitions/Plugin" - 404: - description: "plugin is not installed" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "name" - in: "path" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." - required: true - type: "string" - tags: ["Plugin"] - /plugins/{name}: - delete: - summary: "Remove a plugin" - operationId: "PluginDelete" - responses: - 200: - description: "no error" - schema: - $ref: "#/definitions/Plugin" - 404: - description: "plugin is not installed" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "name" - in: "path" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." - required: true - type: "string" - - name: "force" - in: "query" - description: "Disable the plugin before removing. This may result in issues if the plugin is in use by a container." - type: "boolean" - default: false - tags: ["Plugin"] - /plugins/{name}/enable: - post: - summary: "Enable a plugin" - operationId: "PluginEnable" - responses: - 200: - description: "no error" - 404: - description: "plugin is not installed" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "name" - in: "path" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." - required: true - type: "string" - - name: "timeout" - in: "query" - description: "Set the HTTP client timeout (in seconds)" - type: "integer" - default: 0 - tags: ["Plugin"] - /plugins/{name}/disable: - post: - summary: "Disable a plugin" - operationId: "PluginDisable" - responses: - 200: - description: "no error" - 404: - description: "plugin is not installed" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "name" - in: "path" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." - required: true - type: "string" - tags: ["Plugin"] - /plugins/{name}/upgrade: - post: - summary: "Upgrade a plugin" - operationId: "PluginUpgrade" - responses: - 204: - description: "no error" - 404: - description: "plugin not installed" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "name" - in: "path" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." - required: true - type: "string" - - name: "remote" - in: "query" - description: | - Remote reference to upgrade to. - - The `:latest` tag is optional, and is used as the default if omitted. - required: true - type: "string" - - name: "X-Registry-Auth" - in: "header" - description: "A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)" - type: "string" - - name: "body" - in: "body" - schema: - type: "array" - items: - description: "Describes a permission accepted by the user upon installing the plugin." - type: "object" - properties: - Name: - type: "string" - Description: - type: "string" - Value: - type: "array" - items: - type: "string" - example: - - Name: "network" - Description: "" - Value: - - "host" - - Name: "mount" - Description: "" - Value: - - "/data" - - Name: "device" - Description: "" - Value: - - "/dev/cpu_dma_latency" - tags: ["Plugin"] - /plugins/create: - post: - summary: "Create a plugin" - operationId: "PluginCreate" - consumes: - - "application/x-tar" - responses: - 204: - description: "no error" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "name" - in: "query" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." - required: true - type: "string" - - name: "tarContext" - in: "body" - description: "Path to tar containing plugin rootfs and manifest" - schema: - type: "string" - format: "binary" - tags: ["Plugin"] - /plugins/{name}/push: - post: - summary: "Push a plugin" - operationId: "PluginPush" - description: | - Push a plugin to the registry. - parameters: - - name: "name" - in: "path" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." - required: true - type: "string" - responses: - 200: - description: "no error" - 404: - description: "plugin not installed" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["Plugin"] - /plugins/{name}/set: - post: - summary: "Configure a plugin" - operationId: "PluginSet" - consumes: - - "application/json" - parameters: - - name: "name" - in: "path" - description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted." - required: true - type: "string" - - name: "body" - in: "body" - schema: - type: "array" - items: - type: "string" - example: ["DEBUG=1"] - responses: - 204: - description: "No error" - 404: - description: "Plugin not installed" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["Plugin"] - /nodes: - get: - summary: "List nodes" - operationId: "NodeList" - responses: - 200: - description: "no error" - schema: - type: "array" - items: - $ref: "#/definitions/Node" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "filters" - in: "query" - description: | - Filters to process on the nodes list, encoded as JSON (a `map[string][]string`). - - Available filters: - - `id=` - - `label=` - - `membership=`(`accepted`|`pending`)` - - `name=` - - `role=`(`manager`|`worker`)` - type: "string" - tags: ["Node"] - /nodes/{id}: - get: - summary: "Inspect a node" - operationId: "NodeInspect" - responses: - 200: - description: "no error" - schema: - $ref: "#/definitions/Node" - 404: - description: "no such node" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - description: "The ID or name of the node" - type: "string" - required: true - tags: ["Node"] - delete: - summary: "Delete a node" - operationId: "NodeDelete" - responses: - 200: - description: "no error" - 404: - description: "no such node" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - description: "The ID or name of the node" - type: "string" - required: true - - name: "force" - in: "query" - description: "Force remove a node from the swarm" - default: false - type: "boolean" - tags: ["Node"] - /nodes/{id}/update: - post: - summary: "Update a node" - operationId: "NodeUpdate" - responses: - 200: - description: "no error" - 400: - description: "bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 404: - description: "no such node" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - description: "The ID of the node" - type: "string" - required: true - - name: "body" - in: "body" - schema: - $ref: "#/definitions/NodeSpec" - - name: "version" - in: "query" - description: "The version number of the node object being updated. This is required to avoid conflicting writes." - type: "integer" - format: "int64" - required: true - tags: ["Node"] - /swarm: - get: - summary: "Inspect swarm" - operationId: "SwarmInspect" - responses: - 200: - description: "no error" - schema: - $ref: "#/definitions/Swarm" - 404: - description: "no such swarm" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["Swarm"] - /swarm/init: - post: - summary: "Initialize a new swarm" - operationId: "SwarmInit" - produces: - - "application/json" - - "text/plain" - responses: - 200: - description: "no error" - schema: - description: "The node ID" - type: "string" - example: "7v2t30z9blmxuhnyo6s4cpenp" - 400: - description: "bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is already part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "body" - in: "body" - required: true - schema: - type: "object" - properties: - ListenAddr: - description: "Listen address used for inter-manager communication, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP). This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the default swarm listening port is used." - type: "string" - AdvertiseAddr: - description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible." - type: "string" - DataPathAddr: - description: | - Address or interface to use for data path traffic (format: ``), for example, `192.168.1.1`, - or an interface, like `eth0`. If `DataPathAddr` is unspecified, the same address as `AdvertiseAddr` - is used. - - The `DataPathAddr` specifies the address that global scope network drivers will publish towards other - nodes in order to reach the containers running on this node. Using this parameter it is possible to - separate the container data traffic from the management traffic of the cluster. - type: "string" - ForceNewCluster: - description: "Force creation of a new swarm." - type: "boolean" - Spec: - $ref: "#/definitions/SwarmSpec" - example: - ListenAddr: "0.0.0.0:2377" - AdvertiseAddr: "192.168.1.1:2377" - ForceNewCluster: false - Spec: - Orchestration: {} - Raft: {} - Dispatcher: {} - CAConfig: {} - EncryptionConfig: - AutoLockManagers: false - tags: ["Swarm"] - /swarm/join: - post: - summary: "Join an existing swarm" - operationId: "SwarmJoin" - responses: - 200: - description: "no error" - 400: - description: "bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is already part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "body" - in: "body" - required: true - schema: - type: "object" - properties: - ListenAddr: - description: "Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)." - type: "string" - AdvertiseAddr: - description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible." - type: "string" - DataPathAddr: - description: | - Address or interface to use for data path traffic (format: ``), for example, `192.168.1.1`, - or an interface, like `eth0`. If `DataPathAddr` is unspecified, the same address as `AdvertiseAddr` - is used. - - The `DataPathAddr` specifies the address that global scope network drivers will publish towards other - nodes in order to reach the containers running on this node. Using this parameter it is possible to - separate the container data traffic from the management traffic of the cluster. - - type: "string" - RemoteAddrs: - description: "Addresses of manager nodes already participating in the swarm." - type: "string" - JoinToken: - description: "Secret token for joining this swarm." - type: "string" - example: - ListenAddr: "0.0.0.0:2377" - AdvertiseAddr: "192.168.1.1:2377" - RemoteAddrs: - - "node1:2377" - JoinToken: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" - tags: ["Swarm"] - /swarm/leave: - post: - summary: "Leave a swarm" - operationId: "SwarmLeave" - responses: - 200: - description: "no error" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "force" - description: "Force leave swarm, even if this is the last manager or that it will break the cluster." - in: "query" - type: "boolean" - default: false - tags: ["Swarm"] - /swarm/update: - post: - summary: "Update a swarm" - operationId: "SwarmUpdate" - responses: - 200: - description: "no error" - 400: - description: "bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "body" - in: "body" - required: true - schema: - $ref: "#/definitions/SwarmSpec" - - name: "version" - in: "query" - description: "The version number of the swarm object being updated. This is required to avoid conflicting writes." - type: "integer" - format: "int64" - required: true - - name: "rotateWorkerToken" - in: "query" - description: "Rotate the worker join token." - type: "boolean" - default: false - - name: "rotateManagerToken" - in: "query" - description: "Rotate the manager join token." - type: "boolean" - default: false - - name: "rotateManagerUnlockKey" - in: "query" - description: "Rotate the manager unlock key." - type: "boolean" - default: false - tags: ["Swarm"] - /swarm/unlockkey: - get: - summary: "Get the unlock key" - operationId: "SwarmUnlockkey" - consumes: - - "application/json" - responses: - 200: - description: "no error" - schema: - type: "object" - title: "UnlockKeyResponse" - properties: - UnlockKey: - description: "The swarm's unlock key." - type: "string" - example: - UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["Swarm"] - /swarm/unlock: - post: - summary: "Unlock a locked manager" - operationId: "SwarmUnlock" - consumes: - - "application/json" - produces: - - "application/json" - parameters: - - name: "body" - in: "body" - required: true - schema: - type: "object" - properties: - UnlockKey: - description: "The swarm's unlock key." - type: "string" - example: - UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" - responses: - 200: - description: "no error" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["Swarm"] - /services: - get: - summary: "List services" - operationId: "ServiceList" - responses: - 200: - description: "no error" - schema: - type: "array" - items: - $ref: "#/definitions/Service" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "filters" - in: "query" - type: "string" - description: | - A JSON encoded value of the filters (a `map[string][]string`) to process on the services list. Available filters: - - - `id=` - - `label=` - - `mode=["replicated"|"global"]` - - `name=` - tags: ["Service"] - /services/create: - post: - summary: "Create a service" - operationId: "ServiceCreate" - consumes: - - "application/json" - produces: - - "application/json" - responses: - 201: - description: "no error" - schema: - type: "object" - title: "ServiceCreateResponse" - properties: - ID: - description: "The ID of the created service." - type: "string" - Warning: - description: "Optional warning message" - type: "string" - example: - ID: "ak7w3gjqoa3kuz8xcpnyy0pvl" - Warning: "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" - 400: - description: "bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 403: - description: "network is not eligible for services" - schema: - $ref: "#/definitions/ErrorResponse" - 409: - description: "name conflicts with an existing service" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "body" - in: "body" - required: true - schema: - allOf: - - $ref: "#/definitions/ServiceSpec" - - type: "object" - example: - Name: "web" - TaskTemplate: - ContainerSpec: - Image: "nginx:alpine" - Mounts: - - - ReadOnly: true - Source: "web-data" - Target: "/usr/share/nginx/html" - Type: "volume" - VolumeOptions: - DriverConfig: {} - Labels: - com.example.something: "something-value" - Hosts: ["10.10.10.10 host1", "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 host2"] - User: "33" - DNSConfig: - Nameservers: ["8.8.8.8"] - Search: ["example.org"] - Options: ["timeout:3"] - Secrets: - - - File: - Name: "www.example.org.key" - UID: "33" - GID: "33" - Mode: 384 - SecretID: "fpjqlhnwb19zds35k8wn80lq9" - SecretName: "example_org_domain_key" - LogDriver: - Name: "json-file" - Options: - max-file: "3" - max-size: "10M" - Placement: {} - Resources: - Limits: - MemoryBytes: 104857600 - Reservations: {} - RestartPolicy: - Condition: "on-failure" - Delay: 10000000000 - MaxAttempts: 10 - Mode: - Replicated: - Replicas: 4 - UpdateConfig: - Parallelism: 2 - Delay: 1000000000 - FailureAction: "pause" - Monitor: 15000000000 - MaxFailureRatio: 0.15 - RollbackConfig: - Parallelism: 1 - Delay: 1000000000 - FailureAction: "pause" - Monitor: 15000000000 - MaxFailureRatio: 0.15 - EndpointSpec: - Ports: - - - Protocol: "tcp" - PublishedPort: 8080 - TargetPort: 80 - Labels: - foo: "bar" - - name: "X-Registry-Auth" - in: "header" - description: "A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)" - type: "string" - tags: ["Service"] - /services/{id}: - get: - summary: "Inspect a service" - operationId: "ServiceInspect" - responses: - 200: - description: "no error" - schema: - $ref: "#/definitions/Service" - 404: - description: "no such service" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - description: "ID or name of service." - required: true - type: "string" - - name: "insertDefaults" - in: "query" - description: "Fill empty fields with default values." - type: "boolean" - default: false - tags: ["Service"] - delete: - summary: "Delete a service" - operationId: "ServiceDelete" - responses: - 200: - description: "no error" - 404: - description: "no such service" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - description: "ID or name of service." - required: true - type: "string" - tags: ["Service"] - /services/{id}/update: - post: - summary: "Update a service" - operationId: "ServiceUpdate" - consumes: ["application/json"] - produces: ["application/json"] - responses: - 200: - description: "no error" - schema: - $ref: "#/definitions/ServiceUpdateResponse" - 400: - description: "bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 404: - description: "no such service" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - description: "ID or name of service." - required: true - type: "string" - - name: "body" - in: "body" - required: true - schema: - allOf: - - $ref: "#/definitions/ServiceSpec" - - type: "object" - example: - Name: "top" - TaskTemplate: - ContainerSpec: - Image: "busybox" - Args: - - "top" - Resources: - Limits: {} - Reservations: {} - RestartPolicy: - Condition: "any" - MaxAttempts: 0 - Placement: {} - ForceUpdate: 0 - Mode: - Replicated: - Replicas: 1 - UpdateConfig: - Parallelism: 2 - Delay: 1000000000 - FailureAction: "pause" - Monitor: 15000000000 - MaxFailureRatio: 0.15 - RollbackConfig: - Parallelism: 1 - Delay: 1000000000 - FailureAction: "pause" - Monitor: 15000000000 - MaxFailureRatio: 0.15 - EndpointSpec: - Mode: "vip" - - - name: "version" - in: "query" - description: "The version number of the service object being updated. This is required to avoid conflicting writes." - required: true - type: "integer" - - name: "registryAuthFrom" - in: "query" - type: "string" - description: "If the X-Registry-Auth header is not specified, this parameter indicates where to find registry authorization credentials. The valid values are `spec` and `previous-spec`." - default: "spec" - - name: "rollback" - in: "query" - type: "string" - description: "Set to this parameter to `previous` to cause a server-side rollback to the previous service spec. The supplied spec will be ignored in this case." - - name: "X-Registry-Auth" - in: "header" - description: "A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)" - type: "string" - - tags: ["Service"] - /services/{id}/logs: - get: - summary: "Get service logs" - description: | - Get `stdout` and `stderr` logs from a service. - - **Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers. - operationId: "ServiceLogs" - produces: - - "application/vnd.docker.raw-stream" - - "application/json" - responses: - 101: - description: "logs returned as a stream" - schema: - type: "string" - format: "binary" - 200: - description: "logs returned as a string in response body" - schema: - type: "string" - 404: - description: "no such service" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such service: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID or name of the service" - type: "string" - - name: "details" - in: "query" - description: "Show service context and extra details provided to logs." - type: "boolean" - default: false - - name: "follow" - in: "query" - description: | - Return the logs as a stream. - - This will return a `101` HTTP response with a `Connection: upgrade` header, then hijack the HTTP connection to send raw output. For more information about hijacking and the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach). - type: "boolean" - default: false - - name: "stdout" - in: "query" - description: "Return logs from `stdout`" - type: "boolean" - default: false - - name: "stderr" - in: "query" - description: "Return logs from `stderr`" - type: "boolean" - default: false - - name: "since" - in: "query" - description: "Only return logs since this time, as a UNIX timestamp" - type: "integer" - default: 0 - - name: "timestamps" - in: "query" - description: "Add timestamps to every log line" - type: "boolean" - default: false - - name: "tail" - in: "query" - description: "Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines." - type: "string" - default: "all" - tags: ["Service"] - /tasks: - get: - summary: "List tasks" - operationId: "TaskList" - produces: - - "application/json" - responses: - 200: - description: "no error" - schema: - type: "array" - items: - $ref: "#/definitions/Task" - example: - - ID: "0kzzo1i0y4jz6027t0k7aezc7" - Version: - Index: 71 - CreatedAt: "2016-06-07T21:07:31.171892745Z" - UpdatedAt: "2016-06-07T21:07:31.376370513Z" - Spec: - ContainerSpec: - Image: "redis" - Resources: - Limits: {} - Reservations: {} - RestartPolicy: - Condition: "any" - MaxAttempts: 0 - Placement: {} - ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" - Slot: 1 - NodeID: "60gvrl6tm78dmak4yl7srz94v" - Status: - Timestamp: "2016-06-07T21:07:31.290032978Z" - State: "running" - Message: "started" - ContainerStatus: - ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" - PID: 677 - DesiredState: "running" - NetworksAttachments: - - Network: - ID: "4qvuz4ko70xaltuqbt8956gd1" - Version: - Index: 18 - CreatedAt: "2016-06-07T20:31:11.912919752Z" - UpdatedAt: "2016-06-07T21:07:29.955277358Z" - Spec: - Name: "ingress" - Labels: - com.docker.swarm.internal: "true" - DriverConfiguration: {} - IPAMOptions: - Driver: {} - Configs: - - Subnet: "10.255.0.0/16" - Gateway: "10.255.0.1" - DriverState: - Name: "overlay" - Options: - com.docker.network.driver.overlay.vxlanid_list: "256" - IPAMOptions: - Driver: - Name: "default" - Configs: - - Subnet: "10.255.0.0/16" - Gateway: "10.255.0.1" - Addresses: - - "10.255.0.10/16" - - ID: "1yljwbmlr8er2waf8orvqpwms" - Version: - Index: 30 - CreatedAt: "2016-06-07T21:07:30.019104782Z" - UpdatedAt: "2016-06-07T21:07:30.231958098Z" - Name: "hopeful_cori" - Spec: - ContainerSpec: - Image: "redis" - Resources: - Limits: {} - Reservations: {} - RestartPolicy: - Condition: "any" - MaxAttempts: 0 - Placement: {} - ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" - Slot: 1 - NodeID: "60gvrl6tm78dmak4yl7srz94v" - Status: - Timestamp: "2016-06-07T21:07:30.202183143Z" - State: "shutdown" - Message: "shutdown" - ContainerStatus: - ContainerID: "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213" - DesiredState: "shutdown" - NetworksAttachments: - - Network: - ID: "4qvuz4ko70xaltuqbt8956gd1" - Version: - Index: 18 - CreatedAt: "2016-06-07T20:31:11.912919752Z" - UpdatedAt: "2016-06-07T21:07:29.955277358Z" - Spec: - Name: "ingress" - Labels: - com.docker.swarm.internal: "true" - DriverConfiguration: {} - IPAMOptions: - Driver: {} - Configs: - - Subnet: "10.255.0.0/16" - Gateway: "10.255.0.1" - DriverState: - Name: "overlay" - Options: - com.docker.network.driver.overlay.vxlanid_list: "256" - IPAMOptions: - Driver: - Name: "default" - Configs: - - Subnet: "10.255.0.0/16" - Gateway: "10.255.0.1" - Addresses: - - "10.255.0.5/16" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "filters" - in: "query" - type: "string" - description: | - A JSON encoded value of the filters (a `map[string][]string`) to process on the tasks list. Available filters: - - - `desired-state=(running | shutdown | accepted)` - - `id=` - - `label=key` or `label="key=value"` - - `name=` - - `node=` - - `service=` - tags: ["Task"] - /tasks/{id}: - get: - summary: "Inspect a task" - operationId: "TaskInspect" - produces: - - "application/json" - responses: - 200: - description: "no error" - schema: - $ref: "#/definitions/Task" - 404: - description: "no such task" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - description: "ID of the task" - required: true - type: "string" - tags: ["Task"] - /tasks/{id}/logs: - get: - summary: "Get task logs" - description: | - Get `stdout` and `stderr` logs from a task. - - **Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers. - operationId: "TaskLogs" - produces: - - "application/vnd.docker.raw-stream" - - "application/json" - responses: - 101: - description: "logs returned as a stream" - schema: - type: "string" - format: "binary" - 200: - description: "logs returned as a string in response body" - schema: - type: "string" - 404: - description: "no such task" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such task: c2ada9df5af8" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - description: "ID of the task" - type: "string" - - name: "details" - in: "query" - description: "Show task context and extra details provided to logs." - type: "boolean" - default: false - - name: "follow" - in: "query" - description: | - Return the logs as a stream. - - This will return a `101` HTTP response with a `Connection: upgrade` header, then hijack the HTTP connection to send raw output. For more information about hijacking and the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach). - type: "boolean" - default: false - - name: "stdout" - in: "query" - description: "Return logs from `stdout`" - type: "boolean" - default: false - - name: "stderr" - in: "query" - description: "Return logs from `stderr`" - type: "boolean" - default: false - - name: "since" - in: "query" - description: "Only return logs since this time, as a UNIX timestamp" - type: "integer" - default: 0 - - name: "timestamps" - in: "query" - description: "Add timestamps to every log line" - type: "boolean" - default: false - - name: "tail" - in: "query" - description: "Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines." - type: "string" - default: "all" - /secrets: - get: - summary: "List secrets" - operationId: "SecretList" - produces: - - "application/json" - responses: - 200: - description: "no error" - schema: - type: "array" - items: - $ref: "#/definitions/Secret" - example: - - ID: "blt1owaxmitz71s9v5zh81zun" - Version: - Index: 85 - CreatedAt: "2017-07-20T13:55:28.678958722Z" - UpdatedAt: "2017-07-20T13:55:28.678958722Z" - Spec: - Name: "mysql-passwd" - Labels: - some.label: "some.value" - Driver: - Name: "secret-bucket" - Options: - OptionA: "value for driver option A" - OptionB: "value for driver option B" - - ID: "ktnbjxoalbkvbvedmg1urrz8h" - Version: - Index: 11 - CreatedAt: "2016-11-05T01:20:17.327670065Z" - UpdatedAt: "2016-11-05T01:20:17.327670065Z" - Spec: - Name: "app-dev.crt" - Labels: - foo: "bar" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "filters" - in: "query" - type: "string" - description: | - A JSON encoded value of the filters (a `map[string][]string`) to process on the secrets list. Available filters: - - - `id=` - - `label= or label==value` - - `name=` - - `names=` - tags: ["Secret"] - /secrets/create: - post: - summary: "Create a secret" - operationId: "SecretCreate" - consumes: - - "application/json" - produces: - - "application/json" - responses: - 201: - description: "no error" - schema: - $ref: "#/definitions/IdResponse" - 409: - description: "name conflicts with an existing object" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "body" - in: "body" - schema: - allOf: - - $ref: "#/definitions/SecretSpec" - - type: "object" - example: - Name: "app-key.crt" - Labels: - foo: "bar" - Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" - Driver: - Name: "secret-bucket" - Options: - OptionA: "value for driver option A" - OptionB: "value for driver option B" - tags: ["Secret"] - /secrets/{id}: - get: - summary: "Inspect a secret" - operationId: "SecretInspect" - produces: - - "application/json" - responses: - 200: - description: "no error" - schema: - $ref: "#/definitions/Secret" - examples: - application/json: - ID: "ktnbjxoalbkvbvedmg1urrz8h" - Version: - Index: 11 - CreatedAt: "2016-11-05T01:20:17.327670065Z" - UpdatedAt: "2016-11-05T01:20:17.327670065Z" - Spec: - Name: "app-dev.crt" - Labels: - foo: "bar" - Driver: - Name: "secret-bucket" - Options: - OptionA: "value for driver option A" - OptionB: "value for driver option B" - - 404: - description: "secret not found" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - description: "ID of the secret" - tags: ["Secret"] - delete: - summary: "Delete a secret" - operationId: "SecretDelete" - produces: - - "application/json" - responses: - 204: - description: "no error" - 404: - description: "secret not found" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - description: "ID of the secret" - tags: ["Secret"] - /secrets/{id}/update: - post: - summary: "Update a Secret" - operationId: "SecretUpdate" - responses: - 200: - description: "no error" - 400: - description: "bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 404: - description: "no such secret" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - description: "The ID or name of the secret" - type: "string" - required: true - - name: "body" - in: "body" - schema: - $ref: "#/definitions/SecretSpec" - description: "The spec of the secret to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the [SecretInspect endpoint](#operation/SecretInspect) response values." - - name: "version" - in: "query" - description: "The version number of the secret object being updated. This is required to avoid conflicting writes." - type: "integer" - format: "int64" - required: true - tags: ["Secret"] - /configs: - get: - summary: "List configs" - operationId: "ConfigList" - produces: - - "application/json" - responses: - 200: - description: "no error" - schema: - type: "array" - items: - $ref: "#/definitions/Config" - example: - - ID: "ktnbjxoalbkvbvedmg1urrz8h" - Version: - Index: 11 - CreatedAt: "2016-11-05T01:20:17.327670065Z" - UpdatedAt: "2016-11-05T01:20:17.327670065Z" - Spec: - Name: "server.conf" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "filters" - in: "query" - type: "string" - description: | - A JSON encoded value of the filters (a `map[string][]string`) to process on the configs list. Available filters: - - - `id=` - - `label= or label==value` - - `name=` - - `names=` - tags: ["Config"] - /configs/create: - post: - summary: "Create a config" - operationId: "ConfigCreate" - consumes: - - "application/json" - produces: - - "application/json" - responses: - 201: - description: "no error" - schema: - $ref: "#/definitions/IdResponse" - 409: - description: "name conflicts with an existing object" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "body" - in: "body" - schema: - allOf: - - $ref: "#/definitions/ConfigSpec" - - type: "object" - example: - Name: "server.conf" - Labels: - foo: "bar" - Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" - tags: ["Config"] - /configs/{id}: - get: - summary: "Inspect a config" - operationId: "ConfigInspect" - produces: - - "application/json" - responses: - 200: - description: "no error" - schema: - $ref: "#/definitions/Config" - examples: - application/json: - ID: "ktnbjxoalbkvbvedmg1urrz8h" - Version: - Index: 11 - CreatedAt: "2016-11-05T01:20:17.327670065Z" - UpdatedAt: "2016-11-05T01:20:17.327670065Z" - Spec: - Name: "app-dev.crt" - 404: - description: "config not found" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - description: "ID of the config" - tags: ["Config"] - delete: - summary: "Delete a config" - operationId: "ConfigDelete" - produces: - - "application/json" - responses: - 204: - description: "no error" - 404: - description: "config not found" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - description: "ID of the config" - tags: ["Config"] - /configs/{id}/update: - post: - summary: "Update a Config" - operationId: "ConfigUpdate" - responses: - 200: - description: "no error" - 400: - description: "bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 404: - description: "no such config" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - 503: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "id" - in: "path" - description: "The ID or name of the config" - type: "string" - required: true - - name: "body" - in: "body" - schema: - $ref: "#/definitions/ConfigSpec" - description: "The spec of the config to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the [ConfigInspect endpoint](#operation/ConfigInspect) response values." - - name: "version" - in: "query" - description: "The version number of the config object being updated. This is required to avoid conflicting writes." - type: "integer" - format: "int64" - required: true - tags: ["Config"] - /distribution/{name}/json: - get: - summary: "Get image information from the registry" - description: "Return image digest and platform information by contacting the registry." - operationId: "DistributionInspect" - produces: - - "application/json" - responses: - 200: - description: "descriptor and platform information" - schema: - type: "object" - x-go-name: DistributionInspect - title: "DistributionInspectResponse" - required: [Descriptor, Platforms] - properties: - Descriptor: - type: "object" - description: "A descriptor struct containing digest, media type, and size" - properties: - MediaType: - type: "string" - Size: - type: "integer" - format: "int64" - Digest: - type: "string" - URLs: - type: "array" - items: - type: "string" - Platforms: - type: "array" - description: "An array containing all platforms supported by the image" - items: - type: "object" - properties: - Architecture: - type: "string" - OS: - type: "string" - OSVersion: - type: "string" - OSFeatures: - type: "array" - items: - type: "string" - Variant: - type: "string" - Features: - type: "array" - items: - type: "string" - examples: - application/json: - Descriptor: - MediaType: "application/vnd.docker.distribution.manifest.v2+json" - Digest: "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96" - Size: 3987495 - URLs: - - "" - Platforms: - - Architecture: "amd64" - OS: "linux" - OSVersion: "" - OSFeatures: - - "" - Variant: "" - Features: - - "" - 401: - description: "Failed authentication or no image found" - schema: - $ref: "#/definitions/ErrorResponse" - examples: - application/json: - message: "No such image: someimage (tag: latest)" - 500: - description: "Server error" - schema: - $ref: "#/definitions/ErrorResponse" - parameters: - - name: "name" - in: "path" - description: "Image name or id" - type: "string" - required: true - tags: ["Distribution"] - /session: - post: - summary: "Initialize interactive session" - description: | - Start a new interactive session with a server. Session allows server to call back to the client for advanced capabilities. - - > **Note**: This endpoint is *experimental* and only available if the daemon is started with experimental - > features enabled. The specifications for this endpoint may still change in a future version of the API. - - ### Hijacking - - This endpoint hijacks the HTTP connection to HTTP2 transport that allows the client to expose gPRC services on that connection. - - For example, the client sends this request to upgrade the connection: - - ``` - POST /session HTTP/1.1 - Upgrade: h2c - Connection: Upgrade - ``` - - The Docker daemon will respond with a `101 UPGRADED` response follow with the raw stream: - - ``` - HTTP/1.1 101 UPGRADED - Connection: Upgrade - Upgrade: h2c - ``` - operationId: "Session" - produces: - - "application/vnd.docker.raw-stream" - responses: - 101: - description: "no error, hijacking successful" - 400: - description: "bad parameter" - schema: - $ref: "#/definitions/ErrorResponse" - 500: - description: "server error" - schema: - $ref: "#/definitions/ErrorResponse" - tags: ["Session (experimental)"] diff --git a/patches/NetworkSettingsNormalizer.patch b/patches/NetworkSettingsNormalizer.patch new file mode 100644 index 00000000..804501bb --- /dev/null +++ b/patches/NetworkSettingsNormalizer.patch @@ -0,0 +1,26 @@ +diff --git a/src/Normalizer/NetworkSettingsNormalizer.php b/src/Normalizer/NetworkSettingsNormalizer.php +index 22cfce8..392058c 100644 +--- a/src/Normalizer/NetworkSettingsNormalizer.php ++++ b/src/Normalizer/NetworkSettingsNormalizer.php +@@ -78,6 +78,10 @@ class NetworkSettingsNormalizer implements DenormalizerInterface, NormalizerInte + if (\array_key_exists('Ports', $data) && $data['Ports'] !== null) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Ports'] as $key => $value) { ++ if (null === $value) { ++ $values[$key] = null; ++ continue; ++ } + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\PortBinding::class, 'json', $context); +@@ -214,6 +218,10 @@ class NetworkSettingsNormalizer implements DenormalizerInterface, NormalizerInte + if ($data->isInitialized('ports') && null !== $data->getPorts()) { + $values = []; + foreach ($data->getPorts() as $key => $value) { ++ if (null === $value) { ++ $values[$key] = null; ++ continue; ++ } + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); diff --git a/spec/v1.36.json b/spec/v1.36.json new file mode 100644 index 00000000..ee306135 --- /dev/null +++ b/spec/v1.36.json @@ -0,0 +1,15417 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Docker Engine API", + "description": "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.\n\nMost 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.\n\n# Errors\n\nThe 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:\n\n```\n{\n \"message\": \"page not found\"\n}\n```\n\n# Versioning\n\nThe API is usually changed in each release, so API calls are versioned to\nensure that clients don't break. To lock to a specific version of the API,\nyou prefix the URL with its version, for example, call `/v1.30/info` to use\nthe v1.30 version of the `/info` endpoint. If the API version specified in\nthe URL is not supported by the daemon, a HTTP `400 Bad Request` error message\nis returned.\n\nIf you omit the version-prefix, the current version of the API (v1.36) is used.\nFor example, calling `/info` is the same as calling `/v1.36/info`. Using the\nAPI without a version-prefix is deprecated and will be removed in a future release.\n\nEngine releases in the near future should support this version of the API,\nso your client will continue to work even if it is talking to a newer Engine.\n\nThe API uses an open schema model, which means server may add extra properties\nto responses. Likewise, the server will ignore any extra query parameters and\nrequest body properties. When you write clients, you need to ignore additional\nproperties in responses to ensure they do not break when talking to newer\ndaemons.\n\n\n# Authentication\n\nAuthentication 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:\n\n```\n{\n \"username\": \"string\",\n \"password\": \"string\",\n \"email\": \"string\",\n \"serveraddress\": \"string\"\n}\n```\n\nThe `serveraddress` is a domain/IP without a protocol. Throughout this structure, double quotes are required.\n\nIf you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth), you can just pass this instead of credentials:\n\n```\n{\n \"identitytoken\": \"9cbaf023786cd7...\"\n}\n```\n", + "version": "1.36", + "x-logo": { + "url": "https://docs.docker.com/images/logo-docker-main.png" + } + }, + "servers": [ + { + "url": "/v1.36" + } + ], + "tags": [ + { + "name": "Container", + "description": "Create and manage containers.\n", + "x-displayName": "Containers" + }, + { + "name": "Image", + "x-displayName": "Images" + }, + { + "name": "Network", + "description": "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.\n", + "x-displayName": "Networks" + }, + { + "name": "Volume", + "description": "Create and manage persistent storage that can be attached to containers.\n", + "x-displayName": "Volumes" + }, + { + "name": "Exec", + "description": "Run new commands inside running containers. See the [command-line reference](https://docs.docker.com/engine/reference/commandline/exec/) for more information.\n\nTo 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`.\n", + "x-displayName": "Exec" + }, + { + "name": "Swarm", + "description": "Engines can be clustered together in a swarm. See [the swarm mode documentation](https://docs.docker.com/engine/swarm/) for more information.\n", + "x-displayName": "Swarm" + }, + { + "name": "Node", + "description": "Nodes are instances of the Engine participating in a swarm. Swarm mode must be enabled for these endpoints to work.\n", + "x-displayName": "Nodes" + }, + { + "name": "Service", + "description": "Services are the definitions of tasks to run on a swarm. Swarm mode must be enabled for these endpoints to work.\n", + "x-displayName": "Services" + }, + { + "name": "Task", + "description": "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.\n", + "x-displayName": "Tasks" + }, + { + "name": "Secret", + "description": "Secrets are sensitive data that can be used by services. Swarm mode must be enabled for these endpoints to work.\n", + "x-displayName": "Secrets" + }, + { + "name": "Config", + "description": "Configs are application configurations that can be used by services. Swarm mode must be enabled for these endpoints to work.\n", + "x-displayName": "Configs" + }, + { + "name": "Plugin", + "x-displayName": "Plugins" + }, + { + "name": "System", + "x-displayName": "System" + } + ], + "paths": { + "/containers/json": { + "get": { + "tags": [ + "Container" + ], + "summary": "List containers", + "description": "Returns a list of containers. For details on the format, see [the inspect endpoint](#operation/ContainerInspect).\n\nNote that it uses a different, smaller representation of a container than inspecting a single container. For example,\nthe list of linked containers is not propagated .\n", + "operationId": "ContainerList", + "parameters": [ + { + "name": "all", + "in": "query", + "description": "Return all containers. By default, only running containers are shown", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "limit", + "in": "query", + "description": "Return this number of most recently created containers, including non-running ones.", + "schema": { + "type": "integer" + } + }, + { + "name": "size", + "in": "query", + "description": "Return the size of container as fields `SizeRw` and `SizeRootFs`.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "filters", + "in": "query", + "description": "Filters to process on the container list, encoded as JSON (a `map[string][]string`). For example, `{\"status\": [\"paused\"]}` will only return paused containers. Available filters:\n\n- `ancestor`=(`[:]`, ``, or ``)\n- `before`=(`` or ``)\n- `expose`=(`[/]`|`/[]`)\n- `exited=` containers with exit code of ``\n- `health`=(`starting`|`healthy`|`unhealthy`|`none`)\n- `id=` a container's ID\n- `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only)\n- `is-task=`(`true`|`false`)\n- `label=key` or `label=\"key=value\"` of a container label\n- `name=` a container's name\n- `network`=(`` or ``)\n- `publish`=(`[/]`|`/[]`)\n- `since`=(`` or ``)\n- `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`)\n- `volume`=(`` or ``)\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContainerSummary" + }, + "example": [ + { + "Id": "8dfafdbc3a40", + "Names": [ + "/boring_feynman" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 1", + "Created": 1367854155, + "State": "Exited", + "Status": "Exit 0", + "Ports": [ + { + "PrivatePort": 2222, + "PublicPort": 3333, + "Type": "tcp" + } + ], + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "2cdc4edb1ded3631c81f57966563e5c8525b81121bb3706a9a9a3ae102711f3f", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:02" + } + } + }, + "Mounts": [ + { + "Name": "fac362...80535", + "Source": "/data", + "Destination": "/data", + "Driver": "local", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" + } + ] + }, + { + "Id": "9cd87474be90", + "Names": [ + "/coolName" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 222222", + "Created": 1367854155, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "88eaed7b37b38c2a3f0c4bc796494fdf51b270c2d22656412a2ca5d559a64d7a", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.8", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:08" + } + } + }, + "Mounts": [] + }, + { + "Id": "3176a2479c92", + "Names": [ + "/sleepy_dog" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "8b27c041c30326d59cd6e6f510d4f8d1d570a228466f956edf7815508f78e30d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.6", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:06" + } + } + }, + "Mounts": [] + }, + { + "Id": "4cb07b47f9fb", + "Names": [ + "/running_cat" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "d91c7b2f0644403d7ef3095985ea0e2370325cd2332ff3a3225c4247328e66e9", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.5", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:05" + } + } + }, + "Mounts": [] + } + ] + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/create": { + "post": { + "tags": [ + "Container" + ], + "summary": "Create a container", + "operationId": "ContainerCreate", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Assign the specified name to the container. Must match `/?[a-zA-Z0-9_-]+`.", + "schema": { + "pattern": "/?[a-zA-Z0-9_-]+", + "type": "string" + } + } + ], + "requestBody": { + "description": "Container to create", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ContainerConfig" + }, + { + "type": "object", + "properties": { + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "NetworkingConfig": { + "type": "object", + "properties": { + "EndpointsConfig": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + }, + "description": "A mapping of network name to endpoint configuration for that network." + } + }, + "description": "This container's networking configuration." + } + } + } + ] + } + }, + "application/octet-stream": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ContainerConfig" + }, + { + "type": "object", + "properties": { + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "NetworkingConfig": { + "type": "object", + "properties": { + "EndpointsConfig": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + }, + "description": "A mapping of network name to endpoint configuration for that network." + } + }, + "description": "This container's networking configuration." + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Container created successfully", + "content": { + "application/json": { + "schema": { + "title": "ContainerCreateResponse", + "required": [ + "Id", + "Warnings" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the created container", + "nullable": false + }, + "Warnings": { + "type": "array", + "description": "Warnings encountered when creating the container", + "nullable": false, + "items": { + "type": "string" + } + } + }, + "description": "OK response to ContainerCreate operation" + }, + "example": { + "Id": "e90e34656806", + "Warnings": [] + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "409": { + "description": "conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/containers/{id}/json": { + "get": { + "tags": [ + "Container" + ], + "summary": "Inspect a container", + "description": "Return low-level information about a container.", + "operationId": "ContainerInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "size", + "in": "query", + "description": "Return the size of container as fields `SizeRw` and `SizeRootFs`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "ContainerInspectResponse", + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the container" + }, + "Created": { + "type": "string", + "description": "The time the container was created" + }, + "Path": { + "type": "string", + "description": "The path to the command being run" + }, + "Args": { + "type": "array", + "description": "The arguments to the command being run", + "items": { + "type": "string" + } + }, + "State": { + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "The status of the container. For example, `\"running\"` or `\"exited\"`.\n", + "enum": [ + "created", + "running", + "paused", + "restarting", + "removing", + "exited", + "dead" + ] + }, + "Running": { + "type": "boolean", + "description": "Whether this container is running.\n\nNote that a running container can be _paused_. The `Running` and `Paused`\nbooleans are not mutually exclusive:\n\nWhen pausing a container (on Linux), the cgroups freezer is used to suspend\nall processes in the container. Freezing the process requires the process to\nbe running. As a result, paused containers are both `Running` _and_ `Paused`.\n\nUse the `Status` field instead to determine if a container's state is \"running\".\n" + }, + "Paused": { + "type": "boolean", + "description": "Whether this container is paused." + }, + "Restarting": { + "type": "boolean", + "description": "Whether this container is restarting." + }, + "OOMKilled": { + "type": "boolean", + "description": "Whether this container has been killed because it ran out of memory." + }, + "Dead": { + "type": "boolean" + }, + "Pid": { + "type": "integer", + "description": "The process ID of this container" + }, + "ExitCode": { + "type": "integer", + "description": "The last exit code of this container" + }, + "Error": { + "type": "string" + }, + "StartedAt": { + "type": "string", + "description": "The time when this container was last started." + }, + "FinishedAt": { + "type": "string", + "description": "The time when this container last exited." + } + }, + "description": "The state of the container." + }, + "Image": { + "type": "string", + "description": "The container's image" + }, + "ResolvConfPath": { + "type": "string" + }, + "HostnamePath": { + "type": "string" + }, + "HostsPath": { + "type": "string" + }, + "LogPath": { + "type": "string" + }, + "Node": { + "type": "object", + "properties": {}, + "description": "TODO" + }, + "Name": { + "type": "string" + }, + "RestartCount": { + "type": "integer" + }, + "Driver": { + "type": "string" + }, + "MountLabel": { + "type": "string" + }, + "ProcessLabel": { + "type": "string" + }, + "AppArmorProfile": { + "type": "string" + }, + "ExecIDs": { + "type": "string" + }, + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "GraphDriver": { + "$ref": "#/components/schemas/GraphDriverData" + }, + "SizeRw": { + "type": "integer", + "description": "The size of files that have been created or changed by this container.", + "format": "int64" + }, + "SizeRootFs": { + "type": "integer", + "description": "The total size of all the files in this container.", + "format": "int64" + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MountPoint" + } + }, + "Config": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "NetworkSettings": { + "$ref": "#/components/schemas/NetworkSettings" + } + } + }, + "example": { + "AppArmorProfile": "", + "Args": [ + "-c", + "exit 9" + ], + "Config": { + "AttachStderr": true, + "AttachStdin": false, + "AttachStdout": true, + "Cmd": [ + "/bin/sh", + "-c", + "exit 9" + ], + "Domainname": "", + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Hostname": "ba033ac44011", + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "MacAddress": "", + "NetworkDisabled": false, + "OpenStdin": false, + "StdinOnce": false, + "Tty": false, + "User": "", + "Volumes": { + "/volumes/data": {} + }, + "WorkingDir": "", + "StopSignal": "SIGTERM", + "StopTimeout": 10 + }, + "Created": "2015-01-06T15:47:31.485331387Z", + "Driver": "devicemapper", + "HostConfig": { + "MaximumIOps": 0, + "MaximumIOBps": 0, + "BlkioWeight": 0, + "BlkioWeightDevice": [ + {} + ], + "BlkioDeviceReadBps": [ + {} + ], + "BlkioDeviceWriteBps": [ + {} + ], + "BlkioDeviceReadIOps": [ + {} + ], + "BlkioDeviceWriteIOps": [ + {} + ], + "ContainerIDFile": "", + "CpusetCpus": "", + "CpusetMems": "", + "CpuPercent": 80, + "CpuShares": 0, + "CpuPeriod": 100000, + "CpuRealtimePeriod": 1000000, + "CpuRealtimeRuntime": 10000, + "Devices": [], + "IpcMode": "", + "LxcConf": [], + "Memory": 0, + "MemorySwap": 0, + "MemoryReservation": 0, + "KernelMemory": 0, + "OomKillDisable": false, + "OomScoreAdj": 500, + "NetworkMode": "bridge", + "PidMode": "", + "PortBindings": {}, + "Privileged": false, + "ReadonlyRootfs": false, + "PublishAllPorts": false, + "RestartPolicy": { + "MaximumRetryCount": 2, + "Name": "on-failure" + }, + "LogConfig": { + "Type": "json-file" + }, + "Sysctls": { + "net.ipv4.ip_forward": "1" + }, + "Ulimits": [ + {} + ], + "VolumeDriver": "", + "ShmSize": 67108864 + }, + "HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname", + "HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts", + "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log", + "Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39", + "Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2", + "MountLabel": "", + "Name": "/boring_euclid", + "NetworkSettings": { + "Bridge": "", + "SandboxID": "", + "HairpinMode": false, + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + "SandboxKey": "", + "EndpointID": "", + "Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "IPAddress": "", + "IPPrefixLen": 0, + "IPv6Gateway": "", + "MacAddress": "", + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Path": "/bin/sh", + "ProcessLabel": "", + "ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf", + "RestartCount": 1, + "State": { + "Error": "", + "ExitCode": 9, + "FinishedAt": "2015-01-06T15:47:32.080254511Z", + "OOMKilled": false, + "Dead": false, + "Paused": false, + "Pid": 0, + "Restarting": false, + "Running": true, + "StartedAt": "2015-01-06T15:47:32.072697474Z", + "Status": "running" + }, + "Mounts": [ + { + "Name": "fac362...80535", + "Source": "/data", + "Destination": "/data", + "Driver": "local", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" + } + ] + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/top": { + "get": { + "tags": [ + "Container" + ], + "summary": "List processes running inside a container", + "description": "On Unix systems, this is done by running the `ps` command. This endpoint is not supported on Windows.", + "operationId": "ContainerTop", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "ps_args", + "in": "query", + "description": "The arguments to pass to `ps`. For example, `aux`", + "schema": { + "type": "string", + "default": "-ef" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "ContainerTopResponse", + "type": "object", + "properties": { + "Titles": { + "type": "array", + "description": "The ps column titles", + "items": { + "type": "string" + } + }, + "Processes": { + "type": "array", + "description": "Each process running in the container, where each is process is an array of values corresponding to the titles", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "description": "OK response to ContainerTop operation" + }, + "example": { + "Titles": [ + "UID", + "PID", + "PPID", + "C", + "STIME", + "TTY", + "TIME", + "CMD" + ], + "Processes": [ + [ + "root", + "13642", + "882", + "0", + "17:03", + "pts/0", + "00:00:00", + "/bin/bash" + ], + [ + "root", + "13735", + "13642", + "0", + "17:06", + "pts/0", + "00:00:00", + "sleep 10" + ] + ] + } + }, + "text/plain": { + "schema": { + "title": "ContainerTopResponse", + "type": "object", + "properties": { + "Titles": { + "type": "array", + "description": "The ps column titles", + "items": { + "type": "string" + } + }, + "Processes": { + "type": "array", + "description": "Each process running in the container, where each is process is an array of values corresponding to the titles", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "description": "OK response to ContainerTop operation" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/logs": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get container logs", + "description": "Get `stdout` and `stderr` logs from a container.\n\nNote: This endpoint works only for containers with the `json-file` or `journald` logging driver.\n", + "operationId": "ContainerLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "follow", + "in": "query", + "description": "Return the logs as a stream.\n\nThis 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).\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "until", + "in": "query", + "description": "Only return logs before this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines.", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "101": { + "description": "logs returned as a stream", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "200": { + "description": "logs returned as a string in response body", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/changes": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get changes on a container’s filesystem", + "description": "Returns which files in a container's filesystem have been added, deleted,\nor modified. The `Kind` of modification can be one of:\n\n- `0`: Modified\n- `1`: Added\n- `2`: Deleted\n", + "operationId": "ContainerChanges", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The list of changes", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "ContainerChangeResponseItem", + "required": [ + "Kind", + "Path" + ], + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Path to file that has changed", + "nullable": false + }, + "Kind": { + "type": "integer", + "description": "Kind of change", + "format": "uint8", + "nullable": false + } + }, + "description": "change item in response to ContainerChanges operation", + "x-go-name": "ContainerChangeResponseItem" + } + }, + "example": [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/export": { + "get": { + "tags": [ + "Container" + ], + "summary": "Export a container", + "description": "Export the contents of a container as a tarball.", + "operationId": "ContainerExport", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/stats": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get container stats based on resource usage", + "description": "This endpoint returns a live stream of a container’s resource usage\nstatistics.\n\nThe `precpu_stats` is the CPU statistic of last read, which is used\nfor calculating the CPU usage percentage. It is not the same as the\n`cpu_stats` field.\n\nIf either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is\nnil then for compatibility with older daemons the length of the\ncorresponding `cpu_usage.percpu_usage` array should be used.\n", + "operationId": "ContainerStats", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "stream", + "in": "query", + "description": "Stream the output. If false, the stats will be output once and then it will disconnect.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "read": "2015-01-08T22:57:31.547920715Z", + "pids_stats": { + "current": 3 + }, + "networks": { + "eth0": { + "rx_bytes": 5338, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 36, + "tx_bytes": 648, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 8 + }, + "eth5": { + "rx_bytes": 4641, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 26, + "tx_bytes": 690, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 9 + } + }, + "memory_stats": { + "stats": { + "total_pgmajfault": 0, + "cache": 0, + "mapped_file": 0, + "total_inactive_file": 0, + "pgpgout": 414, + "rss": 6537216, + "total_mapped_file": 0, + "writeback": 0, + "unevictable": 0, + "pgpgin": 477, + "total_unevictable": 0, + "pgmajfault": 0, + "total_rss": 6537216, + "total_rss_huge": 6291456, + "total_writeback": 0, + "total_inactive_anon": 0, + "rss_huge": 6291456, + "hierarchical_memory_limit": 67108864, + "total_pgfault": 964, + "total_active_file": 0, + "active_anon": 6537216, + "total_active_anon": 6537216, + "total_pgpgout": 414, + "total_cache": 0, + "inactive_anon": 0, + "active_file": 0, + "pgfault": 964, + "inactive_file": 0, + "total_pgpgin": 477 + }, + "max_usage": 6651904, + "usage": 6537216, + "failcnt": 0, + "limit": 67108864 + }, + "blkio_stats": {}, + "cpu_stats": { + "cpu_usage": { + "percpu_usage": [ + 8646879, + 24472255, + 36438778, + 30657443 + ], + "usage_in_usermode": 50000000, + "total_usage": 100215355, + "usage_in_kernelmode": 30000000 + }, + "system_cpu_usage": 739306590000000, + "online_cpus": 4, + "throttling_data": { + "periods": 0, + "throttled_periods": 0, + "throttled_time": 0 + } + }, + "precpu_stats": { + "cpu_usage": { + "percpu_usage": [ + 8646879, + 24350896, + 36438778, + 30657443 + ], + "usage_in_usermode": 50000000, + "total_usage": 100093996, + "usage_in_kernelmode": 30000000 + }, + "system_cpu_usage": 9492140000000, + "online_cpus": 4, + "throttling_data": { + "periods": 0, + "throttled_periods": 0, + "throttled_time": 0 + } + } + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/resize": { + "post": { + "tags": [ + "Container" + ], + "summary": "Resize a container TTY", + "description": "Resize the TTY for a container. You must restart the container for the resize to take effect.", + "operationId": "ContainerResize", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "h", + "in": "query", + "description": "Height of the tty session in characters", + "schema": { + "type": "integer" + } + }, + { + "name": "w", + "in": "query", + "description": "Width of the tty session in characters", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "cannot resize container", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/start": { + "post": { + "tags": [ + "Container" + ], + "summary": "Start a container", + "operationId": "ContainerStart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "304": { + "description": "container already started", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/stop": { + "post": { + "tags": [ + "Container" + ], + "summary": "Stop a container", + "operationId": "ContainerStop", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "t", + "in": "query", + "description": "Number of seconds to wait before killing the container", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "304": { + "description": "container already stopped", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/restart": { + "post": { + "tags": [ + "Container" + ], + "summary": "Restart a container", + "operationId": "ContainerRestart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "t", + "in": "query", + "description": "Number of seconds to wait before killing the container", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/kill": { + "post": { + "tags": [ + "Container" + ], + "summary": "Kill a container", + "description": "Send a POSIX signal to a container, defaulting to killing to the container.", + "operationId": "ContainerKill", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "signal", + "in": "query", + "description": "Signal to send to the container as an integer or string (e.g. `SIGINT`)", + "schema": { + "type": "string", + "default": "SIGKILL" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/update": { + "post": { + "tags": [ + "Container" + ], + "summary": "Update a container", + "description": "Change various configuration options of a container without having to recreate it.", + "operationId": "ContainerUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Resources" + }, + { + "type": "object", + "properties": { + "RestartPolicy": { + "$ref": "#/components/schemas/RestartPolicy" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The container has been updated.", + "content": { + "application/json": { + "schema": { + "title": "ContainerUpdateResponse", + "type": "object", + "properties": { + "Warnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "OK response to ContainerUpdate operation" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "update" + } + }, + "/containers/{id}/rename": { + "post": { + "tags": [ + "Container" + ], + "summary": "Rename a container", + "operationId": "ContainerRename", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "description": "New name for the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "name already in use", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/pause": { + "post": { + "tags": [ + "Container" + ], + "summary": "Pause a container", + "description": "Use the cgroups freezer to suspend all processes in a container.\n\nTraditionally, 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.\n", + "operationId": "ContainerPause", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/unpause": { + "post": { + "tags": [ + "Container" + ], + "summary": "Unpause a container", + "description": "Resume a container which has been paused.", + "operationId": "ContainerUnpause", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/attach": { + "post": { + "tags": [ + "Container" + ], + "summary": "Attach to a container", + "description": "Attach to a container to read its output or send it input. You can attach to the same container multiple times and you can reattach to containers that have been detached.\n\nEither the `stream` or `logs` parameter must be `true` for this endpoint to do anything.\n\nSee [the documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) for more details.\n\n### Hijacking\n\nThis endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, and `stderr` on the same socket.\n\nThis is the response from the daemon for an attach request:\n\n```\nHTTP/1.1 200 OK\nContent-Type: application/vnd.docker.raw-stream\n\n[STREAM]\n```\n\nAfter the headers and two new lines, the TCP connection can now be used for raw, bidirectional communication between the client and server.\n\nTo hint potential proxies about connection hijacking, the Docker client can also optionally send connection upgrade headers.\n\nFor example, the client sends this request to upgrade the connection:\n\n```\nPOST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1\nUpgrade: tcp\nConnection: Upgrade\n```\n\nThe Docker daemon will respond with a `101 UPGRADED` response, and will similarly follow with the raw stream:\n\n```\nHTTP/1.1 101 UPGRADED\nContent-Type: application/vnd.docker.raw-stream\nConnection: Upgrade\nUpgrade: tcp\n\n[STREAM]\n```\n\n### Stream format\n\nWhen 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.\n\nThe 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`).\n\nIt is encoded on the first eight bytes like this:\n\n```go\nheader := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n```\n\n`STREAM_TYPE` can be:\n\n- 0: `stdin` (is written on `stdout`)\n- 1: `stdout`\n- 2: `stderr`\n\n`SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size encoded as big endian.\n\nFollowing the header is the payload, which is the specified number of bytes of `STREAM_TYPE`.\n\nThe simplest way to implement this protocol is the following:\n\n1. Read 8 bytes.\n2. Choose `stdout` or `stderr` depending on the first byte.\n3. Extract the frame size from the last four bytes.\n4. Read the extracted size and output it on the correct output.\n5. Goto 1.\n\n### Stream format when using a TTY\n\nWhen 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`.\n", + "operationId": "ContainerAttach", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container.Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.", + "schema": { + "type": "string" + } + }, + { + "name": "logs", + "in": "query", + "description": "Replay previous logs from the container.\n\nThis is useful for attaching to a container that has started and you want to output everything since the container started.\n\nIf `stream` is also enabled, once all the previous output has been returned, it will seamlessly transition into streaming current output.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stream", + "in": "query", + "description": "Stream attached streams from the time the request was made onwards", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdin", + "in": "query", + "description": "Attach to `stdin`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Attach to `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Attach to `stderr`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "101": { + "description": "no error, hints proxy about hijacking", + "content": {} + }, + "200": { + "description": "no error, no upgrade header found", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/attach/ws": { + "get": { + "tags": [ + "Container" + ], + "summary": "Attach to a container via a websocket", + "operationId": "ContainerAttachWebsocket", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container.Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,`, or `_`.", + "schema": { + "type": "string" + } + }, + { + "name": "logs", + "in": "query", + "description": "Return logs", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stream", + "in": "query", + "description": "Return stream", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdin", + "in": "query", + "description": "Attach to `stdin`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Attach to `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Attach to `stderr`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "101": { + "description": "no error, hints proxy about hijacking", + "content": {} + }, + "200": { + "description": "no error, no upgrade header found", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/wait": { + "post": { + "tags": [ + "Container" + ], + "summary": "Wait for a container", + "description": "Block until a container stops, then returns the exit code.", + "operationId": "ContainerWait", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "condition", + "in": "query", + "description": "Wait until a container state reaches the given condition, either 'not-running' (default), 'next-exit', or 'removed'.", + "schema": { + "type": "string", + "default": "not-running" + } + } + ], + "responses": { + "200": { + "description": "The container has exit.", + "content": { + "application/json": { + "schema": { + "title": "ContainerWaitResponse", + "required": [ + "StatusCode" + ], + "type": "object", + "properties": { + "StatusCode": { + "type": "integer", + "description": "Exit code of the container", + "nullable": false + }, + "Error": { + "type": "object", + "properties": { + "Message": { + "type": "string", + "description": "Details of an error" + } + }, + "description": "container waiting error, if any" + } + }, + "description": "OK response to ContainerWait operation" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}": { + "delete": { + "tags": [ + "Container" + ], + "summary": "Remove a container", + "operationId": "ContainerDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "v", + "in": "query", + "description": "Remove the volumes associated with the container.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "force", + "in": "query", + "description": "If the container is running, kill it before removing it.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "link", + "in": "query", + "description": "Remove the specified link associated with the container.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "You cannot remove a running container: c2ada9df5af8. Stop the container before attempting removal or force remove" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/archive": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get an archive of a filesystem resource in a container", + "description": "Get a tar archive of a resource in the filesystem of container id.", + "operationId": "ContainerArchive", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Resource in the container’s filesystem to archive.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/x-tar": { + "schema": { + "type": "object", + "properties": { + "ErrorResponse": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "message": { + "type": "string", + "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).", + "nullable": false + } + } + } + } + } + }, + "404": { + "description": "Container or path does not exist", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Container" + ], + "summary": "Extract an archive of files or folders to a directory in a container", + "description": "Upload a tar archive to be extracted to a path in the filesystem of container id.", + "operationId": "PutContainerArchive", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Path to a directory in the container to extract the archive’s contents into. ", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "noOverwriteDirNonDir", + "in": "query", + "description": "If “1”, “true”, or “True” then it will be an error if unpacking the given content would cause an existing directory to be replaced with a non-directory and vice versa.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz.", + "content": { + "application/x-tar": { + "schema": { + "type": "string" + } + }, + "application/octet-stream": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The content was extracted successfully", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "Permission denied, the volume or container rootfs is marked as read-only.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "No such container or path does not exist inside the container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputStream" + }, + "head": { + "tags": [ + "Container" + ], + "summary": "Get information about files in a container", + "description": "A response header `X-Docker-Container-Path-Stat` is return containing a base64 - encoded JSON object with some filesystem header information about the path.", + "operationId": "ContainerArchiveInfo", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Resource in the container’s filesystem to archive.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "headers": { + "X-Docker-Container-Path-Stat": { + "description": "TODO", + "schema": { + "type": "string" + } + } + }, + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ErrorResponse": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "message": { + "type": "string", + "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).", + "nullable": false + } + } + } + }, + "text/plain": { + "schema": { + "type": "object", + "properties": { + "ErrorResponse": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "message": { + "type": "string", + "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).", + "nullable": false + } + } + } + } + } + }, + "404": { + "description": "Container or path does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/prune": { + "post": { + "tags": [ + "Container" + ], + "summary": "Delete stopped containers", + "operationId": "ContainerPrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `until=` Prune containers created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune containers with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ContainerPruneResponse", + "type": "object", + "properties": { + "ContainersDeleted": { + "type": "array", + "description": "Container IDs that were deleted", + "items": { + "type": "string" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/json": { + "get": { + "tags": [ + "Image" + ], + "summary": "List Images", + "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.", + "operationId": "ImageList", + "parameters": [ + { + "name": "all", + "in": "query", + "description": "Show all images. Only images from a final layer (no children) are shown by default.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:\n\n- `before`=(`[:]`, `` or ``)\n- `dangling=true`\n- `label=key` or `label=\"key=value\"` of an image label\n- `reference`=(`[:]`)\n- `since`=(`[:]`, `` or ``)\n", + "schema": { + "type": "string" + } + }, + { + "name": "digests", + "in": "query", + "description": "Show digest information as a `RepoDigests` field on each image.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Summary image data for the images matching the query", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + }, + "example": [ + { + "Id": "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8", + "ParentId": "", + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise" + ], + "RepoDigests": [ + "ubuntu@sha256:992069aee4016783df6345315302fa59681aae51a8eeb2f889dea59290f21787" + ], + "Created": 1474925151, + "Size": 103579269, + "VirtualSize": 103579269, + "SharedSize": 0, + "Labels": {}, + "Containers": 2 + }, + { + "Id": "sha256:3e314f95dcace0f5e4fd37b10862fe8398e3c60ed36600bc0ca5fda78b087175", + "ParentId": "", + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "RepoDigests": [ + "ubuntu@sha256:002fba3e3255af10be97ea26e476692a7ebed0bb074a9ab960b2e7a1526b15d7", + "ubuntu@sha256:68ea0200f0b90df725d99d823905b04cf844f6039ef60c60bf3e019915017bd3" + ], + "Created": 1403128455, + "Size": 172064416, + "VirtualSize": 172064416, + "SharedSize": 0, + "Labels": {}, + "Containers": 5 + } + ] + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/build": { + "post": { + "tags": [ + "Image" + ], + "summary": "Build an image", + "description": "Build an image from a tar archive with a `Dockerfile` in it.\n\nThe `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/).\n\nThe 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.\n\nThe build is canceled if the client drops the connection by quitting or being killed.\n", + "operationId": "ImageBuild", + "parameters": [ + { + "name": "dockerfile", + "in": "query", + "description": "Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`.", + "schema": { + "type": "string", + "default": "Dockerfile" + } + }, + { + "name": "t", + "in": "query", + "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.", + "schema": { + "type": "string" + } + }, + { + "name": "extrahosts", + "in": "query", + "description": "Extra hosts to add to /etc/hosts", + "schema": { + "type": "string" + } + }, + { + "name": "remote", + "in": "query", + "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.", + "schema": { + "type": "string" + } + }, + { + "name": "q", + "in": "query", + "description": "Suppress verbose build output.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "nocache", + "in": "query", + "description": "Do not use the cache when building the image.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "cachefrom", + "in": "query", + "description": "JSON array of images used for build cache resolution.", + "schema": { + "type": "string" + } + }, + { + "name": "pull", + "in": "query", + "description": "Attempt to pull the image even if an older image exists locally.", + "schema": { + "type": "string" + } + }, + { + "name": "rm", + "in": "query", + "description": "Remove intermediate containers after a successful build.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "forcerm", + "in": "query", + "description": "Always remove intermediate containers, even upon failure.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "memory", + "in": "query", + "description": "Set memory limit for build.", + "schema": { + "type": "integer" + } + }, + { + "name": "memswap", + "in": "query", + "description": "Total memory (memory + swap). Set as `-1` to disable swap.", + "schema": { + "type": "integer" + } + }, + { + "name": "cpushares", + "in": "query", + "description": "CPU shares (relative weight).", + "schema": { + "type": "integer" + } + }, + { + "name": "cpusetcpus", + "in": "query", + "description": "CPUs in which to allow execution (e.g., `0-3`, `0,1`).", + "schema": { + "type": "string" + } + }, + { + "name": "cpuperiod", + "in": "query", + "description": "The length of a CPU period in microseconds.", + "schema": { + "type": "integer" + } + }, + { + "name": "cpuquota", + "in": "query", + "description": "Microseconds of CPU time that the container can get in a CPU period.", + "schema": { + "type": "integer" + } + }, + { + "name": "buildargs", + "in": "query", + "description": "JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values. [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg)", + "schema": { + "type": "string" + } + }, + { + "name": "shmsize", + "in": "query", + "description": "Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB.", + "schema": { + "type": "integer" + } + }, + { + "name": "squash", + "in": "query", + "description": "Squash the resulting images layers into a single layer. *(Experimental release only.)*", + "schema": { + "type": "boolean" + } + }, + { + "name": "labels", + "in": "query", + "description": "Arbitrary key/value labels to set on the image, as a JSON map of string pairs.", + "schema": { + "type": "string" + } + }, + { + "name": "networkmode", + "in": "query", + "description": "Sets the networking mode for the run commands during build. Supported standard values are: `bridge`, `host`, `none`, and `container:`. Any other value is taken as a custom network's name to which this container should connect to.", + "schema": { + "type": "string" + } + }, + { + "name": "Content-type", + "in": "header", + "schema": { + "type": "string", + "default": "application/x-tar", + "enum": [ + "application/x-tar" + ] + } + }, + { + "name": "X-Registry-Config", + "in": "header", + "description": "This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to.\n\nThe key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example:\n\n```\n{\n \"docker.example.com\": {\n \"username\": \"janedoe\",\n \"password\": \"hunter2\"\n },\n \"https://index.docker.io/v1/\": {\n \"username\": \"mobydock\",\n \"password\": \"conta1n3rize14\"\n }\n}\n```\n\nOnly 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.\n", + "schema": { + "type": "string" + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform in the format os[/arch[/variant]]", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz.", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputStream" + } + }, + "/build/prune": { + "post": { + "tags": [ + "Image" + ], + "summary": "Delete builder cache", + "operationId": "BuildPrune", + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "BuildPruneResponse", + "type": "object", + "properties": { + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/create": { + "post": { + "tags": [ + "Image" + ], + "summary": "Create an image", + "description": "Create an image by either pulling it from a registry or importing it.", + "operationId": "ImageCreate", + "parameters": [ + { + "name": "fromImage", + "in": "query", + "description": "Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed.", + "schema": { + "type": "string" + } + }, + { + "name": "fromSrc", + "in": "query", + "description": "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image.", + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled.", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)", + "schema": { + "type": "string" + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform in the format os[/arch[/variant]]", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Image content if the value `-` has been specified in fromSrc query parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/octet-stream": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "repository does not exist or no read access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputImage" + } + }, + "/images/{name}/json": { + "get": { + "tags": [ + "Image" + ], + "summary": "Inspect an image", + "description": "Return low-level information about an image.", + "operationId": "ImageInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Image" + }, + "example": { + "Id": "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c", + "Container": "cb91e48a60d01f1e27028b4fc6819f4f290b3cf12496c8176ec714d0d390984a", + "Comment": "", + "Os": "linux", + "Architecture": "amd64", + "Parent": "sha256:91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "ContainerConfig": { + "Tty": false, + "Hostname": "e611e15f9c9d", + "Domainname": "", + "AttachStdout": false, + "PublishService": "", + "AttachStdin": false, + "OpenStdin": false, + "StdinOnce": false, + "NetworkDisabled": false, + "OnBuild": [], + "Image": "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "User": "", + "WorkingDir": "", + "MacAddress": "", + "AttachStderr": false, + "Labels": { + "com.example.license": "GPL", + "com.example.version": "1.0", + "com.example.vendor": "Acme" + }, + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Cmd": [ + "/bin/sh", + "-c", + "#(nop) LABEL com.example.vendor=Acme com.example.license=GPL com.example.version=1.0" + ] + }, + "DockerVersion": "1.9.0-dev", + "VirtualSize": 188359297, + "Size": 0, + "Author": "", + "Created": "2015-09-10T08:30:53.26995814Z", + "GraphDriver": { + "Name": "aufs", + "Data": {} + }, + "RepoDigests": [ + "localhost:5000/test/busybox/example@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf" + ], + "RepoTags": [ + "example:1.0", + "example:latest", + "example:stable" + ], + "Config": { + "Image": "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "NetworkDisabled": false, + "OnBuild": [], + "StdinOnce": false, + "PublishService": "", + "AttachStdin": false, + "OpenStdin": false, + "Domainname": "", + "AttachStdout": false, + "Tty": false, + "Hostname": "e611e15f9c9d", + "Cmd": [ + "/bin/bash" + ], + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Labels": { + "com.example.vendor": "Acme", + "com.example.version": "1.0", + "com.example.license": "GPL" + }, + "MacAddress": "", + "AttachStderr": false, + "WorkingDir": "", + "User": "" + }, + "RootFS": { + "Type": "layers", + "Layers": [ + "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6", + "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" + ] + } + } + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such image: someimage (tag: latest)" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/history": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get the history of an image", + "description": "Return parent layers of an image.", + "operationId": "ImageHistory", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "List of image layers", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "HistoryResponseItem", + "required": [ + "Comment", + "Created", + "CreatedBy", + "Id", + "Size", + "Tags" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": false + }, + "Created": { + "type": "integer", + "format": "int64", + "nullable": false + }, + "CreatedBy": { + "type": "string", + "nullable": false + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "Size": { + "type": "integer", + "format": "int64", + "nullable": false + }, + "Comment": { + "type": "string", + "nullable": false + } + }, + "description": "individual image layer information in response to ImageHistory operation", + "x-go-name": "HistoryResponseItem" + } + }, + "example": [ + { + "Id": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710", + "Created": 1398108230, + "CreatedBy": "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /", + "Tags": [ + "ubuntu:lucid", + "ubuntu:10.04" + ], + "Size": 182964289, + "Comment": "" + }, + { + "Id": "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8", + "Created": 1398108222, + "CreatedBy": "/bin/sh -c #(nop) MAINTAINER Tianon Gravi - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/", + "Tags": [], + "Size": 0, + "Comment": "" + }, + { + "Id": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158", + "Created": 1371157430, + "CreatedBy": "", + "Tags": [ + "scratch12:latest", + "scratch:latest" + ], + "Size": 0, + "Comment": "Imported from -" + } + ] + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/push": { + "post": { + "tags": [ + "Image" + ], + "summary": "Push an image", + "description": "Push an image to a registry.\n\nIf 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`.\n\nThe push is cancelled if the HTTP connection is closed.\n", + "operationId": "ImagePush", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag to associate with the image on the registry.", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/tag": { + "post": { + "tags": [ + "Image" + ], + "summary": "Tag an image", + "description": "Tag an image so that it becomes part of a repository.", + "operationId": "ImageTag", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID to tag.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "The repository to tag in. For example, `someuser/someimage`.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The name of the new tag.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "No error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}": { + "delete": { + "tags": [ + "Image" + ], + "summary": "Remove an image", + "description": "Remove an image, along with any untagged parent images that were\nreferenced by that image.\n\nImages can't be removed if they have descendant images, are being\nused by a running container or are being used by a build.\n", + "operationId": "ImageDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Remove the image even if it is being used by stopped containers or has other tags", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "noprune", + "in": "query", + "description": "Do not delete untagged parent images", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "The image was deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageDeleteResponseItem" + } + }, + "example": [ + { + "Untagged": "3e2f21a89f" + }, + { + "Deleted": "3e2f21a89f" + }, + { + "Deleted": "53b4f83ac9" + } + ] + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/search": { + "get": { + "tags": [ + "Image" + ], + "summary": "Search images", + "description": "Search for an image on Docker Hub.", + "operationId": "ImageSearch", + "parameters": [ + { + "name": "term", + "in": "query", + "description": "Term to search", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "schema": { + "type": "integer" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:\n\n- `is-automated=(true|false)`\n- `is-official=(true|false)`\n- `stars=` Matches images that has at least 'number' stars.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "ImageSearchResponseItem", + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "is_official": { + "type": "boolean" + }, + "is_automated": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "star_count": { + "type": "integer" + } + } + } + }, + "example": [ + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ] + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/prune": { + "post": { + "tags": [ + "Image" + ], + "summary": "Delete unused images", + "operationId": "ImagePrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters:\n\n- `dangling=` When set to `true` (or `1`), prune only\n unused *and* untagged images. When set to `false`\n (or `0`), all unused images are pruned.\n- `until=` Prune images created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune images with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ImagePruneResponse", + "type": "object", + "properties": { + "ImagesDeleted": { + "type": "array", + "description": "Images that were deleted", + "items": { + "$ref": "#/components/schemas/ImageDeleteResponseItem" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/auth": { + "post": { + "tags": [ + "System" + ], + "summary": "Check auth configuration", + "description": "Validate credentials for a registry and, if available, get an identity token for accessing the registry without password.", + "operationId": "SystemAuth", + "requestBody": { + "description": "Authentication to check", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthConfig" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "An identity token was generated successfully.", + "content": { + "application/json": { + "schema": { + "title": "SystemAuthResponse", + "required": [ + "Status" + ], + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "The status of the authentication", + "nullable": false + }, + "IdentityToken": { + "type": "string", + "description": "An opaque token used to authenticate a user after a successful login", + "nullable": false + } + } + }, + "example": { + "Status": "Login Succeeded", + "IdentityToken": "9cbaf023786cd7..." + } + } + } + }, + "204": { + "description": "No error", + "content": {} + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "authConfig" + } + }, + "/info": { + "get": { + "tags": [ + "System" + ], + "summary": "Get system information", + "operationId": "SystemInfo", + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/version": { + "get": { + "tags": [ + "System" + ], + "summary": "Get version", + "description": "Returns the version of Docker that is running and various information about the system that Docker is running on.", + "operationId": "SystemVersion", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "SystemVersionResponse", + "type": "object", + "properties": { + "Platform": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string" + } + } + }, + "Components": { + "type": "array", + "items": { + "required": [ + "Name", + "Version" + ], + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Version": { + "type": "string", + "nullable": false + }, + "Details": { + "type": "object", + "properties": {}, + "nullable": true + } + }, + "x-go-name": "ComponentVersion" + } + }, + "Version": { + "type": "string" + }, + "ApiVersion": { + "type": "string" + }, + "MinAPIVersion": { + "type": "string" + }, + "GitCommit": { + "type": "string" + }, + "GoVersion": { + "type": "string" + }, + "Os": { + "type": "string" + }, + "Arch": { + "type": "string" + }, + "KernelVersion": { + "type": "string" + }, + "Experimental": { + "type": "boolean" + }, + "BuildTime": { + "type": "string" + } + } + }, + "example": { + "Version": "17.04.0", + "Os": "linux", + "KernelVersion": "3.19.0-23-generic", + "GoVersion": "go1.7.5", + "GitCommit": "deadbee", + "Arch": "amd64", + "ApiVersion": "1.27", + "MinAPIVersion": "1.12", + "BuildTime": "2016-06-14T07:09:13.444803460+00:00", + "Experimental": true + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/_ping": { + "get": { + "tags": [ + "System" + ], + "summary": "Ping", + "description": "This is a dummy endpoint you can use to test if the server is accessible.", + "operationId": "SystemPing", + "responses": { + "200": { + "description": "no error", + "headers": { + "Docker-Experimental": { + "description": "If the server is running with experimental mode enabled", + "schema": { + "type": "boolean" + } + }, + "API-Version": { + "description": "Max API Version the server supports", + "schema": { + "type": "string" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string", + "example": "OK" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/commit": { + "post": { + "tags": [ + "Image" + ], + "summary": "Create a new image from a container", + "operationId": "ImageCommit", + "parameters": [ + { + "name": "container", + "in": "query", + "description": "The ID or name of the container to commit", + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "Repository name for the created image", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "Tag name for the create image", + "schema": { + "type": "string" + } + }, + { + "name": "comment", + "in": "query", + "description": "Commit message", + "schema": { + "type": "string" + } + }, + { + "name": "author", + "in": "query", + "description": "Author of the image (e.g., `John Hannibal Smith `)", + "schema": { + "type": "string" + } + }, + { + "name": "pause", + "in": "query", + "description": "Whether to pause the container before committing", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "changes", + "in": "query", + "description": "`Dockerfile` instructions to apply while committing", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The container configuration", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContainerConfig" + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "containerConfig" + } + }, + "/events": { + "get": { + "tags": [ + "System" + ], + "summary": "Monitor events", + "description": "Stream real-time events from the server.\n\nVarious objects within Docker report events when something happens to them.\n\nContainers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, and `update`\n\nImages report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, and `untag`\n\nVolumes report these events: `create`, `mount`, `unmount`, and `destroy`\n\nNetworks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, and `remove`\n\nThe Docker daemon reports these events: `reload`\n\nServices report these events: `create`, `update`, and `remove`\n\nNodes report these events: `create`, `update`, and `remove`\n\nSecrets report these events: `create`, `update`, and `remove`\n\nConfigs report these events: `create`, `update`, and `remove`\n", + "operationId": "SystemEvents", + "parameters": [ + { + "name": "since", + "in": "query", + "description": "Show events created since this timestamp then stream new events.", + "schema": { + "type": "string" + } + }, + { + "name": "until", + "in": "query", + "description": "Show events created until this timestamp then stop streaming.", + "schema": { + "type": "string" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters:\n\n- `config=` config name or ID\n- `container=` container name or ID\n- `daemon=` daemon name or ID\n- `event=` event type\n- `image=` image name or ID\n- `label=` image or container label\n- `network=` network name or ID\n- `node=` node ID\n- `plugin`= plugin name or ID\n- `scope`= local or swarm\n- `secret=` secret name or ID\n- `service=` service name or ID\n- `type=` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config`\n- `volume=` volume name\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "SystemEventsResponse", + "type": "object", + "properties": { + "Type": { + "type": "string", + "description": "The type of object emitting the event" + }, + "Action": { + "type": "string", + "description": "The type of event" + }, + "Actor": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the object emitting the event" + }, + "Attributes": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Various key/value attributes of the object, depending on its type" + } + } + }, + "time": { + "type": "integer", + "description": "Timestamp of event" + }, + "timeNano": { + "type": "integer", + "description": "Timestamp of event, with nanosecond accuracy", + "format": "int64" + } + } + }, + "example": { + "Type": "container", + "Action": "create", + "Actor": { + "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "Attributes": { + "com.example.some-label": "some-label-value", + "image": "alpine", + "name": "my-container" + } + }, + "time": 1461943101 + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/system/df": { + "get": { + "tags": [ + "System" + ], + "summary": "Get data usage information", + "operationId": "SystemDataUsage", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "SystemDataUsageResponse", + "type": "object", + "properties": { + "LayersSize": { + "type": "integer", + "format": "int64" + }, + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + }, + "Containers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerSummary" + } + }, + "Volumes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Volume" + } + } + }, + "example": { + "LayersSize": 1092588, + "Images": [ + { + "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "ParentId": "", + "RepoTags": [ + "busybox:latest" + ], + "RepoDigests": [ + "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + ], + "Created": 1466724217, + "Size": 1092588, + "SharedSize": 0, + "VirtualSize": 1092588, + "Labels": {}, + "Containers": 1 + } + ], + "Containers": [ + { + "Id": "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148", + "Names": [ + "/top" + ], + "Image": "busybox", + "ImageID": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "Command": "top", + "Created": 1472592424, + "Ports": [], + "SizeRootFs": 1092588, + "Labels": {}, + "State": "exited", + "Status": "Exited (0) 56 minutes ago", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92", + "EndpointID": "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a", + "Gateway": "172.18.0.1", + "IPAddress": "172.18.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Mounts": [] + } + ], + "Volumes": [ + { + "Name": "my-volume", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/my-volume/_data", + "Scope": "local", + "UsageData": { + "Size": 10920104, + "RefCount": 2 + } + } + ] + } + } + }, + "text/plain": { + "schema": { + "title": "SystemDataUsageResponse", + "type": "object", + "properties": { + "LayersSize": { + "type": "integer", + "format": "int64" + }, + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + }, + "Containers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerSummary" + } + }, + "Volumes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Volume" + } + } + }, + "example": { + "LayersSize": 1092588, + "Images": [ + { + "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "ParentId": "", + "RepoTags": [ + "busybox:latest" + ], + "RepoDigests": [ + "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + ], + "Created": 1466724217, + "Size": 1092588, + "SharedSize": 0, + "VirtualSize": 1092588, + "Labels": {}, + "Containers": 1 + } + ], + "Containers": [ + { + "Id": "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148", + "Names": [ + "/top" + ], + "Image": "busybox", + "ImageID": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "Command": "top", + "Created": 1472592424, + "Ports": [], + "SizeRootFs": 1092588, + "Labels": {}, + "State": "exited", + "Status": "Exited (0) 56 minutes ago", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92", + "EndpointID": "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a", + "Gateway": "172.18.0.1", + "IPAddress": "172.18.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Mounts": [] + } + ], + "Volumes": [ + { + "Name": "my-volume", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/my-volume/_data", + "Scope": "local", + "UsageData": { + "Size": 10920104, + "RefCount": 2 + } + } + ] + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/get": { + "get": { + "tags": [ + "Image" + ], + "summary": "Export an image", + "description": "Get a tarball containing all images and metadata for a repository.\n\nIf `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.\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID), each containing these files:\n\n- `VERSION`: currently `1.0` - the file format version\n- `json`: detailed layer information, similar to `docker inspect layer_id`\n- `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions.\n\nIf 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.\n\n```json\n{\n \"hello-world\": {\n \"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"\n }\n}\n```\n", + "operationId": "ImageGet", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/get": { + "get": { + "tags": [ + "Image" + ], + "summary": "Export several images", + "description": "Get a tarball containing all images and metadata for several image repositories.\n\nFor 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.\n\nFor details on the format, see [the export image endpoint](#operation/ImageGet).\n", + "operationId": "ImageGetAll", + "parameters": [ + { + "name": "names", + "in": "query", + "description": "Image names to filter by", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/load": { + "post": { + "tags": [ + "Image" + ], + "summary": "Import images", + "description": "Load a set of images and tags into a repository.\n\nFor details on the format, see [the export image endpoint](#operation/ImageGet).\n", + "operationId": "ImageLoad", + "parameters": [ + { + "name": "quiet", + "in": "query", + "description": "Suppress progress details during load.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "Tar archive containing images", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "imagesTarball" + } + }, + "/containers/{id}/exec": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Create an exec instance", + "description": "Run a command inside a running container.", + "operationId": "ContainerExec", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Exec configuration", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "AttachStdin": { + "type": "boolean", + "description": "Attach to `stdin` of the exec command." + }, + "AttachStdout": { + "type": "boolean", + "description": "Attach to `stdout` of the exec command." + }, + "AttachStderr": { + "type": "boolean", + "description": "Attach to `stderr` of the exec command." + }, + "DetachKeys": { + "type": "string", + "description": "Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`." + }, + "Tty": { + "type": "boolean", + "description": "Allocate a pseudo-TTY." + }, + "Env": { + "type": "array", + "description": "A list of environment variables in the form `[\"VAR=value\", ...]`.", + "items": { + "type": "string" + } + }, + "Cmd": { + "type": "array", + "description": "Command to run, as a string or array of strings.", + "items": { + "type": "string" + } + }, + "Privileged": { + "type": "boolean", + "description": "Runs the exec process with extended privileges.", + "default": false + }, + "User": { + "type": "string", + "description": "The user, and optionally, group to run the exec process inside the container. Format is one of: `user`, `user:group`, `uid`, or `uid:gid`." + }, + "WorkingDir": { + "type": "string", + "description": "The working directory for the exec process inside the container." + } + }, + "example": { + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "DetachKeys": "ctrl-p,ctrl-q", + "Tty": false, + "Cmd": [ + "date" + ], + "Env": [ + "FOO=bar", + "BAZ=quux" + ] + } + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "409": { + "description": "container is paused", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "execConfig" + } + }, + "/exec/{id}/start": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Start an exec instance", + "description": "Starts a previously set up exec instance. If detach is true, this endpoint returns immediately after starting the command. Otherwise, it sets up an interactive session with the command.", + "operationId": "ExecStart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "Detach": { + "type": "boolean", + "description": "Detach from the command." + }, + "Tty": { + "type": "boolean", + "description": "Allocate a pseudo-TTY." + } + }, + "example": { + "Detach": false, + "Tty": false + } + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "404": { + "description": "No such exec instance", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Container is stopped or paused", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "execStartConfig" + } + }, + "/exec/{id}/resize": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Resize an exec instance", + "description": "Resize the TTY session used by an exec instance. This endpoint only works if `tty` was specified as part of creating and starting the exec instance.", + "operationId": "ExecResize", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "h", + "in": "query", + "description": "Height of the TTY session in characters", + "schema": { + "type": "integer" + } + }, + { + "name": "w", + "in": "query", + "description": "Width of the TTY session in characters", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "201": { + "description": "No error", + "content": {} + }, + "404": { + "description": "No such exec instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/exec/{id}/json": { + "get": { + "tags": [ + "Exec" + ], + "summary": "Inspect an exec instance", + "description": "Return low-level information about an exec instance.", + "operationId": "ExecInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ExecInspectResponse", + "type": "object", + "properties": { + "CanRemove": { + "type": "boolean" + }, + "DetachKeys": { + "type": "string" + }, + "ID": { + "type": "string" + }, + "Running": { + "type": "boolean" + }, + "ExitCode": { + "type": "integer" + }, + "ProcessConfig": { + "$ref": "#/components/schemas/ProcessConfig" + }, + "OpenStdin": { + "type": "boolean" + }, + "OpenStderr": { + "type": "boolean" + }, + "OpenStdout": { + "type": "boolean" + }, + "ContainerID": { + "type": "string" + }, + "Pid": { + "type": "integer", + "description": "The system process ID for the exec process." + } + } + }, + "example": { + "CanRemove": false, + "ContainerID": "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126", + "DetachKeys": "", + "ExitCode": 2, + "ID": "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b", + "OpenStderr": true, + "OpenStdin": true, + "OpenStdout": true, + "ProcessConfig": { + "arguments": [ + "-c", + "exit 2" + ], + "entrypoint": "sh", + "privileged": false, + "tty": true, + "user": "1000" + }, + "Running": false, + "Pid": 42000 + } + } + } + }, + "404": { + "description": "No such exec instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes": { + "get": { + "tags": [ + "Volume" + ], + "summary": "List volumes", + "operationId": "VolumeList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the volumes list. Available filters:\n\n- `dangling=` When set to `true` (or `1`), returns all\n volumes that are not in use by a container. When set to `false`\n (or `0`), only volumes that are in use by one or more\n containers are returned.\n- `driver=` Matches volumes based on their driver.\n- `label=` or `label=:` Matches volumes based on\n the presence of a `label` alone or a `label` and a value.\n- `name=` Matches all or part of a volume name.\n", + "schema": { + "type": "string", + "format": "json" + } + } + ], + "responses": { + "200": { + "description": "Summary volume data that matches the query", + "content": { + "application/json": { + "schema": { + "title": "VolumeListResponse", + "required": [ + "Volumes", + "Warnings" + ], + "type": "object", + "properties": { + "Volumes": { + "type": "array", + "description": "List of volumes", + "nullable": false, + "items": { + "$ref": "#/components/schemas/Volume" + } + }, + "Warnings": { + "type": "array", + "description": "Warnings that occurred when fetching the list of volumes", + "nullable": false, + "items": { + "type": "string" + } + } + } + }, + "example": { + "Volumes": [ + { + "CreatedAt": "2017-07-19T12:00:26Z", + "Name": "tardis", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/tardis", + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + }, + "Scope": "local", + "Options": { + "device": "tmpfs", + "o": "size=100m,uid=1000", + "type": "tmpfs" + } + } + ], + "Warnings": [] + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes/create": { + "post": { + "tags": [ + "Volume" + ], + "summary": "Create a volume", + "operationId": "VolumeCreate", + "requestBody": { + "description": "Volume configuration", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The new volume's name. If not specified, Docker generates a name.", + "nullable": false + }, + "Driver": { + "type": "string", + "description": "Name of the volume driver to use.", + "nullable": false, + "default": "local" + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A mapping of driver options and values. These options are passed directly to the driver and are driver specific." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + } + }, + "example": { + "Name": "tardis", + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + }, + "Driver": "custom" + } + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "The volume was created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Volume" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "volumeConfig" + } + }, + "/volumes/{name}": { + "get": { + "tags": [ + "Volume" + ], + "summary": "Inspect a volume", + "operationId": "VolumeInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Volume name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Volume" + } + } + } + }, + "404": { + "description": "No such volume", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Volume" + ], + "summary": "Remove a volume", + "description": "Instruct the driver to remove the volume.", + "operationId": "VolumeDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Volume name or ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force the removal of the volume", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "The volume was removed", + "content": {} + }, + "404": { + "description": "No such volume or volume driver", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Volume is in use and cannot be removed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes/prune": { + "post": { + "tags": [ + "Volume" + ], + "summary": "Delete unused volumes", + "operationId": "VolumePrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "VolumePruneResponse", + "type": "object", + "properties": { + "VolumesDeleted": { + "type": "array", + "description": "Volumes that were deleted", + "items": { + "type": "string" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks": { + "get": { + "tags": [ + "Network" + ], + "summary": "List networks", + "description": "Returns a list of networks. For details on the format, see [the network inspect endpoint](#operation/NetworkInspect).\n\nNote that it uses a different, smaller representation of a network than inspecting a single network. For example,\nthe list of containers attached to the network is not propagated in API versions 1.28 and up.\n", + "operationId": "NetworkList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "JSON encoded value of the filters (a `map[string][]string`) to process on the networks list. Available filters:\n\n- `driver=` Matches a network's driver.\n- `id=` Matches all or part of a network ID.\n- `label=` or `label==` of a network label.\n- `name=` Matches all or part of a network name.\n- `scope=[\"swarm\"|\"global\"|\"local\"]` Filters networks by scope (`swarm`, `global`, or `local`).\n- `type=[\"custom\"|\"builtin\"]` Filters networks by type. The `custom` keyword returns all user-defined networks.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Network" + } + }, + "example": [ + { + "Name": "bridge", + "Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566", + "Created": "2016-10-19T06:21:00.416543526Z", + "Scope": "local", + "Driver": "bridge", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.17.0.0/16" + } + ] + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + } + }, + { + "Name": "none", + "Id": "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794", + "Created": "0001-01-01T00:00:00Z", + "Scope": "local", + "Driver": "null", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + }, + { + "Name": "host", + "Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e", + "Created": "0001-01-01T00:00:00Z", + "Scope": "local", + "Driver": "host", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + } + ] + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks/{id}": { + "get": { + "tags": [ + "Network" + ], + "summary": "Inspect a network", + "operationId": "NetworkInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "verbose", + "in": "query", + "description": "Detailed inspect output for troubleshooting", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "scope", + "in": "query", + "description": "Filter the network by scope (swarm, global, or local)", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Network" + } + } + } + }, + "404": { + "description": "Network not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Network" + ], + "summary": "Remove a network", + "operationId": "NetworkDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No error", + "content": {} + }, + "403": { + "description": "operation not supported for pre-defined networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such network", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks/create": { + "post": { + "tags": [ + "Network" + ], + "summary": "Create a network", + "operationId": "NetworkCreate", + "requestBody": { + "description": "Network configuration", + "content": { + "application/json": { + "schema": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The network's name." + }, + "CheckDuplicate": { + "type": "boolean", + "description": "Check for networks with duplicate names. Since Network is primarily keyed based on a random ID and not on the name, and network name is strictly a user-friendly alias to the network which is uniquely identified using ID, there is no guaranteed way to check for duplicates. CheckDuplicate is there to provide a best effort checking of any networks which has the same name but it is not guaranteed to catch all name collisions." + }, + "Driver": { + "type": "string", + "description": "Name of the network driver plugin to use.", + "default": "bridge" + }, + "Internal": { + "type": "boolean", + "description": "Restrict external access to the network." + }, + "Attachable": { + "type": "boolean", + "description": "Globally scoped network is manually attachable by regular containers from workers in swarm mode." + }, + "Ingress": { + "type": "boolean", + "description": "Ingress network is the network which provides the routing-mesh in swarm mode." + }, + "IPAM": { + "$ref": "#/components/schemas/IPAM" + }, + "EnableIPv6": { + "type": "boolean", + "description": "Enable IPv6 on the network." + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Network specific options to be used by the drivers." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + } + }, + "example": { + "Name": "isolated_nw", + "CheckDuplicate": false, + "Driver": "bridge", + "EnableIPv6": true, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.20.0.0/16", + "IPRange": "172.20.10.0/24", + "Gateway": "172.20.10.11" + }, + { + "Subnet": "2001:db8:abcd::/64", + "Gateway": "2001:db8:abcd::1011" + } + ], + "Options": { + "foo": "bar" + } + }, + "Internal": true, + "Attachable": false, + "Ingress": false, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "NetworkCreateResponse", + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the created network." + }, + "Warning": { + "type": "string" + } + }, + "example": { + "Id": "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30", + "Warning": "" + } + } + } + } + }, + "403": { + "description": "operation not supported for pre-defined networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "plugin not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "networkConfig" + } + }, + "/networks/{id}/connect": { + "post": { + "tags": [ + "Network" + ], + "summary": "Connect a container to a network", + "operationId": "NetworkConnect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "The ID or name of the container to connect to the network." + }, + "EndpointConfig": { + "$ref": "#/components/schemas/EndpointSettings" + } + }, + "example": { + "Container": "3613f73ba0e4", + "EndpointConfig": { + "IPAMConfig": { + "IPv4Address": "172.24.56.89", + "IPv6Address": "2001:db8::5689" + } + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "403": { + "description": "Operation not supported for swarm scoped networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Network or container not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "container" + } + }, + "/networks/{id}/disconnect": { + "post": { + "tags": [ + "Network" + ], + "summary": "Disconnect a container from a network", + "operationId": "NetworkDisconnect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "The ID or name of the container to disconnect from the network." + }, + "Force": { + "type": "boolean", + "description": "Force the container to disconnect from the network." + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "403": { + "description": "Operation not supported for swarm scoped networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Network or container not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "container" + } + }, + "/networks/prune": { + "post": { + "tags": [ + "Network" + ], + "summary": "Delete unused networks", + "operationId": "NetworkPrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `until=` Prune networks created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune networks with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "NetworkPruneResponse", + "type": "object", + "properties": { + "NetworksDeleted": { + "type": "array", + "description": "Networks that were deleted", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "List plugins", + "description": "Returns information about installed plugins.", + "operationId": "PluginList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to process on the plugin list. Available filters:\n\n- `capability=`\n- `enable=|`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Plugin" + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/privileges": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "Get plugin privileges", + "operationId": "GetPluginPrivileges", + "parameters": [ + { + "name": "remote", + "in": "query", + "description": "The name of the plugin. The `:latest` tag is optional, and is the default if omitted.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "title": "PluginPrivilegeItem", + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission the user has to accept upon installing the plugin." + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "title": "PluginPrivilegeItem", + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission the user has to accept upon installing the plugin." + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/pull": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Install a plugin", + "description": "Pulls and installs a plugin. After the plugin is installed, it can be enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable).\n", + "operationId": "PluginPull", + "parameters": [ + { + "name": "remote", + "in": "query", + "description": "Remote reference for plugin to install.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "description": "Local name for the pulled plugin.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission accepted by the user upon installing the plugin." + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission accepted by the user upon installing the plugin." + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/plugins/{name}/json": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "Inspect a plugin", + "operationId": "PluginInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the default if omitted.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + } + } + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}": { + "delete": { + "tags": [ + "Plugin" + ], + "summary": "Remove a plugin", + "operationId": "PluginDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the default if omitted.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Disable the plugin before removing. This may result in issues if the plugin is in use by a container.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + } + } + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/enable": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Enable a plugin", + "operationId": "PluginEnable", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the default if omitted.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Set the HTTP client timeout (in seconds)", + "schema": { + "type": "integer", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/disable": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Disable a plugin", + "operationId": "PluginDisable", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the default if omitted.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/upgrade": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Upgrade a plugin", + "operationId": "PluginUpgrade", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the default if omitted.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "remote", + "in": "query", + "description": "Remote reference to upgrade to.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission accepted by the user upon installing the plugin." + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission accepted by the user upon installing the plugin." + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/plugins/create": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Create a plugin", + "operationId": "PluginCreate", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the plugin. The `:latest` tag is optional, and is the default if omitted.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Path to tar containing plugin rootfs and manifest", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "tarContext" + } + }, + "/plugins/{name}/push": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Push a plugin", + "description": "Push a plugin to the registry.\n", + "operationId": "PluginPush", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the default if omitted.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/set": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Configure a plugin", + "operationId": "PluginSet", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the default if omitted.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + "DEBUG=1" + ], + "items": { + "type": "string" + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "No error", + "content": {} + }, + "404": { + "description": "Plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/nodes": { + "get": { + "tags": [ + "Node" + ], + "summary": "List nodes", + "operationId": "NodeList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the nodes list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `id=`\n- `label=`\n- `membership=`(`accepted`|`pending`)`\n- `name=`\n- `role=`(`manager`|`worker`)`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Node" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Node" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/nodes/{id}": { + "get": { + "tags": [ + "Node" + ], + "summary": "Inspect a node", + "operationId": "NodeInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the node", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Node" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Node" + } + } + } + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Node" + ], + "summary": "Delete a node", + "operationId": "NodeDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the node", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force remove a node from the swarm", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/nodes/{id}/update": { + "post": { + "tags": [ + "Node" + ], + "summary": "Update a node", + "operationId": "NodeUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the node", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the node object being updated. This is required to avoid conflicting writes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NodeSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/NodeSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm": { + "get": { + "tags": [ + "Swarm" + ], + "summary": "Inspect swarm", + "operationId": "SwarmInspect", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Swarm" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Swarm" + } + } + } + }, + "404": { + "description": "no such swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/init": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Initialize a new swarm", + "operationId": "SwarmInit", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "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." + }, + "AdvertiseAddr": { + "type": "string", + "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." + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format: ``), for example, `192.168.1.1`,\nor an interface, like `eth0`. If `DataPathAddr` is unspecified, the same address as `AdvertiseAddr`\nis used.\n\nThe `DataPathAddr` specifies the address that global scope network drivers will publish towards other\nnodes in order to reach the containers running on this node. Using this parameter it is possible to\nseparate the container data traffic from the management traffic of the cluster.\n" + }, + "ForceNewCluster": { + "type": "boolean", + "description": "Force creation of a new swarm." + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "ForceNewCluster": false, + "Spec": { + "Orchestration": {}, + "Raft": {}, + "Dispatcher": {}, + "CAConfig": {}, + "EncryptionConfig": { + "AutoLockManagers": false + } + } + } + } + }, + "text/plain": { + "schema": { + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "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." + }, + "AdvertiseAddr": { + "type": "string", + "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." + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format: ``), for example, `192.168.1.1`,\nor an interface, like `eth0`. If `DataPathAddr` is unspecified, the same address as `AdvertiseAddr`\nis used.\n\nThe `DataPathAddr` specifies the address that global scope network drivers will publish towards other\nnodes in order to reach the containers running on this node. Using this parameter it is possible to\nseparate the container data traffic from the management traffic of the cluster.\n" + }, + "ForceNewCluster": { + "type": "boolean", + "description": "Force creation of a new swarm." + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "ForceNewCluster": false, + "Spec": { + "Orchestration": {}, + "Raft": {}, + "Dispatcher": {}, + "CAConfig": {}, + "EncryptionConfig": { + "AutoLockManagers": false + } + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "string", + "description": "The node ID", + "example": "7v2t30z9blmxuhnyo6s4cpenp" + } + }, + "text/plain": { + "schema": { + "type": "string", + "description": "The node ID", + "example": "7v2t30z9blmxuhnyo6s4cpenp" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is already part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/join": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Join an existing swarm", + "operationId": "SwarmJoin", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "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)." + }, + "AdvertiseAddr": { + "type": "string", + "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." + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format: ``), for example, `192.168.1.1`,\nor an interface, like `eth0`. If `DataPathAddr` is unspecified, the same address as `AdvertiseAddr`\nis used.\n\nThe `DataPathAddr` specifies the address that global scope network drivers will publish towards other\nnodes in order to reach the containers running on this node. Using this parameter it is possible to\nseparate the container data traffic from the management traffic of the cluster.\n" + }, + "RemoteAddrs": { + "type": "string", + "description": "Addresses of manager nodes already participating in the swarm." + }, + "JoinToken": { + "type": "string", + "description": "Secret token for joining this swarm." + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "RemoteAddrs": [ + "node1:2377" + ], + "JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + } + }, + "text/plain": { + "schema": { + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "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)." + }, + "AdvertiseAddr": { + "type": "string", + "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." + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format: ``), for example, `192.168.1.1`,\nor an interface, like `eth0`. If `DataPathAddr` is unspecified, the same address as `AdvertiseAddr`\nis used.\n\nThe `DataPathAddr` specifies the address that global scope network drivers will publish towards other\nnodes in order to reach the containers running on this node. Using this parameter it is possible to\nseparate the container data traffic from the management traffic of the cluster.\n" + }, + "RemoteAddrs": { + "type": "string", + "description": "Addresses of manager nodes already participating in the swarm." + }, + "JoinToken": { + "type": "string", + "description": "Secret token for joining this swarm." + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "RemoteAddrs": [ + "node1:2377" + ], + "JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is already part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/leave": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Leave a swarm", + "operationId": "SwarmLeave", + "parameters": [ + { + "name": "force", + "in": "query", + "description": "Force leave swarm, even if this is the last manager or that it will break the cluster.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/update": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Update a swarm", + "operationId": "SwarmUpdate", + "parameters": [ + { + "name": "version", + "in": "query", + "description": "The version number of the swarm object being updated. This is required to avoid conflicting writes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "rotateWorkerToken", + "in": "query", + "description": "Rotate the worker join token.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "rotateManagerToken", + "in": "query", + "description": "Rotate the manager join token.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "rotateManagerUnlockKey", + "in": "query", + "description": "Rotate the manager unlock key.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/SwarmSpec" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/unlockkey": { + "get": { + "tags": [ + "Swarm" + ], + "summary": "Get the unlock key", + "operationId": "SwarmUnlockkey", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "UnlockKeyResponse", + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + }, + "text/plain": { + "schema": { + "title": "UnlockKeyResponse", + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/unlock": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Unlock a locked manager", + "operationId": "SwarmUnlock", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services": { + "get": { + "tags": [ + "Service" + ], + "summary": "List services", + "operationId": "ServiceList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to process on the services list. Available filters:\n\n- `id=`\n- `label=`\n- `mode=[\"replicated\"|\"global\"]`\n- `name=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/services/create": { + "post": { + "tags": [ + "Service" + ], + "summary": "Create a service", + "operationId": "ServiceCreate", + "parameters": [ + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServiceSpec" + }, + { + "type": "object", + "example": { + "Name": "web", + "TaskTemplate": { + "ContainerSpec": { + "Image": "nginx:alpine", + "Mounts": [ + { + "ReadOnly": true, + "Source": "web-data", + "Target": "/usr/share/nginx/html", + "Type": "volume", + "VolumeOptions": { + "DriverConfig": {}, + "Labels": { + "com.example.something": "something-value" + } + } + } + ], + "Hosts": [ + "10.10.10.10 host1", + "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 host2" + ], + "User": "33", + "DNSConfig": { + "Nameservers": [ + "8.8.8.8" + ], + "Search": [ + "example.org" + ], + "Options": [ + "timeout:3" + ] + }, + "Secrets": [ + { + "File": { + "Name": "www.example.org.key", + "UID": "33", + "GID": "33", + "Mode": 384 + }, + "SecretID": "fpjqlhnwb19zds35k8wn80lq9", + "SecretName": "example_org_domain_key" + } + ] + }, + "LogDriver": { + "Name": "json-file", + "Options": { + "max-file": "3", + "max-size": "10M" + } + }, + "Placement": {}, + "Resources": { + "Limits": { + "MemoryBytes": 104857600 + }, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "on-failure", + "Delay": 10000000000, + "MaxAttempts": 10 + } + }, + "Mode": { + "Replicated": { + "Replicas": 4 + } + }, + "UpdateConfig": { + "Parallelism": 2, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Ports": [ + { + "Protocol": "tcp", + "PublishedPort": 8080, + "TargetPort": 80 + } + ] + }, + "Labels": { + "foo": "bar" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "ServiceCreateResponse", + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the created service." + }, + "Warning": { + "type": "string", + "description": "Optional warning message" + } + }, + "example": { + "ID": "ak7w3gjqoa3kuz8xcpnyy0pvl", + "Warning": "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + } + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "network is not eligible for services", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services/{id}": { + "get": { + "tags": [ + "Service" + ], + "summary": "Inspect a service", + "operationId": "ServiceInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "insertDefaults", + "in": "query", + "description": "Fill empty fields with default values.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Service" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Service" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Service" + ], + "summary": "Delete a service", + "operationId": "ServiceDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/services/{id}/update": { + "post": { + "tags": [ + "Service" + ], + "summary": "Update a service", + "operationId": "ServiceUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the service object being updated. This is required to avoid conflicting writes.", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "registryAuthFrom", + "in": "query", + "description": "If the X-Registry-Auth header is not specified, this parameter indicates where to find registry authorization credentials. The valid values are `spec` and `previous-spec`.", + "schema": { + "type": "string", + "default": "spec" + } + }, + { + "name": "rollback", + "in": "query", + "description": "Set to this parameter to `previous` to cause a server-side rollback to the previous service spec. The supplied spec will be ignored in this case.", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServiceSpec" + }, + { + "type": "object", + "example": { + "Name": "top", + "TaskTemplate": { + "ContainerSpec": { + "Image": "busybox", + "Args": [ + "top" + ] + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {}, + "ForceUpdate": 0 + }, + "Mode": { + "Replicated": { + "Replicas": 1 + } + }, + "UpdateConfig": { + "Parallelism": 2, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Mode": "vip" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUpdateResponse" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services/{id}/logs": { + "get": { + "tags": [ + "Service" + ], + "summary": "Get service logs", + "description": "Get `stdout` and `stderr` logs from a service.\n\n**Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers.\n", + "operationId": "ServiceLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the service", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "details", + "in": "query", + "description": "Show service context and extra details provided to logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "follow", + "in": "query", + "description": "Return the logs as a stream.\n\nThis 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).\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines.", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "101": { + "description": "logs returned as a stream", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "200": { + "description": "logs returned as a string in response body", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such service: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks": { + "get": { + "tags": [ + "Task" + ], + "summary": "List tasks", + "operationId": "TaskList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to process on the tasks list. Available filters:\n\n- `desired-state=(running | shutdown | accepted)`\n- `id=`\n- `label=key` or `label=\"key=value\"`\n- `name=`\n- `node=`\n- `service=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "0kzzo1i0y4jz6027t0k7aezc7", + "Version": { + "Index": 71 + }, + "CreatedAt": "2016-06-07T21:07:31.171892745Z", + "UpdatedAt": "2016-06-07T21:07:31.376370513Z", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:31.290032978Z", + "State": "running", + "Message": "started", + "ContainerStatus": { + "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035", + "PID": 677 + } + }, + "DesiredState": "running", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.10/16" + ] + } + ] + }, + { + "ID": "1yljwbmlr8er2waf8orvqpwms", + "Version": { + "Index": 30 + }, + "CreatedAt": "2016-06-07T21:07:30.019104782Z", + "UpdatedAt": "2016-06-07T21:07:30.231958098Z", + "Name": "hopeful_cori", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:30.202183143Z", + "State": "shutdown", + "Message": "shutdown", + "ContainerStatus": { + "ContainerID": "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213" + } + }, + "DesiredState": "shutdown", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.5/16" + ] + } + ] + } + ], + "items": { + "$ref": "#/components/schemas/Task" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks/{id}": { + "get": { + "tags": [ + "Task" + ], + "summary": "Inspect a task", + "operationId": "TaskInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the task", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Task" + } + } + } + }, + "404": { + "description": "no such task", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks/{id}/logs": { + "get": { + "summary": "Get task logs", + "description": "Get `stdout` and `stderr` logs from a task.\n\n**Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers.\n", + "operationId": "TaskLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the task", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "details", + "in": "query", + "description": "Show task context and extra details provided to logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "follow", + "in": "query", + "description": "Return the logs as a stream.\n\nThis 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).\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines.", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "101": { + "description": "logs returned as a stream", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "200": { + "description": "logs returned as a string in response body", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "no such task", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such task: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets": { + "get": { + "tags": [ + "Secret" + ], + "summary": "List secrets", + "operationId": "SecretList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to process on the secrets list. Available filters:\n\n- `id=`\n- `label= or label==value`\n- `name=`\n- `names=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "blt1owaxmitz71s9v5zh81zun", + "Version": { + "Index": 85 + }, + "CreatedAt": "2017-07-20T13:55:28.678958722Z", + "UpdatedAt": "2017-07-20T13:55:28.678958722Z", + "Spec": { + "Name": "mysql-passwd", + "Labels": { + "some.label": "some.value" + }, + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + }, + { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt", + "Labels": { + "foo": "bar" + } + } + } + ], + "items": { + "$ref": "#/components/schemas/Secret" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets/create": { + "post": { + "tags": [ + "Secret" + ], + "summary": "Create a secret", + "operationId": "SecretCreate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SecretSpec" + }, + { + "type": "object", + "example": { + "Name": "app-key.crt", + "Labels": { + "foo": "bar" + }, + "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==", + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + } + ] + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/secrets/{id}": { + "get": { + "tags": [ + "Secret" + ], + "summary": "Inspect a secret", + "operationId": "SecretInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the secret", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Secret" + }, + "example": { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt", + "Labels": { + "foo": "bar" + }, + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + } + } + } + }, + "404": { + "description": "secret not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Secret" + ], + "summary": "Delete a secret", + "operationId": "SecretDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the secret", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "secret not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets/{id}/update": { + "post": { + "tags": [ + "Secret" + ], + "summary": "Update a Secret", + "operationId": "SecretUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the secret", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the secret object being updated. This is required to avoid conflicting writes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "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.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SecretSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/SecretSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such secret", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/configs": { + "get": { + "tags": [ + "Config" + ], + "summary": "List configs", + "operationId": "ConfigList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to process on the configs list. Available filters:\n\n- `id=`\n- `label= or label==value`\n- `name=`\n- `names=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "server.conf" + } + } + ], + "items": { + "$ref": "#/components/schemas/Config" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/configs/create": { + "post": { + "tags": [ + "Config" + ], + "summary": "Create a config", + "operationId": "ConfigCreate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ConfigSpec" + }, + { + "type": "object", + "example": { + "Name": "server.conf", + "Labels": { + "foo": "bar" + }, + "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + } + } + ] + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/configs/{id}": { + "get": { + "tags": [ + "Config" + ], + "summary": "Inspect a config", + "operationId": "ConfigInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the config", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Config" + }, + "example": { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt" + } + } + } + } + }, + "404": { + "description": "config not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Config" + ], + "summary": "Delete a config", + "operationId": "ConfigDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the config", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "config not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/configs/{id}/update": { + "post": { + "tags": [ + "Config" + ], + "summary": "Update a Config", + "operationId": "ConfigUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the config", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the config object being updated. This is required to avoid conflicting writes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "The spec of the config to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the [ConfigInspect endpoint](#operation/ConfigInspect) response values.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ConfigSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such config", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/distribution/{name}/json": { + "get": { + "tags": [ + "Distribution" + ], + "summary": "Get image information from the registry", + "description": "Return image digest and platform information by contacting the registry.", + "operationId": "DistributionInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "descriptor and platform information", + "content": { + "application/json": { + "schema": { + "title": "DistributionInspectResponse", + "required": [ + "Descriptor", + "Platforms" + ], + "type": "object", + "properties": { + "Descriptor": { + "type": "object", + "properties": { + "MediaType": { + "type": "string" + }, + "Size": { + "type": "integer", + "format": "int64" + }, + "Digest": { + "type": "string" + }, + "URLs": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "A descriptor struct containing digest, media type, and size" + }, + "Platforms": { + "type": "array", + "description": "An array containing all platforms supported by the image", + "items": { + "type": "object", + "properties": { + "Architecture": { + "type": "string" + }, + "OS": { + "type": "string" + }, + "OSVersion": { + "type": "string" + }, + "OSFeatures": { + "type": "array", + "items": { + "type": "string" + } + }, + "Variant": { + "type": "string" + }, + "Features": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "x-go-name": "DistributionInspect" + }, + "example": { + "Descriptor": { + "MediaType": "application/vnd.docker.distribution.manifest.v2+json", + "Digest": "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96", + "Size": 3987495, + "URLs": [ + "" + ] + }, + "Platforms": [ + { + "Architecture": "amd64", + "OS": "linux", + "OSVersion": "", + "OSFeatures": [ + "" + ], + "Variant": "", + "Features": [ + "" + ] + } + ] + } + } + } + }, + "401": { + "description": "Failed authentication or no image found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such image: someimage (tag: latest)" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/session": { + "post": { + "tags": [ + "Session (experimental)" + ], + "summary": "Initialize interactive session", + "description": "Start a new interactive session with a server. Session allows server to call back to the client for advanced capabilities.\n\n> **Note**: This endpoint is *experimental* and only available if the daemon is started with experimental\n> features enabled. The specifications for this endpoint may still change in a future version of the API.\n\n### Hijacking\n\nThis endpoint hijacks the HTTP connection to HTTP2 transport that allows the client to expose gPRC services on that connection.\n\nFor example, the client sends this request to upgrade the connection:\n\n```\nPOST /session HTTP/1.1\nUpgrade: h2c\nConnection: Upgrade\n```\n\nThe Docker daemon will respond with a `101 UPGRADED` response follow with the raw stream:\n\n```\nHTTP/1.1 101 UPGRADED\nConnection: Upgrade\nUpgrade: h2c\n```\n", + "operationId": "Session", + "responses": { + "101": { + "description": "no error, hijacking successful", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Port": { + "required": [ + "PrivatePort", + "Type" + ], + "type": "object", + "properties": { + "IP": { + "type": "string", + "format": "ip-address" + }, + "PrivatePort": { + "type": "integer", + "description": "Port on the container", + "format": "uint16", + "nullable": false + }, + "PublicPort": { + "type": "integer", + "description": "Port exposed on the host", + "format": "uint16" + }, + "Type": { + "type": "string", + "nullable": false, + "enum": [ + "tcp", + "udp" + ] + } + }, + "description": "An open port on a container", + "example": { + "PrivatePort": 8080, + "PublicPort": 80, + "Type": "tcp" + } + }, + "MountPoint": { + "type": "object", + "properties": { + "Type": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Source": { + "type": "string" + }, + "Destination": { + "type": "string" + }, + "Driver": { + "type": "string" + }, + "Mode": { + "type": "string" + }, + "RW": { + "type": "boolean" + }, + "Propagation": { + "type": "string" + } + }, + "description": "A mount point inside a container" + }, + "DeviceMapping": { + "type": "object", + "properties": { + "PathOnHost": { + "type": "string" + }, + "PathInContainer": { + "type": "string" + }, + "CgroupPermissions": { + "type": "string" + } + }, + "description": "A device mapping between the host and container", + "example": { + "PathOnHost": "/dev/deviceName", + "PathInContainer": "/dev/deviceName", + "CgroupPermissions": "mrw" + } + }, + "ThrottleDevice": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Device path" + }, + "Rate": { + "minimum": 0, + "type": "integer", + "description": "Rate", + "format": "int64" + } + } + }, + "Mount": { + "type": "object", + "properties": { + "Target": { + "type": "string", + "description": "Container path." + }, + "Source": { + "type": "string", + "description": "Mount source (e.g. a volume name, a host path)." + }, + "Type": { + "type": "string", + "description": "The mount type. Available types:\n\n- `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container.\n- `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.\n- `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs.\n", + "enum": [ + "bind", + "volume", + "tmpfs" + ] + }, + "ReadOnly": { + "type": "boolean", + "description": "Whether the mount should be read-only." + }, + "Consistency": { + "type": "string", + "description": "The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`." + }, + "BindOptions": { + "type": "object", + "properties": { + "Propagation": { + "type": "string", + "description": "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.", + "enum": [ + "private", + "rprivate", + "shared", + "rshared", + "slave", + "rslave" + ] + } + }, + "description": "Optional configuration for the `bind` type." + }, + "VolumeOptions": { + "type": "object", + "properties": { + "NoCopy": { + "type": "boolean", + "description": "Populate volume with data from the target.", + "default": false + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "DriverConfig": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the driver to use to create the volume." + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "key/value map of driver specific options." + } + }, + "description": "Map of driver specific options" + } + }, + "description": "Optional configuration for the `volume` type." + }, + "TmpfsOptions": { + "type": "object", + "properties": { + "SizeBytes": { + "type": "integer", + "description": "The size for the tmpfs mount in bytes.", + "format": "int64" + }, + "Mode": { + "type": "integer", + "description": "The permission mode for the tmpfs mount in an integer." + } + }, + "description": "Optional configuration for the `tmpfs` type." + } + } + }, + "RestartPolicy": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "- Empty string means not to restart\n- `always` Always restart\n- `unless-stopped` Restart always except when the user has manually stopped the container\n- `on-failure` Restart only when the container exit code is non-zero\n", + "enum": [ + "", + "always", + "unless-stopped", + "on-failure" + ] + }, + "MaximumRetryCount": { + "type": "integer", + "description": "If `on-failure` is used, the number of times to retry before giving up" + } + }, + "description": "The behavior to apply when the container exits. The default is not to restart.\n\nAn ever increasing delay (double the previous delay, starting at 100ms) is added before each restart to prevent flooding the server.\n" + }, + "Resources": { + "type": "object", + "properties": { + "CpuShares": { + "type": "integer", + "description": "An integer value representing this container's relative CPU weight versus other containers." + }, + "Memory": { + "type": "integer", + "description": "Memory limit in bytes.", + "format": "int64", + "default": 0 + }, + "CgroupParent": { + "type": "string", + "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." + }, + "BlkioWeight": { + "maximum": 1000, + "minimum": 0, + "type": "integer", + "description": "Block IO weight (relative weight)." + }, + "BlkioWeightDevice": { + "type": "array", + "description": "Block IO weight (relative device weight) in the form `[{\"Path\": \"device_path\", \"Weight\": weight}]`.\n", + "items": { + "type": "object", + "properties": { + "Path": { + "type": "string" + }, + "Weight": { + "minimum": 0, + "type": "integer" + } + } + } + }, + "BlkioDeviceReadBps": { + "type": "array", + "description": "Limit read rate (bytes per second) from a device, in the form `[{\"Path\": \"device_path\", \"Rate\": rate}]`.\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceWriteBps": { + "type": "array", + "description": "Limit write rate (bytes per second) to a device, in the form `[{\"Path\": \"device_path\", \"Rate\": rate}]`.\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceReadIOps": { + "type": "array", + "description": "Limit read rate (IO per second) from a device, in the form `[{\"Path\": \"device_path\", \"Rate\": rate}]`.\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceWriteIOps": { + "type": "array", + "description": "Limit write rate (IO per second) to a device, in the form `[{\"Path\": \"device_path\", \"Rate\": rate}]`.\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "CpuPeriod": { + "type": "integer", + "description": "The length of a CPU period in microseconds.", + "format": "int64" + }, + "CpuQuota": { + "type": "integer", + "description": "Microseconds of CPU time that the container can get in a CPU period.", + "format": "int64" + }, + "CpuRealtimePeriod": { + "type": "integer", + "description": "The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks.", + "format": "int64" + }, + "CpuRealtimeRuntime": { + "type": "integer", + "description": "The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks.", + "format": "int64" + }, + "CpusetCpus": { + "type": "string", + "description": "CPUs in which to allow execution (e.g., `0-3`, `0,1`)", + "example": "0-3" + }, + "CpusetMems": { + "type": "string", + "description": "Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems." + }, + "Devices": { + "type": "array", + "description": "A list of devices to add to the container.", + "items": { + "$ref": "#/components/schemas/DeviceMapping" + } + }, + "DeviceCgroupRules": { + "type": "array", + "description": "a list of cgroup rules to apply to the container", + "items": { + "type": "string", + "example": "c 13:* rwm" + } + }, + "DiskQuota": { + "type": "integer", + "description": "Disk limit (in bytes).", + "format": "int64" + }, + "KernelMemory": { + "type": "integer", + "description": "Kernel memory limit in bytes.", + "format": "int64" + }, + "MemoryReservation": { + "type": "integer", + "description": "Memory soft limit in bytes.", + "format": "int64" + }, + "MemorySwap": { + "type": "integer", + "description": "Total memory limit (memory + swap). Set as `-1` to enable unlimited swap.", + "format": "int64" + }, + "MemorySwappiness": { + "maximum": 100, + "minimum": 0, + "type": "integer", + "description": "Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.", + "format": "int64" + }, + "NanoCPUs": { + "type": "integer", + "description": "CPU quota in units of 10-9 CPUs.", + "format": "int64" + }, + "OomKillDisable": { + "type": "boolean", + "description": "Disable OOM Killer for the container." + }, + "PidsLimit": { + "type": "integer", + "description": "Tune a container's pids limit. Set -1 for unlimited.", + "format": "int64" + }, + "Ulimits": { + "type": "array", + "description": "A list of resource limits to set in the container. For example: `{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}`\"\n", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of ulimit" + }, + "Soft": { + "type": "integer", + "description": "Soft limit" + }, + "Hard": { + "type": "integer", + "description": "Hard limit" + } + } + } + }, + "CpuCount": { + "type": "integer", + "description": "The number of usable CPUs (Windows only).\n\nOn Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last.\n", + "format": "int64" + }, + "CpuPercent": { + "type": "integer", + "description": "The usable percentage of the available CPUs (Windows only).\n\nOn Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last.\n", + "format": "int64" + }, + "IOMaximumIOps": { + "type": "integer", + "description": "Maximum IOps for the container system drive (Windows only)", + "format": "int64" + }, + "IOMaximumBandwidth": { + "type": "integer", + "description": "Maximum IO in bytes per second for the container system drive (Windows only)", + "format": "int64" + } + }, + "description": "A container's resources (cgroups config, ulimits, etc)" + }, + "ResourceObject": { + "type": "object", + "properties": { + "NanoCPUs": { + "type": "integer", + "format": "int64", + "example": 4000000000 + }, + "MemoryBytes": { + "type": "integer", + "format": "int64", + "example": 8272408576 + }, + "GenericResources": { + "$ref": "#/components/schemas/GenericResources" + } + }, + "description": "An object describing the resources which can be advertised by a node and requested by a task" + }, + "GenericResources": { + "type": "array", + "description": "User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`)", + "example": [ + { + "DiscreteResourceSpec": { + "Kind": "SSD", + "Value": 3 + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID1" + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID2" + } + } + ], + "items": { + "type": "object", + "properties": { + "NamedResourceSpec": { + "type": "object", + "properties": { + "Kind": { + "type": "string" + }, + "Value": { + "type": "string" + } + } + }, + "DiscreteResourceSpec": { + "type": "object", + "properties": { + "Kind": { + "type": "string" + }, + "Value": { + "type": "integer", + "format": "int64" + } + } + } + } + } + }, + "HealthConfig": { + "type": "object", + "properties": { + "Test": { + "type": "array", + "description": "The test to perform. Possible values are:\n\n- `[]` inherit healthcheck from image or parent image\n- `[\"NONE\"]` disable healthcheck\n- `[\"CMD\", args...]` exec arguments directly\n- `[\"CMD-SHELL\", command]` run command with system's default shell\n", + "items": { + "type": "string" + } + }, + "Interval": { + "type": "integer", + "description": "The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit." + }, + "Timeout": { + "type": "integer", + "description": "The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit." + }, + "Retries": { + "type": "integer", + "description": "The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit." + }, + "StartPeriod": { + "type": "integer", + "description": "Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit." + } + }, + "description": "A test to perform to check that the container is healthy." + }, + "HostConfig": { + "description": "Container configuration that depends on the host we are running on", + "allOf": [ + { + "$ref": "#/components/schemas/Resources" + }, + { + "type": "object", + "properties": { + "Binds": { + "type": "array", + "description": "A list of volume bindings for this container. Each volume binding is a string in one of these forms:\n\n- `host-src:container-dest` to bind-mount a host path into the container. Both `host-src`, and `container-dest` must be an _absolute_ path.\n- `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.\n- `volume-name:container-dest` to bind-mount a volume managed by a volume driver into the container. `container-dest` must be an _absolute_ path.\n- `volume-name:container-dest:ro` to mount the volume read-only inside the container. `container-dest` must be an _absolute_ path.\n", + "items": { + "type": "string" + } + }, + "ContainerIDFile": { + "type": "string", + "description": "Path to a file where the container ID is written" + }, + "LogConfig": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "enum": [ + "json-file", + "syslog", + "journald", + "gelf", + "fluentd", + "awslogs", + "splunk", + "etwlogs", + "none" + ] + }, + "Config": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "The logging configuration for this container" + }, + "NetworkMode": { + "type": "string", + "description": "Network mode to use for this container. Supported standard values are: `bridge`, `host`, `none`, and `container:`. Any other value is taken as a custom network's name to which this container should connect to." + }, + "PortBindings": { + "$ref": "#/components/schemas/PortMap" + }, + "RestartPolicy": { + "$ref": "#/components/schemas/RestartPolicy" + }, + "AutoRemove": { + "type": "boolean", + "description": "Automatically remove the container when the container's process exits. This has no effect if `RestartPolicy` is set." + }, + "VolumeDriver": { + "type": "string", + "description": "Driver that this container uses to mount volumes." + }, + "VolumesFrom": { + "type": "array", + "description": "A list of volumes to inherit from another container, specified in the form `[:]`.", + "items": { + "type": "string" + } + }, + "Mounts": { + "type": "array", + "description": "Specification for mounts to be added to the container.", + "items": { + "$ref": "#/components/schemas/Mount" + } + }, + "CapAdd": { + "type": "array", + "description": "A list of kernel capabilities to add to the container.", + "items": { + "type": "string" + } + }, + "CapDrop": { + "type": "array", + "description": "A list of kernel capabilities to drop from the container.", + "items": { + "type": "string" + } + }, + "Dns": { + "type": "array", + "description": "A list of DNS servers for the container to use.", + "items": { + "type": "string" + } + }, + "DnsOptions": { + "type": "array", + "description": "A list of DNS options.", + "items": { + "type": "string" + } + }, + "DnsSearch": { + "type": "array", + "description": "A list of DNS search domains.", + "items": { + "type": "string" + } + }, + "ExtraHosts": { + "type": "array", + "description": "A list of hostnames/IP mappings to add to the container's `/etc/hosts` file. Specified in the form `[\"hostname:IP\"]`.\n", + "items": { + "type": "string" + } + }, + "GroupAdd": { + "type": "array", + "description": "A list of additional groups that the container process will run as.", + "items": { + "type": "string" + } + }, + "IpcMode": { + "type": "string", + "description": "IPC sharing mode for the container. Possible values are:\n\n- `\"none\"`: own private IPC namespace, with /dev/shm not mounted\n- `\"private\"`: own private IPC namespace\n- `\"shareable\"`: own private IPC namespace, with a possibility to share it with other containers\n- `\"container:\"`: join another (shareable) container's IPC namespace\n- `\"host\"`: use the host system's IPC namespace\n\nIf not specified, daemon default is used, which can either be `\"private\"`\nor `\"shareable\"`, depending on daemon version and configuration.\n" + }, + "Cgroup": { + "type": "string", + "description": "Cgroup to use for the container." + }, + "Links": { + "type": "array", + "description": "A list of links for the container in the form `container_name:alias`.", + "items": { + "type": "string" + } + }, + "OomScoreAdj": { + "type": "integer", + "description": "An integer value containing the score given to the container in order to tune OOM killer preferences.", + "example": 500 + }, + "PidMode": { + "type": "string", + "description": "Set the PID (Process) Namespace mode for the container. It can be either:\n\n- `\"container:\"`: joins another container's PID namespace\n- `\"host\"`: use the host's PID namespace inside the container\n" + }, + "Privileged": { + "type": "boolean", + "description": "Gives the container full access to the host." + }, + "PublishAllPorts": { + "type": "boolean", + "description": "Allocates an ephemeral host port for all of a container's\nexposed ports.\n\nPorts are de-allocated when the container stops and allocated when the container starts.\nThe allocated port might be changed when restarting the container.\n\nThe port is selected from the ephemeral port range that depends on the kernel.\nFor example, on Linux the range is defined by `/proc/sys/net/ipv4/ip_local_port_range`.\n" + }, + "ReadonlyRootfs": { + "type": "boolean", + "description": "Mount the container's root filesystem as read only." + }, + "SecurityOpt": { + "type": "array", + "description": "A list of string values to customize labels for MLS systems, such as SELinux.", + "items": { + "type": "string" + } + }, + "StorageOpt": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Storage driver options for this container, in the form `{\"size\": \"120G\"}`.\n" + }, + "Tmpfs": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options. For example: `{ \"/run\": \"rw,noexec,nosuid,size=65536k\" }`.\n" + }, + "UTSMode": { + "type": "string", + "description": "UTS namespace to use for the container." + }, + "UsernsMode": { + "type": "string", + "description": "Sets the usernamespace mode for the container when usernamespace remapping option is enabled." + }, + "ShmSize": { + "minimum": 0, + "type": "integer", + "description": "Size of `/dev/shm` in bytes. If omitted, the system uses 64MB." + }, + "Sysctls": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A list of kernel parameters (sysctls) to set in the container. For example: `{\"net.ipv4.ip_forward\": \"1\"}`\n" + }, + "Runtime": { + "type": "string", + "description": "Runtime to use with this container." + }, + "ConsoleSize": { + "maxItems": 2, + "minItems": 2, + "type": "array", + "description": "Initial console size, as an `[height, width]` array. (Windows only)", + "items": { + "minimum": 0, + "type": "integer" + } + }, + "Isolation": { + "type": "string", + "description": "Isolation technology of the container. (Windows only)", + "enum": [ + "default", + "process", + "hyperv" + ] + } + } + } + ] + }, + "ContainerConfig": { + "type": "object", + "properties": { + "Hostname": { + "type": "string", + "description": "The hostname to use for the container, as a valid RFC 1123 hostname." + }, + "Domainname": { + "type": "string", + "description": "The domain name to use for the container." + }, + "User": { + "type": "string", + "description": "The user that commands are run as inside the container." + }, + "AttachStdin": { + "type": "boolean", + "description": "Whether to attach to `stdin`.", + "default": false + }, + "AttachStdout": { + "type": "boolean", + "description": "Whether to attach to `stdout`.", + "default": true + }, + "AttachStderr": { + "type": "boolean", + "description": "Whether to attach to `stderr`.", + "default": true + }, + "ExposedPorts": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "An object mapping ports to an empty object in the form:\n\n`{\"/\": {}}`\n" + }, + "Tty": { + "type": "boolean", + "description": "Attach standard streams to a TTY, including `stdin` if it is not closed.", + "default": false + }, + "OpenStdin": { + "type": "boolean", + "description": "Open `stdin`", + "default": false + }, + "StdinOnce": { + "type": "boolean", + "description": "Close `stdin` after one attached client disconnects", + "default": false + }, + "Env": { + "type": "array", + "description": "A list of environment variables to set inside the container in the form `[\"VAR=value\", ...]`. A variable without `=` is removed from the environment, rather than to have an empty value.\n", + "items": { + "type": "string" + } + }, + "Cmd": { + "type": "array", + "description": "Command to run specified as a string or an array of strings.", + "items": { + "type": "string" + } + }, + "Healthcheck": { + "$ref": "#/components/schemas/HealthConfig" + }, + "ArgsEscaped": { + "type": "boolean", + "description": "Command is already escaped (Windows only)" + }, + "Image": { + "type": "string", + "description": "The name of the image to use when creating the container" + }, + "Volumes": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "An object mapping mount point paths inside the container to empty objects." + }, + "WorkingDir": { + "type": "string", + "description": "The working directory for commands to run in." + }, + "Entrypoint": { + "type": "array", + "description": "The entry point for the container as a string or an array of strings.\n\nIf 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`).\n", + "items": { + "type": "string" + } + }, + "NetworkDisabled": { + "type": "boolean", + "description": "Disable networking for the container." + }, + "MacAddress": { + "type": "string", + "description": "MAC address of the container." + }, + "OnBuild": { + "type": "array", + "description": "`ONBUILD` metadata that were defined in the image's `Dockerfile`.", + "items": { + "type": "string" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "StopSignal": { + "type": "string", + "description": "Signal to stop a container as a string or unsigned integer.", + "default": "SIGTERM" + }, + "StopTimeout": { + "type": "integer", + "description": "Timeout to stop a container in seconds." + }, + "Shell": { + "type": "array", + "description": "Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell.", + "items": { + "type": "string" + } + } + }, + "description": "Configuration for a container that is portable between hosts" + }, + "NetworkSettings": { + "type": "object", + "properties": { + "Bridge": { + "type": "string", + "description": "Name of the network'a bridge (for example, `docker0`).", + "example": "docker0" + }, + "SandboxID": { + "type": "string", + "description": "SandboxID uniquely represents a container's network stack.", + "example": "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3" + }, + "HairpinMode": { + "type": "boolean", + "description": "Indicates if hairpin NAT should be enabled on the virtual interface.\n", + "example": false + }, + "LinkLocalIPv6Address": { + "type": "string", + "description": "IPv6 unicast address using the link-local prefix.", + "example": "fe80::42:acff:fe11:1" + }, + "LinkLocalIPv6PrefixLen": { + "type": "integer", + "description": "Prefix length of the IPv6 unicast address.", + "example": 64 + }, + "Ports": { + "$ref": "#/components/schemas/PortMap" + }, + "SandboxKey": { + "type": "string", + "description": "SandboxKey identifies the sandbox", + "example": "/var/run/docker/netns/8ab54b426c38" + }, + "SecondaryIPAddresses": { + "type": "array", + "description": "", + "nullable": true, + "items": { + "$ref": "#/components/schemas/Address" + } + }, + "SecondaryIPv6Addresses": { + "type": "array", + "description": "", + "nullable": true, + "items": { + "$ref": "#/components/schemas/Address" + } + }, + "EndpointID": { + "type": "string", + "description": "EndpointID uniquely represents a service endpoint in a Sandbox.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + }, + "Gateway": { + "type": "string", + "description": "Gateway address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "172.17.0.1" + }, + "GlobalIPv6Address": { + "type": "string", + "description": "Global IPv6 address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "2001:db8::5689" + }, + "GlobalIPv6PrefixLen": { + "type": "integer", + "description": "Mask length of the global IPv6 address.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": 64 + }, + "IPAddress": { + "type": "string", + "description": "IPv4 address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "172.17.0.4" + }, + "IPPrefixLen": { + "type": "integer", + "description": "Mask length of the IPv4 address.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": 16 + }, + "IPv6Gateway": { + "type": "string", + "description": "IPv6 gateway address for this network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "2001:db8:2::100" + }, + "MacAddress": { + "type": "string", + "description": "MAC address for the container on the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "02:42:ac:11:00:04" + }, + "Networks": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + }, + "description": "Information about all networks that the container is connected to.\n" + } + }, + "description": "NetworkSettings exposes the network settings in the API" + }, + "Address": { + "type": "object", + "properties": { + "Addr": { + "type": "string", + "description": "IP address." + }, + "PrefixLen": { + "type": "integer", + "description": "Mask length of the IP address." + } + }, + "description": "Address represents an IPv4 or IPv6 IP address." + }, + "PortMap": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PortBinding" + } + }, + "description": "PortMap describes the mapping of container ports to host ports, using the\ncontainer's port-number and protocol as key in the format `/`,\nfor example, `80/udp`.\n\nIf a container's port is mapped for both `tcp` and `udp`, two separate\nentries are added to the mapping table.\n", + "example": { + "443/tcp": [ + { + "HostIp": "127.0.0.1", + "HostPort": "4443" + } + ], + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "80" + }, + { + "HostIp": "0.0.0.0", + "HostPort": "8080" + } + ], + "80/udp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "80" + } + ], + "53/udp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "53" + } + ] + } + }, + "PortBinding": { + "type": "object", + "properties": { + "HostIp": { + "type": "string", + "description": "Host IP address that the container's port is mapped to.", + "example": "127.0.0.1" + }, + "HostPort": { + "type": "string", + "description": "Host port number that the container's port is mapped to.", + "example": "4443" + } + }, + "description": "PortBinding represents a binding between a host IP address and a host\nport.\n", + "nullable": true, + "x-nullable": true + }, + "GraphDriverData": { + "required": [ + "Data", + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false + }, + "Data": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "nullable": false + } + }, + "description": "Information about a container's graph driver." + }, + "Image": { + "required": [ + "Architecture", + "Author", + "Comment", + "Container", + "Created", + "DockerVersion", + "GraphDriver", + "Id", + "Os", + "Parent", + "RootFS", + "Size", + "VirtualSize" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": false + }, + "RepoTags": { + "type": "array", + "items": { + "type": "string" + } + }, + "RepoDigests": { + "type": "array", + "items": { + "type": "string" + } + }, + "Parent": { + "type": "string", + "nullable": false + }, + "Comment": { + "type": "string", + "nullable": false + }, + "Created": { + "type": "string", + "nullable": false + }, + "Container": { + "type": "string", + "nullable": false + }, + "ContainerConfig": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "DockerVersion": { + "type": "string", + "nullable": false + }, + "Author": { + "type": "string", + "nullable": false + }, + "Config": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "Architecture": { + "type": "string", + "nullable": false + }, + "Os": { + "type": "string", + "nullable": false + }, + "OsVersion": { + "type": "string" + }, + "Size": { + "type": "integer", + "format": "int64", + "nullable": false + }, + "VirtualSize": { + "type": "integer", + "format": "int64", + "nullable": false + }, + "GraphDriver": { + "$ref": "#/components/schemas/GraphDriverData" + }, + "RootFS": { + "required": [ + "Type" + ], + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": false + }, + "Layers": { + "type": "array", + "items": { + "type": "string" + } + }, + "BaseLayer": { + "type": "string" + } + } + }, + "Metadata": { + "type": "object", + "properties": { + "LastTagTime": { + "type": "string", + "format": "dateTime" + } + } + } + } + }, + "ImageSummary": { + "required": [ + "Containers", + "Created", + "Id", + "Labels", + "ParentId", + "RepoDigests", + "RepoTags", + "SharedSize", + "Size", + "VirtualSize" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": false + }, + "ParentId": { + "type": "string", + "nullable": false + }, + "RepoTags": { + "type": "array", + "nullable": false, + "items": { + "type": "string" + } + }, + "RepoDigests": { + "type": "array", + "nullable": false, + "items": { + "type": "string" + } + }, + "Created": { + "type": "integer", + "nullable": false + }, + "Size": { + "type": "integer", + "nullable": false + }, + "SharedSize": { + "type": "integer", + "nullable": false + }, + "VirtualSize": { + "type": "integer", + "nullable": false + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "nullable": false + }, + "Containers": { + "type": "integer", + "nullable": false + } + } + }, + "AuthConfig": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "email": { + "type": "string" + }, + "serveraddress": { + "type": "string" + } + }, + "example": { + "username": "hannibal", + "password": "xxxx", + "serveraddress": "https://index.docker.io/v1/" + } + }, + "ProcessConfig": { + "type": "object", + "properties": { + "privileged": { + "type": "boolean" + }, + "user": { + "type": "string" + }, + "tty": { + "type": "boolean" + }, + "entrypoint": { + "type": "string" + }, + "arguments": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Volume": { + "required": [ + "Driver", + "Labels", + "Mountpoint", + "Name", + "Options", + "Scope" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the volume.", + "nullable": false + }, + "Driver": { + "type": "string", + "description": "Name of the volume driver used by the volume.", + "nullable": false + }, + "Mountpoint": { + "type": "string", + "description": "Mount path of the volume on the host.", + "nullable": false + }, + "CreatedAt": { + "type": "string", + "description": "Date/Time the volume was created.", + "format": "dateTime" + }, + "Status": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "Low-level details about the volume, provided by the volume driver.\nDetails are returned as a map with key/value pairs:\n`{\"key\":\"value\",\"key2\":\"value2\"}`.\n\nThe `Status` field is optional, and is omitted if the volume driver\ndoes not support this feature.\n" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "nullable": false + }, + "Scope": { + "type": "string", + "description": "The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level.", + "nullable": false, + "default": "local", + "enum": [ + "local", + "global" + ] + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The driver specific options used when creating the volume." + }, + "UsageData": { + "required": [ + "RefCount", + "Size" + ], + "type": "object", + "properties": { + "Size": { + "type": "integer", + "description": "Amount of disk space used by the volume (in bytes). This information\nis only available for volumes created with the `\"local\"` volume\ndriver. For volumes created with other volume drivers, this field\nis set to `-1` (\"not available\")\n", + "nullable": false + }, + "RefCount": { + "type": "integer", + "description": "The number of containers referencing this volume. This field\nis set to `-1` if the reference-count is not available.\n", + "nullable": false + } + }, + "description": "Usage details about the volume. This information is used by the\n`GET /system/df` endpoint, and omitted in other endpoints.\n", + "nullable": true + } + }, + "example": { + "Name": "tardis", + "Driver": "custom", + "Mountpoint": "/var/lib/docker/volumes/tardis", + "Status": { + "hello": "world" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + }, + "Scope": "local", + "CreatedAt": "2016-06-07T20:31:11.853781916Z" + } + }, + "Network": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Id": { + "type": "string" + }, + "Created": { + "type": "string", + "format": "dateTime" + }, + "Scope": { + "type": "string" + }, + "Driver": { + "type": "string" + }, + "EnableIPv6": { + "type": "boolean" + }, + "IPAM": { + "$ref": "#/components/schemas/IPAM" + }, + "Internal": { + "type": "boolean" + }, + "Attachable": { + "type": "boolean" + }, + "Ingress": { + "type": "boolean" + }, + "Containers": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/NetworkContainer" + } + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "example": { + "Name": "net01", + "Id": "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99", + "Created": "2016-10-19T04:33:30.360899459Z", + "Scope": "local", + "Driver": "bridge", + "EnableIPv6": false, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.19.0.0/16", + "Gateway": "172.19.0.1" + } + ], + "Options": { + "foo": "bar" + } + }, + "Internal": false, + "Attachable": false, + "Ingress": false, + "Containers": { + "19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c": { + "Name": "test", + "EndpointID": "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a", + "MacAddress": "02:42:ac:13:00:02", + "IPv4Address": "172.19.0.2/16", + "IPv6Address": "" + } + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + }, + "IPAM": { + "type": "object", + "properties": { + "Driver": { + "type": "string", + "description": "Name of the IPAM driver to use.", + "default": "default" + }, + "Config": { + "type": "array", + "description": "List of IPAM configuration options, specified as a map: `{\"Subnet\": , \"IPRange\": , \"Gateway\": , \"AuxAddress\": }`", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "Options": { + "type": "array", + "description": "Driver-specific options, specified as a map.", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "NetworkContainer": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "EndpointID": { + "type": "string" + }, + "MacAddress": { + "type": "string" + }, + "IPv4Address": { + "type": "string" + }, + "IPv6Address": { + "type": "string" + } + } + }, + "BuildInfo": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "stream": { + "type": "string" + }, + "error": { + "type": "string" + }, + "errorDetail": { + "$ref": "#/components/schemas/ErrorDetail" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + }, + "aux": { + "$ref": "#/components/schemas/ImageID" + } + } + }, + "ImageID": { + "type": "object", + "properties": { + "ID": { + "type": "string" + } + }, + "description": "Image ID or Digest", + "example": { + "ID": "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" + } + }, + "CreateImageInfo": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "error": { + "type": "string" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + } + } + }, + "PushImageInfo": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + } + } + }, + "ErrorDetail": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + }, + "ProgressDetail": { + "type": "object", + "properties": { + "current": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "ErrorResponse": { + "required": [ + "message" + ], + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "The error message.", + "nullable": false + } + }, + "description": "Represents an error.", + "example": { + "message": "Something went wrong." + } + }, + "IdResponse": { + "required": [ + "Id" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The id of the newly created object.", + "nullable": false + } + }, + "description": "Response to an API call that returns just an Id" + }, + "EndpointSettings": { + "type": "object", + "properties": { + "IPAMConfig": { + "$ref": "#/components/schemas/EndpointIPAMConfig" + }, + "Links": { + "type": "array", + "example": [ + "container_1", + "container_2" + ], + "items": { + "type": "string" + } + }, + "Aliases": { + "type": "array", + "example": [ + "server_x", + "server_y" + ], + "items": { + "type": "string" + } + }, + "NetworkID": { + "type": "string", + "description": "Unique ID of the network.\n", + "example": "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a" + }, + "EndpointID": { + "type": "string", + "description": "Unique ID for the service endpoint in a Sandbox.\n", + "example": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + }, + "Gateway": { + "type": "string", + "description": "Gateway address for this network.\n", + "example": "172.17.0.1" + }, + "IPAddress": { + "type": "string", + "description": "IPv4 address.\n", + "example": "172.17.0.4" + }, + "IPPrefixLen": { + "type": "integer", + "description": "Mask length of the IPv4 address.\n", + "example": 16 + }, + "IPv6Gateway": { + "type": "string", + "description": "IPv6 gateway address.\n", + "example": "2001:db8:2::100" + }, + "GlobalIPv6Address": { + "type": "string", + "description": "Global IPv6 address.\n", + "example": "2001:db8::5689" + }, + "GlobalIPv6PrefixLen": { + "type": "integer", + "description": "Mask length of the global IPv6 address.\n", + "format": "int64", + "example": 64 + }, + "MacAddress": { + "type": "string", + "description": "MAC address for the endpoint on this network.\n", + "example": "02:42:ac:11:00:04" + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "DriverOpts is a mapping of driver options and values. These options\nare passed directly to the driver and are driver specific.\n", + "nullable": true, + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + }, + "description": "Configuration for a network endpoint." + }, + "EndpointIPAMConfig": { + "type": "object", + "properties": { + "IPv4Address": { + "type": "string", + "example": "172.20.30.33" + }, + "IPv6Address": { + "type": "string", + "example": "2001:db8:abcd::3033" + }, + "LinkLocalIPs": { + "type": "array", + "example": [ + "169.254.34.68", + "fe80::3468" + ], + "items": { + "type": "string" + } + } + }, + "description": "EndpointIPAMConfig represents an endpoint's IPAM configuration.\n", + "nullable": true, + "x-nullable": true + }, + "PluginMount": { + "required": [ + "Description", + "Destination", + "Name", + "Options", + "Settable", + "Source", + "Type" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false, + "example": "some-mount" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "This is a mount that's used by the plugin." + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Source": { + "type": "string", + "example": "/var/lib/docker/plugins/" + }, + "Destination": { + "type": "string", + "nullable": false, + "example": "/mnt/state" + }, + "Type": { + "type": "string", + "nullable": false, + "example": "bind" + }, + "Options": { + "type": "array", + "example": [ + "rbind", + "rw" + ], + "items": { + "type": "string" + } + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginDevice": { + "required": [ + "Description", + "Name", + "Path", + "Settable" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false + }, + "Description": { + "type": "string", + "nullable": false + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Path": { + "type": "string", + "example": "/dev/fuse" + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginEnv": { + "required": [ + "Description", + "Name", + "Settable", + "Value" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false + }, + "Description": { + "type": "string", + "nullable": false + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Value": { + "type": "string" + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginInterfaceType": { + "required": [ + "Capability", + "Prefix", + "Version" + ], + "type": "object", + "properties": { + "Prefix": { + "type": "string", + "nullable": false + }, + "Capability": { + "type": "string", + "nullable": false + }, + "Version": { + "type": "string", + "nullable": false + } + }, + "nullable": false, + "x-nullable": false + }, + "Plugin": { + "required": [ + "Config", + "Enabled", + "Name", + "Settings" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "example": "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" + }, + "Name": { + "type": "string", + "nullable": false, + "example": "tiborvass/sample-volume-plugin" + }, + "Enabled": { + "type": "boolean", + "description": "True if the plugin is running. False if the plugin is not running, only installed.", + "nullable": false, + "example": true + }, + "Settings": { + "required": [ + "Args", + "Devices", + "Env", + "Mounts" + ], + "type": "object", + "properties": { + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginMount" + } + }, + "Env": { + "type": "array", + "example": [ + "DEBUG=0" + ], + "items": { + "type": "string" + } + }, + "Args": { + "type": "array", + "items": { + "type": "string" + } + }, + "Devices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginDevice" + } + } + }, + "description": "Settings that can be modified by users.", + "nullable": false + }, + "PluginReference": { + "type": "string", + "description": "plugin remote reference used to push/pull the plugin", + "nullable": false, + "example": "localhost:5000/tiborvass/sample-volume-plugin:latest" + }, + "Config": { + "required": [ + "Args", + "Description", + "Documentation", + "Entrypoint", + "Env", + "Interface", + "IpcHost", + "Linux", + "Mounts", + "Network", + "PidHost", + "PropagatedMount", + "WorkDir" + ], + "type": "object", + "properties": { + "DockerVersion": { + "type": "string", + "description": "Docker Version used to create the plugin", + "nullable": false, + "example": "17.06.0-ce" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "A sample volume plugin for Docker" + }, + "Documentation": { + "type": "string", + "nullable": false, + "example": "https://docs.docker.com/engine/extend/plugins/" + }, + "Interface": { + "required": [ + "Socket", + "Types" + ], + "type": "object", + "properties": { + "Types": { + "type": "array", + "example": [ + "docker.volumedriver/1.0" + ], + "items": { + "$ref": "#/components/schemas/PluginInterfaceType" + } + }, + "Socket": { + "type": "string", + "nullable": false, + "example": "plugins.sock" + } + }, + "description": "The interface between Docker and the plugin", + "nullable": false + }, + "Entrypoint": { + "type": "array", + "example": [ + "/usr/bin/sample-volume-plugin", + "/data" + ], + "items": { + "type": "string" + } + }, + "WorkDir": { + "type": "string", + "nullable": false, + "example": "/bin/" + }, + "User": { + "type": "object", + "properties": { + "UID": { + "type": "integer", + "format": "uint32", + "example": 1000 + }, + "GID": { + "type": "integer", + "format": "uint32", + "example": 1000 + } + }, + "nullable": false + }, + "Network": { + "required": [ + "Type" + ], + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": false, + "example": "host" + } + }, + "nullable": false + }, + "Linux": { + "required": [ + "AllowAllDevices", + "Capabilities", + "Devices" + ], + "type": "object", + "properties": { + "Capabilities": { + "type": "array", + "example": [ + "CAP_SYS_ADMIN", + "CAP_SYSLOG" + ], + "items": { + "type": "string" + } + }, + "AllowAllDevices": { + "type": "boolean", + "nullable": false, + "example": false + }, + "Devices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginDevice" + } + } + }, + "nullable": false + }, + "PropagatedMount": { + "type": "string", + "nullable": false, + "example": "/mnt/volumes" + }, + "IpcHost": { + "type": "boolean", + "nullable": false, + "example": false + }, + "PidHost": { + "type": "boolean", + "nullable": false, + "example": false + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginMount" + } + }, + "Env": { + "type": "array", + "example": [ + { + "Name": "DEBUG", + "Description": "If set, prints debug messages", + "Value": "0" + } + ], + "items": { + "$ref": "#/components/schemas/PluginEnv" + } + }, + "Args": { + "required": [ + "Description", + "Name", + "Settable", + "Value" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false, + "example": "args" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "command line arguments" + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "nullable": false + }, + "rootfs": { + "type": "object", + "properties": { + "type": { + "type": "string", + "example": "layers" + }, + "diff_ids": { + "type": "array", + "example": [ + "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887", + "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" + ], + "items": { + "type": "string" + } + } + } + } + }, + "description": "The config of a plugin.", + "nullable": false + } + }, + "description": "A plugin for the Engine API" + }, + "ObjectVersion": { + "type": "object", + "properties": { + "Index": { + "type": "integer", + "format": "uint64", + "example": 373531 + } + }, + "description": "The version number of the object such as node, service, etc. This is needed to avoid conflicting writes.\nThe client must send the version number along with the modified specification when updating these objects.\nThis approach ensures safe concurrency and determinism in that the change on the object\nmay not be applied if the version number has changed from the last read. In other words,\nif two update requests specify the same base version, only one of the requests can succeed.\nAs a result, two separate update requests that happen at the same time will not\nunintentionally overwrite each other.\n" + }, + "NodeSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name for the node.", + "example": "my-node" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Role": { + "type": "string", + "description": "Role of the node.", + "example": "manager", + "enum": [ + "worker", + "manager" + ] + }, + "Availability": { + "type": "string", + "description": "Availability of the node.", + "example": "active", + "enum": [ + "active", + "pause", + "drain" + ] + } + }, + "example": { + "Availability": "active", + "Name": "node-name", + "Role": "manager", + "Labels": { + "foo": "bar" + } + } + }, + "Node": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "example": "24ifsmvkjbyhk" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the node was added to the swarm in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "UpdatedAt": { + "type": "string", + "description": "Date and time at which the node was last updated in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2017-08-09T07:09:37.632105588Z" + }, + "Spec": { + "$ref": "#/components/schemas/NodeSpec" + }, + "Description": { + "$ref": "#/components/schemas/NodeDescription" + }, + "Status": { + "$ref": "#/components/schemas/NodeStatus" + }, + "ManagerStatus": { + "$ref": "#/components/schemas/ManagerStatus" + } + } + }, + "NodeDescription": { + "type": "object", + "properties": { + "Hostname": { + "type": "string", + "example": "bf3067039e47" + }, + "Platform": { + "$ref": "#/components/schemas/Platform" + }, + "Resources": { + "$ref": "#/components/schemas/ResourceObject" + }, + "Engine": { + "$ref": "#/components/schemas/EngineDescription" + }, + "TLSInfo": { + "$ref": "#/components/schemas/TLSInfo" + } + }, + "description": "NodeDescription encapsulates the properties of the Node as reported by the\nagent.\n" + }, + "Platform": { + "type": "object", + "properties": { + "Architecture": { + "type": "string", + "description": "Architecture represents the hardware architecture (for example,\n`x86_64`).\n", + "example": "x86_64" + }, + "OS": { + "type": "string", + "description": "OS represents the Operating System (for example, `linux` or `windows`).\n", + "example": "linux" + } + }, + "description": "Platform represents the platform (Arch/OS).\n" + }, + "EngineDescription": { + "type": "object", + "properties": { + "EngineVersion": { + "type": "string", + "example": "17.06.0" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "example": { + "foo": "bar" + } + }, + "Plugins": { + "type": "array", + "example": [ + { + "Type": "Log", + "Name": "awslogs" + }, + { + "Type": "Log", + "Name": "fluentd" + }, + { + "Type": "Log", + "Name": "gcplogs" + }, + { + "Type": "Log", + "Name": "gelf" + }, + { + "Type": "Log", + "Name": "journald" + }, + { + "Type": "Log", + "Name": "json-file" + }, + { + "Type": "Log", + "Name": "logentries" + }, + { + "Type": "Log", + "Name": "splunk" + }, + { + "Type": "Log", + "Name": "syslog" + }, + { + "Type": "Network", + "Name": "bridge" + }, + { + "Type": "Network", + "Name": "host" + }, + { + "Type": "Network", + "Name": "ipvlan" + }, + { + "Type": "Network", + "Name": "macvlan" + }, + { + "Type": "Network", + "Name": "null" + }, + { + "Type": "Network", + "Name": "overlay" + }, + { + "Type": "Volume", + "Name": "local" + }, + { + "Type": "Volume", + "Name": "localhost:5000/vieux/sshfs:latest" + }, + { + "Type": "Volume", + "Name": "vieux/sshfs:latest" + } + ], + "items": { + "type": "object", + "properties": { + "Type": { + "type": "string" + }, + "Name": { + "type": "string" + } + } + } + } + }, + "description": "EngineDescription provides information about an engine." + }, + "TLSInfo": { + "type": "object", + "properties": { + "TrustRoot": { + "type": "string", + "description": "The root CA certificate(s) that are used to validate leaf TLS certificates" + }, + "CertIssuerSubject": { + "type": "string", + "description": "The base64-url-safe-encoded raw subject bytes of the issuer" + }, + "CertIssuerPublicKey": { + "type": "string", + "description": "The base64-url-safe-encoded raw public key bytes of the issuer" + } + }, + "description": "Information about the issuer of leaf TLS certificates and the trusted root CA certificate", + "example": { + "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0\nMzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf\n3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO\nPQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz\npxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H\n-----END CERTIFICATE-----\n", + "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh", + "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A==" + } + }, + "NodeStatus": { + "type": "object", + "properties": { + "State": { + "$ref": "#/components/schemas/NodeState" + }, + "Message": { + "type": "string", + "example": "" + }, + "Addr": { + "type": "string", + "description": "IP address of the node.", + "example": "172.17.0.2" + } + }, + "description": "NodeStatus represents the status of a node.\n\nIt provides the current status of the node, as seen by the manager.\n" + }, + "NodeState": { + "type": "string", + "description": "NodeState represents the state of a node.", + "example": "ready", + "enum": [ + "unknown", + "down", + "ready", + "disconnected" + ] + }, + "ManagerStatus": { + "type": "object", + "properties": { + "Leader": { + "type": "boolean", + "example": true, + "default": false + }, + "Reachability": { + "$ref": "#/components/schemas/Reachability" + }, + "Addr": { + "type": "string", + "description": "The IP address and port at which the manager is reachable.\n", + "example": "10.0.0.46:2377" + } + }, + "description": "ManagerStatus represents the status of a manager.\n\nIt provides the current status of a node's manager component, if the node\nis a manager.\n", + "nullable": true, + "x-nullable": true + }, + "Reachability": { + "type": "string", + "description": "Reachability represents the reachability of a node.", + "example": "reachable", + "enum": [ + "unknown", + "unreachable", + "reachable" + ] + }, + "SwarmSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the swarm.", + "example": "default" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.corp.type": "production", + "com.example.corp.department": "engineering" + } + }, + "Orchestration": { + "type": "object", + "properties": { + "TaskHistoryRetentionLimit": { + "type": "integer", + "description": "The number of historic tasks to keep per instance or node. If negative, never remove completed or failed tasks.", + "format": "int64", + "example": 10 + } + }, + "description": "Orchestration configuration.", + "nullable": true + }, + "Raft": { + "type": "object", + "properties": { + "SnapshotInterval": { + "type": "integer", + "description": "The number of log entries between snapshots.", + "format": "uint64", + "example": 10000 + }, + "KeepOldSnapshots": { + "type": "integer", + "description": "The number of snapshots to keep beyond the current snapshot.", + "format": "uint64" + }, + "LogEntriesForSlowFollowers": { + "type": "integer", + "description": "The number of log entries to keep around to sync up slow followers after a snapshot is created.", + "format": "uint64", + "example": 500 + }, + "ElectionTick": { + "type": "integer", + "description": "The number of ticks that a follower will wait for a message from the leader before becoming a candidate and starting an election. `ElectionTick` must be greater than `HeartbeatTick`.\n\nA tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed.\n", + "example": 3 + }, + "HeartbeatTick": { + "type": "integer", + "description": "The number of ticks between heartbeats. Every HeartbeatTick ticks, the leader will send a heartbeat to the followers.\n\nA tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed.\n", + "example": 1 + } + }, + "description": "Raft configuration." + }, + "Dispatcher": { + "type": "object", + "properties": { + "HeartbeatPeriod": { + "type": "integer", + "description": "The delay for an agent to send a heartbeat to the dispatcher.", + "format": "int64", + "example": 5000000000 + } + }, + "description": "Dispatcher configuration.", + "nullable": true + }, + "CAConfig": { + "type": "object", + "properties": { + "NodeCertExpiry": { + "type": "integer", + "description": "The duration node certificates are issued for.", + "format": "int64", + "example": 7776000000000000 + }, + "ExternalCAs": { + "type": "array", + "description": "Configuration for forwarding signing requests to an external certificate authority.", + "items": { + "type": "object", + "properties": { + "Protocol": { + "type": "string", + "description": "Protocol for communication with the external CA (currently only `cfssl` is supported).", + "default": "cfssl", + "enum": [ + "cfssl" + ] + }, + "URL": { + "type": "string", + "description": "URL where certificate signing requests should be sent." + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "An object with key/value pairs that are interpreted as protocol-specific options for the external CA driver." + }, + "CACert": { + "type": "string", + "description": "The root CA certificate (in PEM format) this external CA uses to issue TLS certificates (assumed to be to the current swarm root CA certificate if not provided)." + } + } + } + }, + "SigningCACert": { + "type": "string", + "description": "The desired signing CA certificate for all swarm node TLS leaf certificates, in PEM format." + }, + "SigningCAKey": { + "type": "string", + "description": "The desired signing CA key for all swarm node TLS leaf certificates, in PEM format." + }, + "ForceRotate": { + "type": "integer", + "description": "An integer whose purpose is to force swarm to generate a new signing CA certificate and key, if none have been specified in `SigningCACert` and `SigningCAKey`", + "format": "uint64" + } + }, + "description": "CA configuration.", + "nullable": true + }, + "EncryptionConfig": { + "type": "object", + "properties": { + "AutoLockManagers": { + "type": "boolean", + "description": "If set, generate a key and use it to lock data stored on the managers.", + "example": false + } + }, + "description": "Parameters related to encryption-at-rest." + }, + "TaskDefaults": { + "type": "object", + "properties": { + "LogDriver": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The log driver to use as a default for new tasks.\n", + "example": "json-file" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver-specific options for the selectd log driver, specified\nas key/value pairs.\n", + "example": { + "max-file": "10", + "max-size": "100m" + } + } + }, + "description": "The log driver to use for tasks created in the orchestrator if\nunspecified by a service.\n\nUpdating this value only affects new tasks. Existing tasks continue\nto use their previously configured log driver until recreated.\n" + } + }, + "description": "Defaults for creating tasks in this cluster." + } + }, + "description": "User modifiable swarm configuration." + }, + "ClusterInfo": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the swarm.", + "example": "abajmipo7b4xz5ip2nrla6b11" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the swarm was initialised in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "UpdatedAt": { + "type": "string", + "description": "Date and time at which the swarm was last updated in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2017-08-09T07:09:37.632105588Z" + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + }, + "TLSInfo": { + "$ref": "#/components/schemas/TLSInfo" + }, + "RootRotationInProgress": { + "type": "boolean", + "description": "Whether there is currently a root CA rotation in progress for the swarm", + "example": false + } + }, + "description": "ClusterInfo represents information about the swarm as is returned by the\n\"/info\" endpoint. Join-tokens are not included.\n", + "nullable": true, + "x-nullable": true + }, + "JoinTokens": { + "type": "object", + "properties": { + "Worker": { + "type": "string", + "description": "The token workers can use to join the swarm.\n", + "example": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx" + }, + "Manager": { + "type": "string", + "description": "The token managers can use to join the swarm.\n", + "example": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + }, + "description": "JoinTokens contains the tokens workers and managers need to join the swarm.\n" + }, + "Swarm": { + "allOf": [ + { + "$ref": "#/components/schemas/ClusterInfo" + }, + { + "type": "object", + "properties": { + "JoinTokens": { + "$ref": "#/components/schemas/JoinTokens" + } + } + } + ] + }, + "TaskSpec": { + "type": "object", + "properties": { + "PluginSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The name or 'alias' to use for the plugin." + }, + "Remote": { + "type": "string", + "description": "The plugin image reference to use." + }, + "Disabled": { + "type": "boolean", + "description": "Disable the plugin once scheduled." + }, + "PluginPrivilege": { + "type": "array", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission accepted by the user upon installing the plugin." + } + } + }, + "description": "Invalid when specified with `ContainerSpec`. *(Experimental release only.)*" + }, + "ContainerSpec": { + "type": "object", + "properties": { + "Image": { + "type": "string", + "description": "The image name to use for the container" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value data." + }, + "Command": { + "type": "array", + "description": "The command to be run in the image.", + "items": { + "type": "string" + } + }, + "Args": { + "type": "array", + "description": "Arguments to the command.", + "items": { + "type": "string" + } + }, + "Hostname": { + "type": "string", + "description": "The hostname to use for the container, as a valid RFC 1123 hostname." + }, + "Env": { + "type": "array", + "description": "A list of environment variables in the form `VAR=value`.", + "items": { + "type": "string" + } + }, + "Dir": { + "type": "string", + "description": "The working directory for commands to run in." + }, + "User": { + "type": "string", + "description": "The user inside the container." + }, + "Groups": { + "type": "array", + "description": "A list of additional groups that the container process will run as.", + "items": { + "type": "string" + } + }, + "Privileges": { + "type": "object", + "properties": { + "CredentialSpec": { + "type": "object", + "properties": { + "File": { + "type": "string", + "description": "Load credential spec from this file. The file is read by the daemon, and must be present in the\n`CredentialSpecs` subdirectory in the docker data directory, which defaults to\n`C:\\ProgramData\\Docker\\` on Windows.\n\nFor example, specifying `spec.json` loads `C:\\ProgramData\\Docker\\CredentialSpecs\\spec.json`.\n\n


\n\n> **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive.\n" + }, + "Registry": { + "type": "string", + "description": "Load credential spec from this value in the Windows registry. The specified registry value must be\nlocated in:\n\n`HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Virtualization\\Containers\\CredentialSpecs`\n\n


\n\n\n> **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive.\n" + } + }, + "description": "CredentialSpec for managed service account (Windows only)" + }, + "SELinuxContext": { + "type": "object", + "properties": { + "Disable": { + "type": "boolean", + "description": "Disable SELinux" + }, + "User": { + "type": "string", + "description": "SELinux user label" + }, + "Role": { + "type": "string", + "description": "SELinux role label" + }, + "Type": { + "type": "string", + "description": "SELinux type label" + }, + "Level": { + "type": "string", + "description": "SELinux level label" + } + }, + "description": "SELinux labels of the container" + } + }, + "description": "Security options for the container" + }, + "TTY": { + "type": "boolean", + "description": "Whether a pseudo-TTY should be allocated." + }, + "OpenStdin": { + "type": "boolean", + "description": "Open `stdin`" + }, + "ReadOnly": { + "type": "boolean", + "description": "Mount the container's root filesystem as read only." + }, + "Mounts": { + "type": "array", + "description": "Specification for mounts to be added to containers created as part of the service.", + "items": { + "$ref": "#/components/schemas/Mount" + } + }, + "StopSignal": { + "type": "string", + "description": "Signal to stop the container." + }, + "StopGracePeriod": { + "type": "integer", + "description": "Amount of time to wait for the container to terminate before forcefully killing it.", + "format": "int64" + }, + "HealthCheck": { + "$ref": "#/components/schemas/HealthConfig" + }, + "Hosts": { + "type": "array", + "description": "A list of hostname/IP mappings to add to the container's `hosts`\nfile. The format of extra hosts is specified in the\n[hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html)\nman page:\n\n IP_address canonical_hostname [aliases...]\n", + "items": { + "type": "string" + } + }, + "DNSConfig": { + "type": "object", + "properties": { + "Nameservers": { + "type": "array", + "description": "The IP addresses of the name servers.", + "items": { + "type": "string" + } + }, + "Search": { + "type": "array", + "description": "A search list for host-name lookup.", + "items": { + "type": "string" + } + }, + "Options": { + "type": "array", + "description": "A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.).", + "items": { + "type": "string" + } + } + }, + "description": "Specification for DNS related configurations in resolver configuration file (`resolv.conf`)." + }, + "Secrets": { + "type": "array", + "description": "Secrets contains references to zero or more secrets that will be exposed to the service.", + "items": { + "type": "object", + "properties": { + "File": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name represents the final filename in the filesystem." + }, + "UID": { + "type": "string", + "description": "UID represents the file UID." + }, + "GID": { + "type": "string", + "description": "GID represents the file GID." + }, + "Mode": { + "type": "integer", + "description": "Mode represents the FileMode of the file.", + "format": "uint32" + } + }, + "description": "File represents a specific target that is backed by a file." + }, + "SecretID": { + "type": "string", + "description": "SecretID represents the ID of the specific secret that we're referencing." + }, + "SecretName": { + "type": "string", + "description": "SecretName is the name of the secret that this references, but this is just provided for\nlookup/display purposes. The secret in the reference will be identified by its ID.\n" + } + } + } + }, + "Configs": { + "type": "array", + "description": "Configs contains references to zero or more configs that will be exposed to the service.", + "items": { + "type": "object", + "properties": { + "File": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name represents the final filename in the filesystem." + }, + "UID": { + "type": "string", + "description": "UID represents the file UID." + }, + "GID": { + "type": "string", + "description": "GID represents the file GID." + }, + "Mode": { + "type": "integer", + "description": "Mode represents the FileMode of the file.", + "format": "uint32" + } + }, + "description": "File represents a specific target that is backed by a file." + }, + "ConfigID": { + "type": "string", + "description": "ConfigID represents the ID of the specific config that we're referencing." + }, + "ConfigName": { + "type": "string", + "description": "ConfigName is the name of the config that this references, but this is just provided for\nlookup/display purposes. The config in the reference will be identified by its ID.\n" + } + } + } + }, + "Isolation": { + "type": "string", + "description": "Isolation technology of the containers running the service. (Windows only)", + "enum": [ + "default", + "process", + "hyperv" + ] + } + }, + "description": "Invalid when specified with `PluginSpec`." + }, + "Resources": { + "type": "object", + "properties": { + "Limits": { + "$ref": "#/components/schemas/ResourceObject" + }, + "Reservation": { + "$ref": "#/components/schemas/ResourceObject" + } + }, + "description": "Resource requirements which apply to each individual container created as part of the service." + }, + "RestartPolicy": { + "type": "object", + "properties": { + "Condition": { + "type": "string", + "description": "Condition for restart.", + "enum": [ + "none", + "on-failure", + "any" + ] + }, + "Delay": { + "type": "integer", + "description": "Delay between restart attempts.", + "format": "int64" + }, + "MaxAttempts": { + "type": "integer", + "description": "Maximum attempts to restart a given container before giving up (default value is 0, which is ignored).", + "format": "int64", + "default": 0 + }, + "Window": { + "type": "integer", + "description": "Windows is the time window used to evaluate the restart policy (default value is 0, which is unbounded).", + "format": "int64", + "default": 0 + } + }, + "description": "Specification for the restart policy which applies to containers created as part of this service." + }, + "Placement": { + "type": "object", + "properties": { + "Constraints": { + "type": "array", + "description": "An array of constraints.", + "example": [ + "node.hostname!=node3.corp.example.com", + "node.role!=manager", + "node.labels.type==production" + ], + "items": { + "type": "string" + } + }, + "Preferences": { + "type": "array", + "description": "Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence.", + "example": [ + { + "Spread": { + "SpreadDescriptor": "node.labels.datacenter" + } + }, + { + "Spread": { + "SpreadDescriptor": "node.labels.rack" + } + } + ], + "items": { + "type": "object", + "properties": { + "Spread": { + "type": "object", + "properties": { + "SpreadDescriptor": { + "type": "string", + "description": "label descriptor, such as engine.labels.az" + } + } + } + } + } + }, + "Platforms": { + "type": "array", + "description": "Platforms stores all the platforms that the service's image can\nrun on. This field is used in the platform filter for scheduling.\nIf empty, then the platform filter is off, meaning there are no\nscheduling restrictions.\n", + "items": { + "$ref": "#/components/schemas/Platform" + } + } + } + }, + "ForceUpdate": { + "type": "integer", + "description": "A counter that triggers an update even if no relevant parameters have been changed." + }, + "Runtime": { + "type": "string", + "description": "Runtime is the type of runtime specified for the task executor." + }, + "Networks": { + "type": "array", + "items": { + "type": "object", + "properties": { + "Target": { + "type": "string" + }, + "Aliases": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "LogDriver": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "Specifies the log driver to use for tasks created from this spec. If not present, the default one for the swarm will be used, finally falling back to the engine default if not specified." + } + }, + "description": "User modifiable task configuration." + }, + "TaskState": { + "type": "string", + "enum": [ + "new", + "allocated", + "pending", + "assigned", + "accepted", + "preparing", + "ready", + "starting", + "running", + "complete", + "shutdown", + "failed", + "rejected" + ] + }, + "Task": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the task." + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Name": { + "type": "string", + "description": "Name of the task." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Spec": { + "$ref": "#/components/schemas/TaskSpec" + }, + "ServiceID": { + "type": "string", + "description": "The ID of the service this task is part of." + }, + "Slot": { + "type": "integer" + }, + "NodeID": { + "type": "string", + "description": "The ID of the node that this task is on." + }, + "AssignedGenericResources": { + "$ref": "#/components/schemas/GenericResources" + }, + "Status": { + "type": "object", + "properties": { + "Timestamp": { + "type": "string", + "format": "dateTime" + }, + "State": { + "$ref": "#/components/schemas/TaskState" + }, + "Message": { + "type": "string" + }, + "Err": { + "type": "string" + }, + "ContainerStatus": { + "type": "object", + "properties": { + "ContainerID": { + "type": "string" + }, + "PID": { + "type": "integer" + }, + "ExitCode": { + "type": "integer" + } + } + } + } + }, + "DesiredState": { + "$ref": "#/components/schemas/TaskState" + } + }, + "example": { + "ID": "0kzzo1i0y4jz6027t0k7aezc7", + "Version": { + "Index": 71 + }, + "CreatedAt": "2016-06-07T21:07:31.171892745Z", + "UpdatedAt": "2016-06-07T21:07:31.376370513Z", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:31.290032978Z", + "State": "running", + "Message": "started", + "ContainerStatus": { + "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035", + "PID": 677 + } + }, + "DesiredState": "running", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.10/16" + ] + } + ], + "AssignedGenericResources": [ + { + "DiscreteResourceSpec": { + "Kind": "SSD", + "Value": 3 + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID1" + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID2" + } + } + ] + } + }, + "ServiceSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the service." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "TaskTemplate": { + "$ref": "#/components/schemas/TaskSpec" + }, + "Mode": { + "type": "object", + "properties": { + "Replicated": { + "type": "object", + "properties": { + "Replicas": { + "type": "integer", + "format": "int64" + } + } + }, + "Global": { + "type": "object", + "properties": {} + } + }, + "description": "Scheduling mode for the service." + }, + "UpdateConfig": { + "type": "object", + "properties": { + "Parallelism": { + "type": "integer", + "description": "Maximum number of tasks to be updated in one iteration (0 means unlimited parallelism).", + "format": "int64" + }, + "Delay": { + "type": "integer", + "description": "Amount of time between updates, in nanoseconds.", + "format": "int64" + }, + "FailureAction": { + "type": "string", + "description": "Action to take if an updated task fails to run, or stops running during the update.", + "enum": [ + "continue", + "pause", + "rollback" + ] + }, + "Monitor": { + "type": "integer", + "description": "Amount of time to monitor each updated task for failures, in nanoseconds.", + "format": "int64" + }, + "MaxFailureRatio": { + "type": "number", + "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." + }, + "Order": { + "type": "string", + "description": "The order of operations when rolling out an updated task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down.", + "enum": [ + "stop-first", + "start-first" + ] + } + }, + "description": "Specification for the update strategy of the service." + }, + "RollbackConfig": { + "type": "object", + "properties": { + "Parallelism": { + "type": "integer", + "description": "Maximum number of tasks to be rolled back in one iteration (0 means unlimited parallelism).", + "format": "int64" + }, + "Delay": { + "type": "integer", + "description": "Amount of time between rollback iterations, in nanoseconds.", + "format": "int64" + }, + "FailureAction": { + "type": "string", + "description": "Action to take if an rolled back task fails to run, or stops running during the rollback.", + "enum": [ + "continue", + "pause" + ] + }, + "Monitor": { + "type": "integer", + "description": "Amount of time to monitor each rolled back task for failures, in nanoseconds.", + "format": "int64" + }, + "MaxFailureRatio": { + "type": "number", + "description": "The fraction of tasks that may fail during a rollback before the failure action is invoked, specified as a floating point number between 0 and 1." + }, + "Order": { + "type": "string", + "description": "The order of operations when rolling back a task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down.", + "enum": [ + "stop-first", + "start-first" + ] + } + }, + "description": "Specification for the rollback strategy of the service." + }, + "Networks": { + "type": "array", + "description": "Array of network names or IDs to attach the service to.", + "items": { + "type": "object", + "properties": { + "Target": { + "type": "string" + }, + "Aliases": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "EndpointSpec": { + "$ref": "#/components/schemas/EndpointSpec" + } + }, + "description": "User modifiable configuration for a service." + }, + "EndpointPortConfig": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Protocol": { + "type": "string", + "enum": [ + "tcp", + "udp" + ] + }, + "TargetPort": { + "type": "integer", + "description": "The port inside the container." + }, + "PublishedPort": { + "type": "integer", + "description": "The port on the swarm hosts." + }, + "PublishMode": { + "type": "string", + "description": "The mode in which port is published.\n\n


\n\n- \"ingress\" makes the target port accessible on on every node,\n regardless of whether there is a task for the service running on\n that node or not.\n- \"host\" bypasses the routing mesh and publish the port directly on\n the swarm node where that service is running.\n", + "example": "ingress", + "default": "ingress", + "enum": [ + "ingress", + "host" + ] + } + } + }, + "EndpointSpec": { + "type": "object", + "properties": { + "Mode": { + "type": "string", + "description": "The mode of resolution to use for internal load balancing between tasks.", + "default": "vip", + "enum": [ + "vip", + "dnsrr" + ] + }, + "Ports": { + "type": "array", + "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.", + "items": { + "$ref": "#/components/schemas/EndpointPortConfig" + } + } + }, + "description": "Properties that can be configured to access and load balance a service." + }, + "Service": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Spec": { + "$ref": "#/components/schemas/ServiceSpec" + }, + "Endpoint": { + "type": "object", + "properties": { + "Spec": { + "$ref": "#/components/schemas/EndpointSpec" + }, + "Ports": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EndpointPortConfig" + } + }, + "VirtualIPs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "NetworkID": { + "type": "string" + }, + "Addr": { + "type": "string" + } + } + } + } + } + }, + "UpdateStatus": { + "type": "object", + "properties": { + "State": { + "type": "string", + "enum": [ + "updating", + "paused", + "completed" + ] + }, + "StartedAt": { + "type": "string", + "format": "dateTime" + }, + "CompletedAt": { + "type": "string", + "format": "dateTime" + }, + "Message": { + "type": "string" + } + }, + "description": "The status of a service update." + } + }, + "example": { + "ID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Version": { + "Index": 19 + }, + "CreatedAt": "2016-06-07T21:05:51.880065305Z", + "UpdatedAt": "2016-06-07T21:07:29.962229872Z", + "Spec": { + "Name": "hopeful_cori", + "TaskTemplate": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {}, + "ForceUpdate": 0 + }, + "Mode": { + "Replicated": { + "Replicas": 1 + } + }, + "UpdateConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Mode": "vip", + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ] + } + }, + "Endpoint": { + "Spec": { + "Mode": "vip", + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ] + }, + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ], + "VirtualIPs": [ + { + "NetworkID": "4qvuz4ko70xaltuqbt8956gd1", + "Addr": "10.255.0.2/16" + }, + { + "NetworkID": "4qvuz4ko70xaltuqbt8956gd1", + "Addr": "10.255.0.3/16" + } + ] + } + } + }, + "ImageDeleteResponseItem": { + "type": "object", + "properties": { + "Untagged": { + "type": "string", + "description": "The image ID of an image that was untagged" + }, + "Deleted": { + "type": "string", + "description": "The image ID of an image that was deleted" + } + } + }, + "ServiceUpdateResponse": { + "type": "object", + "properties": { + "Warnings": { + "type": "array", + "description": "Optional warning messages", + "items": { + "type": "string" + } + } + }, + "example": { + "Warning": "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + } + }, + "ContainerSummary": { + "type": "array", + "items": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of this container", + "x-go-name": "ID" + }, + "Names": { + "type": "array", + "description": "The names that this container has been given", + "items": { + "type": "string" + } + }, + "Image": { + "type": "string", + "description": "The name of the image used when creating this container" + }, + "ImageID": { + "type": "string", + "description": "The ID of the image that this container was created from" + }, + "Command": { + "type": "string", + "description": "Command to run when starting the container" + }, + "Created": { + "type": "integer", + "description": "When the container was created", + "format": "int64" + }, + "Ports": { + "type": "array", + "description": "The ports exposed by this container", + "items": { + "$ref": "#/components/schemas/Port" + } + }, + "SizeRw": { + "type": "integer", + "description": "The size of files that have been created or changed by this container", + "format": "int64" + }, + "SizeRootFs": { + "type": "integer", + "description": "The total size of all the files in this container", + "format": "int64" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "State": { + "type": "string", + "description": "The state of this container (e.g. `Exited`)" + }, + "Status": { + "type": "string", + "description": "Additional human-readable status of this container (e.g. `Exit 0`)" + }, + "HostConfig": { + "type": "object", + "properties": { + "NetworkMode": { + "type": "string" + } + } + }, + "NetworkSettings": { + "type": "object", + "properties": { + "Networks": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + } + } + }, + "description": "A summary of the container's network settings" + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Mount" + } + } + } + } + }, + "Driver": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the driver.", + "nullable": false, + "example": "some-driver" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Key/value map of driver-specific options.", + "nullable": false, + "example": { + "OptionA": "value for driver-specific option A", + "OptionB": "value for driver-specific option B" + } + } + }, + "description": "Driver represents a driver (network, logging, secrets)." + }, + "SecretSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "User-defined name of the secret." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "Data": { + "type": "string", + "description": "Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2))\ndata to store as secret.\n\nThis field is only used to _create_ a secret, and is not returned by\nother endpoints.\n", + "example": "" + }, + "Driver": { + "$ref": "#/components/schemas/Driver" + } + } + }, + "Secret": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "example": "blt1owaxmitz71s9v5zh81zun" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime", + "example": "2017-07-20T13:55:28.678958722Z" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime", + "example": "2017-07-20T13:55:28.678958722Z" + }, + "Spec": { + "$ref": "#/components/schemas/SecretSpec" + } + } + }, + "ConfigSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "User-defined name of the config." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Data": { + "type": "string", + "description": "Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2))\nconfig data.\n" + } + } + }, + "Config": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Spec": { + "$ref": "#/components/schemas/ConfigSpec" + } + } + }, + "SystemInfo": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Unique identifier of the daemon.\n\n


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


\n\n> **Note**: The information returned in this field, including the\n> formatting of values and labels, should not be considered stable,\n> and may change without notice.\n", + "example": [ + [ + "Backing Filesystem", + "extfs" + ], + [ + "Supports d_type", + "true" + ], + [ + "Native Overlay Diff", + "true" + ] + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "DockerRootDir": { + "type": "string", + "description": "Root directory of persistent Docker state.\n\nDefaults to `/var/lib/docker` on Linux, and `C:\\ProgramData\\docker`\non Windows.\n", + "example": "/var/lib/docker" + }, + "SystemStatus": { + "type": "array", + "description": "Status information about this node (standalone Swarm API).\n\n


\n\n> **Note**: The information returned in this field is only propagated\n> by the Swarm standalone API, and is empty (`null`) when using\n> built-in swarm mode.\n", + "example": [ + [ + "Role", + "primary" + ], + [ + "State", + "Healthy" + ], + [ + "Strategy", + "spread" + ], + [ + "Filters", + "health, port, containerslots, dependency, affinity, constraint, whitelist" + ], + [ + "Nodes", + "2" + ], + [ + " swarm-agent-00", + "192.168.99.102:2376" + ], + [ + " └ ID", + "5CT6:FBGO:RVGO:CZL4:PB2K:WCYN:2JSV:KSHH:GGFW:QOPG:6J5Q:IOZ2|192.168.99.102:2376" + ], + [ + " └ Status", + "Healthy" + ], + [ + " └ Containers", + "1 (1 Running, 0 Paused, 0 Stopped)" + ], + [ + " └ Reserved CPUs", + "0 / 1" + ], + [ + " └ Reserved Memory", + "0 B / 1.021 GiB" + ], + [ + " └ Labels", + "kernelversion=4.4.74-boot2docker, operatingsystem=Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017, ostype=linux, provider=virtualbox, storagedriver=aufs" + ], + [ + " └ UpdatedAt", + "2017-08-09T10:03:46Z" + ], + [ + " └ ServerVersion", + "17.06.0-ce" + ], + [ + " swarm-manager", + "192.168.99.101:2376" + ], + [ + " └ ID", + "TAMD:7LL3:SEF7:LW2W:4Q2X:WVFH:RTXX:JSYS:XY2P:JEHL:ZMJK:JGIW|192.168.99.101:2376" + ], + [ + " └ Status", + "Healthy" + ], + [ + " └ Containers", + "2 (2 Running, 0 Paused, 0 Stopped)" + ], + [ + " └ Reserved CPUs", + "0 / 1" + ], + [ + " └ Reserved Memory", + "0 B / 1.021 GiB" + ], + [ + " └ Labels", + "kernelversion=4.4.74-boot2docker, operatingsystem=Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017, ostype=linux, provider=virtualbox, storagedriver=aufs" + ], + [ + " └ UpdatedAt", + "2017-08-09T10:04:11Z" + ], + [ + " └ ServerVersion", + "17.06.0-ce" + ] + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "Plugins": { + "$ref": "#/components/schemas/PluginsInfo" + }, + "MemoryLimit": { + "type": "boolean", + "description": "Indicates if the host has memory limit support enabled.", + "example": true + }, + "SwapLimit": { + "type": "boolean", + "description": "Indicates if the host has memory swap limit support enabled.", + "example": true + }, + "KernelMemory": { + "type": "boolean", + "description": "Indicates if the host has kernel memory limit support enabled.", + "example": true + }, + "CpuCfsPeriod": { + "type": "boolean", + "description": "Indicates if CPU CFS(Completely Fair Scheduler) period is supported by the host.", + "example": true + }, + "CpuCfsQuota": { + "type": "boolean", + "description": "Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by the host.", + "example": true + }, + "CPUShares": { + "type": "boolean", + "description": "Indicates if CPU Shares limiting is supported by the host.", + "example": true + }, + "CPUSet": { + "type": "boolean", + "description": "Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host.\n\nSee [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt)\n", + "example": true + }, + "OomKillDisable": { + "type": "boolean", + "description": "Indicates if OOM killer disable is supported on the host." + }, + "IPv4Forwarding": { + "type": "boolean", + "description": "Indicates IPv4 forwarding is enabled.", + "example": true + }, + "BridgeNfIptables": { + "type": "boolean", + "description": "Indicates if `bridge-nf-call-iptables` is available on the host.", + "example": true + }, + "BridgeNfIp6tables": { + "type": "boolean", + "description": "Indicates if `bridge-nf-call-ip6tables` is available on the host.", + "example": true + }, + "Debug": { + "type": "boolean", + "description": "Indicates if the daemon is running in debug-mode / with debug-level logging enabled.", + "example": true + }, + "NFd": { + "type": "integer", + "description": "The total number of file Descriptors in use by the daemon process.\n\nThis information is only returned if debug-mode is enabled.\n", + "example": 64 + }, + "NGoroutines": { + "type": "integer", + "description": "The number of goroutines that currently exist.\n\nThis information is only returned if debug-mode is enabled.\n", + "example": 174 + }, + "SystemTime": { + "type": "string", + "description": "Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt)\nformat with nano-seconds.\n", + "example": "2017-08-08T20:28:29.06202363Z" + }, + "LoggingDriver": { + "type": "string", + "description": "The logging driver to use as a default for new containers.\n" + }, + "CgroupDriver": { + "type": "string", + "description": "The driver to use for managing cgroups.\n", + "example": "cgroupfs", + "default": "cgroupfs", + "enum": [ + "cgroupfs", + "systemd" + ] + }, + "NEventsListener": { + "type": "integer", + "description": "Number of event listeners subscribed.", + "example": 30 + }, + "KernelVersion": { + "type": "string", + "description": "Kernel version of the host.\n\nOn Linux, this information obtained from `uname`. On Windows this\ninformation is queried from the HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\\nregistry value, for example _\"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)\"_.\n", + "example": "4.9.38-moby" + }, + "OperatingSystem": { + "type": "string", + "description": "Name of the host's operating system, for example: \"Ubuntu 16.04.2 LTS\"\nor \"Windows Server 2016 Datacenter\"\n", + "example": "Alpine Linux v3.5" + }, + "OSType": { + "type": "string", + "description": "Generic type of the operating system of the host, as returned by the\nGo runtime (`GOOS`).\n\nCurrently returned values are \"linux\" and \"windows\". A full list of\npossible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment).\n", + "example": "linux" + }, + "Architecture": { + "type": "string", + "description": "Hardware architecture of the host, as returned by the Go runtime\n(`GOARCH`).\n\nA full list of possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment).\n", + "example": "x86_64" + }, + "NCPU": { + "type": "integer", + "description": "The number of logical CPUs usable by the daemon.\n\nThe number of available CPUs is checked by querying the operating\nsystem when the daemon starts. Changes to operating system CPU\nallocation after the daemon is started are not reflected.\n", + "example": 4 + }, + "MemTotal": { + "type": "integer", + "description": "Total amount of physical memory available on the host, in kilobytes (kB).\n", + "format": "int64", + "example": 2095882240 + }, + "IndexServerAddress": { + "type": "string", + "description": "Address / URL of the index server that is used for image search,\nand as a default for user authentication for Docker Hub and Docker Cloud.\n", + "example": "https://index.docker.io/v1/", + "default": "https://index.docker.io/v1/" + }, + "RegistryConfig": { + "$ref": "#/components/schemas/RegistryServiceConfig" + }, + "GenericResources": { + "$ref": "#/components/schemas/GenericResources" + }, + "HttpProxy": { + "type": "string", + "description": "HTTP-proxy configured for the daemon. This value is obtained from the\n[`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable.\n\nContainers do not automatically inherit this configuration.\n", + "example": "http://user:pass@proxy.corp.example.com:8080" + }, + "HttpsProxy": { + "type": "string", + "description": "HTTPS-proxy configured for the daemon. This value is obtained from the\n[`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable.\n\nContainers do not automatically inherit this configuration.\n", + "example": "https://user:pass@proxy.corp.example.com:4443" + }, + "NoProxy": { + "type": "string", + "description": "Comma-separated list of domain extensions for which no proxy should be\nused. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html)\nenvironment variable.\n\nContainers do not automatically inherit this configuration.\n", + "example": "*.local, 169.254/16" + }, + "Name": { + "type": "string", + "description": "Hostname of the host.", + "example": "node5.corp.example.com" + }, + "Labels": { + "type": "array", + "description": "User-defined labels (key/value metadata) as set on the daemon.\n\n


\n\n> **Note**: When part of a Swarm, nodes can both have _daemon_ labels,\n> set through the daemon configuration, and _node_ labels, set from a\n> manager node in the Swarm. Node labels are not included in this\n> field. Node labels can be retrieved using the `/nodes/(id)` endpoint\n> on a manager node in the Swarm.\n", + "example": [ + "storage=ssd", + "production" + ], + "items": { + "type": "string" + } + }, + "ExperimentalBuild": { + "type": "boolean", + "description": "Indicates if experimental features are enabled on the daemon.\n", + "example": true + }, + "ServerVersion": { + "type": "string", + "description": "Version string of the daemon.\n\n> **Note**: the [standalone Swarm API](https://docs.docker.com/swarm/swarm-api/)\n> returns the Swarm version instead of the daemon version, for example\n> `swarm/1.2.8`.\n", + "example": "17.06.0-ce" + }, + "ClusterStore": { + "type": "string", + "description": "URL of the distributed storage backend.\n\n\nThe storage backend is used for multihost networking (to store\nnetwork and endpoint information) and by the node discovery mechanism.\n\n


\n\n> **Note**: This field is only propagated when using standalone Swarm\n> mode, and overlay networking using an external k/v store. Overlay\n> networks with Swarm mode enabled use the built-in raft store, and\n> this field will be empty.\n", + "example": "consul://consul.corp.example.com:8600/some/path" + }, + "ClusterAdvertise": { + "type": "string", + "description": "The network endpoint that the Engine advertises for the purpose of\nnode discovery. ClusterAdvertise is a `host:port` combination on which\nthe daemon is reachable by other hosts.\n\n


\n\n> **Note**: This field is only propagated when using standalone Swarm\n> mode, and overlay networking using an external k/v store. Overlay\n> networks with Swarm mode enabled use the built-in raft store, and\n> this field will be empty.\n", + "example": "node5.corp.example.com:8000" + }, + "Runtimes": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Runtime" + }, + "description": "List of [OCI compliant](https://github.com/opencontainers/runtime-spec)\nruntimes configured on the daemon. Keys hold the \"name\" used to\nreference the runtime.\n\nThe Docker daemon relies on an OCI compliant runtime (invoked via the\n`containerd` daemon) as its interface to the Linux kernel namespaces,\ncgroups, and SELinux.\n\nThe default runtime is `runc`, and automatically configured. Additional\nruntimes can be configured by the user and will be listed here.\n", + "example": { + "runc": { + "path": "docker-runc" + }, + "runc-master": { + "path": "/go/bin/runc" + }, + "custom": { + "path": "/usr/local/bin/my-oci-runtime", + "runtimeArgs": [ + "--debug", + "--systemd-cgroup=false" + ] + } + } + }, + "DefaultRuntime": { + "type": "string", + "description": "Name of the default OCI runtime that is used when starting containers.\n\nThe default can be overridden per-container at create time.\n", + "example": "runc", + "default": "runc" + }, + "Swarm": { + "$ref": "#/components/schemas/SwarmInfo" + }, + "LiveRestoreEnabled": { + "type": "boolean", + "description": "Indicates if live restore is enabled.\n\nIf enabled, containers are kept running when the daemon is shutdown\nor upon daemon start if running containers are detected.\n", + "example": false, + "default": false + }, + "Isolation": { + "type": "string", + "description": "Represents the isolation technology to use as a default for containers.\nThe supported values are platform-specific.\n\nIf no isolation value is specified on daemon start, on Windows client,\nthe default is `hyperv`, and on Windows server, the default is `process`.\n\nThis option is currently not used on other platforms.\n", + "default": "default", + "enum": [ + "default", + "hyperv", + "process" + ] + }, + "InitBinary": { + "type": "string", + "description": "Name and, optional, path of the the `docker-init` binary.\n\nIf the path is omitted, the daemon searches the host's `$PATH` for the\nbinary and uses the first result.\n", + "example": "docker-init" + }, + "ContainerdCommit": { + "$ref": "#/components/schemas/Commit" + }, + "RuncCommit": { + "$ref": "#/components/schemas/Commit" + }, + "InitCommit": { + "$ref": "#/components/schemas/Commit" + }, + "SecurityOptions": { + "type": "array", + "description": "List of security features that are enabled on the daemon, such as\napparmor, seccomp, SELinux, and user-namespaces (userns).\n\nAdditional configuration options for each security feature may\nbe present, and are included as a comma-separated list of key/value\npairs.\n", + "example": [ + "name=apparmor", + "name=seccomp,profile=default", + "name=selinux", + "name=userns" + ], + "items": { + "type": "string" + } + } + } + }, + "PluginsInfo": { + "type": "object", + "properties": { + "Volume": { + "type": "array", + "description": "Names of available volume-drivers, and network-driver plugins.", + "example": [ + "local" + ], + "items": { + "type": "string" + } + }, + "Network": { + "type": "array", + "description": "Names of available network-drivers, and network-driver plugins.", + "example": [ + "bridge", + "host", + "ipvlan", + "macvlan", + "null", + "overlay" + ], + "items": { + "type": "string" + } + }, + "Authorization": { + "type": "array", + "description": "Names of available authorization plugins.", + "example": [ + "img-authz-plugin", + "hbm" + ], + "items": { + "type": "string" + } + }, + "Log": { + "type": "array", + "description": "Names of available logging-drivers, and logging-driver plugins.", + "example": [ + "awslogs", + "fluentd", + "gcplogs", + "gelf", + "journald", + "json-file", + "logentries", + "splunk", + "syslog" + ], + "items": { + "type": "string" + } + } + }, + "description": "Available plugins per type.\n\n


\n\n> **Note**: Only unmanaged (V1) plugins are included in this list.\n> V1 plugins are \"lazily\" loaded, and are not returned in this list\n> if there is no resource using the plugin.\n" + }, + "RegistryServiceConfig": { + "type": "object", + "properties": { + "AllowNondistributableArtifactsCIDRs": { + "type": "array", + "description": "List of IP ranges to which nondistributable artifacts can be pushed,\nusing the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632).\n\nSome images (for example, Windows base images) contain artifacts\nwhose distribution is restricted by license. When these images are\npushed to a registry, restricted artifacts are not included.\n\nThis configuration override this behavior, and enables the daemon to\npush nondistributable artifacts to all registries whose resolved IP\naddress is within the subnet described by the CIDR syntax.\n\nThis option is useful when pushing images containing\nnondistributable artifacts to a registry on an air-gapped network so\nhosts on that network can pull the images without connecting to\nanother server.\n\n> **Warning**: Nondistributable artifacts typically have restrictions\n> on how and where they can be distributed and shared. Only use this\n> feature to push artifacts to private registries and ensure that you\n> are in compliance with any terms that cover redistributing\n> nondistributable artifacts.\n", + "example": [ + "::1/128", + "127.0.0.0/8" + ], + "items": { + "type": "string" + } + }, + "AllowNondistributableArtifactsHostnames": { + "type": "array", + "description": "List of registry hostnames to which nondistributable artifacts can be\npushed, using the format `[:]` or `[:]`.\n\nSome images (for example, Windows base images) contain artifacts\nwhose distribution is restricted by license. When these images are\npushed to a registry, restricted artifacts are not included.\n\nThis configuration override this behavior for the specified\nregistries.\n\nThis option is useful when pushing images containing\nnondistributable artifacts to a registry on an air-gapped network so\nhosts on that network can pull the images without connecting to\nanother server.\n\n> **Warning**: Nondistributable artifacts typically have restrictions\n> on how and where they can be distributed and shared. Only use this\n> feature to push artifacts to private registries and ensure that you\n> are in compliance with any terms that cover redistributing\n> nondistributable artifacts.\n", + "example": [ + "registry.internal.corp.example.com:3000", + "[2001:db8:a0b:12f0::1]:443" + ], + "items": { + "type": "string" + } + }, + "InsecureRegistryCIDRs": { + "type": "array", + "description": "List of IP ranges of insecure registries, using the CIDR syntax\n([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries\naccept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates\nfrom unknown CAs) communication.\n\nBy default, local registries (`127.0.0.0/8`) are configured as\ninsecure. All other registries are secure. Communicating with an\ninsecure registry is not possible if the daemon assumes that registry\nis secure.\n\nThis configuration override this behavior, insecure communication with\nregistries whose resolved IP address is within the subnet described by\nthe CIDR syntax.\n\nRegistries can also be marked insecure by hostname. Those registries\nare listed under `IndexConfigs` and have their `Secure` field set to\n`false`.\n\n> **Warning**: Using this option can be useful when running a local\n> registry, but introduces security vulnerabilities. This option\n> should therefore ONLY be used for testing purposes. For increased\n> security, users should add their CA to their system's list of trusted\n> CAs instead of enabling this option.\n", + "example": [ + "::1/128", + "127.0.0.0/8" + ], + "items": { + "type": "string" + } + }, + "IndexConfigs": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/IndexInfo" + }, + "example": { + "127.0.0.1:5000": { + "Name": "127.0.0.1:5000", + "Mirrors": [], + "Secure": false, + "Official": false + }, + "[2001:db8:a0b:12f0::1]:80": { + "Name": "[2001:db8:a0b:12f0::1]:80", + "Mirrors": [], + "Secure": false, + "Official": false + }, + "docker.io": { + "Name": "docker.io", + "Mirrors": [ + "https://hub-mirror.corp.example.com:5000/" + ], + "Secure": true, + "Official": true + }, + "registry.internal.corp.example.com:3000": { + "Name": "registry.internal.corp.example.com:3000", + "Mirrors": [], + "Secure": false, + "Official": false + } + } + }, + "Mirrors": { + "type": "array", + "description": "List of registry URLs that act as a mirror for the official\n(`docker.io`) registry.\n", + "example": [ + "https://hub-mirror.corp.example.com:5000/", + "https://[2001:db8:a0b:12f0::1]/" + ], + "items": { + "type": "string" + } + } + }, + "description": "RegistryServiceConfig stores daemon registry services configuration.\n", + "nullable": true, + "x-nullable": true + }, + "IndexInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the registry, such as \"docker.io\".\n", + "example": "docker.io" + }, + "Mirrors": { + "type": "array", + "description": "List of mirrors, expressed as URIs.\n", + "example": [ + "https://hub-mirror.corp.example.com:5000/", + "https://registry-2.docker.io/", + "https://registry-3.docker.io/" + ], + "items": { + "type": "string" + } + }, + "Secure": { + "type": "boolean", + "description": "Indicates if the the registry is part of the list of insecure\nregistries.\n\nIf `false`, the registry is insecure. Insecure registries accept\nun-encrypted (HTTP) and/or untrusted (HTTPS with certificates from\nunknown CAs) communication.\n\n> **Warning**: Insecure registries can be useful when running a local\n> registry. However, because its use creates security vulnerabilities\n> it should ONLY be enabled for testing purposes. For increased\n> security, users should add their CA to their system's list of\n> trusted CAs instead of enabling this option.\n", + "example": true + }, + "Official": { + "type": "boolean", + "description": "Indicates whether this is an official registry (i.e., Docker Hub / docker.io)\n", + "example": true + } + }, + "description": "IndexInfo contains information about a registry.", + "nullable": true, + "x-nullable": true + }, + "Runtime": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "Name and, optional, path, of the OCI executable binary.\n\nIf the path is omitted, the daemon searches the host's `$PATH` for the\nbinary and uses the first result.\n", + "example": "/usr/local/bin/my-oci-runtime" + }, + "runtimeArgs": { + "type": "array", + "description": "List of command-line arguments to pass to the runtime when invoked.\n", + "nullable": true, + "example": [ + "--debug", + "--systemd-cgroup=false" + ], + "items": { + "type": "string" + } + } + }, + "description": "Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec)\nruntime.\n\nThe runtime is invoked by the daemon via the `containerd` daemon. OCI\nruntimes act as an interface to the Linux kernel namespaces, cgroups,\nand SELinux.\n" + }, + "Commit": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Actual commit ID of external tool.", + "example": "cfb82a876ecc11b5ca0977d1733adbe58599088a" + }, + "Expected": { + "type": "string", + "description": "Commit ID of external tool expected by dockerd as set at build time.\n", + "example": "2d41c047c83e09a6d61d464906feb2a2f3c52aa4" + } + }, + "description": "Commit holds the Git-commit (SHA1) that a binary was built from, as\nreported in the version-string of external tools, such as `containerd`,\nor `runC`.\n" + }, + "SwarmInfo": { + "type": "object", + "properties": { + "NodeID": { + "type": "string", + "description": "Unique identifier of for this node in the swarm.", + "example": "k67qz4598weg5unwwffg6z1m1", + "default": "" + }, + "NodeAddr": { + "type": "string", + "description": "IP address at which this node can be reached by other nodes in the\nswarm.\n", + "example": "10.0.0.46", + "default": "" + }, + "LocalNodeState": { + "$ref": "#/components/schemas/LocalNodeState" + }, + "ControlAvailable": { + "type": "boolean", + "example": true, + "default": false + }, + "Error": { + "type": "string", + "default": "" + }, + "RemoteManagers": { + "type": "array", + "description": "List of ID's and addresses of other managers in the swarm.\n", + "nullable": true, + "example": [ + { + "NodeID": "71izy0goik036k48jg985xnds", + "Addr": "10.0.0.158:2377" + }, + { + "NodeID": "79y6h1o4gv8n120drcprv5nmc", + "Addr": "10.0.0.159:2377" + }, + { + "NodeID": "k67qz4598weg5unwwffg6z1m1", + "Addr": "10.0.0.46:2377" + } + ], + "items": { + "$ref": "#/components/schemas/PeerNode" + } + }, + "Nodes": { + "type": "integer", + "description": "Total number of nodes in the swarm.", + "nullable": true, + "example": 4 + }, + "Managers": { + "type": "integer", + "description": "Total number of managers in the swarm.", + "nullable": true, + "example": 3 + }, + "Cluster": { + "$ref": "#/components/schemas/ClusterInfo" + } + }, + "description": "Represents generic information about swarm.\n" + }, + "LocalNodeState": { + "type": "string", + "description": "Current local status of this node.", + "example": "active", + "default": "", + "enum": [ + "", + "inactive", + "pending", + "active", + "error", + "locked" + ] + }, + "PeerNode": { + "type": "object", + "properties": { + "NodeID": { + "type": "string", + "description": "Unique identifier of for this node in the swarm." + }, + "Addr": { + "type": "string", + "description": "IP address and ports at which this node can be reached.\n" + } + }, + "description": "Represents a peer-node in the swarm" + } + } + } +} \ No newline at end of file diff --git a/spec/v1.41.json b/spec/v1.41.json new file mode 100644 index 00000000..5b645f05 --- /dev/null +++ b/spec/v1.41.json @@ -0,0 +1,16074 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Docker Engine API", + "description": "The Engine API is an HTTP API served by Docker Engine. It is the API the\nDocker client uses to communicate with the Engine, so everything the Docker\nclient can do can be done with the API.\n\nMost of the client's commands map directly to API endpoints (e.g. `docker ps`\nis `GET /containers/json`). The notable exception is running containers,\nwhich consists of several API calls.\n\n# Errors\n\nThe API uses standard HTTP status codes to indicate the success or failure\nof the API call. The body of the response will be JSON in the following\nformat:\n\n```\n{\n \"message\": \"page not found\"\n}\n```\n\n# Versioning\n\nThe API is usually changed in each release, so API calls are versioned to\nensure that clients don't break. To lock to a specific version of the API,\nyou prefix the URL with its version, for example, call `/v1.30/info` to use\nthe v1.30 version of the `/info` endpoint. If the API version specified in\nthe URL is not supported by the daemon, a HTTP `400 Bad Request` error message\nis returned.\n\nIf you omit the version-prefix, the current version of the API (v1.41) is used.\nFor example, calling `/info` is the same as calling `/v1.41/info`. Using the\nAPI without a version-prefix is deprecated and will be removed in a future release.\n\nEngine releases in the near future should support this version of the API,\nso your client will continue to work even if it is talking to a newer Engine.\n\nThe API uses an open schema model, which means server may add extra properties\nto responses. Likewise, the server will ignore any extra query parameters and\nrequest body properties. When you write clients, you need to ignore additional\nproperties in responses to ensure they do not break when talking to newer\ndaemons.\n\n\n# Authentication\n\nAuthentication for registries is handled client side. The client has to send\nauthentication details to various endpoints that need to communicate with\nregistries, such as `POST /images/(name)/push`. These are sent as\n`X-Registry-Auth` header as a [base64url encoded](https://tools.ietf.org/html/rfc4648#section-5)\n(JSON) string with the following structure:\n\n```\n{\n \"username\": \"string\",\n \"password\": \"string\",\n \"email\": \"string\",\n \"serveraddress\": \"string\"\n}\n```\n\nThe `serveraddress` is a domain/IP without a protocol. Throughout this\nstructure, double quotes are required.\n\nIf you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth),\nyou can just pass this instead of credentials:\n\n```\n{\n \"identitytoken\": \"9cbaf023786cd7...\"\n}\n```\n", + "version": "1.41", + "x-logo": { + "url": "https://docs.docker.com/images/logo-docker-main.png" + } + }, + "servers": [ + { + "url": "/v1.41" + } + ], + "tags": [ + { + "name": "Container", + "description": "Create and manage containers.\n", + "x-displayName": "Containers" + }, + { + "name": "Image", + "x-displayName": "Images" + }, + { + "name": "Network", + "description": "Networks are user-defined networks that containers can be attached to.\nSee the [networking documentation](https://docs.docker.com/network/)\nfor more information.\n", + "x-displayName": "Networks" + }, + { + "name": "Volume", + "description": "Create and manage persistent storage that can be attached to containers.\n", + "x-displayName": "Volumes" + }, + { + "name": "Exec", + "description": "Run new commands inside running containers. Refer to the\n[command-line reference](https://docs.docker.com/engine/reference/commandline/exec/)\nfor more information.\n\nTo exec a command in a container, you first need to create an exec instance,\nthen start it. These two API endpoints are wrapped up in a single command-line\ncommand, `docker exec`.\n", + "x-displayName": "Exec" + }, + { + "name": "Swarm", + "description": "Engines can be clustered together in a swarm. Refer to the\n[swarm mode documentation](https://docs.docker.com/engine/swarm/)\nfor more information.\n", + "x-displayName": "Swarm" + }, + { + "name": "Node", + "description": "Nodes are instances of the Engine participating in a swarm. Swarm mode\nmust be enabled for these endpoints to work.\n", + "x-displayName": "Nodes" + }, + { + "name": "Service", + "description": "Services are the definitions of tasks to run on a swarm. Swarm mode must\nbe enabled for these endpoints to work.\n", + "x-displayName": "Services" + }, + { + "name": "Task", + "description": "A task is a container running on a swarm. It is the atomic scheduling unit\nof swarm. Swarm mode must be enabled for these endpoints to work.\n", + "x-displayName": "Tasks" + }, + { + "name": "Secret", + "description": "Secrets are sensitive data that can be used by services. Swarm mode must\nbe enabled for these endpoints to work.\n", + "x-displayName": "Secrets" + }, + { + "name": "Config", + "description": "Configs are application configurations that can be used by services. Swarm\nmode must be enabled for these endpoints to work.\n", + "x-displayName": "Configs" + }, + { + "name": "Plugin", + "x-displayName": "Plugins" + }, + { + "name": "System", + "x-displayName": "System" + } + ], + "paths": { + "/containers/json": { + "get": { + "tags": [ + "Container" + ], + "summary": "List containers", + "description": "Returns a list of containers. For details on the format, see the\n[inspect endpoint](#operation/ContainerInspect).\n\nNote that it uses a different, smaller representation of a container\nthan inspecting a single container. For example, the list of linked\ncontainers is not propagated .\n", + "operationId": "ContainerList", + "parameters": [ + { + "name": "all", + "in": "query", + "description": "Return all containers. By default, only running containers are shown.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "limit", + "in": "query", + "description": "Return this number of most recently created containers, including\nnon-running ones.\n", + "schema": { + "type": "integer" + } + }, + { + "name": "size", + "in": "query", + "description": "Return the size of container as fields `SizeRw` and `SizeRootFs`.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "filters", + "in": "query", + "description": "Filters to process on the container list, encoded as JSON (a\n`map[string][]string`). For example, `{\"status\": [\"paused\"]}` will\nonly return paused containers.\n\nAvailable filters:\n\n- `ancestor`=(`[:]`, ``, or ``)\n- `before`=(`` or ``)\n- `expose`=(`[/]`|`/[]`)\n- `exited=` containers with exit code of ``\n- `health`=(`starting`|`healthy`|`unhealthy`|`none`)\n- `id=` a container's ID\n- `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only)\n- `is-task=`(`true`|`false`)\n- `label=key` or `label=\"key=value\"` of a container label\n- `name=` a container's name\n- `network`=(`` or ``)\n- `publish`=(`[/]`|`/[]`)\n- `since`=(`` or ``)\n- `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`)\n- `volume`=(`` or ``)\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContainerSummary" + }, + "example": [ + { + "Id": "8dfafdbc3a40", + "Names": [ + "/boring_feynman" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 1", + "Created": 1367854155, + "State": "Exited", + "Status": "Exit 0", + "Ports": [ + { + "PrivatePort": 2222, + "PublicPort": 3333, + "Type": "tcp" + } + ], + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "2cdc4edb1ded3631c81f57966563e5c8525b81121bb3706a9a9a3ae102711f3f", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:02" + } + } + }, + "Mounts": [ + { + "Name": "fac362...80535", + "Source": "/data", + "Destination": "/data", + "Driver": "local", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" + } + ] + }, + { + "Id": "9cd87474be90", + "Names": [ + "/coolName" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 222222", + "Created": 1367854155, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "88eaed7b37b38c2a3f0c4bc796494fdf51b270c2d22656412a2ca5d559a64d7a", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.8", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:08" + } + } + }, + "Mounts": [] + }, + { + "Id": "3176a2479c92", + "Names": [ + "/sleepy_dog" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "8b27c041c30326d59cd6e6f510d4f8d1d570a228466f956edf7815508f78e30d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.6", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:06" + } + } + }, + "Mounts": [] + }, + { + "Id": "4cb07b47f9fb", + "Names": [ + "/running_cat" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "d91c7b2f0644403d7ef3095985ea0e2370325cd2332ff3a3225c4247328e66e9", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.5", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:05" + } + } + }, + "Mounts": [] + } + ] + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/create": { + "post": { + "tags": [ + "Container" + ], + "summary": "Create a container", + "operationId": "ContainerCreate", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Assign the specified name to the container. Must match\n`/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`.\n", + "schema": { + "pattern": "^/?[a-zA-Z0-9][a-zA-Z0-9_.-]+$", + "type": "string" + } + } + ], + "requestBody": { + "description": "Container to create", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ContainerConfig" + }, + { + "type": "object", + "properties": { + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "NetworkingConfig": { + "$ref": "#/components/schemas/NetworkingConfig" + } + } + } + ] + } + }, + "application/octet-stream": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ContainerConfig" + }, + { + "type": "object", + "properties": { + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "NetworkingConfig": { + "$ref": "#/components/schemas/NetworkingConfig" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Container created successfully", + "content": { + "application/json": { + "schema": { + "title": "ContainerCreateResponse", + "required": [ + "Id", + "Warnings" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the created container", + "nullable": false + }, + "Warnings": { + "type": "array", + "description": "Warnings encountered when creating the container", + "nullable": false, + "items": { + "type": "string" + } + } + }, + "description": "OK response to ContainerCreate operation" + }, + "example": { + "Id": "e90e34656806", + "Warnings": [] + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "409": { + "description": "conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/containers/{id}/json": { + "get": { + "tags": [ + "Container" + ], + "summary": "Inspect a container", + "description": "Return low-level information about a container.", + "operationId": "ContainerInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "size", + "in": "query", + "description": "Return the size of container as fields `SizeRw` and `SizeRootFs`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "ContainerInspectResponse", + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the container" + }, + "Created": { + "type": "string", + "description": "The time the container was created" + }, + "Path": { + "type": "string", + "description": "The path to the command being run" + }, + "Args": { + "type": "array", + "description": "The arguments to the command being run", + "items": { + "type": "string" + } + }, + "State": { + "$ref": "#/components/schemas/ContainerState" + }, + "Image": { + "type": "string", + "description": "The container's image ID" + }, + "ResolvConfPath": { + "type": "string" + }, + "HostnamePath": { + "type": "string" + }, + "HostsPath": { + "type": "string" + }, + "LogPath": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "RestartCount": { + "type": "integer" + }, + "Driver": { + "type": "string" + }, + "Platform": { + "type": "string" + }, + "MountLabel": { + "type": "string" + }, + "ProcessLabel": { + "type": "string" + }, + "AppArmorProfile": { + "type": "string" + }, + "ExecIDs": { + "type": "array", + "description": "IDs of exec instances that are running in the container.", + "nullable": true, + "items": { + "type": "string" + } + }, + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "GraphDriver": { + "$ref": "#/components/schemas/GraphDriverData" + }, + "SizeRw": { + "type": "integer", + "description": "The size of files that have been created or changed by this\ncontainer.\n", + "format": "int64" + }, + "SizeRootFs": { + "type": "integer", + "description": "The total size of all the files in this container.", + "format": "int64" + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MountPoint" + } + }, + "Config": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "NetworkSettings": { + "$ref": "#/components/schemas/NetworkSettings" + } + } + }, + "example": { + "AppArmorProfile": "", + "Args": [ + "-c", + "exit 9" + ], + "Config": { + "AttachStderr": true, + "AttachStdin": false, + "AttachStdout": true, + "Cmd": [ + "/bin/sh", + "-c", + "exit 9" + ], + "Domainname": "", + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Healthcheck": { + "Test": [ + "CMD-SHELL", + "exit 0" + ] + }, + "Hostname": "ba033ac44011", + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "MacAddress": "", + "NetworkDisabled": false, + "OpenStdin": false, + "StdinOnce": false, + "Tty": false, + "User": "", + "Volumes": { + "/volumes/data": {} + }, + "WorkingDir": "", + "StopSignal": "SIGTERM", + "StopTimeout": 10 + }, + "Created": "2015-01-06T15:47:31.485331387Z", + "Driver": "devicemapper", + "ExecIDs": [ + "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca", + "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4" + ], + "HostConfig": { + "MaximumIOps": 0, + "MaximumIOBps": 0, + "BlkioWeight": 0, + "BlkioWeightDevice": [ + {} + ], + "BlkioDeviceReadBps": [ + {} + ], + "BlkioDeviceWriteBps": [ + {} + ], + "BlkioDeviceReadIOps": [ + {} + ], + "BlkioDeviceWriteIOps": [ + {} + ], + "ContainerIDFile": "", + "CpusetCpus": "", + "CpusetMems": "", + "CpuPercent": 80, + "CpuShares": 0, + "CpuPeriod": 100000, + "CpuRealtimePeriod": 1000000, + "CpuRealtimeRuntime": 10000, + "Devices": [], + "DeviceRequests": [ + { + "Driver": "nvidia", + "Count": -1, + "DeviceIDs\"": [ + "0", + "1", + "GPU-fef8089b-4820-abfc-e83e-94318197576e" + ], + "Capabilities": [ + [ + "gpu", + "nvidia", + "compute" + ] + ], + "Options": { + "property1": "string", + "property2": "string" + } + } + ], + "IpcMode": "", + "LxcConf": [], + "Memory": 0, + "MemorySwap": 0, + "MemoryReservation": 0, + "KernelMemory": 0, + "OomKillDisable": false, + "OomScoreAdj": 500, + "NetworkMode": "bridge", + "PidMode": "", + "PortBindings": {}, + "Privileged": false, + "ReadonlyRootfs": false, + "PublishAllPorts": false, + "RestartPolicy": { + "MaximumRetryCount": 2, + "Name": "on-failure" + }, + "LogConfig": { + "Type": "json-file" + }, + "Sysctls": { + "net.ipv4.ip_forward": "1" + }, + "Ulimits": [ + {} + ], + "VolumeDriver": "", + "ShmSize": 67108864 + }, + "HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname", + "HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts", + "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log", + "Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39", + "Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2", + "MountLabel": "", + "Name": "/boring_euclid", + "NetworkSettings": { + "Bridge": "", + "SandboxID": "", + "HairpinMode": false, + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + "SandboxKey": "", + "EndpointID": "", + "Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "IPAddress": "", + "IPPrefixLen": 0, + "IPv6Gateway": "", + "MacAddress": "", + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Path": "/bin/sh", + "ProcessLabel": "", + "ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf", + "RestartCount": 1, + "State": { + "Error": "", + "ExitCode": 9, + "FinishedAt": "2015-01-06T15:47:32.080254511Z", + "Health": { + "Status": "healthy", + "FailingStreak": 0, + "Log": [ + { + "Start": "2019-12-22T10:59:05.6385933Z", + "End": "2019-12-22T10:59:05.8078452Z", + "ExitCode": 0, + "Output": "" + } + ] + }, + "OOMKilled": false, + "Dead": false, + "Paused": false, + "Pid": 0, + "Restarting": false, + "Running": true, + "StartedAt": "2015-01-06T15:47:32.072697474Z", + "Status": "running" + }, + "Mounts": [ + { + "Name": "fac362...80535", + "Source": "/data", + "Destination": "/data", + "Driver": "local", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" + } + ] + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/top": { + "get": { + "tags": [ + "Container" + ], + "summary": "List processes running inside a container", + "description": "On Unix systems, this is done by running the `ps` command. This endpoint\nis not supported on Windows.\n", + "operationId": "ContainerTop", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "ps_args", + "in": "query", + "description": "The arguments to pass to `ps`. For example, `aux`", + "schema": { + "type": "string", + "default": "-ef" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "ContainerTopResponse", + "type": "object", + "properties": { + "Titles": { + "type": "array", + "description": "The ps column titles", + "items": { + "type": "string" + } + }, + "Processes": { + "type": "array", + "description": "Each process running in the container, where each is process\nis an array of values corresponding to the titles.\n", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "description": "OK response to ContainerTop operation" + }, + "example": { + "Titles": [ + "UID", + "PID", + "PPID", + "C", + "STIME", + "TTY", + "TIME", + "CMD" + ], + "Processes": [ + [ + "root", + "13642", + "882", + "0", + "17:03", + "pts/0", + "00:00:00", + "/bin/bash" + ], + [ + "root", + "13735", + "13642", + "0", + "17:06", + "pts/0", + "00:00:00", + "sleep 10" + ] + ] + } + }, + "text/plain": { + "schema": { + "title": "ContainerTopResponse", + "type": "object", + "properties": { + "Titles": { + "type": "array", + "description": "The ps column titles", + "items": { + "type": "string" + } + }, + "Processes": { + "type": "array", + "description": "Each process running in the container, where each is process\nis an array of values corresponding to the titles.\n", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "description": "OK response to ContainerTop operation" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/logs": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get container logs", + "description": "Get `stdout` and `stderr` logs from a container.\n\nNote: This endpoint works only for containers with the `json-file` or\n`journald` logging driver.\n", + "operationId": "ContainerLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "follow", + "in": "query", + "description": "Keep connection after returning logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "until", + "in": "query", + "description": "Only return logs before this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs.\nSpecify as an integer or `all` to output all log lines.\n", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "200": { + "description": "logs returned as a stream in response body.\nFor the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach).\nNote that unlike the attach endpoint, the logs endpoint does not\nupgrade the connection and does not set Content-Type.\n", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/changes": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get changes on a container’s filesystem", + "description": "Returns which files in a container's filesystem have been added, deleted,\nor modified. The `Kind` of modification can be one of:\n\n- `0`: Modified\n- `1`: Added\n- `2`: Deleted\n", + "operationId": "ContainerChanges", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The list of changes", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "ContainerChangeResponseItem", + "required": [ + "Kind", + "Path" + ], + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Path to file that has changed", + "nullable": false + }, + "Kind": { + "type": "integer", + "description": "Kind of change", + "format": "uint8", + "nullable": false + } + }, + "description": "change item in response to ContainerChanges operation", + "x-go-name": "ContainerChangeResponseItem" + } + }, + "example": [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/export": { + "get": { + "tags": [ + "Container" + ], + "summary": "Export a container", + "description": "Export the contents of a container as a tarball.", + "operationId": "ContainerExport", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/stats": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get container stats based on resource usage", + "description": "This endpoint returns a live stream of a container’s resource usage\nstatistics.\n\nThe `precpu_stats` is the CPU statistic of the *previous* read, and is\nused to calculate the CPU usage percentage. It is not an exact copy\nof the `cpu_stats` field.\n\nIf either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is\nnil then for compatibility with older daemons the length of the\ncorresponding `cpu_usage.percpu_usage` array should be used.\n\nOn a cgroup v2 host, the following fields are not set\n* `blkio_stats`: all fields other than `io_service_bytes_recursive`\n* `cpu_stats`: `cpu_usage.percpu_usage`\n* `memory_stats`: `max_usage` and `failcnt`\nAlso, `memory_stats.stats` fields are incompatible with cgroup v1.\n\nTo calculate the values shown by the `stats` command of the docker cli tool\nthe following formulas can be used:\n* used_memory = `memory_stats.usage - memory_stats.stats.cache`\n* available_memory = `memory_stats.limit`\n* Memory usage % = `(used_memory / available_memory) * 100.0`\n* cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage`\n* system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage`\n* number_cpus = `lenght(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus`\n* CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0`\n", + "operationId": "ContainerStats", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "stream", + "in": "query", + "description": "Stream the output. If false, the stats will be output once and then\nit will disconnect.\n", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "one-shot", + "in": "query", + "description": "Only get a single stat instead of waiting for 2 cycles. Must be used\nwith `stream=false`.\n", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "read": "2015-01-08T22:57:31.547920715Z", + "pids_stats": { + "current": 3 + }, + "networks": { + "eth0": { + "rx_bytes": 5338, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 36, + "tx_bytes": 648, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 8 + }, + "eth5": { + "rx_bytes": 4641, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 26, + "tx_bytes": 690, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 9 + } + }, + "memory_stats": { + "stats": { + "total_pgmajfault": 0, + "cache": 0, + "mapped_file": 0, + "total_inactive_file": 0, + "pgpgout": 414, + "rss": 6537216, + "total_mapped_file": 0, + "writeback": 0, + "unevictable": 0, + "pgpgin": 477, + "total_unevictable": 0, + "pgmajfault": 0, + "total_rss": 6537216, + "total_rss_huge": 6291456, + "total_writeback": 0, + "total_inactive_anon": 0, + "rss_huge": 6291456, + "hierarchical_memory_limit": 67108864, + "total_pgfault": 964, + "total_active_file": 0, + "active_anon": 6537216, + "total_active_anon": 6537216, + "total_pgpgout": 414, + "total_cache": 0, + "inactive_anon": 0, + "active_file": 0, + "pgfault": 964, + "inactive_file": 0, + "total_pgpgin": 477 + }, + "max_usage": 6651904, + "usage": 6537216, + "failcnt": 0, + "limit": 67108864 + }, + "blkio_stats": {}, + "cpu_stats": { + "cpu_usage": { + "percpu_usage": [ + 8646879, + 24472255, + 36438778, + 30657443 + ], + "usage_in_usermode": 50000000, + "total_usage": 100215355, + "usage_in_kernelmode": 30000000 + }, + "system_cpu_usage": 739306590000000, + "online_cpus": 4, + "throttling_data": { + "periods": 0, + "throttled_periods": 0, + "throttled_time": 0 + } + }, + "precpu_stats": { + "cpu_usage": { + "percpu_usage": [ + 8646879, + 24350896, + 36438778, + 30657443 + ], + "usage_in_usermode": 50000000, + "total_usage": 100093996, + "usage_in_kernelmode": 30000000 + }, + "system_cpu_usage": 9492140000000, + "online_cpus": 4, + "throttling_data": { + "periods": 0, + "throttled_periods": 0, + "throttled_time": 0 + } + } + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/resize": { + "post": { + "tags": [ + "Container" + ], + "summary": "Resize a container TTY", + "description": "Resize the TTY for a container.", + "operationId": "ContainerResize", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "h", + "in": "query", + "description": "Height of the TTY session in characters", + "schema": { + "type": "integer" + } + }, + { + "name": "w", + "in": "query", + "description": "Width of the TTY session in characters", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "cannot resize container", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/start": { + "post": { + "tags": [ + "Container" + ], + "summary": "Start a container", + "operationId": "ContainerStart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container. Format is a\nsingle character `[a-Z]` or `ctrl-` where `` is one\nof: `a-z`, `@`, `^`, `[`, `,` or `_`.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "304": { + "description": "container already started", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/stop": { + "post": { + "tags": [ + "Container" + ], + "summary": "Stop a container", + "operationId": "ContainerStop", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "t", + "in": "query", + "description": "Number of seconds to wait before killing the container", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "304": { + "description": "container already stopped", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/restart": { + "post": { + "tags": [ + "Container" + ], + "summary": "Restart a container", + "operationId": "ContainerRestart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "t", + "in": "query", + "description": "Number of seconds to wait before killing the container", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/kill": { + "post": { + "tags": [ + "Container" + ], + "summary": "Kill a container", + "description": "Send a POSIX signal to a container, defaulting to killing to the\ncontainer.\n", + "operationId": "ContainerKill", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "signal", + "in": "query", + "description": "Signal to send to the container as an integer or string (e.g. `SIGINT`)", + "schema": { + "type": "string", + "default": "SIGKILL" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "container is not running", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "Container d37cde0fe4ad63c3a7252023b2f9800282894247d145cb5933ddf6e52cc03a28 is not running" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/update": { + "post": { + "tags": [ + "Container" + ], + "summary": "Update a container", + "description": "Change various configuration options of a container without having to\nrecreate it.\n", + "operationId": "ContainerUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Resources" + }, + { + "type": "object", + "properties": { + "RestartPolicy": { + "$ref": "#/components/schemas/RestartPolicy" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The container has been updated.", + "content": { + "application/json": { + "schema": { + "title": "ContainerUpdateResponse", + "type": "object", + "properties": { + "Warnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "OK response to ContainerUpdate operation" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "update" + } + }, + "/containers/{id}/rename": { + "post": { + "tags": [ + "Container" + ], + "summary": "Rename a container", + "operationId": "ContainerRename", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "description": "New name for the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "name already in use", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/pause": { + "post": { + "tags": [ + "Container" + ], + "summary": "Pause a container", + "description": "Use the freezer cgroup to suspend all processes in a container.\n\nTraditionally, when suspending a process the `SIGSTOP` signal is used,\nwhich is observable by the process being suspended. With the freezer\ncgroup the process is unaware, and unable to capture, that it is being\nsuspended, and subsequently resumed.\n", + "operationId": "ContainerPause", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/unpause": { + "post": { + "tags": [ + "Container" + ], + "summary": "Unpause a container", + "description": "Resume a container which has been paused.", + "operationId": "ContainerUnpause", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/attach": { + "post": { + "tags": [ + "Container" + ], + "summary": "Attach to a container", + "description": "Attach to a container to read its output or send it input. You can attach\nto the same container multiple times and you can reattach to containers\nthat have been detached.\n\nEither the `stream` or `logs` parameter must be `true` for this endpoint\nto do anything.\n\nSee the [documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/)\nfor more details.\n\n### Hijacking\n\nThis endpoint hijacks the HTTP connection to transport `stdin`, `stdout`,\nand `stderr` on the same socket.\n\nThis is the response from the daemon for an attach request:\n\n```\nHTTP/1.1 200 OK\nContent-Type: application/vnd.docker.raw-stream\n\n[STREAM]\n```\n\nAfter the headers and two new lines, the TCP connection can now be used\nfor raw, bidirectional communication between the client and server.\n\nTo hint potential proxies about connection hijacking, the Docker client\ncan also optionally send connection upgrade headers.\n\nFor example, the client sends this request to upgrade the connection:\n\n```\nPOST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1\nUpgrade: tcp\nConnection: Upgrade\n```\n\nThe Docker daemon will respond with a `101 UPGRADED` response, and will\nsimilarly follow with the raw stream:\n\n```\nHTTP/1.1 101 UPGRADED\nContent-Type: application/vnd.docker.raw-stream\nConnection: Upgrade\nUpgrade: tcp\n\n[STREAM]\n```\n\n### Stream format\n\nWhen the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate),\nthe stream over the hijacked connected is multiplexed to separate out\n`stdout` and `stderr`. The stream consists of a series of frames, each\ncontaining a header and a payload.\n\nThe header contains the information which the stream writes (`stdout` or\n`stderr`). It also contains the size of the associated frame encoded in\nthe last four bytes (`uint32`).\n\nIt is encoded on the first eight bytes like this:\n\n```go\nheader := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n```\n\n`STREAM_TYPE` can be:\n\n- 0: `stdin` (is written on `stdout`)\n- 1: `stdout`\n- 2: `stderr`\n\n`SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size\nencoded as big endian.\n\nFollowing the header is the payload, which is the specified number of\nbytes of `STREAM_TYPE`.\n\nThe simplest way to implement this protocol is the following:\n\n1. Read 8 bytes.\n2. Choose `stdout` or `stderr` depending on the first byte.\n3. Extract the frame size from the last four bytes.\n4. Read the extracted size and output it on the correct output.\n5. Goto 1.\n\n### Stream format when using a TTY\n\nWhen the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate),\nthe stream is not multiplexed. The data exchanged over the hijacked\nconnection is simply the raw data from the process PTY and client's\n`stdin`.\n", + "operationId": "ContainerAttach", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container.Format is a single\ncharacter `[a-Z]` or `ctrl-` where `` is one of: `a-z`,\n`@`, `^`, `[`, `,` or `_`.\n", + "schema": { + "type": "string" + } + }, + { + "name": "logs", + "in": "query", + "description": "Replay previous logs from the container.\n\nThis is useful for attaching to a container that has started and you\nwant to output everything since the container started.\n\nIf `stream` is also enabled, once all the previous output has been\nreturned, it will seamlessly transition into streaming current\noutput.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stream", + "in": "query", + "description": "Stream attached streams from the time the request was made onwards.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdin", + "in": "query", + "description": "Attach to `stdin`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Attach to `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Attach to `stderr`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "101": { + "description": "no error, hints proxy about hijacking", + "content": {} + }, + "200": { + "description": "no error, no upgrade header found", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/attach/ws": { + "get": { + "tags": [ + "Container" + ], + "summary": "Attach to a container via a websocket", + "operationId": "ContainerAttachWebsocket", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container.Format is a single\ncharacter `[a-Z]` or `ctrl-` where `` is one of: `a-z`,\n`@`, `^`, `[`, `,`, or `_`.\n", + "schema": { + "type": "string" + } + }, + { + "name": "logs", + "in": "query", + "description": "Return logs", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stream", + "in": "query", + "description": "Return stream", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdin", + "in": "query", + "description": "Attach to `stdin`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Attach to `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Attach to `stderr`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "101": { + "description": "no error, hints proxy about hijacking", + "content": {} + }, + "200": { + "description": "no error, no upgrade header found", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/wait": { + "post": { + "tags": [ + "Container" + ], + "summary": "Wait for a container", + "description": "Block until a container stops, then returns the exit code.", + "operationId": "ContainerWait", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "condition", + "in": "query", + "description": "Wait until a container state reaches the given condition, either\n'not-running' (default), 'next-exit', or 'removed'.\n", + "schema": { + "type": "string", + "default": "not-running" + } + } + ], + "responses": { + "200": { + "description": "The container has exit.", + "content": { + "application/json": { + "schema": { + "title": "ContainerWaitResponse", + "required": [ + "StatusCode" + ], + "type": "object", + "properties": { + "StatusCode": { + "type": "integer", + "description": "Exit code of the container", + "nullable": false + }, + "Error": { + "type": "object", + "properties": { + "Message": { + "type": "string", + "description": "Details of an error" + } + }, + "description": "container waiting error, if any" + } + }, + "description": "OK response to ContainerWait operation" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}": { + "delete": { + "tags": [ + "Container" + ], + "summary": "Remove a container", + "operationId": "ContainerDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "v", + "in": "query", + "description": "Remove anonymous volumes associated with the container.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "force", + "in": "query", + "description": "If the container is running, kill it before removing it.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "link", + "in": "query", + "description": "Remove the specified link associated with the container.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "You cannot remove a running container: c2ada9df5af8. Stop the\ncontainer before attempting removal or force remove\n" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/archive": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get an archive of a filesystem resource in a container", + "description": "Get a tar archive of a resource in the filesystem of container id.", + "operationId": "ContainerArchive", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Resource in the container’s filesystem to archive.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/x-tar": { + "schema": { + "type": "object", + "properties": { + "ErrorResponse": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "message": { + "type": "string", + "description": "The error message. Either \"must specify path parameter\"\n(path cannot be empty) or \"not a directory\" (path was\nasserted to be a directory but exists as a file).\n", + "nullable": false + } + } + } + } + } + }, + "404": { + "description": "Container or path does not exist", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Container" + ], + "summary": "Extract an archive of files or folders to a directory in a container", + "description": "Upload a tar archive to be extracted to a path in the filesystem of container id.", + "operationId": "PutContainerArchive", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Path to a directory in the container to extract the archive’s contents into. ", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "noOverwriteDirNonDir", + "in": "query", + "description": "If `1`, `true`, or `True` then it will be an error if unpacking the\ngiven content would cause an existing directory to be replaced with\na non-directory and vice versa.\n", + "schema": { + "type": "string" + } + }, + { + "name": "copyUIDGID", + "in": "query", + "description": "If `1`, `true`, then it will copy UID/GID maps to the dest file or\ndir\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The input stream must be a tar archive compressed with one of the\nfollowing algorithms: `identity` (no compression), `gzip`, `bzip2`,\nor `xz`.\n", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The content was extracted successfully", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "Permission denied, the volume or container rootfs is marked as read-only.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "No such container or path does not exist inside the container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputStream" + }, + "head": { + "tags": [ + "Container" + ], + "summary": "Get information about files in a container", + "description": "A response header `X-Docker-Container-Path-Stat` is returned, containing\na base64 - encoded JSON object with some filesystem header information\nabout the path.\n", + "operationId": "ContainerArchiveInfo", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Resource in the container’s filesystem to archive.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "headers": { + "X-Docker-Container-Path-Stat": { + "description": "A base64 - encoded JSON object with some filesystem header\ninformation about the path\n", + "schema": { + "type": "string" + } + } + }, + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ErrorResponse": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "message": { + "type": "string", + "description": "The error message. Either \"must specify path parameter\"\n(path cannot be empty) or \"not a directory\" (path was\nasserted to be a directory but exists as a file).\n", + "nullable": false + } + } + } + }, + "text/plain": { + "schema": { + "type": "object", + "properties": { + "ErrorResponse": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "message": { + "type": "string", + "description": "The error message. Either \"must specify path parameter\"\n(path cannot be empty) or \"not a directory\" (path was\nasserted to be a directory but exists as a file).\n", + "nullable": false + } + } + } + } + } + }, + "404": { + "description": "Container or path does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/prune": { + "post": { + "tags": [ + "Container" + ], + "summary": "Delete stopped containers", + "operationId": "ContainerPrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `until=` Prune containers created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune containers with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ContainerPruneResponse", + "type": "object", + "properties": { + "ContainersDeleted": { + "type": "array", + "description": "Container IDs that were deleted", + "items": { + "type": "string" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/json": { + "get": { + "tags": [ + "Image" + ], + "summary": "List Images", + "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.", + "operationId": "ImageList", + "parameters": [ + { + "name": "all", + "in": "query", + "description": "Show all images. Only images from a final layer (no children) are shown by default.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the images list.\n\nAvailable filters:\n\n- `before`=(`[:]`, `` or ``)\n- `dangling=true`\n- `label=key` or `label=\"key=value\"` of an image label\n- `reference`=(`[:]`)\n- `since`=(`[:]`, `` or ``)\n", + "schema": { + "type": "string" + } + }, + { + "name": "digests", + "in": "query", + "description": "Show digest information as a `RepoDigests` field on each image.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Summary image data for the images matching the query", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + }, + "example": [ + { + "Id": "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8", + "ParentId": "", + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise" + ], + "RepoDigests": [ + "ubuntu@sha256:992069aee4016783df6345315302fa59681aae51a8eeb2f889dea59290f21787" + ], + "Created": 1474925151, + "Size": 103579269, + "VirtualSize": 103579269, + "SharedSize": 0, + "Labels": {}, + "Containers": 2 + }, + { + "Id": "sha256:3e314f95dcace0f5e4fd37b10862fe8398e3c60ed36600bc0ca5fda78b087175", + "ParentId": "", + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "RepoDigests": [ + "ubuntu@sha256:002fba3e3255af10be97ea26e476692a7ebed0bb074a9ab960b2e7a1526b15d7", + "ubuntu@sha256:68ea0200f0b90df725d99d823905b04cf844f6039ef60c60bf3e019915017bd3" + ], + "Created": 1403128455, + "Size": 172064416, + "VirtualSize": 172064416, + "SharedSize": 0, + "Labels": {}, + "Containers": 5 + } + ] + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/build": { + "post": { + "tags": [ + "Image" + ], + "summary": "Build an image", + "description": "Build an image from a tar archive with a `Dockerfile` in it.\n\nThe `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/).\n\nThe 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.\n\nThe build is canceled if the client drops the connection by quitting or being killed.\n", + "operationId": "ImageBuild", + "parameters": [ + { + "name": "dockerfile", + "in": "query", + "description": "Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`.", + "schema": { + "type": "string", + "default": "Dockerfile" + } + }, + { + "name": "t", + "in": "query", + "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.", + "schema": { + "type": "string" + } + }, + { + "name": "extrahosts", + "in": "query", + "description": "Extra hosts to add to /etc/hosts", + "schema": { + "type": "string" + } + }, + { + "name": "remote", + "in": "query", + "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.", + "schema": { + "type": "string" + } + }, + { + "name": "q", + "in": "query", + "description": "Suppress verbose build output.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "nocache", + "in": "query", + "description": "Do not use the cache when building the image.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "cachefrom", + "in": "query", + "description": "JSON array of images used for build cache resolution.", + "schema": { + "type": "string" + } + }, + { + "name": "pull", + "in": "query", + "description": "Attempt to pull the image even if an older image exists locally.", + "schema": { + "type": "string" + } + }, + { + "name": "rm", + "in": "query", + "description": "Remove intermediate containers after a successful build.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "forcerm", + "in": "query", + "description": "Always remove intermediate containers, even upon failure.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "memory", + "in": "query", + "description": "Set memory limit for build.", + "schema": { + "type": "integer" + } + }, + { + "name": "memswap", + "in": "query", + "description": "Total memory (memory + swap). Set as `-1` to disable swap.", + "schema": { + "type": "integer" + } + }, + { + "name": "cpushares", + "in": "query", + "description": "CPU shares (relative weight).", + "schema": { + "type": "integer" + } + }, + { + "name": "cpusetcpus", + "in": "query", + "description": "CPUs in which to allow execution (e.g., `0-3`, `0,1`).", + "schema": { + "type": "string" + } + }, + { + "name": "cpuperiod", + "in": "query", + "description": "The length of a CPU period in microseconds.", + "schema": { + "type": "integer" + } + }, + { + "name": "cpuquota", + "in": "query", + "description": "Microseconds of CPU time that the container can get in a CPU period.", + "schema": { + "type": "integer" + } + }, + { + "name": "buildargs", + "in": "query", + "description": "JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values.\n\nFor example, the build arg `FOO=bar` would become `{\"FOO\":\"bar\"}` in JSON. This would result in the the query parameter `buildargs={\"FOO\":\"bar\"}`. Note that `{\"FOO\":\"bar\"}` should be URI component encoded.\n\n[Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg)\n", + "schema": { + "type": "string" + } + }, + { + "name": "shmsize", + "in": "query", + "description": "Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB.", + "schema": { + "type": "integer" + } + }, + { + "name": "squash", + "in": "query", + "description": "Squash the resulting images layers into a single layer. *(Experimental release only.)*", + "schema": { + "type": "boolean" + } + }, + { + "name": "labels", + "in": "query", + "description": "Arbitrary key/value labels to set on the image, as a JSON map of string pairs.", + "schema": { + "type": "string" + } + }, + { + "name": "networkmode", + "in": "query", + "description": "Sets the networking mode for the run commands during build. Supported\nstandard values are: `bridge`, `host`, `none`, and `container:`.\nAny other value is taken as a custom network's name or ID to which this\ncontainer should connect to.\n", + "schema": { + "type": "string" + } + }, + { + "name": "Content-type", + "in": "header", + "schema": { + "type": "string", + "default": "application/x-tar", + "enum": [ + "application/x-tar" + ] + } + }, + { + "name": "X-Registry-Config", + "in": "header", + "description": "This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to.\n\nThe key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example:\n\n```\n{\n \"docker.example.com\": {\n \"username\": \"janedoe\",\n \"password\": \"hunter2\"\n },\n \"https://index.docker.io/v1/\": {\n \"username\": \"mobydock\",\n \"password\": \"conta1n3rize14\"\n }\n}\n```\n\nOnly 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.\n", + "schema": { + "type": "string" + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform in the format os[/arch[/variant]]", + "schema": { + "type": "string" + } + }, + { + "name": "target", + "in": "query", + "description": "Target build stage", + "schema": { + "type": "string" + } + }, + { + "name": "outputs", + "in": "query", + "description": "BuildKit output configuration", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz.", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputStream" + } + }, + "/build/prune": { + "post": { + "tags": [ + "Image" + ], + "summary": "Delete builder cache", + "operationId": "BuildPrune", + "parameters": [ + { + "name": "keep-storage", + "in": "query", + "description": "Amount of disk space in bytes to keep for cache", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "all", + "in": "query", + "description": "Remove all types of build cache", + "schema": { + "type": "boolean" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the list of build cache objects.\n\nAvailable filters:\n\n- `until=`: duration relative to daemon's time, during which build cache was not used, in Go's duration format (e.g., '24h')\n- `id=`\n- `parent=`\n- `type=`\n- `description=`\n- `inuse`\n- `shared`\n- `private`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "BuildPruneResponse", + "type": "object", + "properties": { + "CachesDeleted": { + "type": "array", + "items": { + "type": "string", + "description": "ID of build cache object" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/create": { + "post": { + "tags": [ + "Image" + ], + "summary": "Create an image", + "description": "Create an image by either pulling it from a registry or importing it.", + "operationId": "ImageCreate", + "parameters": [ + { + "name": "fromImage", + "in": "query", + "description": "Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed.", + "schema": { + "type": "string" + } + }, + { + "name": "fromSrc", + "in": "query", + "description": "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image.", + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled.", + "schema": { + "type": "string" + } + }, + { + "name": "message", + "in": "query", + "description": "Set commit message for imported image.", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform in the format os[/arch[/variant]]", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Image content if the value `-` has been specified in fromSrc query parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/octet-stream": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "repository does not exist or no read access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputImage" + } + }, + "/images/{name}/json": { + "get": { + "tags": [ + "Image" + ], + "summary": "Inspect an image", + "description": "Return low-level information about an image.", + "operationId": "ImageInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Image" + }, + "example": { + "Id": "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c", + "Container": "cb91e48a60d01f1e27028b4fc6819f4f290b3cf12496c8176ec714d0d390984a", + "Comment": "", + "Os": "linux", + "Architecture": "amd64", + "Parent": "sha256:91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "ContainerConfig": { + "Tty": false, + "Hostname": "e611e15f9c9d", + "Domainname": "", + "AttachStdout": false, + "PublishService": "", + "AttachStdin": false, + "OpenStdin": false, + "StdinOnce": false, + "NetworkDisabled": false, + "OnBuild": [], + "Image": "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "User": "", + "WorkingDir": "", + "MacAddress": "", + "AttachStderr": false, + "Labels": { + "com.example.license": "GPL", + "com.example.version": "1.0", + "com.example.vendor": "Acme" + }, + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Cmd": [ + "/bin/sh", + "-c", + "#(nop) LABEL com.example.vendor=Acme com.example.license=GPL com.example.version=1.0" + ] + }, + "DockerVersion": "1.9.0-dev", + "VirtualSize": 188359297, + "Size": 0, + "Author": "", + "Created": "2015-09-10T08:30:53.26995814Z", + "GraphDriver": { + "Name": "aufs", + "Data": {} + }, + "RepoDigests": [ + "localhost:5000/test/busybox/example@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf" + ], + "RepoTags": [ + "example:1.0", + "example:latest", + "example:stable" + ], + "Config": { + "Image": "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "NetworkDisabled": false, + "OnBuild": [], + "StdinOnce": false, + "PublishService": "", + "AttachStdin": false, + "OpenStdin": false, + "Domainname": "", + "AttachStdout": false, + "Tty": false, + "Hostname": "e611e15f9c9d", + "Cmd": [ + "/bin/bash" + ], + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Labels": { + "com.example.vendor": "Acme", + "com.example.version": "1.0", + "com.example.license": "GPL" + }, + "MacAddress": "", + "AttachStderr": false, + "WorkingDir": "", + "User": "" + }, + "RootFS": { + "Type": "layers", + "Layers": [ + "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6", + "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" + ] + } + } + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such image: someimage (tag: latest)" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/history": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get the history of an image", + "description": "Return parent layers of an image.", + "operationId": "ImageHistory", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "List of image layers", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "HistoryResponseItem", + "required": [ + "Comment", + "Created", + "CreatedBy", + "Id", + "Size", + "Tags" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": false + }, + "Created": { + "type": "integer", + "format": "int64", + "nullable": false + }, + "CreatedBy": { + "type": "string", + "nullable": false + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "Size": { + "type": "integer", + "format": "int64", + "nullable": false + }, + "Comment": { + "type": "string", + "nullable": false + } + }, + "description": "individual image layer information in response to ImageHistory operation", + "x-go-name": "HistoryResponseItem" + } + }, + "example": [ + { + "Id": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710", + "Created": 1398108230, + "CreatedBy": "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /", + "Tags": [ + "ubuntu:lucid", + "ubuntu:10.04" + ], + "Size": 182964289, + "Comment": "" + }, + { + "Id": "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8", + "Created": 1398108222, + "CreatedBy": "/bin/sh -c #(nop) MAINTAINER Tianon Gravi - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/", + "Tags": [], + "Size": 0, + "Comment": "" + }, + { + "Id": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158", + "Created": 1371157430, + "CreatedBy": "", + "Tags": [ + "scratch12:latest", + "scratch:latest" + ], + "Size": 0, + "Comment": "Imported from -" + } + ] + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/push": { + "post": { + "tags": [ + "Image" + ], + "summary": "Push an image", + "description": "Push an image to a registry.\n\nIf you wish to push an image on to a private registry, that image must\nalready have a tag which references the registry. For example,\n`registry.example.com/myimage:latest`.\n\nThe push is cancelled if the HTTP connection is closed.\n", + "operationId": "ImagePush", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag to associate with the image on the registry.", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/tag": { + "post": { + "tags": [ + "Image" + ], + "summary": "Tag an image", + "description": "Tag an image so that it becomes part of a repository.", + "operationId": "ImageTag", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID to tag.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "The repository to tag in. For example, `someuser/someimage`.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The name of the new tag.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "No error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}": { + "delete": { + "tags": [ + "Image" + ], + "summary": "Remove an image", + "description": "Remove an image, along with any untagged parent images that were\nreferenced by that image.\n\nImages can't be removed if they have descendant images, are being\nused by a running container or are being used by a build.\n", + "operationId": "ImageDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Remove the image even if it is being used by stopped containers or has other tags", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "noprune", + "in": "query", + "description": "Do not delete untagged parent images", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "The image was deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageDeleteResponseItem" + } + }, + "example": [ + { + "Untagged": "3e2f21a89f" + }, + { + "Deleted": "3e2f21a89f" + }, + { + "Deleted": "53b4f83ac9" + } + ] + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/search": { + "get": { + "tags": [ + "Image" + ], + "summary": "Search images", + "description": "Search for an image on Docker Hub.", + "operationId": "ImageSearch", + "parameters": [ + { + "name": "term", + "in": "query", + "description": "Term to search", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "schema": { + "type": "integer" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:\n\n- `is-automated=(true|false)`\n- `is-official=(true|false)`\n- `stars=` Matches images that has at least 'number' stars.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "ImageSearchResponseItem", + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "is_official": { + "type": "boolean" + }, + "is_automated": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "star_count": { + "type": "integer" + } + } + } + }, + "example": [ + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ] + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/prune": { + "post": { + "tags": [ + "Image" + ], + "summary": "Delete unused images", + "operationId": "ImagePrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters:\n\n- `dangling=` When set to `true` (or `1`), prune only\n unused *and* untagged images. When set to `false`\n (or `0`), all unused images are pruned.\n- `until=` Prune images created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune images with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ImagePruneResponse", + "type": "object", + "properties": { + "ImagesDeleted": { + "type": "array", + "description": "Images that were deleted", + "items": { + "$ref": "#/components/schemas/ImageDeleteResponseItem" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/auth": { + "post": { + "tags": [ + "System" + ], + "summary": "Check auth configuration", + "description": "Validate credentials for a registry and, if available, get an identity\ntoken for accessing the registry without password.\n", + "operationId": "SystemAuth", + "requestBody": { + "description": "Authentication to check", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthConfig" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "An identity token was generated successfully.", + "content": { + "application/json": { + "schema": { + "title": "SystemAuthResponse", + "required": [ + "Status" + ], + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "The status of the authentication", + "nullable": false + }, + "IdentityToken": { + "type": "string", + "description": "An opaque token used to authenticate a user after a successful login", + "nullable": false + } + } + }, + "example": { + "Status": "Login Succeeded", + "IdentityToken": "9cbaf023786cd7..." + } + } + } + }, + "204": { + "description": "No error", + "content": {} + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "authConfig" + } + }, + "/info": { + "get": { + "tags": [ + "System" + ], + "summary": "Get system information", + "operationId": "SystemInfo", + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/version": { + "get": { + "tags": [ + "System" + ], + "summary": "Get version", + "description": "Returns the version of Docker that is running and various information about the system that Docker is running on.", + "operationId": "SystemVersion", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemVersion" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/_ping": { + "get": { + "tags": [ + "System" + ], + "summary": "Ping", + "description": "This is a dummy endpoint you can use to test if the server is accessible.", + "operationId": "SystemPing", + "responses": { + "200": { + "description": "no error", + "headers": { + "Docker-Experimental": { + "description": "If the server is running with experimental mode enabled", + "schema": { + "type": "boolean" + } + }, + "Cache-Control": { + "schema": { + "type": "string", + "default": "no-cache, no-store, must-revalidate" + } + }, + "Pragma": { + "schema": { + "type": "string", + "default": "no-cache" + } + }, + "API-Version": { + "description": "Max API Version the server supports", + "schema": { + "type": "string" + } + }, + "Builder-Version": { + "description": "Default version of docker image builder", + "schema": { + "type": "string" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string", + "example": "OK" + } + } + } + }, + "500": { + "description": "server error", + "headers": { + "Cache-Control": { + "schema": { + "type": "string", + "default": "no-cache, no-store, must-revalidate" + } + }, + "Pragma": { + "schema": { + "type": "string", + "default": "no-cache" + } + } + }, + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "head": { + "tags": [ + "System" + ], + "summary": "Ping", + "description": "This is a dummy endpoint you can use to test if the server is accessible.", + "operationId": "SystemPingHead", + "responses": { + "200": { + "description": "no error", + "headers": { + "Docker-Experimental": { + "description": "If the server is running with experimental mode enabled", + "schema": { + "type": "boolean" + } + }, + "Cache-Control": { + "schema": { + "type": "string", + "default": "no-cache, no-store, must-revalidate" + } + }, + "Pragma": { + "schema": { + "type": "string", + "default": "no-cache" + } + }, + "API-Version": { + "description": "Max API Version the server supports", + "schema": { + "type": "string" + } + }, + "Builder-Version": { + "description": "Default version of docker image builder", + "schema": { + "type": "string" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string", + "example": "(empty)" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/commit": { + "post": { + "tags": [ + "Image" + ], + "summary": "Create a new image from a container", + "operationId": "ImageCommit", + "parameters": [ + { + "name": "container", + "in": "query", + "description": "The ID or name of the container to commit", + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "Repository name for the created image", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "Tag name for the create image", + "schema": { + "type": "string" + } + }, + { + "name": "comment", + "in": "query", + "description": "Commit message", + "schema": { + "type": "string" + } + }, + { + "name": "author", + "in": "query", + "description": "Author of the image (e.g., `John Hannibal Smith `)", + "schema": { + "type": "string" + } + }, + { + "name": "pause", + "in": "query", + "description": "Whether to pause the container before committing", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "changes", + "in": "query", + "description": "`Dockerfile` instructions to apply while committing", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The container configuration", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContainerConfig" + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "containerConfig" + } + }, + "/events": { + "get": { + "tags": [ + "System" + ], + "summary": "Monitor events", + "description": "Stream real-time events from the server.\n\nVarious objects within Docker report events when something happens to them.\n\nContainers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune`\n\nImages report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune`\n\nVolumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune`\n\nNetworks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune`\n\nThe Docker daemon reports these events: `reload`\n\nServices report these events: `create`, `update`, and `remove`\n\nNodes report these events: `create`, `update`, and `remove`\n\nSecrets report these events: `create`, `update`, and `remove`\n\nConfigs report these events: `create`, `update`, and `remove`\n\nThe Builder reports `prune` events\n", + "operationId": "SystemEvents", + "parameters": [ + { + "name": "since", + "in": "query", + "description": "Show events created since this timestamp then stream new events.", + "schema": { + "type": "string" + } + }, + { + "name": "until", + "in": "query", + "description": "Show events created until this timestamp then stop streaming.", + "schema": { + "type": "string" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters:\n\n- `config=` config name or ID\n- `container=` container name or ID\n- `daemon=` daemon name or ID\n- `event=` event type\n- `image=` image name or ID\n- `label=` image or container label\n- `network=` network name or ID\n- `node=` node ID\n- `plugin`= plugin name or ID\n- `scope`= local or swarm\n- `secret=` secret name or ID\n- `service=` service name or ID\n- `type=` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config`\n- `volume=` volume name\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "SystemEventsResponse", + "type": "object", + "properties": { + "Type": { + "type": "string", + "description": "The type of object emitting the event" + }, + "Action": { + "type": "string", + "description": "The type of event" + }, + "Actor": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the object emitting the event" + }, + "Attributes": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Various key/value attributes of the object, depending on its type" + } + } + }, + "time": { + "type": "integer", + "description": "Timestamp of event" + }, + "timeNano": { + "type": "integer", + "description": "Timestamp of event, with nanosecond accuracy", + "format": "int64" + } + } + }, + "example": { + "Type": "container", + "Action": "create", + "Actor": { + "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "Attributes": { + "com.example.some-label": "some-label-value", + "image": "alpine", + "name": "my-container" + } + }, + "time": 1461943101 + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/system/df": { + "get": { + "tags": [ + "System" + ], + "summary": "Get data usage information", + "operationId": "SystemDataUsage", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "SystemDataUsageResponse", + "type": "object", + "properties": { + "LayersSize": { + "type": "integer", + "format": "int64" + }, + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + }, + "Containers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerSummary" + } + }, + "Volumes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Volume" + } + }, + "BuildCache": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BuildCache" + } + } + }, + "example": { + "LayersSize": 1092588, + "Images": [ + { + "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "ParentId": "", + "RepoTags": [ + "busybox:latest" + ], + "RepoDigests": [ + "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + ], + "Created": 1466724217, + "Size": 1092588, + "SharedSize": 0, + "VirtualSize": 1092588, + "Labels": {}, + "Containers": 1 + } + ], + "Containers": [ + { + "Id": "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148", + "Names": [ + "/top" + ], + "Image": "busybox", + "ImageID": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "Command": "top", + "Created": 1472592424, + "Ports": [], + "SizeRootFs": 1092588, + "Labels": {}, + "State": "exited", + "Status": "Exited (0) 56 minutes ago", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92", + "EndpointID": "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a", + "Gateway": "172.18.0.1", + "IPAddress": "172.18.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Mounts": [] + } + ], + "Volumes": [ + { + "Name": "my-volume", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/my-volume/_data", + "Scope": "local", + "UsageData": { + "Size": 10920104, + "RefCount": 2 + } + } + ] + } + } + }, + "text/plain": { + "schema": { + "title": "SystemDataUsageResponse", + "type": "object", + "properties": { + "LayersSize": { + "type": "integer", + "format": "int64" + }, + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + }, + "Containers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerSummary" + } + }, + "Volumes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Volume" + } + }, + "BuildCache": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BuildCache" + } + } + }, + "example": { + "LayersSize": 1092588, + "Images": [ + { + "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "ParentId": "", + "RepoTags": [ + "busybox:latest" + ], + "RepoDigests": [ + "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + ], + "Created": 1466724217, + "Size": 1092588, + "SharedSize": 0, + "VirtualSize": 1092588, + "Labels": {}, + "Containers": 1 + } + ], + "Containers": [ + { + "Id": "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148", + "Names": [ + "/top" + ], + "Image": "busybox", + "ImageID": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "Command": "top", + "Created": 1472592424, + "Ports": [], + "SizeRootFs": 1092588, + "Labels": {}, + "State": "exited", + "Status": "Exited (0) 56 minutes ago", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92", + "EndpointID": "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a", + "Gateway": "172.18.0.1", + "IPAddress": "172.18.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Mounts": [] + } + ], + "Volumes": [ + { + "Name": "my-volume", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/my-volume/_data", + "Scope": "local", + "UsageData": { + "Size": 10920104, + "RefCount": 2 + } + } + ] + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/get": { + "get": { + "tags": [ + "Image" + ], + "summary": "Export an image", + "description": "Get a tarball containing all images and metadata for a repository.\n\nIf `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.\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID), each containing these files:\n\n- `VERSION`: currently `1.0` - the file format version\n- `json`: detailed layer information, similar to `docker inspect layer_id`\n- `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions.\n\nIf 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.\n\n```json\n{\n \"hello-world\": {\n \"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"\n }\n}\n```\n", + "operationId": "ImageGet", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/get": { + "get": { + "tags": [ + "Image" + ], + "summary": "Export several images", + "description": "Get a tarball containing all images and metadata for several image\nrepositories.\n\nFor each value of the `names` parameter: if it is a specific name and\ntag (e.g. `ubuntu:latest`), then only that image (and its parents) are\nreturned; if it is an image ID, similarly only that image (and its parents)\nare returned and there would be no names referenced in the 'repositories'\nfile for this image ID.\n\nFor details on the format, see the [export image endpoint](#operation/ImageGet).\n", + "operationId": "ImageGetAll", + "parameters": [ + { + "name": "names", + "in": "query", + "description": "Image names to filter by", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/load": { + "post": { + "tags": [ + "Image" + ], + "summary": "Import images", + "description": "Load a set of images and tags into a repository.\n\nFor details on the format, see the [export image endpoint](#operation/ImageGet).\n", + "operationId": "ImageLoad", + "parameters": [ + { + "name": "quiet", + "in": "query", + "description": "Suppress progress details during load.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "Tar archive containing images", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "imagesTarball" + } + }, + "/containers/{id}/exec": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Create an exec instance", + "description": "Run a command inside a running container.", + "operationId": "ContainerExec", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Exec configuration", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "AttachStdin": { + "type": "boolean", + "description": "Attach to `stdin` of the exec command." + }, + "AttachStdout": { + "type": "boolean", + "description": "Attach to `stdout` of the exec command." + }, + "AttachStderr": { + "type": "boolean", + "description": "Attach to `stderr` of the exec command." + }, + "DetachKeys": { + "type": "string", + "description": "Override the key sequence for detaching a container. Format is\na single character `[a-Z]` or `ctrl-` where ``\nis one of: `a-z`, `@`, `^`, `[`, `,` or `_`.\n" + }, + "Tty": { + "type": "boolean", + "description": "Allocate a pseudo-TTY." + }, + "Env": { + "type": "array", + "description": "A list of environment variables in the form `[\"VAR=value\", ...]`.\n", + "items": { + "type": "string" + } + }, + "Cmd": { + "type": "array", + "description": "Command to run, as a string or array of strings.", + "items": { + "type": "string" + } + }, + "Privileged": { + "type": "boolean", + "description": "Runs the exec process with extended privileges.", + "default": false + }, + "User": { + "type": "string", + "description": "The user, and optionally, group to run the exec process inside\nthe container. Format is one of: `user`, `user:group`, `uid`,\nor `uid:gid`.\n" + }, + "WorkingDir": { + "type": "string", + "description": "The working directory for the exec process inside the container.\n" + } + }, + "example": { + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "DetachKeys": "ctrl-p,ctrl-q", + "Tty": false, + "Cmd": [ + "date" + ], + "Env": [ + "FOO=bar", + "BAZ=quux" + ] + } + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "409": { + "description": "container is paused", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "execConfig" + } + }, + "/exec/{id}/start": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Start an exec instance", + "description": "Starts a previously set up exec instance. If detach is true, this endpoint\nreturns immediately after starting the command. Otherwise, it sets up an\ninteractive session with the command.\n", + "operationId": "ExecStart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "Detach": { + "type": "boolean", + "description": "Detach from the command." + }, + "Tty": { + "type": "boolean", + "description": "Allocate a pseudo-TTY." + } + }, + "example": { + "Detach": false, + "Tty": false + } + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "404": { + "description": "No such exec instance", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Container is stopped or paused", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "execStartConfig" + } + }, + "/exec/{id}/resize": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Resize an exec instance", + "description": "Resize the TTY session used by an exec instance. This endpoint only works\nif `tty` was specified as part of creating and starting the exec instance.\n", + "operationId": "ExecResize", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "h", + "in": "query", + "description": "Height of the TTY session in characters", + "schema": { + "type": "integer" + } + }, + { + "name": "w", + "in": "query", + "description": "Width of the TTY session in characters", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "201": { + "description": "No error", + "content": {} + }, + "404": { + "description": "No such exec instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/exec/{id}/json": { + "get": { + "tags": [ + "Exec" + ], + "summary": "Inspect an exec instance", + "description": "Return low-level information about an exec instance.", + "operationId": "ExecInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ExecInspectResponse", + "type": "object", + "properties": { + "CanRemove": { + "type": "boolean" + }, + "DetachKeys": { + "type": "string" + }, + "ID": { + "type": "string" + }, + "Running": { + "type": "boolean" + }, + "ExitCode": { + "type": "integer" + }, + "ProcessConfig": { + "$ref": "#/components/schemas/ProcessConfig" + }, + "OpenStdin": { + "type": "boolean" + }, + "OpenStderr": { + "type": "boolean" + }, + "OpenStdout": { + "type": "boolean" + }, + "ContainerID": { + "type": "string" + }, + "Pid": { + "type": "integer", + "description": "The system process ID for the exec process." + } + } + }, + "example": { + "CanRemove": false, + "ContainerID": "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126", + "DetachKeys": "", + "ExitCode": 2, + "ID": "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b", + "OpenStderr": true, + "OpenStdin": true, + "OpenStdout": true, + "ProcessConfig": { + "arguments": [ + "-c", + "exit 2" + ], + "entrypoint": "sh", + "privileged": false, + "tty": true, + "user": "1000" + }, + "Running": false, + "Pid": 42000 + } + } + } + }, + "404": { + "description": "No such exec instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes": { + "get": { + "tags": [ + "Volume" + ], + "summary": "List volumes", + "operationId": "VolumeList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the volumes list. Available filters:\n\n- `dangling=` When set to `true` (or `1`), returns all\n volumes that are not in use by a container. When set to `false`\n (or `0`), only volumes that are in use by one or more\n containers are returned.\n- `driver=` Matches volumes based on their driver.\n- `label=` or `label=:` Matches volumes based on\n the presence of a `label` alone or a `label` and a value.\n- `name=` Matches all or part of a volume name.\n", + "schema": { + "type": "string", + "format": "json" + } + } + ], + "responses": { + "200": { + "description": "Summary volume data that matches the query", + "content": { + "application/json": { + "schema": { + "title": "VolumeListResponse", + "required": [ + "Volumes", + "Warnings" + ], + "type": "object", + "properties": { + "Volumes": { + "type": "array", + "description": "List of volumes", + "nullable": false, + "items": { + "$ref": "#/components/schemas/Volume" + } + }, + "Warnings": { + "type": "array", + "description": "Warnings that occurred when fetching the list of volumes.\n", + "nullable": false, + "items": { + "type": "string" + } + } + }, + "description": "Volume list response" + }, + "example": { + "Volumes": [ + { + "CreatedAt": "2017-07-19T12:00:26Z", + "Name": "tardis", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/tardis", + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + }, + "Scope": "local", + "Options": { + "device": "tmpfs", + "o": "size=100m,uid=1000", + "type": "tmpfs" + } + } + ], + "Warnings": [] + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes/create": { + "post": { + "tags": [ + "Volume" + ], + "summary": "Create a volume", + "operationId": "VolumeCreate", + "requestBody": { + "description": "Volume configuration", + "content": { + "application/json": { + "schema": { + "title": "VolumeConfig", + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The new volume's name. If not specified, Docker generates a name.\n", + "nullable": false + }, + "Driver": { + "type": "string", + "description": "Name of the volume driver to use.", + "nullable": false, + "default": "local" + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A mapping of driver options and values. These options are\npassed directly to the driver and are driver specific.\n" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + } + }, + "description": "Volume configuration", + "example": { + "Name": "tardis", + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + }, + "Driver": "custom" + } + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "The volume was created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Volume" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "volumeConfig" + } + }, + "/volumes/{name}": { + "get": { + "tags": [ + "Volume" + ], + "summary": "Inspect a volume", + "operationId": "VolumeInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Volume name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Volume" + } + } + } + }, + "404": { + "description": "No such volume", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Volume" + ], + "summary": "Remove a volume", + "description": "Instruct the driver to remove the volume.", + "operationId": "VolumeDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Volume name or ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force the removal of the volume", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "The volume was removed", + "content": {} + }, + "404": { + "description": "No such volume or volume driver", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Volume is in use and cannot be removed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes/prune": { + "post": { + "tags": [ + "Volume" + ], + "summary": "Delete unused volumes", + "operationId": "VolumePrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "VolumePruneResponse", + "type": "object", + "properties": { + "VolumesDeleted": { + "type": "array", + "description": "Volumes that were deleted", + "items": { + "type": "string" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks": { + "get": { + "tags": [ + "Network" + ], + "summary": "List networks", + "description": "Returns a list of networks. For details on the format, see the\n[network inspect endpoint](#operation/NetworkInspect).\n\nNote that it uses a different, smaller representation of a network than\ninspecting a single network. For example, the list of containers attached\nto the network is not propagated in API versions 1.28 and up.\n", + "operationId": "NetworkList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "JSON encoded value of the filters (a `map[string][]string`) to process\non the networks list.\n\nAvailable filters:\n\n- `dangling=` When set to `true` (or `1`), returns all\n networks that are not in use by a container. When set to `false`\n (or `0`), only networks that are in use by one or more\n containers are returned.\n- `driver=` Matches a network's driver.\n- `id=` Matches all or part of a network ID.\n- `label=` or `label==` of a network label.\n- `name=` Matches all or part of a network name.\n- `scope=[\"swarm\"|\"global\"|\"local\"]` Filters networks by scope (`swarm`, `global`, or `local`).\n- `type=[\"custom\"|\"builtin\"]` Filters networks by type. The `custom` keyword returns all user-defined networks.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Network" + } + }, + "example": [ + { + "Name": "bridge", + "Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566", + "Created": "2016-10-19T06:21:00.416543526Z", + "Scope": "local", + "Driver": "bridge", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.17.0.0/16" + } + ] + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + } + }, + { + "Name": "none", + "Id": "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794", + "Created": "0001-01-01T00:00:00Z", + "Scope": "local", + "Driver": "null", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + }, + { + "Name": "host", + "Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e", + "Created": "0001-01-01T00:00:00Z", + "Scope": "local", + "Driver": "host", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + } + ] + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks/{id}": { + "get": { + "tags": [ + "Network" + ], + "summary": "Inspect a network", + "operationId": "NetworkInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "verbose", + "in": "query", + "description": "Detailed inspect output for troubleshooting", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "scope", + "in": "query", + "description": "Filter the network by scope (swarm, global, or local)", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Network" + } + } + } + }, + "404": { + "description": "Network not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Network" + ], + "summary": "Remove a network", + "operationId": "NetworkDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No error", + "content": {} + }, + "403": { + "description": "operation not supported for pre-defined networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such network", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks/create": { + "post": { + "tags": [ + "Network" + ], + "summary": "Create a network", + "operationId": "NetworkCreate", + "requestBody": { + "description": "Network configuration", + "content": { + "application/json": { + "schema": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The network's name." + }, + "CheckDuplicate": { + "type": "boolean", + "description": "Check for networks with duplicate names. Since Network is\nprimarily keyed based on a random ID and not on the name, and\nnetwork name is strictly a user-friendly alias to the network\nwhich is uniquely identified using ID, there is no guaranteed\nway to check for duplicates. CheckDuplicate is there to provide\na best effort checking of any networks which has the same name\nbut it is not guaranteed to catch all name collisions.\n" + }, + "Driver": { + "type": "string", + "description": "Name of the network driver plugin to use.", + "default": "bridge" + }, + "Internal": { + "type": "boolean", + "description": "Restrict external access to the network." + }, + "Attachable": { + "type": "boolean", + "description": "Globally scoped network is manually attachable by regular\ncontainers from workers in swarm mode.\n" + }, + "Ingress": { + "type": "boolean", + "description": "Ingress network is the network which provides the routing-mesh\nin swarm mode.\n" + }, + "IPAM": { + "$ref": "#/components/schemas/IPAM" + }, + "EnableIPv6": { + "type": "boolean", + "description": "Enable IPv6 on the network." + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Network specific options to be used by the drivers." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + } + }, + "example": { + "Name": "isolated_nw", + "CheckDuplicate": false, + "Driver": "bridge", + "EnableIPv6": true, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.20.0.0/16", + "IPRange": "172.20.10.0/24", + "Gateway": "172.20.10.11" + }, + { + "Subnet": "2001:db8:abcd::/64", + "Gateway": "2001:db8:abcd::1011" + } + ], + "Options": { + "foo": "bar" + } + }, + "Internal": true, + "Attachable": false, + "Ingress": false, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "NetworkCreateResponse", + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the created network." + }, + "Warning": { + "type": "string" + } + }, + "example": { + "Id": "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30", + "Warning": "" + } + } + } + } + }, + "403": { + "description": "operation not supported for pre-defined networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "plugin not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "networkConfig" + } + }, + "/networks/{id}/connect": { + "post": { + "tags": [ + "Network" + ], + "summary": "Connect a container to a network", + "operationId": "NetworkConnect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "The ID or name of the container to connect to the network." + }, + "EndpointConfig": { + "$ref": "#/components/schemas/EndpointSettings" + } + }, + "example": { + "Container": "3613f73ba0e4", + "EndpointConfig": { + "IPAMConfig": { + "IPv4Address": "172.24.56.89", + "IPv6Address": "2001:db8::5689" + } + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "403": { + "description": "Operation not supported for swarm scoped networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Network or container not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "container" + } + }, + "/networks/{id}/disconnect": { + "post": { + "tags": [ + "Network" + ], + "summary": "Disconnect a container from a network", + "operationId": "NetworkDisconnect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "The ID or name of the container to disconnect from the network.\n" + }, + "Force": { + "type": "boolean", + "description": "Force the container to disconnect from the network.\n" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "403": { + "description": "Operation not supported for swarm scoped networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Network or container not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "container" + } + }, + "/networks/prune": { + "post": { + "tags": [ + "Network" + ], + "summary": "Delete unused networks", + "operationId": "NetworkPrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `until=` Prune networks created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune networks with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "NetworkPruneResponse", + "type": "object", + "properties": { + "NetworksDeleted": { + "type": "array", + "description": "Networks that were deleted", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "List plugins", + "description": "Returns information about installed plugins.", + "operationId": "PluginList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the plugin list.\n\nAvailable filters:\n\n- `capability=`\n- `enable=|`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Plugin" + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/privileges": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "Get plugin privileges", + "operationId": "GetPluginPrivileges", + "parameters": [ + { + "name": "remote", + "in": "query", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "title": "PluginPrivilegeItem", + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission the user has to accept upon installing\nthe plugin.\n" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "title": "PluginPrivilegeItem", + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission the user has to accept upon installing\nthe plugin.\n" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/pull": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Install a plugin", + "description": "Pulls and installs a plugin. After the plugin is installed, it can be\nenabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable).\n", + "operationId": "PluginPull", + "parameters": [ + { + "name": "remote", + "in": "query", + "description": "Remote reference for plugin to install.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "description": "Local name for the pulled plugin.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration to use when pulling a plugin\nfrom a registry.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission accepted by the user upon installing the\nplugin.\n" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission accepted by the user upon installing the\nplugin.\n" + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/plugins/{name}/json": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "Inspect a plugin", + "operationId": "PluginInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + } + } + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}": { + "delete": { + "tags": [ + "Plugin" + ], + "summary": "Remove a plugin", + "operationId": "PluginDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Disable the plugin before removing. This may result in issues if the\nplugin is in use by a container.\n", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + } + } + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/enable": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Enable a plugin", + "operationId": "PluginEnable", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Set the HTTP client timeout (in seconds)", + "schema": { + "type": "integer", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/disable": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Disable a plugin", + "operationId": "PluginDisable", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/upgrade": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Upgrade a plugin", + "operationId": "PluginUpgrade", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "remote", + "in": "query", + "description": "Remote reference to upgrade to.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration to use when pulling a plugin\nfrom a registry.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission accepted by the user upon installing the\nplugin.\n" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission accepted by the user upon installing the\nplugin.\n" + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/plugins/create": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Create a plugin", + "operationId": "PluginCreate", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Path to tar containing plugin rootfs and manifest", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "tarContext" + } + }, + "/plugins/{name}/push": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Push a plugin", + "description": "Push a plugin to the registry.\n", + "operationId": "PluginPush", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/set": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Configure a plugin", + "operationId": "PluginSet", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + "DEBUG=1" + ], + "items": { + "type": "string" + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "No error", + "content": {} + }, + "404": { + "description": "Plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/nodes": { + "get": { + "tags": [ + "Node" + ], + "summary": "List nodes", + "operationId": "NodeList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the nodes list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `id=`\n- `label=`\n- `membership=`(`accepted`|`pending`)`\n- `name=`\n- `node.label=`\n- `role=`(`manager`|`worker`)`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Node" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Node" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/nodes/{id}": { + "get": { + "tags": [ + "Node" + ], + "summary": "Inspect a node", + "operationId": "NodeInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the node", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Node" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Node" + } + } + } + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Node" + ], + "summary": "Delete a node", + "operationId": "NodeDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the node", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force remove a node from the swarm", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/nodes/{id}/update": { + "post": { + "tags": [ + "Node" + ], + "summary": "Update a node", + "operationId": "NodeUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the node", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the node object being updated. This is required\nto avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NodeSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/NodeSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm": { + "get": { + "tags": [ + "Swarm" + ], + "summary": "Inspect swarm", + "operationId": "SwarmInspect", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Swarm" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Swarm" + } + } + } + }, + "404": { + "description": "no such swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/init": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Initialize a new swarm", + "operationId": "SwarmInit", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication, as well\nas determining the networking interface used for the VXLAN\nTunnel Endpoint (VTEP). This can either be an address/port\ncombination in the form `192.168.1.1:4567`, or an interface\nfollowed by a port number, like `eth0:4567`. If the port number\nis omitted, the default swarm listening port is used.\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "DataPathPort": { + "type": "integer", + "description": "DataPathPort specifies the data path port number for data traffic.\nAcceptable port range is 1024 to 49151.\nif no port is set or is set to 0, default port 4789 will be used.\n", + "format": "uint32" + }, + "DefaultAddrPool": { + "type": "array", + "description": "Default Address Pool specifies default subnet pools for global\nscope networks.\n", + "items": { + "type": "string", + "example": "" + } + }, + "ForceNewCluster": { + "type": "boolean", + "description": "Force creation of a new swarm." + }, + "SubnetSize": { + "type": "integer", + "description": "SubnetSize specifies the subnet size of the networks created\nfrom the default subnet pool.\n", + "format": "uint32" + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "DataPathPort": 4789, + "DefaultAddrPool": [ + "10.10.0.0/8", + "20.20.0.0/8" + ], + "SubnetSize": 24, + "ForceNewCluster": false, + "Spec": { + "Orchestration": {}, + "Raft": {}, + "Dispatcher": {}, + "CAConfig": {}, + "EncryptionConfig": { + "AutoLockManagers": false + } + } + } + } + }, + "text/plain": { + "schema": { + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication, as well\nas determining the networking interface used for the VXLAN\nTunnel Endpoint (VTEP). This can either be an address/port\ncombination in the form `192.168.1.1:4567`, or an interface\nfollowed by a port number, like `eth0:4567`. If the port number\nis omitted, the default swarm listening port is used.\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "DataPathPort": { + "type": "integer", + "description": "DataPathPort specifies the data path port number for data traffic.\nAcceptable port range is 1024 to 49151.\nif no port is set or is set to 0, default port 4789 will be used.\n", + "format": "uint32" + }, + "DefaultAddrPool": { + "type": "array", + "description": "Default Address Pool specifies default subnet pools for global\nscope networks.\n", + "items": { + "type": "string", + "example": "" + } + }, + "ForceNewCluster": { + "type": "boolean", + "description": "Force creation of a new swarm." + }, + "SubnetSize": { + "type": "integer", + "description": "SubnetSize specifies the subnet size of the networks created\nfrom the default subnet pool.\n", + "format": "uint32" + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "DataPathPort": 4789, + "DefaultAddrPool": [ + "10.10.0.0/8", + "20.20.0.0/8" + ], + "SubnetSize": 24, + "ForceNewCluster": false, + "Spec": { + "Orchestration": {}, + "Raft": {}, + "Dispatcher": {}, + "CAConfig": {}, + "EncryptionConfig": { + "AutoLockManagers": false + } + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "string", + "description": "The node ID", + "example": "7v2t30z9blmxuhnyo6s4cpenp" + } + }, + "text/plain": { + "schema": { + "type": "string", + "description": "The node ID", + "example": "7v2t30z9blmxuhnyo6s4cpenp" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is already part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/join": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Join an existing swarm", + "operationId": "SwarmJoin", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication if the node\ngets promoted to manager, as well as determining the networking\ninterface used for the VXLAN Tunnel Endpoint (VTEP).\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same addres\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "RemoteAddrs": { + "type": "array", + "description": "Addresses of manager nodes already participating in the swarm.\n", + "items": { + "type": "string" + } + }, + "JoinToken": { + "type": "string", + "description": "Secret token for joining this swarm." + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "RemoteAddrs": [ + "node1:2377" + ], + "JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + } + }, + "text/plain": { + "schema": { + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication if the node\ngets promoted to manager, as well as determining the networking\ninterface used for the VXLAN Tunnel Endpoint (VTEP).\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same addres\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "RemoteAddrs": { + "type": "array", + "description": "Addresses of manager nodes already participating in the swarm.\n", + "items": { + "type": "string" + } + }, + "JoinToken": { + "type": "string", + "description": "Secret token for joining this swarm." + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "RemoteAddrs": [ + "node1:2377" + ], + "JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is already part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/leave": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Leave a swarm", + "operationId": "SwarmLeave", + "parameters": [ + { + "name": "force", + "in": "query", + "description": "Force leave swarm, even if this is the last manager or that it will\nbreak the cluster.\n", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/update": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Update a swarm", + "operationId": "SwarmUpdate", + "parameters": [ + { + "name": "version", + "in": "query", + "description": "The version number of the swarm object being updated. This is\nrequired to avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "rotateWorkerToken", + "in": "query", + "description": "Rotate the worker join token.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "rotateManagerToken", + "in": "query", + "description": "Rotate the manager join token.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "rotateManagerUnlockKey", + "in": "query", + "description": "Rotate the manager unlock key.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/SwarmSpec" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/unlockkey": { + "get": { + "tags": [ + "Swarm" + ], + "summary": "Get the unlock key", + "operationId": "SwarmUnlockkey", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "UnlockKeyResponse", + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + }, + "text/plain": { + "schema": { + "title": "UnlockKeyResponse", + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/unlock": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Unlock a locked manager", + "operationId": "SwarmUnlock", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services": { + "get": { + "tags": [ + "Service" + ], + "summary": "List services", + "operationId": "ServiceList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the services list.\n\nAvailable filters:\n\n- `id=`\n- `label=`\n- `mode=[\"replicated\"|\"global\"]`\n- `name=`\n", + "schema": { + "type": "string" + } + }, + { + "name": "status", + "in": "query", + "description": "Include service status, with count of running and desired tasks.\n", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/services/create": { + "post": { + "tags": [ + "Service" + ], + "summary": "Create a service", + "operationId": "ServiceCreate", + "parameters": [ + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration for pulling from private\nregistries.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServiceSpec" + }, + { + "type": "object", + "example": { + "Name": "web", + "TaskTemplate": { + "ContainerSpec": { + "Image": "nginx:alpine", + "Mounts": [ + { + "ReadOnly": true, + "Source": "web-data", + "Target": "/usr/share/nginx/html", + "Type": "volume", + "VolumeOptions": { + "DriverConfig": {}, + "Labels": { + "com.example.something": "something-value" + } + } + } + ], + "Hosts": [ + "10.10.10.10 host1", + "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 host2" + ], + "User": "33", + "DNSConfig": { + "Nameservers": [ + "8.8.8.8" + ], + "Search": [ + "example.org" + ], + "Options": [ + "timeout:3" + ] + }, + "Secrets": [ + { + "File": { + "Name": "www.example.org.key", + "UID": "33", + "GID": "33", + "Mode": 384 + }, + "SecretID": "fpjqlhnwb19zds35k8wn80lq9", + "SecretName": "example_org_domain_key" + } + ] + }, + "LogDriver": { + "Name": "json-file", + "Options": { + "max-file": "3", + "max-size": "10M" + } + }, + "Placement": {}, + "Resources": { + "Limits": { + "MemoryBytes": 104857600 + }, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "on-failure", + "Delay": 10000000000, + "MaxAttempts": 10 + } + }, + "Mode": { + "Replicated": { + "Replicas": 4 + } + }, + "UpdateConfig": { + "Parallelism": 2, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Ports": [ + { + "Protocol": "tcp", + "PublishedPort": 8080, + "TargetPort": 80 + } + ] + }, + "Labels": { + "foo": "bar" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "ServiceCreateResponse", + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the created service." + }, + "Warning": { + "type": "string", + "description": "Optional warning message" + } + }, + "example": { + "ID": "ak7w3gjqoa3kuz8xcpnyy0pvl", + "Warning": "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + } + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "network is not eligible for services", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services/{id}": { + "get": { + "tags": [ + "Service" + ], + "summary": "Inspect a service", + "operationId": "ServiceInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "insertDefaults", + "in": "query", + "description": "Fill empty fields with default values.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Service" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Service" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Service" + ], + "summary": "Delete a service", + "operationId": "ServiceDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/services/{id}/update": { + "post": { + "tags": [ + "Service" + ], + "summary": "Update a service", + "operationId": "ServiceUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the service object being updated. This is\nrequired to avoid conflicting writes.\nThis version number should be the value as currently set on the\nservice *before* the update. You can find the current version by\ncalling `GET /services/{id}`\n", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "registryAuthFrom", + "in": "query", + "description": "If the `X-Registry-Auth` header is not specified, this parameter\nindicates where to find registry authorization credentials.\n", + "schema": { + "type": "string", + "default": "spec", + "enum": [ + "spec", + "previous-spec" + ] + } + }, + { + "name": "rollback", + "in": "query", + "description": "Set to this parameter to `previous` to cause a server-side rollback\nto the previous service spec. The supplied spec will be ignored in\nthis case.\n", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration for pulling from private\nregistries.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServiceSpec" + }, + { + "type": "object", + "example": { + "Name": "top", + "TaskTemplate": { + "ContainerSpec": { + "Image": "busybox", + "Args": [ + "top" + ] + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {}, + "ForceUpdate": 0 + }, + "Mode": { + "Replicated": { + "Replicas": 1 + } + }, + "UpdateConfig": { + "Parallelism": 2, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Mode": "vip" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUpdateResponse" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services/{id}/logs": { + "get": { + "tags": [ + "Service" + ], + "summary": "Get service logs", + "description": "Get `stdout` and `stderr` logs from a service. See also\n[`/containers/{id}/logs`](#operation/ContainerLogs).\n\n**Note**: This endpoint works only for services with the `local`,\n`json-file` or `journald` logging drivers.\n", + "operationId": "ServiceLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the service", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "details", + "in": "query", + "description": "Show service context and extra details provided to logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "follow", + "in": "query", + "description": "Keep connection after returning logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs.\nSpecify as an integer or `all` to output all log lines.\n", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "200": { + "description": "logs returned as a stream in response body", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such service: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks": { + "get": { + "tags": [ + "Task" + ], + "summary": "List tasks", + "operationId": "TaskList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the tasks list.\n\nAvailable filters:\n\n- `desired-state=(running | shutdown | accepted)`\n- `id=`\n- `label=key` or `label=\"key=value\"`\n- `name=`\n- `node=`\n- `service=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "0kzzo1i0y4jz6027t0k7aezc7", + "Version": { + "Index": 71 + }, + "CreatedAt": "2016-06-07T21:07:31.171892745Z", + "UpdatedAt": "2016-06-07T21:07:31.376370513Z", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:31.290032978Z", + "State": "running", + "Message": "started", + "ContainerStatus": { + "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035", + "PID": 677 + } + }, + "DesiredState": "running", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.10/16" + ] + } + ] + }, + { + "ID": "1yljwbmlr8er2waf8orvqpwms", + "Version": { + "Index": 30 + }, + "CreatedAt": "2016-06-07T21:07:30.019104782Z", + "UpdatedAt": "2016-06-07T21:07:30.231958098Z", + "Name": "hopeful_cori", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:30.202183143Z", + "State": "shutdown", + "Message": "shutdown", + "ContainerStatus": { + "ContainerID": "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213" + } + }, + "DesiredState": "shutdown", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.5/16" + ] + } + ] + } + ], + "items": { + "$ref": "#/components/schemas/Task" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks/{id}": { + "get": { + "tags": [ + "Task" + ], + "summary": "Inspect a task", + "operationId": "TaskInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the task", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Task" + } + } + } + }, + "404": { + "description": "no such task", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks/{id}/logs": { + "get": { + "tags": [ + "Task" + ], + "summary": "Get task logs", + "description": "Get `stdout` and `stderr` logs from a task.\nSee also [`/containers/{id}/logs`](#operation/ContainerLogs).\n\n**Note**: This endpoint works only for services with the `local`,\n`json-file` or `journald` logging drivers.\n", + "operationId": "TaskLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the task", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "details", + "in": "query", + "description": "Show task context and extra details provided to logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "follow", + "in": "query", + "description": "Keep connection after returning logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs.\nSpecify as an integer or `all` to output all log lines.\n", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "200": { + "description": "logs returned as a stream in response body", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "no such task", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such task: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets": { + "get": { + "tags": [ + "Secret" + ], + "summary": "List secrets", + "operationId": "SecretList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the secrets list.\n\nAvailable filters:\n\n- `id=`\n- `label= or label==value`\n- `name=`\n- `names=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "blt1owaxmitz71s9v5zh81zun", + "Version": { + "Index": 85 + }, + "CreatedAt": "2017-07-20T13:55:28.678958722Z", + "UpdatedAt": "2017-07-20T13:55:28.678958722Z", + "Spec": { + "Name": "mysql-passwd", + "Labels": { + "some.label": "some.value" + }, + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + }, + { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt", + "Labels": { + "foo": "bar" + } + } + } + ], + "items": { + "$ref": "#/components/schemas/Secret" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets/create": { + "post": { + "tags": [ + "Secret" + ], + "summary": "Create a secret", + "operationId": "SecretCreate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SecretSpec" + }, + { + "type": "object", + "example": { + "Name": "app-key.crt", + "Labels": { + "foo": "bar" + }, + "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==", + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + } + ] + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/secrets/{id}": { + "get": { + "tags": [ + "Secret" + ], + "summary": "Inspect a secret", + "operationId": "SecretInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the secret", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Secret" + }, + "example": { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt", + "Labels": { + "foo": "bar" + }, + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + } + } + } + }, + "404": { + "description": "secret not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Secret" + ], + "summary": "Delete a secret", + "operationId": "SecretDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the secret", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "secret not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets/{id}/update": { + "post": { + "tags": [ + "Secret" + ], + "summary": "Update a Secret", + "operationId": "SecretUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the secret", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the secret object being updated. This is\nrequired to avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "The spec of the secret to update. Currently, only the Labels field\ncan be updated. All other fields must remain unchanged from the\n[SecretInspect endpoint](#operation/SecretInspect) response values.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SecretSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/SecretSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such secret", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/configs": { + "get": { + "tags": [ + "Config" + ], + "summary": "List configs", + "operationId": "ConfigList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the configs list.\n\nAvailable filters:\n\n- `id=`\n- `label= or label==value`\n- `name=`\n- `names=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "server.conf" + } + } + ], + "items": { + "$ref": "#/components/schemas/Config" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/configs/create": { + "post": { + "tags": [ + "Config" + ], + "summary": "Create a config", + "operationId": "ConfigCreate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ConfigSpec" + }, + { + "type": "object", + "example": { + "Name": "server.conf", + "Labels": { + "foo": "bar" + }, + "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + } + } + ] + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/configs/{id}": { + "get": { + "tags": [ + "Config" + ], + "summary": "Inspect a config", + "operationId": "ConfigInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the config", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Config" + }, + "example": { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt" + } + } + } + } + }, + "404": { + "description": "config not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Config" + ], + "summary": "Delete a config", + "operationId": "ConfigDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the config", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "config not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/configs/{id}/update": { + "post": { + "tags": [ + "Config" + ], + "summary": "Update a Config", + "operationId": "ConfigUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the config", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the config object being updated. This is\nrequired to avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "The spec of the config to update. Currently, only the Labels field\ncan be updated. All other fields must remain unchanged from the\n[ConfigInspect endpoint](#operation/ConfigInspect) response values.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ConfigSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such config", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/distribution/{name}/json": { + "get": { + "tags": [ + "Distribution" + ], + "summary": "Get image information from the registry", + "description": "Return image digest and platform information by contacting the registry.\n", + "operationId": "DistributionInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "descriptor and platform information", + "content": { + "application/json": { + "schema": { + "title": "DistributionInspectResponse", + "required": [ + "Descriptor", + "Platforms" + ], + "type": "object", + "properties": { + "Descriptor": { + "type": "object", + "properties": { + "MediaType": { + "type": "string" + }, + "Size": { + "type": "integer", + "format": "int64" + }, + "Digest": { + "type": "string" + }, + "URLs": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "A descriptor struct containing digest, media type, and size.\n" + }, + "Platforms": { + "type": "array", + "description": "An array containing all platforms supported by the image.\n", + "items": { + "type": "object", + "properties": { + "Architecture": { + "type": "string" + }, + "OS": { + "type": "string" + }, + "OSVersion": { + "type": "string" + }, + "OSFeatures": { + "type": "array", + "items": { + "type": "string" + } + }, + "Variant": { + "type": "string" + }, + "Features": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "x-go-name": "DistributionInspect" + }, + "example": { + "Descriptor": { + "MediaType": "application/vnd.docker.distribution.manifest.v2+json", + "Digest": "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96", + "Size": 3987495, + "URLs": [ + "" + ] + }, + "Platforms": [ + { + "Architecture": "amd64", + "OS": "linux", + "OSVersion": "", + "OSFeatures": [ + "" + ], + "Variant": "", + "Features": [ + "" + ] + } + ] + } + } + } + }, + "401": { + "description": "Failed authentication or no image found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such image: someimage (tag: latest)" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/session": { + "post": { + "tags": [ + "Session" + ], + "summary": "Initialize interactive session", + "description": "Start a new interactive session with a server. Session allows server to\ncall back to the client for advanced capabilities.\n\n### Hijacking\n\nThis endpoint hijacks the HTTP connection to HTTP2 transport that allows\nthe client to expose gPRC services on that connection.\n\nFor example, the client sends this request to upgrade the connection:\n\n```\nPOST /session HTTP/1.1\nUpgrade: h2c\nConnection: Upgrade\n```\n\nThe Docker daemon responds with a `101 UPGRADED` response follow with\nthe raw stream:\n\n```\nHTTP/1.1 101 UPGRADED\nConnection: Upgrade\nUpgrade: h2c\n```\n", + "operationId": "Session", + "responses": { + "101": { + "description": "no error, hijacking successful", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Port": { + "required": [ + "PrivatePort", + "Type" + ], + "type": "object", + "properties": { + "IP": { + "type": "string", + "description": "Host IP address that the container's port is mapped to", + "format": "ip-address" + }, + "PrivatePort": { + "type": "integer", + "description": "Port on the container", + "format": "uint16", + "nullable": false + }, + "PublicPort": { + "type": "integer", + "description": "Port exposed on the host", + "format": "uint16" + }, + "Type": { + "type": "string", + "nullable": false, + "enum": [ + "tcp", + "udp", + "sctp" + ] + } + }, + "description": "An open port on a container", + "example": { + "PrivatePort": 8080, + "PublicPort": 80, + "Type": "tcp" + } + }, + "MountPoint": { + "type": "object", + "properties": { + "Type": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Source": { + "type": "string" + }, + "Destination": { + "type": "string" + }, + "Driver": { + "type": "string" + }, + "Mode": { + "type": "string" + }, + "RW": { + "type": "boolean" + }, + "Propagation": { + "type": "string" + } + }, + "description": "A mount point inside a container" + }, + "DeviceMapping": { + "type": "object", + "properties": { + "PathOnHost": { + "type": "string" + }, + "PathInContainer": { + "type": "string" + }, + "CgroupPermissions": { + "type": "string" + } + }, + "description": "A device mapping between the host and container", + "example": { + "PathOnHost": "/dev/deviceName", + "PathInContainer": "/dev/deviceName", + "CgroupPermissions": "mrw" + } + }, + "DeviceRequest": { + "type": "object", + "properties": { + "Driver": { + "type": "string", + "example": "nvidia" + }, + "Count": { + "type": "integer", + "example": -1 + }, + "DeviceIDs": { + "type": "array", + "example": [ + "0", + "1", + "GPU-fef8089b-4820-abfc-e83e-94318197576e" + ], + "items": { + "type": "string" + } + }, + "Capabilities": { + "type": "array", + "description": "A list of capabilities; an OR list of AND lists of capabilities.\n", + "example": [ + [ + "gpu", + "nvidia", + "compute" + ] + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver-specific options, specified as a key/value pairs. These options\nare passed directly to the driver.\n" + } + }, + "description": "A request for devices to be sent to device drivers" + }, + "ThrottleDevice": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Device path" + }, + "Rate": { + "minimum": 0, + "type": "integer", + "description": "Rate", + "format": "int64" + } + } + }, + "Mount": { + "type": "object", + "properties": { + "Target": { + "type": "string", + "description": "Container path." + }, + "Source": { + "type": "string", + "description": "Mount source (e.g. a volume name, a host path)." + }, + "Type": { + "type": "string", + "description": "The mount type. Available types:\n\n- `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container.\n- `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.\n- `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs.\n- `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container.\n", + "enum": [ + "bind", + "volume", + "tmpfs", + "npipe" + ] + }, + "ReadOnly": { + "type": "boolean", + "description": "Whether the mount should be read-only." + }, + "Consistency": { + "type": "string", + "description": "The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`." + }, + "BindOptions": { + "type": "object", + "properties": { + "Propagation": { + "type": "string", + "description": "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.", + "enum": [ + "private", + "rprivate", + "shared", + "rshared", + "slave", + "rslave" + ] + }, + "NonRecursive": { + "type": "boolean", + "description": "Disable recursive bind mount.", + "default": false + } + }, + "description": "Optional configuration for the `bind` type." + }, + "VolumeOptions": { + "type": "object", + "properties": { + "NoCopy": { + "type": "boolean", + "description": "Populate volume with data from the target.", + "default": false + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "DriverConfig": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the driver to use to create the volume." + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "key/value map of driver specific options." + } + }, + "description": "Map of driver specific options" + } + }, + "description": "Optional configuration for the `volume` type." + }, + "TmpfsOptions": { + "type": "object", + "properties": { + "SizeBytes": { + "type": "integer", + "description": "The size for the tmpfs mount in bytes.", + "format": "int64" + }, + "Mode": { + "type": "integer", + "description": "The permission mode for the tmpfs mount in an integer." + } + }, + "description": "Optional configuration for the `tmpfs` type." + } + } + }, + "RestartPolicy": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "- Empty string means not to restart\n- `always` Always restart\n- `unless-stopped` Restart always except when the user has manually stopped the container\n- `on-failure` Restart only when the container exit code is non-zero\n", + "enum": [ + "", + "always", + "unless-stopped", + "on-failure" + ] + }, + "MaximumRetryCount": { + "type": "integer", + "description": "If `on-failure` is used, the number of times to retry before giving up.\n" + } + }, + "description": "The behavior to apply when the container exits. The default is not to\nrestart.\n\nAn ever increasing delay (double the previous delay, starting at 100ms) is\nadded before each restart to prevent flooding the server.\n" + }, + "Resources": { + "type": "object", + "properties": { + "CpuShares": { + "type": "integer", + "description": "An integer value representing this container's relative CPU weight\nversus other containers.\n" + }, + "Memory": { + "type": "integer", + "description": "Memory limit in bytes.", + "format": "int64", + "default": 0 + }, + "CgroupParent": { + "type": "string", + "description": "Path to `cgroups` under which the container's `cgroup` is created. If\nthe path is not absolute, the path is considered to be relative to the\n`cgroups` path of the init process. Cgroups are created if they do not\nalready exist.\n" + }, + "BlkioWeight": { + "maximum": 1000, + "minimum": 0, + "type": "integer", + "description": "Block IO weight (relative weight)." + }, + "BlkioWeightDevice": { + "type": "array", + "description": "Block IO weight (relative device weight) in the form:\n\n```\n[{\"Path\": \"device_path\", \"Weight\": weight}]\n```\n", + "items": { + "type": "object", + "properties": { + "Path": { + "type": "string" + }, + "Weight": { + "minimum": 0, + "type": "integer" + } + } + } + }, + "BlkioDeviceReadBps": { + "type": "array", + "description": "Limit read rate (bytes per second) from a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceWriteBps": { + "type": "array", + "description": "Limit write rate (bytes per second) to a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceReadIOps": { + "type": "array", + "description": "Limit read rate (IO per second) from a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceWriteIOps": { + "type": "array", + "description": "Limit write rate (IO per second) to a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "CpuPeriod": { + "type": "integer", + "description": "The length of a CPU period in microseconds.", + "format": "int64" + }, + "CpuQuota": { + "type": "integer", + "description": "Microseconds of CPU time that the container can get in a CPU period.\n", + "format": "int64" + }, + "CpuRealtimePeriod": { + "type": "integer", + "description": "The length of a CPU real-time period in microseconds. Set to 0 to\nallocate no time allocated to real-time tasks.\n", + "format": "int64" + }, + "CpuRealtimeRuntime": { + "type": "integer", + "description": "The length of a CPU real-time runtime in microseconds. Set to 0 to\nallocate no time allocated to real-time tasks.\n", + "format": "int64" + }, + "CpusetCpus": { + "type": "string", + "description": "CPUs in which to allow execution (e.g., `0-3`, `0,1`).\n", + "example": "0-3" + }, + "CpusetMems": { + "type": "string", + "description": "Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only\neffective on NUMA systems.\n" + }, + "Devices": { + "type": "array", + "description": "A list of devices to add to the container.", + "items": { + "$ref": "#/components/schemas/DeviceMapping" + } + }, + "DeviceCgroupRules": { + "type": "array", + "description": "a list of cgroup rules to apply to the container", + "items": { + "type": "string", + "example": "c 13:* rwm" + } + }, + "DeviceRequests": { + "type": "array", + "description": "A list of requests for devices to be sent to device drivers.\n", + "items": { + "$ref": "#/components/schemas/DeviceRequest" + } + }, + "KernelMemory": { + "type": "integer", + "description": "Kernel memory limit in bytes.\n\n


\n\n> **Deprecated**: This field is deprecated as the kernel 5.4 deprecated\n> `kmem.limit_in_bytes`.\n", + "format": "int64", + "example": 209715200 + }, + "KernelMemoryTCP": { + "type": "integer", + "description": "Hard limit for kernel TCP buffer memory (in bytes).", + "format": "int64" + }, + "MemoryReservation": { + "type": "integer", + "description": "Memory soft limit in bytes.", + "format": "int64" + }, + "MemorySwap": { + "type": "integer", + "description": "Total memory limit (memory + swap). Set as `-1` to enable unlimited\nswap.\n", + "format": "int64" + }, + "MemorySwappiness": { + "maximum": 100, + "minimum": 0, + "type": "integer", + "description": "Tune a container's memory swappiness behavior. Accepts an integer\nbetween 0 and 100.\n", + "format": "int64" + }, + "NanoCPUs": { + "type": "integer", + "description": "CPU quota in units of 10-9 CPUs.", + "format": "int64" + }, + "OomKillDisable": { + "type": "boolean", + "description": "Disable OOM Killer for the container." + }, + "Init": { + "type": "boolean", + "description": "Run an init inside the container that forwards signals and reaps\nprocesses. This field is omitted if empty, and the default (as\nconfigured on the daemon) is used.\n", + "nullable": true + }, + "PidsLimit": { + "type": "integer", + "description": "Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null`\nto not change.\n", + "format": "int64", + "nullable": true + }, + "Ulimits": { + "type": "array", + "description": "A list of resource limits to set in the container. For example:\n\n```\n{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}\n```\n", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of ulimit" + }, + "Soft": { + "type": "integer", + "description": "Soft limit" + }, + "Hard": { + "type": "integer", + "description": "Hard limit" + } + } + } + }, + "CpuCount": { + "type": "integer", + "description": "The number of usable CPUs (Windows only).\n\nOn Windows Server containers, the processor resource controls are\nmutually exclusive. The order of precedence is `CPUCount` first, then\n`CPUShares`, and `CPUPercent` last.\n", + "format": "int64" + }, + "CpuPercent": { + "type": "integer", + "description": "The usable percentage of the available CPUs (Windows only).\n\nOn Windows Server containers, the processor resource controls are\nmutually exclusive. The order of precedence is `CPUCount` first, then\n`CPUShares`, and `CPUPercent` last.\n", + "format": "int64" + }, + "IOMaximumIOps": { + "type": "integer", + "description": "Maximum IOps for the container system drive (Windows only)", + "format": "int64" + }, + "IOMaximumBandwidth": { + "type": "integer", + "description": "Maximum IO in bytes per second for the container system drive\n(Windows only).\n", + "format": "int64" + } + }, + "description": "A container's resources (cgroups config, ulimits, etc)" + }, + "Limit": { + "type": "object", + "properties": { + "NanoCPUs": { + "type": "integer", + "format": "int64", + "example": 4000000000 + }, + "MemoryBytes": { + "type": "integer", + "format": "int64", + "example": 8272408576 + }, + "Pids": { + "type": "integer", + "description": "Limits the maximum number of PIDs in the container. Set `0` for unlimited.\n", + "format": "int64", + "example": 100, + "default": 0 + } + }, + "description": "An object describing a limit on resources which can be requested by a task.\n" + }, + "ResourceObject": { + "type": "object", + "properties": { + "NanoCPUs": { + "type": "integer", + "format": "int64", + "example": 4000000000 + }, + "MemoryBytes": { + "type": "integer", + "format": "int64", + "example": 8272408576 + }, + "GenericResources": { + "$ref": "#/components/schemas/GenericResources" + } + }, + "description": "An object describing the resources which can be advertised by a node and\nrequested by a task.\n" + }, + "GenericResources": { + "type": "array", + "description": "User-defined resources can be either Integer resources (e.g, `SSD=3`) or\nString resources (e.g, `GPU=UUID1`).\n", + "example": [ + { + "DiscreteResourceSpec": { + "Kind": "SSD", + "Value": 3 + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID1" + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID2" + } + } + ], + "items": { + "type": "object", + "properties": { + "NamedResourceSpec": { + "type": "object", + "properties": { + "Kind": { + "type": "string" + }, + "Value": { + "type": "string" + } + } + }, + "DiscreteResourceSpec": { + "type": "object", + "properties": { + "Kind": { + "type": "string" + }, + "Value": { + "type": "integer", + "format": "int64" + } + } + } + } + } + }, + "HealthConfig": { + "type": "object", + "properties": { + "Test": { + "type": "array", + "description": "The test to perform. Possible values are:\n\n- `[]` inherit healthcheck from image or parent image\n- `[\"NONE\"]` disable healthcheck\n- `[\"CMD\", args...]` exec arguments directly\n- `[\"CMD-SHELL\", command]` run command with system's default shell\n", + "items": { + "type": "string" + } + }, + "Interval": { + "type": "integer", + "description": "The time to wait between checks in nanoseconds. It should be 0 or at\nleast 1000000 (1 ms). 0 means inherit.\n" + }, + "Timeout": { + "type": "integer", + "description": "The time to wait before considering the check to have hung. It should\nbe 0 or at least 1000000 (1 ms). 0 means inherit.\n" + }, + "Retries": { + "type": "integer", + "description": "The number of consecutive failures needed to consider a container as\nunhealthy. 0 means inherit.\n" + }, + "StartPeriod": { + "type": "integer", + "description": "Start period for the container to initialize before starting\nhealth-retries countdown in nanoseconds. It should be 0 or at least\n1000000 (1 ms). 0 means inherit.\n" + } + }, + "description": "A test to perform to check that the container is healthy." + }, + "Health": { + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "Status is one of `none`, `starting`, `healthy` or `unhealthy`\n\n- \"none\" Indicates there is no healthcheck\n- \"starting\" Starting indicates that the container is not yet ready\n- \"healthy\" Healthy indicates that the container is running correctly\n- \"unhealthy\" Unhealthy indicates that the container has a problem\n", + "example": "healthy", + "enum": [ + "none", + "starting", + "healthy", + "unhealthy" + ] + }, + "FailingStreak": { + "type": "integer", + "description": "FailingStreak is the number of consecutive failures", + "example": 0 + }, + "Log": { + "type": "array", + "description": "Log contains the last few results (oldest first)\n", + "items": { + "$ref": "#/components/schemas/HealthcheckResult" + } + } + }, + "description": "Health stores information about the container's healthcheck results.\n" + }, + "HealthcheckResult": { + "type": "object", + "properties": { + "Start": { + "type": "string", + "description": "Date and time at which this check started in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "date-time", + "example": "2020-01-04T10:44:24.496525531Z" + }, + "End": { + "type": "string", + "description": "Date and time at which this check ended in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2020-01-04T10:45:21.364524523Z" + }, + "ExitCode": { + "type": "integer", + "description": "ExitCode meanings:\n\n- `0` healthy\n- `1` unhealthy\n- `2` reserved (considered unhealthy)\n- other values: error running probe\n", + "example": 0 + }, + "Output": { + "type": "string", + "description": "Output from last check" + } + }, + "description": "HealthcheckResult stores information about a single run of a healthcheck probe\n" + }, + "HostConfig": { + "description": "Container configuration that depends on the host we are running on", + "allOf": [ + { + "$ref": "#/components/schemas/Resources" + }, + { + "type": "object", + "properties": { + "Binds": { + "type": "array", + "description": "A list of volume bindings for this container. Each volume binding\nis a string in one of these forms:\n\n- `host-src:container-dest[:options]` to bind-mount a host path\n into the container. Both `host-src`, and `container-dest` must\n be an _absolute_ path.\n- `volume-name:container-dest[:options]` to bind-mount a volume\n managed by a volume driver into the container. `container-dest`\n must be an _absolute_ path.\n\n`options` is an optional, comma-delimited list of:\n\n- `nocopy` disables automatic copying of data from the container\n path to the volume. The `nocopy` flag only applies to named volumes.\n- `[ro|rw]` mounts a volume read-only or read-write, respectively.\n If omitted or set to `rw`, volumes are mounted read-write.\n- `[z|Z]` applies SELinux labels to allow or deny multiple containers\n to read and write to the same volume.\n - `z`: a _shared_ content label is applied to the content. This\n label indicates that multiple containers can share the volume\n content, for both reading and writing.\n - `Z`: a _private unshared_ label is applied to the content.\n This label indicates that only the current container can use\n a private volume. Labeling systems such as SELinux require\n proper labels to be placed on volume content that is mounted\n into a container. Without a label, the security system can\n prevent a container's processes from using the content. By\n default, the labels set by the host operating system are not\n modified.\n- `[[r]shared|[r]slave|[r]private]` specifies mount\n [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt).\n This only applies to bind-mounted volumes, not internal volumes\n or named volumes. Mount propagation requires the source mount\n point (the location where the source directory is mounted in the\n host operating system) to have the correct propagation properties.\n For shared volumes, the source mount point must be set to `shared`.\n For slave volumes, the mount must be set to either `shared` or\n `slave`.\n", + "items": { + "type": "string" + } + }, + "ContainerIDFile": { + "type": "string", + "description": "Path to a file where the container ID is written" + }, + "LogConfig": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "enum": [ + "json-file", + "syslog", + "journald", + "gelf", + "fluentd", + "awslogs", + "splunk", + "etwlogs", + "none" + ] + }, + "Config": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "The logging configuration for this container" + }, + "NetworkMode": { + "type": "string", + "description": "Network mode to use for this container. Supported standard values\nare: `bridge`, `host`, `none`, and `container:`. Any\nother value is taken as a custom network's name to which this\ncontainer should connect to.\n" + }, + "PortBindings": { + "$ref": "#/components/schemas/PortMap" + }, + "RestartPolicy": { + "$ref": "#/components/schemas/RestartPolicy" + }, + "AutoRemove": { + "type": "boolean", + "description": "Automatically remove the container when the container's process\nexits. This has no effect if `RestartPolicy` is set.\n" + }, + "VolumeDriver": { + "type": "string", + "description": "Driver that this container uses to mount volumes." + }, + "VolumesFrom": { + "type": "array", + "description": "A list of volumes to inherit from another container, specified in\nthe form `[:]`.\n", + "items": { + "type": "string" + } + }, + "Mounts": { + "type": "array", + "description": "Specification for mounts to be added to the container.\n", + "items": { + "$ref": "#/components/schemas/Mount" + } + }, + "CapAdd": { + "type": "array", + "description": "A list of kernel capabilities to add to the container. Conflicts\nwith option 'Capabilities'.\n", + "items": { + "type": "string" + } + }, + "CapDrop": { + "type": "array", + "description": "A list of kernel capabilities to drop from the container. Conflicts\nwith option 'Capabilities'.\n", + "items": { + "type": "string" + } + }, + "CgroupnsMode": { + "type": "string", + "description": "cgroup namespace mode for the container. Possible values are:\n\n- `\"private\"`: the container runs in its own private cgroup namespace\n- `\"host\"`: use the host system's cgroup namespace\n\nIf not specified, the daemon default is used, which can either be `\"private\"`\nor `\"host\"`, depending on daemon version, kernel support and configuration.\n", + "enum": [ + "private", + "host" + ] + }, + "Dns": { + "type": "array", + "description": "A list of DNS servers for the container to use.", + "items": { + "type": "string" + } + }, + "DnsOptions": { + "type": "array", + "description": "A list of DNS options.", + "items": { + "type": "string" + } + }, + "DnsSearch": { + "type": "array", + "description": "A list of DNS search domains.", + "items": { + "type": "string" + } + }, + "ExtraHosts": { + "type": "array", + "description": "A list of hostnames/IP mappings to add to the container's `/etc/hosts`\nfile. Specified in the form `[\"hostname:IP\"]`.\n", + "items": { + "type": "string" + } + }, + "GroupAdd": { + "type": "array", + "description": "A list of additional groups that the container process will run as.\n", + "items": { + "type": "string" + } + }, + "IpcMode": { + "type": "string", + "description": "IPC sharing mode for the container. Possible values are:\n\n- `\"none\"`: own private IPC namespace, with /dev/shm not mounted\n- `\"private\"`: own private IPC namespace\n- `\"shareable\"`: own private IPC namespace, with a possibility to share it with other containers\n- `\"container:\"`: join another (shareable) container's IPC namespace\n- `\"host\"`: use the host system's IPC namespace\n\nIf not specified, daemon default is used, which can either be `\"private\"`\nor `\"shareable\"`, depending on daemon version and configuration.\n" + }, + "Cgroup": { + "type": "string", + "description": "Cgroup to use for the container." + }, + "Links": { + "type": "array", + "description": "A list of links for the container in the form `container_name:alias`.\n", + "items": { + "type": "string" + } + }, + "OomScoreAdj": { + "type": "integer", + "description": "An integer value containing the score given to the container in\norder to tune OOM killer preferences.\n", + "example": 500 + }, + "PidMode": { + "type": "string", + "description": "Set the PID (Process) Namespace mode for the container. It can be\neither:\n\n- `\"container:\"`: joins another container's PID namespace\n- `\"host\"`: use the host's PID namespace inside the container\n" + }, + "Privileged": { + "type": "boolean", + "description": "Gives the container full access to the host." + }, + "PublishAllPorts": { + "type": "boolean", + "description": "Allocates an ephemeral host port for all of a container's\nexposed ports.\n\nPorts are de-allocated when the container stops and allocated when\nthe container starts. The allocated port might be changed when\nrestarting the container.\n\nThe port is selected from the ephemeral port range that depends on\nthe kernel. For example, on Linux the range is defined by\n`/proc/sys/net/ipv4/ip_local_port_range`.\n" + }, + "ReadonlyRootfs": { + "type": "boolean", + "description": "Mount the container's root filesystem as read only." + }, + "SecurityOpt": { + "type": "array", + "description": "A list of string values to customize labels for MLS systems, such as SELinux.", + "items": { + "type": "string" + } + }, + "StorageOpt": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Storage driver options for this container, in the form `{\"size\": \"120G\"}`.\n" + }, + "Tmpfs": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of container directories which should be replaced by tmpfs\nmounts, and their corresponding mount options. For example:\n\n```\n{ \"/run\": \"rw,noexec,nosuid,size=65536k\" }\n```\n" + }, + "UTSMode": { + "type": "string", + "description": "UTS namespace to use for the container." + }, + "UsernsMode": { + "type": "string", + "description": "Sets the usernamespace mode for the container when usernamespace\nremapping option is enabled.\n" + }, + "ShmSize": { + "minimum": 0, + "type": "integer", + "description": "Size of `/dev/shm` in bytes. If omitted, the system uses 64MB.\n" + }, + "Sysctls": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A list of kernel parameters (sysctls) to set in the container.\nFor example:\n\n```\n{\"net.ipv4.ip_forward\": \"1\"}\n```\n" + }, + "Runtime": { + "type": "string", + "description": "Runtime to use with this container." + }, + "ConsoleSize": { + "maxItems": 2, + "minItems": 2, + "type": "array", + "description": "Initial console size, as an `[height, width]` array. (Windows only)\n", + "items": { + "minimum": 0, + "type": "integer" + } + }, + "Isolation": { + "type": "string", + "description": "Isolation technology of the container. (Windows only)\n", + "enum": [ + "default", + "process", + "hyperv" + ] + }, + "MaskedPaths": { + "type": "array", + "description": "The list of paths to be masked inside the container (this overrides\nthe default set of paths).\n", + "items": { + "type": "string" + } + }, + "ReadonlyPaths": { + "type": "array", + "description": "The list of paths to be set as read-only inside the container\n(this overrides the default set of paths).\n", + "items": { + "type": "string" + } + } + } + } + ] + }, + "ContainerConfig": { + "type": "object", + "properties": { + "Hostname": { + "type": "string", + "description": "The hostname to use for the container, as a valid RFC 1123 hostname." + }, + "Domainname": { + "type": "string", + "description": "The domain name to use for the container." + }, + "User": { + "type": "string", + "description": "The user that commands are run as inside the container." + }, + "AttachStdin": { + "type": "boolean", + "description": "Whether to attach to `stdin`.", + "default": false + }, + "AttachStdout": { + "type": "boolean", + "description": "Whether to attach to `stdout`.", + "default": true + }, + "AttachStderr": { + "type": "boolean", + "description": "Whether to attach to `stderr`.", + "default": true + }, + "ExposedPorts": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "An object mapping ports to an empty object in the form:\n\n`{\"/\": {}}`\n" + }, + "Tty": { + "type": "boolean", + "description": "Attach standard streams to a TTY, including `stdin` if it is not closed.\n", + "default": false + }, + "OpenStdin": { + "type": "boolean", + "description": "Open `stdin`", + "default": false + }, + "StdinOnce": { + "type": "boolean", + "description": "Close `stdin` after one attached client disconnects", + "default": false + }, + "Env": { + "type": "array", + "description": "A list of environment variables to set inside the container in the\nform `[\"VAR=value\", ...]`. A variable without `=` is removed from the\nenvironment, rather than to have an empty value.\n", + "items": { + "type": "string" + } + }, + "Cmd": { + "type": "array", + "description": "Command to run specified as a string or an array of strings.\n", + "items": { + "type": "string" + } + }, + "Healthcheck": { + "$ref": "#/components/schemas/HealthConfig" + }, + "ArgsEscaped": { + "type": "boolean", + "description": "Command is already escaped (Windows only)" + }, + "Image": { + "type": "string", + "description": "The name of the image to use when creating the container/\n" + }, + "Volumes": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "An object mapping mount point paths inside the container to empty\nobjects.\n" + }, + "WorkingDir": { + "type": "string", + "description": "The working directory for commands to run in." + }, + "Entrypoint": { + "type": "array", + "description": "The entry point for the container as a string or an array of strings.\n\nIf the array consists of exactly one empty string (`[\"\"]`) then the\nentry point is reset to system default (i.e., the entry point used by\ndocker when there is no `ENTRYPOINT` instruction in the `Dockerfile`).\n", + "items": { + "type": "string" + } + }, + "NetworkDisabled": { + "type": "boolean", + "description": "Disable networking for the container." + }, + "MacAddress": { + "type": "string", + "description": "MAC address of the container." + }, + "OnBuild": { + "type": "array", + "description": "`ONBUILD` metadata that were defined in the image's `Dockerfile`.\n", + "items": { + "type": "string" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "StopSignal": { + "type": "string", + "description": "Signal to stop a container as a string or unsigned integer.\n", + "default": "SIGTERM" + }, + "StopTimeout": { + "type": "integer", + "description": "Timeout to stop a container in seconds." + }, + "Shell": { + "type": "array", + "description": "Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell.\n", + "items": { + "type": "string" + } + } + }, + "description": "Configuration for a container that is portable between hosts" + }, + "NetworkingConfig": { + "type": "object", + "properties": { + "EndpointsConfig": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + }, + "description": "A mapping of network name to endpoint configuration for that network.\n" + } + }, + "description": "NetworkingConfig represents the container's networking configuration for\neach of its interfaces.\nIt is used for the networking configs specified in the `docker create`\nand `docker network connect` commands.\n", + "example": { + "EndpointsConfig": { + "isolated_nw": { + "IPAMConfig": { + "IPv4Address": "172.20.30.33", + "IPv6Address": "2001:db8:abcd::3033", + "LinkLocalIPs": [ + "169.254.34.68", + "fe80::3468" + ] + }, + "Links": [ + "container_1", + "container_2" + ], + "Aliases": [ + "server_x", + "server_y" + ] + } + } + } + }, + "NetworkSettings": { + "type": "object", + "properties": { + "Bridge": { + "type": "string", + "description": "Name of the network'a bridge (for example, `docker0`).", + "example": "docker0" + }, + "SandboxID": { + "type": "string", + "description": "SandboxID uniquely represents a container's network stack.", + "example": "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3" + }, + "HairpinMode": { + "type": "boolean", + "description": "Indicates if hairpin NAT should be enabled on the virtual interface.\n", + "example": false + }, + "LinkLocalIPv6Address": { + "type": "string", + "description": "IPv6 unicast address using the link-local prefix.", + "example": "fe80::42:acff:fe11:1" + }, + "LinkLocalIPv6PrefixLen": { + "type": "integer", + "description": "Prefix length of the IPv6 unicast address.", + "example": 64 + }, + "Ports": { + "$ref": "#/components/schemas/PortMap" + }, + "SandboxKey": { + "type": "string", + "description": "SandboxKey identifies the sandbox", + "example": "/var/run/docker/netns/8ab54b426c38" + }, + "SecondaryIPAddresses": { + "type": "array", + "description": "", + "nullable": true, + "items": { + "$ref": "#/components/schemas/Address" + } + }, + "SecondaryIPv6Addresses": { + "type": "array", + "description": "", + "nullable": true, + "items": { + "$ref": "#/components/schemas/Address" + } + }, + "EndpointID": { + "type": "string", + "description": "EndpointID uniquely represents a service endpoint in a Sandbox.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + }, + "Gateway": { + "type": "string", + "description": "Gateway address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "172.17.0.1" + }, + "GlobalIPv6Address": { + "type": "string", + "description": "Global IPv6 address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "2001:db8::5689" + }, + "GlobalIPv6PrefixLen": { + "type": "integer", + "description": "Mask length of the global IPv6 address.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": 64 + }, + "IPAddress": { + "type": "string", + "description": "IPv4 address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "172.17.0.4" + }, + "IPPrefixLen": { + "type": "integer", + "description": "Mask length of the IPv4 address.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": 16 + }, + "IPv6Gateway": { + "type": "string", + "description": "IPv6 gateway address for this network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "2001:db8:2::100" + }, + "MacAddress": { + "type": "string", + "description": "MAC address for the container on the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "02:42:ac:11:00:04" + }, + "Networks": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + }, + "description": "Information about all networks that the container is connected to.\n" + } + }, + "description": "NetworkSettings exposes the network settings in the API" + }, + "Address": { + "type": "object", + "properties": { + "Addr": { + "type": "string", + "description": "IP address." + }, + "PrefixLen": { + "type": "integer", + "description": "Mask length of the IP address." + } + }, + "description": "Address represents an IPv4 or IPv6 IP address." + }, + "PortMap": { + "type": "object", + "additionalProperties": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/PortBinding" + } + }, + "description": "PortMap describes the mapping of container ports to host ports, using the\ncontainer's port-number and protocol as key in the format `/`,\nfor example, `80/udp`.\n\nIf a container's port is mapped for multiple protocols, separate entries\nare added to the mapping table.\n", + "example": { + "443/tcp": [ + { + "HostIp": "127.0.0.1", + "HostPort": "4443" + } + ], + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "80" + }, + { + "HostIp": "0.0.0.0", + "HostPort": "8080" + } + ], + "80/udp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "80" + } + ], + "53/udp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "53" + } + ] + } + }, + "PortBinding": { + "type": "object", + "properties": { + "HostIp": { + "type": "string", + "description": "Host IP address that the container's port is mapped to.", + "example": "127.0.0.1" + }, + "HostPort": { + "type": "string", + "description": "Host port number that the container's port is mapped to.", + "example": "4443" + } + }, + "description": "PortBinding represents a binding between a host IP address and a host\nport.\n" + }, + "GraphDriverData": { + "required": [ + "Data", + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false + }, + "Data": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "nullable": false + } + }, + "description": "Information about a container's graph driver." + }, + "Image": { + "required": [ + "Architecture", + "Author", + "Comment", + "Container", + "Created", + "DockerVersion", + "GraphDriver", + "Id", + "Os", + "Parent", + "RootFS", + "Size", + "VirtualSize" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": false + }, + "RepoTags": { + "type": "array", + "items": { + "type": "string" + } + }, + "RepoDigests": { + "type": "array", + "items": { + "type": "string" + } + }, + "Parent": { + "type": "string", + "nullable": false + }, + "Comment": { + "type": "string", + "nullable": false + }, + "Created": { + "type": "string", + "nullable": false + }, + "Container": { + "type": "string", + "nullable": false + }, + "ContainerConfig": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "DockerVersion": { + "type": "string", + "nullable": false + }, + "Author": { + "type": "string", + "nullable": false + }, + "Config": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "Architecture": { + "type": "string", + "nullable": false + }, + "Os": { + "type": "string", + "nullable": false + }, + "OsVersion": { + "type": "string" + }, + "Size": { + "type": "integer", + "format": "int64", + "nullable": false + }, + "VirtualSize": { + "type": "integer", + "format": "int64", + "nullable": false + }, + "GraphDriver": { + "$ref": "#/components/schemas/GraphDriverData" + }, + "RootFS": { + "required": [ + "Type" + ], + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": false + }, + "Layers": { + "type": "array", + "items": { + "type": "string" + } + }, + "BaseLayer": { + "type": "string" + } + } + }, + "Metadata": { + "type": "object", + "properties": { + "LastTagTime": { + "type": "string", + "format": "dateTime" + } + } + } + } + }, + "ImageSummary": { + "required": [ + "Containers", + "Created", + "Id", + "Labels", + "ParentId", + "RepoDigests", + "RepoTags", + "SharedSize", + "Size", + "VirtualSize" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": false + }, + "ParentId": { + "type": "string", + "nullable": false + }, + "RepoTags": { + "type": "array", + "nullable": false, + "items": { + "type": "string" + } + }, + "RepoDigests": { + "type": "array", + "nullable": false, + "items": { + "type": "string" + } + }, + "Created": { + "type": "integer", + "nullable": false + }, + "Size": { + "type": "integer", + "nullable": false + }, + "SharedSize": { + "type": "integer", + "nullable": false + }, + "VirtualSize": { + "type": "integer", + "nullable": false + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "nullable": false + }, + "Containers": { + "type": "integer", + "nullable": false + } + } + }, + "AuthConfig": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "email": { + "type": "string" + }, + "serveraddress": { + "type": "string" + } + }, + "example": { + "username": "hannibal", + "password": "xxxx", + "serveraddress": "https://index.docker.io/v1/" + } + }, + "ProcessConfig": { + "type": "object", + "properties": { + "privileged": { + "type": "boolean" + }, + "user": { + "type": "string" + }, + "tty": { + "type": "boolean" + }, + "entrypoint": { + "type": "string" + }, + "arguments": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Volume": { + "required": [ + "Driver", + "Labels", + "Mountpoint", + "Name", + "Options", + "Scope" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the volume.", + "nullable": false + }, + "Driver": { + "type": "string", + "description": "Name of the volume driver used by the volume.", + "nullable": false + }, + "Mountpoint": { + "type": "string", + "description": "Mount path of the volume on the host.", + "nullable": false + }, + "CreatedAt": { + "type": "string", + "description": "Date/Time the volume was created.", + "format": "dateTime" + }, + "Status": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "Low-level details about the volume, provided by the volume driver.\nDetails are returned as a map with key/value pairs:\n`{\"key\":\"value\",\"key2\":\"value2\"}`.\n\nThe `Status` field is optional, and is omitted if the volume driver\ndoes not support this feature.\n" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "nullable": false + }, + "Scope": { + "type": "string", + "description": "The level at which the volume exists. Either `global` for cluster-wide,\nor `local` for machine level.\n", + "nullable": false, + "default": "local", + "enum": [ + "local", + "global" + ] + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The driver specific options used when creating the volume.\n" + }, + "UsageData": { + "required": [ + "RefCount", + "Size" + ], + "type": "object", + "properties": { + "Size": { + "type": "integer", + "description": "Amount of disk space used by the volume (in bytes). This information\nis only available for volumes created with the `\"local\"` volume\ndriver. For volumes created with other volume drivers, this field\nis set to `-1` (\"not available\")\n", + "nullable": false + }, + "RefCount": { + "type": "integer", + "description": "The number of containers referencing this volume. This field\nis set to `-1` if the reference-count is not available.\n", + "nullable": false + } + }, + "description": "Usage details about the volume. This information is used by the\n`GET /system/df` endpoint, and omitted in other endpoints.\n", + "nullable": true + } + }, + "example": { + "Name": "tardis", + "Driver": "custom", + "Mountpoint": "/var/lib/docker/volumes/tardis", + "Status": { + "hello": "world" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + }, + "Scope": "local", + "CreatedAt": "2016-06-07T20:31:11.853781916Z" + } + }, + "Network": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Id": { + "type": "string" + }, + "Created": { + "type": "string", + "format": "dateTime" + }, + "Scope": { + "type": "string" + }, + "Driver": { + "type": "string" + }, + "EnableIPv6": { + "type": "boolean" + }, + "IPAM": { + "$ref": "#/components/schemas/IPAM" + }, + "Internal": { + "type": "boolean" + }, + "Attachable": { + "type": "boolean" + }, + "Ingress": { + "type": "boolean" + }, + "Containers": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/NetworkContainer" + } + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "example": { + "Name": "net01", + "Id": "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99", + "Created": "2016-10-19T04:33:30.360899459Z", + "Scope": "local", + "Driver": "bridge", + "EnableIPv6": false, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.19.0.0/16", + "Gateway": "172.19.0.1" + } + ], + "Options": { + "foo": "bar" + } + }, + "Internal": false, + "Attachable": false, + "Ingress": false, + "Containers": { + "19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c": { + "Name": "test", + "EndpointID": "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a", + "MacAddress": "02:42:ac:13:00:02", + "IPv4Address": "172.19.0.2/16", + "IPv6Address": "" + } + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + }, + "IPAM": { + "type": "object", + "properties": { + "Driver": { + "type": "string", + "description": "Name of the IPAM driver to use.", + "default": "default" + }, + "Config": { + "type": "array", + "description": "List of IPAM configuration options, specified as a map:\n\n```\n{\"Subnet\": , \"IPRange\": , \"Gateway\": , \"AuxAddress\": }\n```\n", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver-specific options, specified as a map." + } + } + }, + "NetworkContainer": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "EndpointID": { + "type": "string" + }, + "MacAddress": { + "type": "string" + }, + "IPv4Address": { + "type": "string" + }, + "IPv6Address": { + "type": "string" + } + } + }, + "BuildInfo": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "stream": { + "type": "string" + }, + "error": { + "type": "string" + }, + "errorDetail": { + "$ref": "#/components/schemas/ErrorDetail" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + }, + "aux": { + "$ref": "#/components/schemas/ImageID" + } + } + }, + "BuildCache": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Parent": { + "type": "string" + }, + "Type": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "InUse": { + "type": "boolean" + }, + "Shared": { + "type": "boolean" + }, + "Size": { + "type": "integer", + "description": "Amount of disk space used by the build cache (in bytes).\n" + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the build cache was created in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "LastUsedAt": { + "type": "string", + "description": "Date and time at which the build cache was last used in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "nullable": true, + "example": "2017-08-09T07:09:37.632105588Z" + }, + "UsageCount": { + "type": "integer" + } + } + }, + "ImageID": { + "type": "object", + "properties": { + "ID": { + "type": "string" + } + }, + "description": "Image ID or Digest", + "example": { + "ID": "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" + } + }, + "CreateImageInfo": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "error": { + "type": "string" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + } + } + }, + "PushImageInfo": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + } + } + }, + "ErrorDetail": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + }, + "ProgressDetail": { + "type": "object", + "properties": { + "current": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "ErrorResponse": { + "required": [ + "message" + ], + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "The error message.", + "nullable": false + } + }, + "description": "Represents an error.", + "example": { + "message": "Something went wrong." + } + }, + "IdResponse": { + "required": [ + "Id" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The id of the newly created object.", + "nullable": false + } + }, + "description": "Response to an API call that returns just an Id" + }, + "EndpointSettings": { + "type": "object", + "properties": { + "IPAMConfig": { + "$ref": "#/components/schemas/EndpointIPAMConfig" + }, + "Links": { + "type": "array", + "example": [ + "container_1", + "container_2" + ], + "items": { + "type": "string" + } + }, + "Aliases": { + "type": "array", + "example": [ + "server_x", + "server_y" + ], + "items": { + "type": "string" + } + }, + "NetworkID": { + "type": "string", + "description": "Unique ID of the network.\n", + "example": "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a" + }, + "EndpointID": { + "type": "string", + "description": "Unique ID for the service endpoint in a Sandbox.\n", + "example": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + }, + "Gateway": { + "type": "string", + "description": "Gateway address for this network.\n", + "example": "172.17.0.1" + }, + "IPAddress": { + "type": "string", + "description": "IPv4 address.\n", + "example": "172.17.0.4" + }, + "IPPrefixLen": { + "type": "integer", + "description": "Mask length of the IPv4 address.\n", + "example": 16 + }, + "IPv6Gateway": { + "type": "string", + "description": "IPv6 gateway address.\n", + "example": "2001:db8:2::100" + }, + "GlobalIPv6Address": { + "type": "string", + "description": "Global IPv6 address.\n", + "example": "2001:db8::5689" + }, + "GlobalIPv6PrefixLen": { + "type": "integer", + "description": "Mask length of the global IPv6 address.\n", + "format": "int64", + "example": 64 + }, + "MacAddress": { + "type": "string", + "description": "MAC address for the endpoint on this network.\n", + "example": "02:42:ac:11:00:04" + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "DriverOpts is a mapping of driver options and values. These options\nare passed directly to the driver and are driver specific.\n", + "nullable": true, + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + }, + "description": "Configuration for a network endpoint." + }, + "EndpointIPAMConfig": { + "type": "object", + "properties": { + "IPv4Address": { + "type": "string", + "example": "172.20.30.33" + }, + "IPv6Address": { + "type": "string", + "example": "2001:db8:abcd::3033" + }, + "LinkLocalIPs": { + "type": "array", + "example": [ + "169.254.34.68", + "fe80::3468" + ], + "items": { + "type": "string" + } + } + }, + "description": "EndpointIPAMConfig represents an endpoint's IPAM configuration.\n", + "nullable": true, + "x-nullable": true + }, + "PluginMount": { + "required": [ + "Description", + "Destination", + "Name", + "Options", + "Settable", + "Source", + "Type" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false, + "example": "some-mount" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "This is a mount that's used by the plugin." + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Source": { + "type": "string", + "example": "/var/lib/docker/plugins/" + }, + "Destination": { + "type": "string", + "nullable": false, + "example": "/mnt/state" + }, + "Type": { + "type": "string", + "nullable": false, + "example": "bind" + }, + "Options": { + "type": "array", + "example": [ + "rbind", + "rw" + ], + "items": { + "type": "string" + } + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginDevice": { + "required": [ + "Description", + "Name", + "Path", + "Settable" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false + }, + "Description": { + "type": "string", + "nullable": false + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Path": { + "type": "string", + "example": "/dev/fuse" + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginEnv": { + "required": [ + "Description", + "Name", + "Settable", + "Value" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false + }, + "Description": { + "type": "string", + "nullable": false + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Value": { + "type": "string" + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginInterfaceType": { + "required": [ + "Capability", + "Prefix", + "Version" + ], + "type": "object", + "properties": { + "Prefix": { + "type": "string", + "nullable": false + }, + "Capability": { + "type": "string", + "nullable": false + }, + "Version": { + "type": "string", + "nullable": false + } + }, + "nullable": false, + "x-nullable": false + }, + "Plugin": { + "required": [ + "Config", + "Enabled", + "Name", + "Settings" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "example": "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" + }, + "Name": { + "type": "string", + "nullable": false, + "example": "tiborvass/sample-volume-plugin" + }, + "Enabled": { + "type": "boolean", + "description": "True if the plugin is running. False if the plugin is not running, only installed.", + "nullable": false, + "example": true + }, + "Settings": { + "required": [ + "Args", + "Devices", + "Env", + "Mounts" + ], + "type": "object", + "properties": { + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginMount" + } + }, + "Env": { + "type": "array", + "example": [ + "DEBUG=0" + ], + "items": { + "type": "string" + } + }, + "Args": { + "type": "array", + "items": { + "type": "string" + } + }, + "Devices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginDevice" + } + } + }, + "description": "Settings that can be modified by users.", + "nullable": false + }, + "PluginReference": { + "type": "string", + "description": "plugin remote reference used to push/pull the plugin", + "nullable": false, + "example": "localhost:5000/tiborvass/sample-volume-plugin:latest" + }, + "Config": { + "required": [ + "Args", + "Description", + "Documentation", + "Entrypoint", + "Env", + "Interface", + "IpcHost", + "Linux", + "Mounts", + "Network", + "PidHost", + "PropagatedMount", + "WorkDir" + ], + "type": "object", + "properties": { + "DockerVersion": { + "type": "string", + "description": "Docker Version used to create the plugin", + "nullable": false, + "example": "17.06.0-ce" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "A sample volume plugin for Docker" + }, + "Documentation": { + "type": "string", + "nullable": false, + "example": "https://docs.docker.com/engine/extend/plugins/" + }, + "Interface": { + "required": [ + "Socket", + "Types" + ], + "type": "object", + "properties": { + "Types": { + "type": "array", + "example": [ + "docker.volumedriver/1.0" + ], + "items": { + "$ref": "#/components/schemas/PluginInterfaceType" + } + }, + "Socket": { + "type": "string", + "nullable": false, + "example": "plugins.sock" + }, + "ProtocolScheme": { + "type": "string", + "description": "Protocol to use for clients connecting to the plugin.", + "example": "some.protocol/v1.0", + "enum": [ + "", + "moby.plugins.http/v1" + ] + } + }, + "description": "The interface between Docker and the plugin", + "nullable": false + }, + "Entrypoint": { + "type": "array", + "example": [ + "/usr/bin/sample-volume-plugin", + "/data" + ], + "items": { + "type": "string" + } + }, + "WorkDir": { + "type": "string", + "nullable": false, + "example": "/bin/" + }, + "User": { + "type": "object", + "properties": { + "UID": { + "type": "integer", + "format": "uint32", + "example": 1000 + }, + "GID": { + "type": "integer", + "format": "uint32", + "example": 1000 + } + }, + "nullable": false + }, + "Network": { + "required": [ + "Type" + ], + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": false, + "example": "host" + } + }, + "nullable": false + }, + "Linux": { + "required": [ + "AllowAllDevices", + "Capabilities", + "Devices" + ], + "type": "object", + "properties": { + "Capabilities": { + "type": "array", + "example": [ + "CAP_SYS_ADMIN", + "CAP_SYSLOG" + ], + "items": { + "type": "string" + } + }, + "AllowAllDevices": { + "type": "boolean", + "nullable": false, + "example": false + }, + "Devices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginDevice" + } + } + }, + "nullable": false + }, + "PropagatedMount": { + "type": "string", + "nullable": false, + "example": "/mnt/volumes" + }, + "IpcHost": { + "type": "boolean", + "nullable": false, + "example": false + }, + "PidHost": { + "type": "boolean", + "nullable": false, + "example": false + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginMount" + } + }, + "Env": { + "type": "array", + "example": [ + { + "Name": "DEBUG", + "Description": "If set, prints debug messages", + "Value": "0" + } + ], + "items": { + "$ref": "#/components/schemas/PluginEnv" + } + }, + "Args": { + "required": [ + "Description", + "Name", + "Settable", + "Value" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false, + "example": "args" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "command line arguments" + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "nullable": false + }, + "rootfs": { + "type": "object", + "properties": { + "type": { + "type": "string", + "example": "layers" + }, + "diff_ids": { + "type": "array", + "example": [ + "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887", + "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" + ], + "items": { + "type": "string" + } + } + } + } + }, + "description": "The config of a plugin.", + "nullable": false + } + }, + "description": "A plugin for the Engine API" + }, + "ObjectVersion": { + "type": "object", + "properties": { + "Index": { + "type": "integer", + "format": "uint64", + "example": 373531 + } + }, + "description": "The version number of the object such as node, service, etc. This is needed\nto avoid conflicting writes. The client must send the version number along\nwith the modified specification when updating these objects.\n\nThis approach ensures safe concurrency and determinism in that the change\non the object may not be applied if the version number has changed from the\nlast read. In other words, if two update requests specify the same base\nversion, only one of the requests can succeed. As a result, two separate\nupdate requests that happen at the same time will not unintentionally\noverwrite each other.\n" + }, + "NodeSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name for the node.", + "example": "my-node" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Role": { + "type": "string", + "description": "Role of the node.", + "example": "manager", + "enum": [ + "worker", + "manager" + ] + }, + "Availability": { + "type": "string", + "description": "Availability of the node.", + "example": "active", + "enum": [ + "active", + "pause", + "drain" + ] + } + }, + "example": { + "Availability": "active", + "Name": "node-name", + "Role": "manager", + "Labels": { + "foo": "bar" + } + } + }, + "Node": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "example": "24ifsmvkjbyhk" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the node was added to the swarm in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "UpdatedAt": { + "type": "string", + "description": "Date and time at which the node was last updated in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2017-08-09T07:09:37.632105588Z" + }, + "Spec": { + "$ref": "#/components/schemas/NodeSpec" + }, + "Description": { + "$ref": "#/components/schemas/NodeDescription" + }, + "Status": { + "$ref": "#/components/schemas/NodeStatus" + }, + "ManagerStatus": { + "$ref": "#/components/schemas/ManagerStatus" + } + } + }, + "NodeDescription": { + "type": "object", + "properties": { + "Hostname": { + "type": "string", + "example": "bf3067039e47" + }, + "Platform": { + "$ref": "#/components/schemas/Platform" + }, + "Resources": { + "$ref": "#/components/schemas/ResourceObject" + }, + "Engine": { + "$ref": "#/components/schemas/EngineDescription" + }, + "TLSInfo": { + "$ref": "#/components/schemas/TLSInfo" + } + }, + "description": "NodeDescription encapsulates the properties of the Node as reported by the\nagent.\n" + }, + "Platform": { + "type": "object", + "properties": { + "Architecture": { + "type": "string", + "description": "Architecture represents the hardware architecture (for example,\n`x86_64`).\n", + "example": "x86_64" + }, + "OS": { + "type": "string", + "description": "OS represents the Operating System (for example, `linux` or `windows`).\n", + "example": "linux" + } + }, + "description": "Platform represents the platform (Arch/OS).\n" + }, + "EngineDescription": { + "type": "object", + "properties": { + "EngineVersion": { + "type": "string", + "example": "17.06.0" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "example": { + "foo": "bar" + } + }, + "Plugins": { + "type": "array", + "example": [ + { + "Type": "Log", + "Name": "awslogs" + }, + { + "Type": "Log", + "Name": "fluentd" + }, + { + "Type": "Log", + "Name": "gcplogs" + }, + { + "Type": "Log", + "Name": "gelf" + }, + { + "Type": "Log", + "Name": "journald" + }, + { + "Type": "Log", + "Name": "json-file" + }, + { + "Type": "Log", + "Name": "logentries" + }, + { + "Type": "Log", + "Name": "splunk" + }, + { + "Type": "Log", + "Name": "syslog" + }, + { + "Type": "Network", + "Name": "bridge" + }, + { + "Type": "Network", + "Name": "host" + }, + { + "Type": "Network", + "Name": "ipvlan" + }, + { + "Type": "Network", + "Name": "macvlan" + }, + { + "Type": "Network", + "Name": "null" + }, + { + "Type": "Network", + "Name": "overlay" + }, + { + "Type": "Volume", + "Name": "local" + }, + { + "Type": "Volume", + "Name": "localhost:5000/vieux/sshfs:latest" + }, + { + "Type": "Volume", + "Name": "vieux/sshfs:latest" + } + ], + "items": { + "type": "object", + "properties": { + "Type": { + "type": "string" + }, + "Name": { + "type": "string" + } + } + } + } + }, + "description": "EngineDescription provides information about an engine." + }, + "TLSInfo": { + "type": "object", + "properties": { + "TrustRoot": { + "type": "string", + "description": "The root CA certificate(s) that are used to validate leaf TLS\ncertificates.\n" + }, + "CertIssuerSubject": { + "type": "string", + "description": "The base64-url-safe-encoded raw subject bytes of the issuer." + }, + "CertIssuerPublicKey": { + "type": "string", + "description": "The base64-url-safe-encoded raw public key bytes of the issuer.\n" + } + }, + "description": "Information about the issuer of leaf TLS certificates and the trusted root\nCA certificate.\n", + "example": { + "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0\nMzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf\n3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO\nPQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz\npxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H\n-----END CERTIFICATE-----\n", + "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh", + "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A==" + } + }, + "NodeStatus": { + "type": "object", + "properties": { + "State": { + "$ref": "#/components/schemas/NodeState" + }, + "Message": { + "type": "string", + "example": "" + }, + "Addr": { + "type": "string", + "description": "IP address of the node.", + "example": "172.17.0.2" + } + }, + "description": "NodeStatus represents the status of a node.\n\nIt provides the current status of the node, as seen by the manager.\n" + }, + "NodeState": { + "type": "string", + "description": "NodeState represents the state of a node.", + "example": "ready", + "enum": [ + "unknown", + "down", + "ready", + "disconnected" + ] + }, + "ManagerStatus": { + "type": "object", + "properties": { + "Leader": { + "type": "boolean", + "example": true, + "default": false + }, + "Reachability": { + "$ref": "#/components/schemas/Reachability" + }, + "Addr": { + "type": "string", + "description": "The IP address and port at which the manager is reachable.\n", + "example": "10.0.0.46:2377" + } + }, + "description": "ManagerStatus represents the status of a manager.\n\nIt provides the current status of a node's manager component, if the node\nis a manager.\n", + "nullable": true, + "x-nullable": true + }, + "Reachability": { + "type": "string", + "description": "Reachability represents the reachability of a node.", + "example": "reachable", + "enum": [ + "unknown", + "unreachable", + "reachable" + ] + }, + "SwarmSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the swarm.", + "example": "default" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.corp.type": "production", + "com.example.corp.department": "engineering" + } + }, + "Orchestration": { + "type": "object", + "properties": { + "TaskHistoryRetentionLimit": { + "type": "integer", + "description": "The number of historic tasks to keep per instance or node. If\nnegative, never remove completed or failed tasks.\n", + "format": "int64", + "example": 10 + } + }, + "description": "Orchestration configuration.", + "nullable": true + }, + "Raft": { + "type": "object", + "properties": { + "SnapshotInterval": { + "type": "integer", + "description": "The number of log entries between snapshots.", + "format": "uint64", + "example": 10000 + }, + "KeepOldSnapshots": { + "type": "integer", + "description": "The number of snapshots to keep beyond the current snapshot.\n", + "format": "uint64" + }, + "LogEntriesForSlowFollowers": { + "type": "integer", + "description": "The number of log entries to keep around to sync up slow followers\nafter a snapshot is created.\n", + "format": "uint64", + "example": 500 + }, + "ElectionTick": { + "type": "integer", + "description": "The number of ticks that a follower will wait for a message from\nthe leader before becoming a candidate and starting an election.\n`ElectionTick` must be greater than `HeartbeatTick`.\n\nA tick currently defaults to one second, so these translate\ndirectly to seconds currently, but this is NOT guaranteed.\n", + "example": 3 + }, + "HeartbeatTick": { + "type": "integer", + "description": "The number of ticks between heartbeats. Every HeartbeatTick ticks,\nthe leader will send a heartbeat to the followers.\n\nA tick currently defaults to one second, so these translate\ndirectly to seconds currently, but this is NOT guaranteed.\n", + "example": 1 + } + }, + "description": "Raft configuration." + }, + "Dispatcher": { + "type": "object", + "properties": { + "HeartbeatPeriod": { + "type": "integer", + "description": "The delay for an agent to send a heartbeat to the dispatcher.\n", + "format": "int64", + "example": 5000000000 + } + }, + "description": "Dispatcher configuration.", + "nullable": true + }, + "CAConfig": { + "type": "object", + "properties": { + "NodeCertExpiry": { + "type": "integer", + "description": "The duration node certificates are issued for.", + "format": "int64", + "example": 7776000000000000 + }, + "ExternalCAs": { + "type": "array", + "description": "Configuration for forwarding signing requests to an external\ncertificate authority.\n", + "items": { + "type": "object", + "properties": { + "Protocol": { + "type": "string", + "description": "Protocol for communication with the external CA (currently\nonly `cfssl` is supported).\n", + "default": "cfssl", + "enum": [ + "cfssl" + ] + }, + "URL": { + "type": "string", + "description": "URL where certificate signing requests should be sent.\n" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "An object with key/value pairs that are interpreted as\nprotocol-specific options for the external CA driver.\n" + }, + "CACert": { + "type": "string", + "description": "The root CA certificate (in PEM format) this external CA uses\nto issue TLS certificates (assumed to be to the current swarm\nroot CA certificate if not provided).\n" + } + } + } + }, + "SigningCACert": { + "type": "string", + "description": "The desired signing CA certificate for all swarm node TLS leaf\ncertificates, in PEM format.\n" + }, + "SigningCAKey": { + "type": "string", + "description": "The desired signing CA key for all swarm node TLS leaf certificates,\nin PEM format.\n" + }, + "ForceRotate": { + "type": "integer", + "description": "An integer whose purpose is to force swarm to generate a new\nsigning CA certificate and key, if none have been specified in\n`SigningCACert` and `SigningCAKey`\n", + "format": "uint64" + } + }, + "description": "CA configuration.", + "nullable": true + }, + "EncryptionConfig": { + "type": "object", + "properties": { + "AutoLockManagers": { + "type": "boolean", + "description": "If set, generate a key and use it to lock data stored on the\nmanagers.\n", + "example": false + } + }, + "description": "Parameters related to encryption-at-rest." + }, + "TaskDefaults": { + "type": "object", + "properties": { + "LogDriver": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The log driver to use as a default for new tasks.\n", + "example": "json-file" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver-specific options for the selectd log driver, specified\nas key/value pairs.\n", + "example": { + "max-file": "10", + "max-size": "100m" + } + } + }, + "description": "The log driver to use for tasks created in the orchestrator if\nunspecified by a service.\n\nUpdating this value only affects new tasks. Existing tasks continue\nto use their previously configured log driver until recreated.\n" + } + }, + "description": "Defaults for creating tasks in this cluster." + } + }, + "description": "User modifiable swarm configuration." + }, + "ClusterInfo": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the swarm.", + "example": "abajmipo7b4xz5ip2nrla6b11" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the swarm was initialised in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "UpdatedAt": { + "type": "string", + "description": "Date and time at which the swarm was last updated in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2017-08-09T07:09:37.632105588Z" + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + }, + "TLSInfo": { + "$ref": "#/components/schemas/TLSInfo" + }, + "RootRotationInProgress": { + "type": "boolean", + "description": "Whether there is currently a root CA rotation in progress for the swarm\n", + "example": false + }, + "DataPathPort": { + "type": "integer", + "description": "DataPathPort specifies the data path port number for data traffic.\nAcceptable port range is 1024 to 49151.\nIf no port is set or is set to 0, the default port (4789) is used.\n", + "format": "uint32", + "example": 4789 + }, + "DefaultAddrPool": { + "type": "array", + "description": "Default Address Pool specifies default subnet pools for global scope\nnetworks.\n", + "items": { + "type": "string", + "format": "CIDR", + "example": "" + } + }, + "SubnetSize": { + "maximum": 29, + "type": "integer", + "description": "SubnetSize specifies the subnet size of the networks created from the\ndefault subnet pool.\n", + "format": "uint32", + "example": 24 + } + }, + "description": "ClusterInfo represents information about the swarm as is returned by the\n\"/info\" endpoint. Join-tokens are not included.\n", + "nullable": true, + "x-nullable": true + }, + "JoinTokens": { + "type": "object", + "properties": { + "Worker": { + "type": "string", + "description": "The token workers can use to join the swarm.\n", + "example": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx" + }, + "Manager": { + "type": "string", + "description": "The token managers can use to join the swarm.\n", + "example": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + }, + "description": "JoinTokens contains the tokens workers and managers need to join the swarm.\n" + }, + "Swarm": { + "allOf": [ + { + "$ref": "#/components/schemas/ClusterInfo" + }, + { + "type": "object", + "properties": { + "JoinTokens": { + "$ref": "#/components/schemas/JoinTokens" + } + } + } + ] + }, + "TaskSpec": { + "type": "object", + "properties": { + "PluginSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The name or 'alias' to use for the plugin." + }, + "Remote": { + "type": "string", + "description": "The plugin image reference to use." + }, + "Disabled": { + "type": "boolean", + "description": "Disable the plugin once scheduled." + }, + "PluginPrivilege": { + "type": "array", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission accepted by the user upon installing the\nplugin.\n" + } + } + }, + "description": "Plugin spec for the service. *(Experimental release only.)*\n\n


\n\n> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n> mutually exclusive. PluginSpec is only used when the Runtime field\n> is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n> field is set to `attachment`.\n" + }, + "ContainerSpec": { + "type": "object", + "properties": { + "Image": { + "type": "string", + "description": "The image name to use for the container" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value data." + }, + "Command": { + "type": "array", + "description": "The command to be run in the image.", + "items": { + "type": "string" + } + }, + "Args": { + "type": "array", + "description": "Arguments to the command.", + "items": { + "type": "string" + } + }, + "Hostname": { + "type": "string", + "description": "The hostname to use for the container, as a valid\n[RFC 1123](https://tools.ietf.org/html/rfc1123) hostname.\n" + }, + "Env": { + "type": "array", + "description": "A list of environment variables in the form `VAR=value`.\n", + "items": { + "type": "string" + } + }, + "Dir": { + "type": "string", + "description": "The working directory for commands to run in." + }, + "User": { + "type": "string", + "description": "The user inside the container." + }, + "Groups": { + "type": "array", + "description": "A list of additional groups that the container process will run as.\n", + "items": { + "type": "string" + } + }, + "Privileges": { + "type": "object", + "properties": { + "CredentialSpec": { + "type": "object", + "properties": { + "Config": { + "type": "string", + "description": "Load credential spec from a Swarm Config with the given ID.\nThe specified config must also be present in the Configs\nfield with the Runtime property set.\n\n


\n\n\n> **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n> and `CredentialSpec.Config` are mutually exclusive.\n", + "example": "0bt9dmxjvjiqermk6xrop3ekq" + }, + "File": { + "type": "string", + "description": "Load credential spec from this file. The file is read by\nthe daemon, and must be present in the `CredentialSpecs`\nsubdirectory in the docker data directory, which defaults\nto `C:\\ProgramData\\Docker\\` on Windows.\n\nFor example, specifying `spec.json` loads\n`C:\\ProgramData\\Docker\\CredentialSpecs\\spec.json`.\n\n


\n\n> **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n> and `CredentialSpec.Config` are mutually exclusive.\n", + "example": "spec.json" + }, + "Registry": { + "type": "string", + "description": "Load credential spec from this value in the Windows\nregistry. The specified registry value must be located in:\n\n`HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Virtualization\\Containers\\CredentialSpecs`\n\n


\n\n\n> **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n> and `CredentialSpec.Config` are mutually exclusive.\n" + } + }, + "description": "CredentialSpec for managed service account (Windows only)" + }, + "SELinuxContext": { + "type": "object", + "properties": { + "Disable": { + "type": "boolean", + "description": "Disable SELinux" + }, + "User": { + "type": "string", + "description": "SELinux user label" + }, + "Role": { + "type": "string", + "description": "SELinux role label" + }, + "Type": { + "type": "string", + "description": "SELinux type label" + }, + "Level": { + "type": "string", + "description": "SELinux level label" + } + }, + "description": "SELinux labels of the container" + } + }, + "description": "Security options for the container" + }, + "TTY": { + "type": "boolean", + "description": "Whether a pseudo-TTY should be allocated." + }, + "OpenStdin": { + "type": "boolean", + "description": "Open `stdin`" + }, + "ReadOnly": { + "type": "boolean", + "description": "Mount the container's root filesystem as read only." + }, + "Mounts": { + "type": "array", + "description": "Specification for mounts to be added to containers created as part\nof the service.\n", + "items": { + "$ref": "#/components/schemas/Mount" + } + }, + "StopSignal": { + "type": "string", + "description": "Signal to stop the container." + }, + "StopGracePeriod": { + "type": "integer", + "description": "Amount of time to wait for the container to terminate before\nforcefully killing it.\n", + "format": "int64" + }, + "HealthCheck": { + "$ref": "#/components/schemas/HealthConfig" + }, + "Hosts": { + "type": "array", + "description": "A list of hostname/IP mappings to add to the container's `hosts`\nfile. The format of extra hosts is specified in the\n[hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html)\nman page:\n\n IP_address canonical_hostname [aliases...]\n", + "items": { + "type": "string" + } + }, + "DNSConfig": { + "type": "object", + "properties": { + "Nameservers": { + "type": "array", + "description": "The IP addresses of the name servers.", + "items": { + "type": "string" + } + }, + "Search": { + "type": "array", + "description": "A search list for host-name lookup.", + "items": { + "type": "string" + } + }, + "Options": { + "type": "array", + "description": "A list of internal resolver variables to be modified (e.g.,\n`debug`, `ndots:3`, etc.).\n", + "items": { + "type": "string" + } + } + }, + "description": "Specification for DNS related configurations in resolver configuration\nfile (`resolv.conf`).\n" + }, + "Secrets": { + "type": "array", + "description": "Secrets contains references to zero or more secrets that will be\nexposed to the service.\n", + "items": { + "type": "object", + "properties": { + "File": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name represents the final filename in the filesystem.\n" + }, + "UID": { + "type": "string", + "description": "UID represents the file UID." + }, + "GID": { + "type": "string", + "description": "GID represents the file GID." + }, + "Mode": { + "type": "integer", + "description": "Mode represents the FileMode of the file.", + "format": "uint32" + } + }, + "description": "File represents a specific target that is backed by a file.\n" + }, + "SecretID": { + "type": "string", + "description": "SecretID represents the ID of the specific secret that we're\nreferencing.\n" + }, + "SecretName": { + "type": "string", + "description": "SecretName is the name of the secret that this references,\nbut this is just provided for lookup/display purposes. The\nsecret in the reference will be identified by its ID.\n" + } + } + } + }, + "Configs": { + "type": "array", + "description": "Configs contains references to zero or more configs that will be\nexposed to the service.\n", + "items": { + "type": "object", + "properties": { + "File": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name represents the final filename in the filesystem.\n" + }, + "UID": { + "type": "string", + "description": "UID represents the file UID." + }, + "GID": { + "type": "string", + "description": "GID represents the file GID." + }, + "Mode": { + "type": "integer", + "description": "Mode represents the FileMode of the file.", + "format": "uint32" + } + }, + "description": "File represents a specific target that is backed by a file.\n\n


\n\n> **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive\n" + }, + "Runtime": { + "type": "object", + "properties": {}, + "description": "Runtime represents a target that is not mounted into the\ncontainer but is used by the task\n\n


\n\n> **Note**: `Configs.File` and `Configs.Runtime` are mutually\n> exclusive\n" + }, + "ConfigID": { + "type": "string", + "description": "ConfigID represents the ID of the specific config that we're\nreferencing.\n" + }, + "ConfigName": { + "type": "string", + "description": "ConfigName is the name of the config that this references,\nbut this is just provided for lookup/display purposes. The\nconfig in the reference will be identified by its ID.\n" + } + } + } + }, + "Isolation": { + "type": "string", + "description": "Isolation technology of the containers running the service.\n(Windows only)\n", + "enum": [ + "default", + "process", + "hyperv" + ] + }, + "Init": { + "type": "boolean", + "description": "Run an init inside the container that forwards signals and reaps\nprocesses. This field is omitted if empty, and the default (as\nconfigured on the daemon) is used.\n", + "nullable": true + }, + "Sysctls": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Set kernel namedspaced parameters (sysctls) in the container.\nThe Sysctls option on services accepts the same sysctls as the\nare supported on containers. Note that while the same sysctls are\nsupported, no guarantees or checks are made about their\nsuitability for a clustered environment, and it's up to the user\nto determine whether a given sysctl will work properly in a\nService.\n" + }, + "CapabilityAdd": { + "type": "array", + "description": "A list of kernel capabilities to add to the default set\nfor the container.\n", + "example": [ + "CAP_NET_RAW", + "CAP_SYS_ADMIN", + "CAP_SYS_CHROOT", + "CAP_SYSLOG" + ], + "items": { + "type": "string" + } + }, + "CapabilityDrop": { + "type": "array", + "description": "A list of kernel capabilities to drop from the default set\nfor the container.\n", + "example": [ + "CAP_NET_RAW" + ], + "items": { + "type": "string" + } + }, + "Ulimits": { + "type": "array", + "description": "A list of resource limits to set in the container. For example: `{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}`\"\n", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of ulimit" + }, + "Soft": { + "type": "integer", + "description": "Soft limit" + }, + "Hard": { + "type": "integer", + "description": "Hard limit" + } + } + } + } + }, + "description": "Container spec for the service.\n\n


\n\n> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n> mutually exclusive. PluginSpec is only used when the Runtime field\n> is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n> field is set to `attachment`.\n" + }, + "NetworkAttachmentSpec": { + "type": "object", + "properties": { + "ContainerID": { + "type": "string", + "description": "ID of the container represented by this task" + } + }, + "description": "Read-only spec type for non-swarm containers attached to swarm overlay\nnetworks.\n\n


\n\n> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n> mutually exclusive. PluginSpec is only used when the Runtime field\n> is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n> field is set to `attachment`.\n" + }, + "Resources": { + "type": "object", + "properties": { + "Limits": { + "$ref": "#/components/schemas/Limit" + }, + "Reservation": { + "$ref": "#/components/schemas/ResourceObject" + } + }, + "description": "Resource requirements which apply to each individual container created\nas part of the service.\n" + }, + "RestartPolicy": { + "type": "object", + "properties": { + "Condition": { + "type": "string", + "description": "Condition for restart.", + "enum": [ + "none", + "on-failure", + "any" + ] + }, + "Delay": { + "type": "integer", + "description": "Delay between restart attempts.", + "format": "int64" + }, + "MaxAttempts": { + "type": "integer", + "description": "Maximum attempts to restart a given container before giving up\n(default value is 0, which is ignored).\n", + "format": "int64", + "default": 0 + }, + "Window": { + "type": "integer", + "description": "Windows is the time window used to evaluate the restart policy\n(default value is 0, which is unbounded).\n", + "format": "int64", + "default": 0 + } + }, + "description": "Specification for the restart policy which applies to containers\ncreated as part of this service.\n" + }, + "Placement": { + "type": "object", + "properties": { + "Constraints": { + "type": "array", + "description": "An array of constraint expressions to limit the set of nodes where\na task can be scheduled. Constraint expressions can either use a\n_match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find\nnodes that satisfy every expression (AND match). Constraints can\nmatch node or Docker Engine labels as follows:\n\nnode attribute | matches | example\n---------------------|--------------------------------|-----------------------------------------------\n`node.id` | Node ID | `node.id==2ivku8v2gvtg4`\n`node.hostname` | Node hostname | `node.hostname!=node-2`\n`node.role` | Node role (`manager`/`worker`) | `node.role==manager`\n`node.platform.os` | Node operating system | `node.platform.os==windows`\n`node.platform.arch` | Node architecture | `node.platform.arch==x86_64`\n`node.labels` | User-defined node labels | `node.labels.security==high`\n`engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-14.04`\n\n`engine.labels` apply to Docker Engine labels like operating system,\ndrivers, etc. Swarm administrators add `node.labels` for operational\npurposes by using the [`node update endpoint`](#operation/NodeUpdate).\n", + "example": [ + "node.hostname!=node3.corp.example.com", + "node.role!=manager", + "node.labels.type==production", + "node.platform.os==linux", + "node.platform.arch==x86_64" + ], + "items": { + "type": "string" + } + }, + "Preferences": { + "type": "array", + "description": "Preferences provide a way to make the scheduler aware of factors\nsuch as topology. They are provided in order from highest to\nlowest precedence.\n", + "example": [ + { + "Spread": { + "SpreadDescriptor": "node.labels.datacenter" + } + }, + { + "Spread": { + "SpreadDescriptor": "node.labels.rack" + } + } + ], + "items": { + "type": "object", + "properties": { + "Spread": { + "type": "object", + "properties": { + "SpreadDescriptor": { + "type": "string", + "description": "label descriptor, such as `engine.labels.az`.\n" + } + } + } + } + } + }, + "MaxReplicas": { + "type": "integer", + "description": "Maximum number of replicas for per node (default value is 0, which\nis unlimited)\n", + "format": "int64", + "default": 0 + }, + "Platforms": { + "type": "array", + "description": "Platforms stores all the platforms that the service's image can\nrun on. This field is used in the platform filter for scheduling.\nIf empty, then the platform filter is off, meaning there are no\nscheduling restrictions.\n", + "items": { + "$ref": "#/components/schemas/Platform" + } + } + } + }, + "ForceUpdate": { + "type": "integer", + "description": "A counter that triggers an update even if no relevant parameters have\nbeen changed.\n" + }, + "Runtime": { + "type": "string", + "description": "Runtime is the type of runtime specified for the task executor.\n" + }, + "Networks": { + "type": "array", + "description": "Specifies which networks the service should attach to.", + "items": { + "$ref": "#/components/schemas/NetworkAttachmentConfig" + } + }, + "LogDriver": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "Specifies the log driver to use for tasks created from this spec. If\nnot present, the default one for the swarm will be used, finally\nfalling back to the engine default if not specified.\n" + } + }, + "description": "User modifiable task configuration." + }, + "TaskState": { + "type": "string", + "enum": [ + "new", + "allocated", + "pending", + "assigned", + "accepted", + "preparing", + "ready", + "starting", + "running", + "complete", + "shutdown", + "failed", + "rejected", + "remove", + "orphaned" + ] + }, + "Task": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the task." + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Name": { + "type": "string", + "description": "Name of the task." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Spec": { + "$ref": "#/components/schemas/TaskSpec" + }, + "ServiceID": { + "type": "string", + "description": "The ID of the service this task is part of." + }, + "Slot": { + "type": "integer" + }, + "NodeID": { + "type": "string", + "description": "The ID of the node that this task is on." + }, + "AssignedGenericResources": { + "$ref": "#/components/schemas/GenericResources" + }, + "Status": { + "type": "object", + "properties": { + "Timestamp": { + "type": "string", + "format": "dateTime" + }, + "State": { + "$ref": "#/components/schemas/TaskState" + }, + "Message": { + "type": "string" + }, + "Err": { + "type": "string" + }, + "ContainerStatus": { + "type": "object", + "properties": { + "ContainerID": { + "type": "string" + }, + "PID": { + "type": "integer" + }, + "ExitCode": { + "type": "integer" + } + } + } + } + }, + "DesiredState": { + "$ref": "#/components/schemas/TaskState" + }, + "JobIteration": { + "$ref": "#/components/schemas/ObjectVersion" + } + }, + "example": { + "ID": "0kzzo1i0y4jz6027t0k7aezc7", + "Version": { + "Index": 71 + }, + "CreatedAt": "2016-06-07T21:07:31.171892745Z", + "UpdatedAt": "2016-06-07T21:07:31.376370513Z", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:31.290032978Z", + "State": "running", + "Message": "started", + "ContainerStatus": { + "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035", + "PID": 677 + } + }, + "DesiredState": "running", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.10/16" + ] + } + ], + "AssignedGenericResources": [ + { + "DiscreteResourceSpec": { + "Kind": "SSD", + "Value": 3 + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID1" + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID2" + } + } + ] + } + }, + "ServiceSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the service." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "TaskTemplate": { + "$ref": "#/components/schemas/TaskSpec" + }, + "Mode": { + "type": "object", + "properties": { + "Replicated": { + "type": "object", + "properties": { + "Replicas": { + "type": "integer", + "format": "int64" + } + } + }, + "Global": { + "type": "object", + "properties": {} + }, + "ReplicatedJob": { + "type": "object", + "properties": { + "MaxConcurrent": { + "type": "integer", + "description": "The maximum number of replicas to run simultaneously.\n", + "format": "int64", + "default": 1 + }, + "TotalCompletions": { + "type": "integer", + "description": "The total number of replicas desired to reach the Completed\nstate. If unset, will default to the value of `MaxConcurrent`\n", + "format": "int64" + } + }, + "description": "The mode used for services with a finite number of tasks that run\nto a completed state.\n" + }, + "GlobalJob": { + "type": "object", + "properties": {}, + "description": "The mode used for services which run a task to the completed state\non each valid node.\n" + } + }, + "description": "Scheduling mode for the service." + }, + "UpdateConfig": { + "type": "object", + "properties": { + "Parallelism": { + "type": "integer", + "description": "Maximum number of tasks to be updated in one iteration (0 means\nunlimited parallelism).\n", + "format": "int64" + }, + "Delay": { + "type": "integer", + "description": "Amount of time between updates, in nanoseconds.", + "format": "int64" + }, + "FailureAction": { + "type": "string", + "description": "Action to take if an updated task fails to run, or stops running\nduring the update.\n", + "enum": [ + "continue", + "pause", + "rollback" + ] + }, + "Monitor": { + "type": "integer", + "description": "Amount of time to monitor each updated task for failures, in\nnanoseconds.\n", + "format": "int64" + }, + "MaxFailureRatio": { + "type": "number", + "description": "The fraction of tasks that may fail during an update before the\nfailure action is invoked, specified as a floating point number\nbetween 0 and 1.\n" + }, + "Order": { + "type": "string", + "description": "The order of operations when rolling out an updated task. Either\nthe old task is shut down before the new task is started, or the\nnew task is started before the old task is shut down.\n", + "enum": [ + "stop-first", + "start-first" + ] + } + }, + "description": "Specification for the update strategy of the service." + }, + "RollbackConfig": { + "type": "object", + "properties": { + "Parallelism": { + "type": "integer", + "description": "Maximum number of tasks to be rolled back in one iteration (0 means\nunlimited parallelism).\n", + "format": "int64" + }, + "Delay": { + "type": "integer", + "description": "Amount of time between rollback iterations, in nanoseconds.\n", + "format": "int64" + }, + "FailureAction": { + "type": "string", + "description": "Action to take if an rolled back task fails to run, or stops\nrunning during the rollback.\n", + "enum": [ + "continue", + "pause" + ] + }, + "Monitor": { + "type": "integer", + "description": "Amount of time to monitor each rolled back task for failures, in\nnanoseconds.\n", + "format": "int64" + }, + "MaxFailureRatio": { + "type": "number", + "description": "The fraction of tasks that may fail during a rollback before the\nfailure action is invoked, specified as a floating point number\nbetween 0 and 1.\n" + }, + "Order": { + "type": "string", + "description": "The order of operations when rolling back a task. Either the old\ntask is shut down before the new task is started, or the new task\nis started before the old task is shut down.\n", + "enum": [ + "stop-first", + "start-first" + ] + } + }, + "description": "Specification for the rollback strategy of the service." + }, + "Networks": { + "type": "array", + "description": "Specifies which networks the service should attach to.", + "items": { + "$ref": "#/components/schemas/NetworkAttachmentConfig" + } + }, + "EndpointSpec": { + "$ref": "#/components/schemas/EndpointSpec" + } + }, + "description": "User modifiable configuration for a service." + }, + "EndpointPortConfig": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Protocol": { + "type": "string", + "enum": [ + "tcp", + "udp", + "sctp" + ] + }, + "TargetPort": { + "type": "integer", + "description": "The port inside the container." + }, + "PublishedPort": { + "type": "integer", + "description": "The port on the swarm hosts." + }, + "PublishMode": { + "type": "string", + "description": "The mode in which port is published.\n\n


\n\n- \"ingress\" makes the target port accessible on every node,\n regardless of whether there is a task for the service running on\n that node or not.\n- \"host\" bypasses the routing mesh and publish the port directly on\n the swarm node where that service is running.\n", + "example": "ingress", + "default": "ingress", + "enum": [ + "ingress", + "host" + ] + } + } + }, + "EndpointSpec": { + "type": "object", + "properties": { + "Mode": { + "type": "string", + "description": "The mode of resolution to use for internal load balancing between tasks.\n", + "default": "vip", + "enum": [ + "vip", + "dnsrr" + ] + }, + "Ports": { + "type": "array", + "description": "List of exposed ports that this service is accessible on from the\noutside. Ports can only be provided if `vip` resolution mode is used.\n", + "items": { + "$ref": "#/components/schemas/EndpointPortConfig" + } + } + }, + "description": "Properties that can be configured to access and load balance a service." + }, + "Service": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Spec": { + "$ref": "#/components/schemas/ServiceSpec" + }, + "Endpoint": { + "type": "object", + "properties": { + "Spec": { + "$ref": "#/components/schemas/EndpointSpec" + }, + "Ports": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EndpointPortConfig" + } + }, + "VirtualIPs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "NetworkID": { + "type": "string" + }, + "Addr": { + "type": "string" + } + } + } + } + } + }, + "UpdateStatus": { + "type": "object", + "properties": { + "State": { + "type": "string", + "enum": [ + "updating", + "paused", + "completed" + ] + }, + "StartedAt": { + "type": "string", + "format": "dateTime" + }, + "CompletedAt": { + "type": "string", + "format": "dateTime" + }, + "Message": { + "type": "string" + } + }, + "description": "The status of a service update." + }, + "ServiceStatus": { + "type": "object", + "properties": { + "RunningTasks": { + "type": "integer", + "description": "The number of tasks for the service currently in the Running state.\n", + "format": "uint64", + "example": 7 + }, + "DesiredTasks": { + "type": "integer", + "description": "The number of tasks for the service desired to be running.\nFor replicated services, this is the replica count from the\nservice spec. For global services, this is computed by taking\ncount of all tasks for the service with a Desired State other\nthan Shutdown.\n", + "format": "uint64", + "example": 10 + }, + "CompletedTasks": { + "type": "integer", + "description": "The number of tasks for a job that are in the Completed state.\nThis field must be cross-referenced with the service type, as the\nvalue of 0 may mean the service is not in a job mode, or it may\nmean the job-mode service has no tasks yet Completed.\n", + "format": "uint64" + } + }, + "description": "The status of the service's tasks. Provided only when requested as\npart of a ServiceList operation.\n" + }, + "JobStatus": { + "type": "object", + "properties": { + "JobIteration": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "LastExecution": { + "type": "string", + "description": "The last time, as observed by the server, that this job was\nstarted.\n", + "format": "dateTime" + } + }, + "description": "The status of the service when it is in one of ReplicatedJob or\nGlobalJob modes. Absent on Replicated and Global mode services. The\nJobIteration is an ObjectVersion, but unlike the Service's version,\ndoes not need to be sent with an update request.\n" + } + }, + "example": { + "ID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Version": { + "Index": 19 + }, + "CreatedAt": "2016-06-07T21:05:51.880065305Z", + "UpdatedAt": "2016-06-07T21:07:29.962229872Z", + "Spec": { + "Name": "hopeful_cori", + "TaskTemplate": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {}, + "ForceUpdate": 0 + }, + "Mode": { + "Replicated": { + "Replicas": 1 + } + }, + "UpdateConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Mode": "vip", + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ] + } + }, + "Endpoint": { + "Spec": { + "Mode": "vip", + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ] + }, + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ], + "VirtualIPs": [ + { + "NetworkID": "4qvuz4ko70xaltuqbt8956gd1", + "Addr": "10.255.0.2/16" + }, + { + "NetworkID": "4qvuz4ko70xaltuqbt8956gd1", + "Addr": "10.255.0.3/16" + } + ] + } + } + }, + "ImageDeleteResponseItem": { + "type": "object", + "properties": { + "Untagged": { + "type": "string", + "description": "The image ID of an image that was untagged" + }, + "Deleted": { + "type": "string", + "description": "The image ID of an image that was deleted" + } + } + }, + "ServiceUpdateResponse": { + "type": "object", + "properties": { + "Warnings": { + "type": "array", + "description": "Optional warning messages", + "items": { + "type": "string" + } + } + }, + "example": { + "Warning": "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + } + }, + "ContainerSummary": { + "type": "array", + "items": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of this container", + "x-go-name": "ID" + }, + "Names": { + "type": "array", + "description": "The names that this container has been given", + "items": { + "type": "string" + } + }, + "Image": { + "type": "string", + "description": "The name of the image used when creating this container" + }, + "ImageID": { + "type": "string", + "description": "The ID of the image that this container was created from" + }, + "Command": { + "type": "string", + "description": "Command to run when starting the container" + }, + "Created": { + "type": "integer", + "description": "When the container was created", + "format": "int64" + }, + "Ports": { + "type": "array", + "description": "The ports exposed by this container", + "items": { + "$ref": "#/components/schemas/Port" + } + }, + "SizeRw": { + "type": "integer", + "description": "The size of files that have been created or changed by this container", + "format": "int64" + }, + "SizeRootFs": { + "type": "integer", + "description": "The total size of all the files in this container", + "format": "int64" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "State": { + "type": "string", + "description": "The state of this container (e.g. `Exited`)" + }, + "Status": { + "type": "string", + "description": "Additional human-readable status of this container (e.g. `Exit 0`)" + }, + "HostConfig": { + "type": "object", + "properties": { + "NetworkMode": { + "type": "string" + } + } + }, + "NetworkSettings": { + "type": "object", + "properties": { + "Networks": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + } + } + }, + "description": "A summary of the container's network settings" + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Mount" + } + } + } + } + }, + "Driver": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the driver.", + "nullable": false, + "example": "some-driver" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Key/value map of driver-specific options.", + "nullable": false, + "example": { + "OptionA": "value for driver-specific option A", + "OptionB": "value for driver-specific option B" + } + } + }, + "description": "Driver represents a driver (network, logging, secrets)." + }, + "SecretSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "User-defined name of the secret." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "Data": { + "type": "string", + "description": "Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5))\ndata to store as secret.\n\nThis field is only used to _create_ a secret, and is not returned by\nother endpoints.\n", + "example": "" + }, + "Driver": { + "$ref": "#/components/schemas/Driver" + }, + "Templating": { + "$ref": "#/components/schemas/Driver" + } + } + }, + "Secret": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "example": "blt1owaxmitz71s9v5zh81zun" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime", + "example": "2017-07-20T13:55:28.678958722Z" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime", + "example": "2017-07-20T13:55:28.678958722Z" + }, + "Spec": { + "$ref": "#/components/schemas/SecretSpec" + } + } + }, + "ConfigSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "User-defined name of the config." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Data": { + "type": "string", + "description": "Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5))\nconfig data.\n" + }, + "Templating": { + "$ref": "#/components/schemas/Driver" + } + } + }, + "Config": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Spec": { + "$ref": "#/components/schemas/ConfigSpec" + } + } + }, + "ContainerState": { + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "String representation of the container state. Can be one of \"created\",\n\"running\", \"paused\", \"restarting\", \"removing\", \"exited\", or \"dead\".\n", + "example": "running", + "enum": [ + "created", + "running", + "paused", + "restarting", + "removing", + "exited", + "dead" + ] + }, + "Running": { + "type": "boolean", + "description": "Whether this container is running.\n\nNote that a running container can be _paused_. The `Running` and `Paused`\nbooleans are not mutually exclusive:\n\nWhen pausing a container (on Linux), the freezer cgroup is used to suspend\nall processes in the container. Freezing the process requires the process to\nbe running. As a result, paused containers are both `Running` _and_ `Paused`.\n\nUse the `Status` field instead to determine if a container's state is \"running\".\n", + "example": true + }, + "Paused": { + "type": "boolean", + "description": "Whether this container is paused.", + "example": false + }, + "Restarting": { + "type": "boolean", + "description": "Whether this container is restarting.", + "example": false + }, + "OOMKilled": { + "type": "boolean", + "description": "Whether this container has been killed because it ran out of memory.\n", + "example": false + }, + "Dead": { + "type": "boolean", + "example": false + }, + "Pid": { + "type": "integer", + "description": "The process ID of this container", + "example": 1234 + }, + "ExitCode": { + "type": "integer", + "description": "The last exit code of this container", + "example": 0 + }, + "Error": { + "type": "string" + }, + "StartedAt": { + "type": "string", + "description": "The time when this container was last started.", + "example": "2020-01-06T09:06:59.461876391Z" + }, + "FinishedAt": { + "type": "string", + "description": "The time when this container last exited.", + "example": "2020-01-06T09:07:59.461876391Z" + }, + "Health": { + "$ref": "#/components/schemas/Health" + } + }, + "description": "ContainerState stores container's running state. It's part of ContainerJSONBase\nand will be returned by the \"inspect\" command.\n" + }, + "SystemVersion": { + "type": "object", + "properties": { + "Platform": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string" + } + } + }, + "Components": { + "type": "array", + "description": "Information about system components\n", + "items": { + "required": [ + "Name", + "Version" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the component\n", + "example": "Engine" + }, + "Version": { + "type": "string", + "description": "Version of the component\n", + "nullable": false, + "example": "19.03.12" + }, + "Details": { + "type": "object", + "properties": {}, + "description": "Key/value pairs of strings with additional information about the\ncomponent. These values are intended for informational purposes\nonly, and their content is not defined, and not part of the API\nspecification.\n\nThese messages can be printed by the client as information to the user.\n", + "nullable": true + } + }, + "x-go-name": "ComponentVersion" + } + }, + "Version": { + "type": "string", + "description": "The version of the daemon", + "example": "19.03.12" + }, + "ApiVersion": { + "type": "string", + "description": "The default (and highest) API version that is supported by the daemon\n", + "example": "1.40" + }, + "MinAPIVersion": { + "type": "string", + "description": "The minimum API version that is supported by the daemon\n", + "example": "1.12" + }, + "GitCommit": { + "type": "string", + "description": "The Git commit of the source code that was used to build the daemon\n", + "example": "48a66213fe" + }, + "GoVersion": { + "type": "string", + "description": "The version Go used to compile the daemon, and the version of the Go\nruntime in use.\n", + "example": "go1.13.14" + }, + "Os": { + "type": "string", + "description": "The operating system that the daemon is running on (\"linux\" or \"windows\")\n", + "example": "linux" + }, + "Arch": { + "type": "string", + "description": "The architecture that the daemon is running on\n", + "example": "amd64" + }, + "KernelVersion": { + "type": "string", + "description": "The kernel version (`uname -r`) that the daemon is running on.\n\nThis field is omitted when empty.\n", + "example": "4.19.76-linuxkit" + }, + "Experimental": { + "type": "boolean", + "description": "Indicates if the daemon is started with experimental features enabled.\n\nThis field is omitted when empty / false.\n", + "example": true + }, + "BuildTime": { + "type": "string", + "description": "The date and time that the daemon was compiled.\n", + "example": "2020-06-22T15:49:27.000000000+00:00" + } + }, + "description": "Response of Engine API: GET \"/version\"\n" + }, + "SystemInfo": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Unique identifier of the daemon.\n\n


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


\n\n> **Note**: The information returned in this field, including the\n> formatting of values and labels, should not be considered stable,\n> and may change without notice.\n", + "example": [ + [ + "Backing Filesystem", + "extfs" + ], + [ + "Supports d_type", + "true" + ], + [ + "Native Overlay Diff", + "true" + ] + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "DockerRootDir": { + "type": "string", + "description": "Root directory of persistent Docker state.\n\nDefaults to `/var/lib/docker` on Linux, and `C:\\ProgramData\\docker`\non Windows.\n", + "example": "/var/lib/docker" + }, + "Plugins": { + "$ref": "#/components/schemas/PluginsInfo" + }, + "MemoryLimit": { + "type": "boolean", + "description": "Indicates if the host has memory limit support enabled.", + "example": true + }, + "SwapLimit": { + "type": "boolean", + "description": "Indicates if the host has memory swap limit support enabled.", + "example": true + }, + "KernelMemory": { + "type": "boolean", + "description": "Indicates if the host has kernel memory limit support enabled.\n\n


\n\n> **Deprecated**: This field is deprecated as the kernel 5.4 deprecated\n> `kmem.limit_in_bytes`.\n", + "example": true + }, + "CpuCfsPeriod": { + "type": "boolean", + "description": "Indicates if CPU CFS(Completely Fair Scheduler) period is supported by\nthe host.\n", + "example": true + }, + "CpuCfsQuota": { + "type": "boolean", + "description": "Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by\nthe host.\n", + "example": true + }, + "CPUShares": { + "type": "boolean", + "description": "Indicates if CPU Shares limiting is supported by the host.\n", + "example": true + }, + "CPUSet": { + "type": "boolean", + "description": "Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host.\n\nSee [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt)\n", + "example": true + }, + "PidsLimit": { + "type": "boolean", + "description": "Indicates if the host kernel has PID limit support enabled.", + "example": true + }, + "OomKillDisable": { + "type": "boolean", + "description": "Indicates if OOM killer disable is supported on the host." + }, + "IPv4Forwarding": { + "type": "boolean", + "description": "Indicates IPv4 forwarding is enabled.", + "example": true + }, + "BridgeNfIptables": { + "type": "boolean", + "description": "Indicates if `bridge-nf-call-iptables` is available on the host.", + "example": true + }, + "BridgeNfIp6tables": { + "type": "boolean", + "description": "Indicates if `bridge-nf-call-ip6tables` is available on the host.", + "example": true + }, + "Debug": { + "type": "boolean", + "description": "Indicates if the daemon is running in debug-mode / with debug-level\nlogging enabled.\n", + "example": true + }, + "NFd": { + "type": "integer", + "description": "The total number of file Descriptors in use by the daemon process.\n\nThis information is only returned if debug-mode is enabled.\n", + "example": 64 + }, + "NGoroutines": { + "type": "integer", + "description": "The number of goroutines that currently exist.\n\nThis information is only returned if debug-mode is enabled.\n", + "example": 174 + }, + "SystemTime": { + "type": "string", + "description": "Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt)\nformat with nano-seconds.\n", + "example": "2017-08-08T20:28:29.06202363Z" + }, + "LoggingDriver": { + "type": "string", + "description": "The logging driver to use as a default for new containers.\n" + }, + "CgroupDriver": { + "type": "string", + "description": "The driver to use for managing cgroups.\n", + "example": "cgroupfs", + "default": "cgroupfs", + "enum": [ + "cgroupfs", + "systemd", + "none" + ] + }, + "CgroupVersion": { + "type": "string", + "description": "The version of the cgroup.\n", + "example": "1", + "default": "1", + "enum": [ + "1", + "2" + ] + }, + "NEventsListener": { + "type": "integer", + "description": "Number of event listeners subscribed.", + "example": 30 + }, + "KernelVersion": { + "type": "string", + "description": "Kernel version of the host.\n\nOn Linux, this information obtained from `uname`. On Windows this\ninformation is queried from the HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\\nregistry value, for example _\"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)\"_.\n", + "example": "4.9.38-moby" + }, + "OperatingSystem": { + "type": "string", + "description": "Name of the host's operating system, for example: \"Ubuntu 16.04.2 LTS\"\nor \"Windows Server 2016 Datacenter\"\n", + "example": "Alpine Linux v3.5" + }, + "OSVersion": { + "type": "string", + "description": "Version of the host's operating system\n\n


\n\n> **Note**: The information returned in this field, including its\n> very existence, and the formatting of values, should not be considered\n> stable, and may change without notice.\n", + "example": "16.04" + }, + "OSType": { + "type": "string", + "description": "Generic type of the operating system of the host, as returned by the\nGo runtime (`GOOS`).\n\nCurrently returned values are \"linux\" and \"windows\". A full list of\npossible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment).\n", + "example": "linux" + }, + "Architecture": { + "type": "string", + "description": "Hardware architecture of the host, as returned by the Go runtime\n(`GOARCH`).\n\nA full list of possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment).\n", + "example": "x86_64" + }, + "NCPU": { + "type": "integer", + "description": "The number of logical CPUs usable by the daemon.\n\nThe number of available CPUs is checked by querying the operating\nsystem when the daemon starts. Changes to operating system CPU\nallocation after the daemon is started are not reflected.\n", + "example": 4 + }, + "MemTotal": { + "type": "integer", + "description": "Total amount of physical memory available on the host, in bytes.\n", + "format": "int64", + "example": 2095882240 + }, + "IndexServerAddress": { + "type": "string", + "description": "Address / URL of the index server that is used for image search,\nand as a default for user authentication for Docker Hub and Docker Cloud.\n", + "example": "https://index.docker.io/v1/", + "default": "https://index.docker.io/v1/" + }, + "RegistryConfig": { + "$ref": "#/components/schemas/RegistryServiceConfig" + }, + "GenericResources": { + "$ref": "#/components/schemas/GenericResources" + }, + "HttpProxy": { + "type": "string", + "description": "HTTP-proxy configured for the daemon. This value is obtained from the\n[`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable.\nCredentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL\nare masked in the API response.\n\nContainers do not automatically inherit this configuration.\n", + "example": "http://xxxxx:xxxxx@proxy.corp.example.com:8080" + }, + "HttpsProxy": { + "type": "string", + "description": "HTTPS-proxy configured for the daemon. This value is obtained from the\n[`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable.\nCredentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL\nare masked in the API response.\n\nContainers do not automatically inherit this configuration.\n", + "example": "https://xxxxx:xxxxx@proxy.corp.example.com:4443" + }, + "NoProxy": { + "type": "string", + "description": "Comma-separated list of domain extensions for which no proxy should be\nused. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html)\nenvironment variable.\n\nContainers do not automatically inherit this configuration.\n", + "example": "*.local, 169.254/16" + }, + "Name": { + "type": "string", + "description": "Hostname of the host.", + "example": "node5.corp.example.com" + }, + "Labels": { + "type": "array", + "description": "User-defined labels (key/value metadata) as set on the daemon.\n\n


\n\n> **Note**: When part of a Swarm, nodes can both have _daemon_ labels,\n> set through the daemon configuration, and _node_ labels, set from a\n> manager node in the Swarm. Node labels are not included in this\n> field. Node labels can be retrieved using the `/nodes/(id)` endpoint\n> on a manager node in the Swarm.\n", + "example": [ + "storage=ssd", + "production" + ], + "items": { + "type": "string" + } + }, + "ExperimentalBuild": { + "type": "boolean", + "description": "Indicates if experimental features are enabled on the daemon.\n", + "example": true + }, + "ServerVersion": { + "type": "string", + "description": "Version string of the daemon.\n\n> **Note**: the [standalone Swarm API](https://docs.docker.com/swarm/swarm-api/)\n> returns the Swarm version instead of the daemon version, for example\n> `swarm/1.2.8`.\n", + "example": "17.06.0-ce" + }, + "ClusterStore": { + "type": "string", + "description": "URL of the distributed storage backend.\n\n\nThe storage backend is used for multihost networking (to store\nnetwork and endpoint information) and by the node discovery mechanism.\n\n


\n\n> **Deprecated**: This field is only propagated when using standalone Swarm\n> mode, and overlay networking using an external k/v store. Overlay\n> networks with Swarm mode enabled use the built-in raft store, and\n> this field will be empty.\n", + "example": "consul://consul.corp.example.com:8600/some/path" + }, + "ClusterAdvertise": { + "type": "string", + "description": "The network endpoint that the Engine advertises for the purpose of\nnode discovery. ClusterAdvertise is a `host:port` combination on which\nthe daemon is reachable by other hosts.\n\n


\n\n> **Deprecated**: This field is only propagated when using standalone Swarm\n> mode, and overlay networking using an external k/v store. Overlay\n> networks with Swarm mode enabled use the built-in raft store, and\n> this field will be empty.\n", + "example": "node5.corp.example.com:8000" + }, + "Runtimes": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Runtime" + }, + "description": "List of [OCI compliant](https://github.com/opencontainers/runtime-spec)\nruntimes configured on the daemon. Keys hold the \"name\" used to\nreference the runtime.\n\nThe Docker daemon relies on an OCI compliant runtime (invoked via the\n`containerd` daemon) as its interface to the Linux kernel namespaces,\ncgroups, and SELinux.\n\nThe default runtime is `runc`, and automatically configured. Additional\nruntimes can be configured by the user and will be listed here.\n", + "example": { + "runc": { + "path": "runc" + }, + "runc-master": { + "path": "/go/bin/runc" + }, + "custom": { + "path": "/usr/local/bin/my-oci-runtime", + "runtimeArgs": [ + "--debug", + "--systemd-cgroup=false" + ] + } + } + }, + "DefaultRuntime": { + "type": "string", + "description": "Name of the default OCI runtime that is used when starting containers.\n\nThe default can be overridden per-container at create time.\n", + "example": "runc", + "default": "runc" + }, + "Swarm": { + "$ref": "#/components/schemas/SwarmInfo" + }, + "LiveRestoreEnabled": { + "type": "boolean", + "description": "Indicates if live restore is enabled.\n\nIf enabled, containers are kept running when the daemon is shutdown\nor upon daemon start if running containers are detected.\n", + "example": false, + "default": false + }, + "Isolation": { + "type": "string", + "description": "Represents the isolation technology to use as a default for containers.\nThe supported values are platform-specific.\n\nIf no isolation value is specified on daemon start, on Windows client,\nthe default is `hyperv`, and on Windows server, the default is `process`.\n\nThis option is currently not used on other platforms.\n", + "default": "default", + "enum": [ + "default", + "hyperv", + "process" + ] + }, + "InitBinary": { + "type": "string", + "description": "Name and, optional, path of the `docker-init` binary.\n\nIf the path is omitted, the daemon searches the host's `$PATH` for the\nbinary and uses the first result.\n", + "example": "docker-init" + }, + "ContainerdCommit": { + "$ref": "#/components/schemas/Commit" + }, + "RuncCommit": { + "$ref": "#/components/schemas/Commit" + }, + "InitCommit": { + "$ref": "#/components/schemas/Commit" + }, + "SecurityOptions": { + "type": "array", + "description": "List of security features that are enabled on the daemon, such as\napparmor, seccomp, SELinux, user-namespaces (userns), and rootless.\n\nAdditional configuration options for each security feature may\nbe present, and are included as a comma-separated list of key/value\npairs.\n", + "example": [ + "name=apparmor", + "name=seccomp,profile=default", + "name=selinux", + "name=userns", + "name=rootless" + ], + "items": { + "type": "string" + } + }, + "ProductLicense": { + "type": "string", + "description": "Reports a summary of the product license on the daemon.\n\nIf a commercial license has been applied to the daemon, information\nsuch as number of nodes, and expiration are included.\n", + "example": "Community Engine" + }, + "DefaultAddressPools": { + "type": "array", + "description": "List of custom default address pools for local networks, which can be\nspecified in the daemon.json file or dockerd option.\n\nExample: a Base \"10.10.0.0/16\" with Size 24 will define the set of 256\n10.10.[0-255].0/24 address pools.\n", + "items": { + "type": "object", + "properties": { + "Base": { + "type": "string", + "description": "The network address in CIDR format", + "example": "10.10.0.0/16" + }, + "Size": { + "type": "integer", + "description": "The network pool size", + "example": 24 + } + } + } + }, + "Warnings": { + "type": "array", + "description": "List of warnings / informational messages about missing features, or\nissues related to the daemon configuration.\n\nThese messages can be printed by the client as information to the user.\n", + "example": [ + "WARNING: No memory limit support", + "WARNING: bridge-nf-call-iptables is disabled", + "WARNING: bridge-nf-call-ip6tables is disabled" + ], + "items": { + "type": "string" + } + } + } + }, + "PluginsInfo": { + "type": "object", + "properties": { + "Volume": { + "type": "array", + "description": "Names of available volume-drivers, and network-driver plugins.", + "example": [ + "local" + ], + "items": { + "type": "string" + } + }, + "Network": { + "type": "array", + "description": "Names of available network-drivers, and network-driver plugins.", + "example": [ + "bridge", + "host", + "ipvlan", + "macvlan", + "null", + "overlay" + ], + "items": { + "type": "string" + } + }, + "Authorization": { + "type": "array", + "description": "Names of available authorization plugins.", + "example": [ + "img-authz-plugin", + "hbm" + ], + "items": { + "type": "string" + } + }, + "Log": { + "type": "array", + "description": "Names of available logging-drivers, and logging-driver plugins.", + "example": [ + "awslogs", + "fluentd", + "gcplogs", + "gelf", + "journald", + "json-file", + "logentries", + "splunk", + "syslog" + ], + "items": { + "type": "string" + } + } + }, + "description": "Available plugins per type.\n\n


\n\n> **Note**: Only unmanaged (V1) plugins are included in this list.\n> V1 plugins are \"lazily\" loaded, and are not returned in this list\n> if there is no resource using the plugin.\n" + }, + "RegistryServiceConfig": { + "type": "object", + "properties": { + "AllowNondistributableArtifactsCIDRs": { + "type": "array", + "description": "List of IP ranges to which nondistributable artifacts can be pushed,\nusing the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632).\n\nSome images (for example, Windows base images) contain artifacts\nwhose distribution is restricted by license. When these images are\npushed to a registry, restricted artifacts are not included.\n\nThis configuration override this behavior, and enables the daemon to\npush nondistributable artifacts to all registries whose resolved IP\naddress is within the subnet described by the CIDR syntax.\n\nThis option is useful when pushing images containing\nnondistributable artifacts to a registry on an air-gapped network so\nhosts on that network can pull the images without connecting to\nanother server.\n\n> **Warning**: Nondistributable artifacts typically have restrictions\n> on how and where they can be distributed and shared. Only use this\n> feature to push artifacts to private registries and ensure that you\n> are in compliance with any terms that cover redistributing\n> nondistributable artifacts.\n", + "example": [ + "::1/128", + "127.0.0.0/8" + ], + "items": { + "type": "string" + } + }, + "AllowNondistributableArtifactsHostnames": { + "type": "array", + "description": "List of registry hostnames to which nondistributable artifacts can be\npushed, using the format `[:]` or `[:]`.\n\nSome images (for example, Windows base images) contain artifacts\nwhose distribution is restricted by license. When these images are\npushed to a registry, restricted artifacts are not included.\n\nThis configuration override this behavior for the specified\nregistries.\n\nThis option is useful when pushing images containing\nnondistributable artifacts to a registry on an air-gapped network so\nhosts on that network can pull the images without connecting to\nanother server.\n\n> **Warning**: Nondistributable artifacts typically have restrictions\n> on how and where they can be distributed and shared. Only use this\n> feature to push artifacts to private registries and ensure that you\n> are in compliance with any terms that cover redistributing\n> nondistributable artifacts.\n", + "example": [ + "registry.internal.corp.example.com:3000", + "[2001:db8:a0b:12f0::1]:443" + ], + "items": { + "type": "string" + } + }, + "InsecureRegistryCIDRs": { + "type": "array", + "description": "List of IP ranges of insecure registries, using the CIDR syntax\n([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries\naccept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates\nfrom unknown CAs) communication.\n\nBy default, local registries (`127.0.0.0/8`) are configured as\ninsecure. All other registries are secure. Communicating with an\ninsecure registry is not possible if the daemon assumes that registry\nis secure.\n\nThis configuration override this behavior, insecure communication with\nregistries whose resolved IP address is within the subnet described by\nthe CIDR syntax.\n\nRegistries can also be marked insecure by hostname. Those registries\nare listed under `IndexConfigs` and have their `Secure` field set to\n`false`.\n\n> **Warning**: Using this option can be useful when running a local\n> registry, but introduces security vulnerabilities. This option\n> should therefore ONLY be used for testing purposes. For increased\n> security, users should add their CA to their system's list of trusted\n> CAs instead of enabling this option.\n", + "example": [ + "::1/128", + "127.0.0.0/8" + ], + "items": { + "type": "string" + } + }, + "IndexConfigs": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/IndexInfo" + }, + "example": { + "127.0.0.1:5000": { + "Name": "127.0.0.1:5000", + "Mirrors": [], + "Secure": false, + "Official": false + }, + "[2001:db8:a0b:12f0::1]:80": { + "Name": "[2001:db8:a0b:12f0::1]:80", + "Mirrors": [], + "Secure": false, + "Official": false + }, + "docker.io": { + "Name": "docker.io", + "Mirrors": [ + "https://hub-mirror.corp.example.com:5000/" + ], + "Secure": true, + "Official": true + }, + "registry.internal.corp.example.com:3000": { + "Name": "registry.internal.corp.example.com:3000", + "Mirrors": [], + "Secure": false, + "Official": false + } + } + }, + "Mirrors": { + "type": "array", + "description": "List of registry URLs that act as a mirror for the official\n(`docker.io`) registry.\n", + "example": [ + "https://hub-mirror.corp.example.com:5000/", + "https://[2001:db8:a0b:12f0::1]/" + ], + "items": { + "type": "string" + } + } + }, + "description": "RegistryServiceConfig stores daemon registry services configuration.\n", + "nullable": true, + "x-nullable": true + }, + "IndexInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the registry, such as \"docker.io\".\n", + "example": "docker.io" + }, + "Mirrors": { + "type": "array", + "description": "List of mirrors, expressed as URIs.\n", + "example": [ + "https://hub-mirror.corp.example.com:5000/", + "https://registry-2.docker.io/", + "https://registry-3.docker.io/" + ], + "items": { + "type": "string" + } + }, + "Secure": { + "type": "boolean", + "description": "Indicates if the registry is part of the list of insecure\nregistries.\n\nIf `false`, the registry is insecure. Insecure registries accept\nun-encrypted (HTTP) and/or untrusted (HTTPS with certificates from\nunknown CAs) communication.\n\n> **Warning**: Insecure registries can be useful when running a local\n> registry. However, because its use creates security vulnerabilities\n> it should ONLY be enabled for testing purposes. For increased\n> security, users should add their CA to their system's list of\n> trusted CAs instead of enabling this option.\n", + "example": true + }, + "Official": { + "type": "boolean", + "description": "Indicates whether this is an official registry (i.e., Docker Hub / docker.io)\n", + "example": true + } + }, + "description": "IndexInfo contains information about a registry.", + "nullable": true, + "x-nullable": true + }, + "Runtime": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "Name and, optional, path, of the OCI executable binary.\n\nIf the path is omitted, the daemon searches the host's `$PATH` for the\nbinary and uses the first result.\n", + "example": "/usr/local/bin/my-oci-runtime" + }, + "runtimeArgs": { + "type": "array", + "description": "List of command-line arguments to pass to the runtime when invoked.\n", + "nullable": true, + "example": [ + "--debug", + "--systemd-cgroup=false" + ], + "items": { + "type": "string" + } + } + }, + "description": "Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec)\nruntime.\n\nThe runtime is invoked by the daemon via the `containerd` daemon. OCI\nruntimes act as an interface to the Linux kernel namespaces, cgroups,\nand SELinux.\n" + }, + "Commit": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Actual commit ID of external tool.", + "example": "cfb82a876ecc11b5ca0977d1733adbe58599088a" + }, + "Expected": { + "type": "string", + "description": "Commit ID of external tool expected by dockerd as set at build time.\n", + "example": "2d41c047c83e09a6d61d464906feb2a2f3c52aa4" + } + }, + "description": "Commit holds the Git-commit (SHA1) that a binary was built from, as\nreported in the version-string of external tools, such as `containerd`,\nor `runC`.\n" + }, + "SwarmInfo": { + "type": "object", + "properties": { + "NodeID": { + "type": "string", + "description": "Unique identifier of for this node in the swarm.", + "example": "k67qz4598weg5unwwffg6z1m1", + "default": "" + }, + "NodeAddr": { + "type": "string", + "description": "IP address at which this node can be reached by other nodes in the\nswarm.\n", + "example": "10.0.0.46", + "default": "" + }, + "LocalNodeState": { + "$ref": "#/components/schemas/LocalNodeState" + }, + "ControlAvailable": { + "type": "boolean", + "example": true, + "default": false + }, + "Error": { + "type": "string", + "default": "" + }, + "RemoteManagers": { + "type": "array", + "description": "List of ID's and addresses of other managers in the swarm.\n", + "nullable": true, + "example": [ + { + "NodeID": "71izy0goik036k48jg985xnds", + "Addr": "10.0.0.158:2377" + }, + { + "NodeID": "79y6h1o4gv8n120drcprv5nmc", + "Addr": "10.0.0.159:2377" + }, + { + "NodeID": "k67qz4598weg5unwwffg6z1m1", + "Addr": "10.0.0.46:2377" + } + ], + "items": { + "$ref": "#/components/schemas/PeerNode" + } + }, + "Nodes": { + "type": "integer", + "description": "Total number of nodes in the swarm.", + "nullable": true, + "example": 4 + }, + "Managers": { + "type": "integer", + "description": "Total number of managers in the swarm.", + "nullable": true, + "example": 3 + }, + "Cluster": { + "$ref": "#/components/schemas/ClusterInfo" + } + }, + "description": "Represents generic information about swarm.\n" + }, + "LocalNodeState": { + "type": "string", + "description": "Current local status of this node.", + "example": "active", + "default": "", + "enum": [ + "", + "inactive", + "pending", + "active", + "error", + "locked" + ] + }, + "PeerNode": { + "type": "object", + "properties": { + "NodeID": { + "type": "string", + "description": "Unique identifier of for this node in the swarm." + }, + "Addr": { + "type": "string", + "description": "IP address and ports at which this node can be reached.\n" + } + }, + "description": "Represents a peer-node in the swarm" + }, + "NetworkAttachmentConfig": { + "type": "object", + "properties": { + "Target": { + "type": "string", + "description": "The target network for attachment. Must be a network name or ID.\n" + }, + "Aliases": { + "type": "array", + "description": "Discoverable alternate names for the service on this network.\n", + "items": { + "type": "string" + } + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver attachment options for the network target.\n" + } + }, + "description": "Specifies how a service should be attached to a particular network.\n" + } + } + } +} \ No newline at end of file diff --git a/spec/v1.42.json b/spec/v1.42.json new file mode 100644 index 00000000..541cb215 --- /dev/null +++ b/spec/v1.42.json @@ -0,0 +1,16631 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Docker Engine API", + "description": "The Engine API is an HTTP API served by Docker Engine. It is the API the\nDocker client uses to communicate with the Engine, so everything the Docker\nclient can do can be done with the API.\n\nMost of the client's commands map directly to API endpoints (e.g. `docker ps`\nis `GET /containers/json`). The notable exception is running containers,\nwhich consists of several API calls.\n\n# Errors\n\nThe API uses standard HTTP status codes to indicate the success or failure\nof the API call. The body of the response will be JSON in the following\nformat:\n\n```\n{\n \"message\": \"page not found\"\n}\n```\n\n# Versioning\n\nThe API is usually changed in each release, so API calls are versioned to\nensure that clients don't break. To lock to a specific version of the API,\nyou prefix the URL with its version, for example, call `/v1.30/info` to use\nthe v1.30 version of the `/info` endpoint. If the API version specified in\nthe URL is not supported by the daemon, a HTTP `400 Bad Request` error message\nis returned.\n\nIf you omit the version-prefix, the current version of the API (v1.42) is used.\nFor example, calling `/info` is the same as calling `/v1.42/info`. Using the\nAPI without a version-prefix is deprecated and will be removed in a future release.\n\nEngine releases in the near future should support this version of the API,\nso your client will continue to work even if it is talking to a newer Engine.\n\nThe API uses an open schema model, which means server may add extra properties\nto responses. Likewise, the server will ignore any extra query parameters and\nrequest body properties. When you write clients, you need to ignore additional\nproperties in responses to ensure they do not break when talking to newer\ndaemons.\n\n\n# Authentication\n\nAuthentication for registries is handled client side. The client has to send\nauthentication details to various endpoints that need to communicate with\nregistries, such as `POST /images/(name)/push`. These are sent as\n`X-Registry-Auth` header as a [base64url encoded](https://tools.ietf.org/html/rfc4648#section-5)\n(JSON) string with the following structure:\n\n```\n{\n \"username\": \"string\",\n \"password\": \"string\",\n \"email\": \"string\",\n \"serveraddress\": \"string\"\n}\n```\n\nThe `serveraddress` is a domain/IP without a protocol. Throughout this\nstructure, double quotes are required.\n\nIf you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth),\nyou can just pass this instead of credentials:\n\n```\n{\n \"identitytoken\": \"9cbaf023786cd7...\"\n}\n```\n", + "version": "1.42", + "x-logo": { + "url": "https://docs.docker.com/assets/images/logo-docker-main.png" + } + }, + "servers": [ + { + "url": "/v1.42" + } + ], + "tags": [ + { + "name": "Container", + "description": "Create and manage containers.\n", + "x-displayName": "Containers" + }, + { + "name": "Image", + "x-displayName": "Images" + }, + { + "name": "Network", + "description": "Networks are user-defined networks that containers can be attached to.\nSee the [networking documentation](https://docs.docker.com/network/)\nfor more information.\n", + "x-displayName": "Networks" + }, + { + "name": "Volume", + "description": "Create and manage persistent storage that can be attached to containers.\n", + "x-displayName": "Volumes" + }, + { + "name": "Exec", + "description": "Run new commands inside running containers. Refer to the\n[command-line reference](https://docs.docker.com/engine/reference/commandline/exec/)\nfor more information.\n\nTo exec a command in a container, you first need to create an exec instance,\nthen start it. These two API endpoints are wrapped up in a single command-line\ncommand, `docker exec`.\n", + "x-displayName": "Exec" + }, + { + "name": "Swarm", + "description": "Engines can be clustered together in a swarm. Refer to the\n[swarm mode documentation](https://docs.docker.com/engine/swarm/)\nfor more information.\n", + "x-displayName": "Swarm" + }, + { + "name": "Node", + "description": "Nodes are instances of the Engine participating in a swarm. Swarm mode\nmust be enabled for these endpoints to work.\n", + "x-displayName": "Nodes" + }, + { + "name": "Service", + "description": "Services are the definitions of tasks to run on a swarm. Swarm mode must\nbe enabled for these endpoints to work.\n", + "x-displayName": "Services" + }, + { + "name": "Task", + "description": "A task is a container running on a swarm. It is the atomic scheduling unit\nof swarm. Swarm mode must be enabled for these endpoints to work.\n", + "x-displayName": "Tasks" + }, + { + "name": "Secret", + "description": "Secrets are sensitive data that can be used by services. Swarm mode must\nbe enabled for these endpoints to work.\n", + "x-displayName": "Secrets" + }, + { + "name": "Config", + "description": "Configs are application configurations that can be used by services. Swarm\nmode must be enabled for these endpoints to work.\n", + "x-displayName": "Configs" + }, + { + "name": "Plugin", + "x-displayName": "Plugins" + }, + { + "name": "System", + "x-displayName": "System" + } + ], + "paths": { + "/containers/json": { + "get": { + "tags": [ + "Container" + ], + "summary": "List containers", + "description": "Returns a list of containers. For details on the format, see the\n[inspect endpoint](#operation/ContainerInspect).\n\nNote that it uses a different, smaller representation of a container\nthan inspecting a single container. For example, the list of linked\ncontainers is not propagated .\n", + "operationId": "ContainerList", + "parameters": [ + { + "name": "all", + "in": "query", + "description": "Return all containers. By default, only running containers are shown.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "limit", + "in": "query", + "description": "Return this number of most recently created containers, including\nnon-running ones.\n", + "schema": { + "type": "integer" + } + }, + { + "name": "size", + "in": "query", + "description": "Return the size of container as fields `SizeRw` and `SizeRootFs`.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "filters", + "in": "query", + "description": "Filters to process on the container list, encoded as JSON (a\n`map[string][]string`). For example, `{\"status\": [\"paused\"]}` will\nonly return paused containers.\n\nAvailable filters:\n\n- `ancestor`=(`[:]`, ``, or ``)\n- `before`=(`` or ``)\n- `expose`=(`[/]`|`/[]`)\n- `exited=` containers with exit code of ``\n- `health`=(`starting`|`healthy`|`unhealthy`|`none`)\n- `id=` a container's ID\n- `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only)\n- `is-task=`(`true`|`false`)\n- `label=key` or `label=\"key=value\"` of a container label\n- `name=` a container's name\n- `network`=(`` or ``)\n- `publish`=(`[/]`|`/[]`)\n- `since`=(`` or ``)\n- `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`)\n- `volume`=(`` or ``)\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerSummary" + } + }, + "example": [ + { + "Id": "8dfafdbc3a40", + "Names": [ + "/boring_feynman" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 1", + "Created": 1367854155, + "State": "Exited", + "Status": "Exit 0", + "Ports": [ + { + "PrivatePort": 2222, + "PublicPort": 3333, + "Type": "tcp" + } + ], + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "2cdc4edb1ded3631c81f57966563e5c8525b81121bb3706a9a9a3ae102711f3f", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:02" + } + } + }, + "Mounts": [ + { + "Name": "fac362...80535", + "Source": "/data", + "Destination": "/data", + "Driver": "local", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" + } + ] + }, + { + "Id": "9cd87474be90", + "Names": [ + "/coolName" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 222222", + "Created": 1367854155, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "88eaed7b37b38c2a3f0c4bc796494fdf51b270c2d22656412a2ca5d559a64d7a", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.8", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:08" + } + } + }, + "Mounts": [] + }, + { + "Id": "3176a2479c92", + "Names": [ + "/sleepy_dog" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "8b27c041c30326d59cd6e6f510d4f8d1d570a228466f956edf7815508f78e30d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.6", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:06" + } + } + }, + "Mounts": [] + }, + { + "Id": "4cb07b47f9fb", + "Names": [ + "/running_cat" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "d91c7b2f0644403d7ef3095985ea0e2370325cd2332ff3a3225c4247328e66e9", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.5", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:05" + } + } + }, + "Mounts": [] + } + ] + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/create": { + "post": { + "tags": [ + "Container" + ], + "summary": "Create a container", + "operationId": "ContainerCreate", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Assign the specified name to the container. Must match\n`/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`.\n", + "schema": { + "pattern": "^/?[a-zA-Z0-9][a-zA-Z0-9_.-]+$", + "type": "string" + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform in the format `os[/arch[/variant]]` used for image lookup.\n\nWhen specified, the daemon checks if the requested image is present\nin the local image cache with the given OS and Architecture, and\notherwise returns a `404` status.\n\nIf the option is not set, the host's native OS and Architecture are\nused to look up the image in the image cache. However, if no platform\nis passed and the given image does exist in the local image cache,\nbut its OS or architecture does not match, the container is created\nwith the available image, and a warning is added to the `Warnings`\nfield in the response, for example;\n\n WARNING: The requested image's platform (linux/arm64/v8) does not\n match the detected host platform (linux/amd64) and no\n specific platform was requested\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Container to create", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ContainerConfig" + }, + { + "type": "object", + "properties": { + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "NetworkingConfig": { + "$ref": "#/components/schemas/NetworkingConfig" + } + } + } + ] + } + }, + "application/octet-stream": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ContainerConfig" + }, + { + "type": "object", + "properties": { + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "NetworkingConfig": { + "$ref": "#/components/schemas/NetworkingConfig" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Container created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContainerCreateResponse" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such image: c2ada9df5af8" + } + } + } + }, + "409": { + "description": "conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/containers/{id}/json": { + "get": { + "tags": [ + "Container" + ], + "summary": "Inspect a container", + "description": "Return low-level information about a container.", + "operationId": "ContainerInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "size", + "in": "query", + "description": "Return the size of container as fields `SizeRw` and `SizeRootFs`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "ContainerInspectResponse", + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the container" + }, + "Created": { + "type": "string", + "description": "The time the container was created" + }, + "Path": { + "type": "string", + "description": "The path to the command being run" + }, + "Args": { + "type": "array", + "description": "The arguments to the command being run", + "items": { + "type": "string" + } + }, + "State": { + "$ref": "#/components/schemas/ContainerState" + }, + "Image": { + "type": "string", + "description": "The container's image ID" + }, + "ResolvConfPath": { + "type": "string" + }, + "HostnamePath": { + "type": "string" + }, + "HostsPath": { + "type": "string" + }, + "LogPath": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "RestartCount": { + "type": "integer" + }, + "Driver": { + "type": "string" + }, + "Platform": { + "type": "string" + }, + "MountLabel": { + "type": "string" + }, + "ProcessLabel": { + "type": "string" + }, + "AppArmorProfile": { + "type": "string" + }, + "ExecIDs": { + "type": "array", + "description": "IDs of exec instances that are running in the container.", + "nullable": true, + "items": { + "type": "string" + } + }, + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "GraphDriver": { + "$ref": "#/components/schemas/GraphDriverData" + }, + "SizeRw": { + "type": "integer", + "description": "The size of files that have been created or changed by this\ncontainer.\n", + "format": "int64" + }, + "SizeRootFs": { + "type": "integer", + "description": "The total size of all the files in this container.", + "format": "int64" + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MountPoint" + } + }, + "Config": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "NetworkSettings": { + "$ref": "#/components/schemas/NetworkSettings" + } + } + }, + "example": { + "AppArmorProfile": "", + "Args": [ + "-c", + "exit 9" + ], + "Config": { + "AttachStderr": true, + "AttachStdin": false, + "AttachStdout": true, + "Cmd": [ + "/bin/sh", + "-c", + "exit 9" + ], + "Domainname": "", + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Healthcheck": { + "Test": [ + "CMD-SHELL", + "exit 0" + ] + }, + "Hostname": "ba033ac44011", + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "MacAddress": "", + "NetworkDisabled": false, + "OpenStdin": false, + "StdinOnce": false, + "Tty": false, + "User": "", + "Volumes": { + "/volumes/data": {} + }, + "WorkingDir": "", + "StopSignal": "SIGTERM", + "StopTimeout": 10 + }, + "Created": "2015-01-06T15:47:31.485331387Z", + "Driver": "devicemapper", + "ExecIDs": [ + "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca", + "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4" + ], + "HostConfig": { + "MaximumIOps": 0, + "MaximumIOBps": 0, + "BlkioWeight": 0, + "BlkioWeightDevice": [ + {} + ], + "BlkioDeviceReadBps": [ + {} + ], + "BlkioDeviceWriteBps": [ + {} + ], + "BlkioDeviceReadIOps": [ + {} + ], + "BlkioDeviceWriteIOps": [ + {} + ], + "ContainerIDFile": "", + "CpusetCpus": "", + "CpusetMems": "", + "CpuPercent": 80, + "CpuShares": 0, + "CpuPeriod": 100000, + "CpuRealtimePeriod": 1000000, + "CpuRealtimeRuntime": 10000, + "Devices": [], + "DeviceRequests": [ + { + "Driver": "nvidia", + "Count": -1, + "DeviceIDs\"": [ + "0", + "1", + "GPU-fef8089b-4820-abfc-e83e-94318197576e" + ], + "Capabilities": [ + [ + "gpu", + "nvidia", + "compute" + ] + ], + "Options": { + "property1": "string", + "property2": "string" + } + } + ], + "IpcMode": "", + "Memory": 0, + "MemorySwap": 0, + "MemoryReservation": 0, + "OomKillDisable": false, + "OomScoreAdj": 500, + "NetworkMode": "bridge", + "PidMode": "", + "PortBindings": {}, + "Privileged": false, + "ReadonlyRootfs": false, + "PublishAllPorts": false, + "RestartPolicy": { + "MaximumRetryCount": 2, + "Name": "on-failure" + }, + "LogConfig": { + "Type": "json-file" + }, + "Sysctls": { + "net.ipv4.ip_forward": "1" + }, + "Ulimits": [ + {} + ], + "VolumeDriver": "", + "ShmSize": 67108864 + }, + "HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname", + "HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts", + "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log", + "Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39", + "Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2", + "MountLabel": "", + "Name": "/boring_euclid", + "NetworkSettings": { + "Bridge": "", + "SandboxID": "", + "HairpinMode": false, + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + "SandboxKey": "", + "EndpointID": "", + "Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "IPAddress": "", + "IPPrefixLen": 0, + "IPv6Gateway": "", + "MacAddress": "", + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Path": "/bin/sh", + "ProcessLabel": "", + "ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf", + "RestartCount": 1, + "State": { + "Error": "", + "ExitCode": 9, + "FinishedAt": "2015-01-06T15:47:32.080254511Z", + "Health": { + "Status": "healthy", + "FailingStreak": 0, + "Log": [ + { + "Start": "2019-12-22T10:59:05.6385933Z", + "End": "2019-12-22T10:59:05.8078452Z", + "ExitCode": 0, + "Output": "" + } + ] + }, + "OOMKilled": false, + "Dead": false, + "Paused": false, + "Pid": 0, + "Restarting": false, + "Running": true, + "StartedAt": "2015-01-06T15:47:32.072697474Z", + "Status": "running" + }, + "Mounts": [ + { + "Name": "fac362...80535", + "Source": "/data", + "Destination": "/data", + "Driver": "local", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" + } + ] + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/top": { + "get": { + "tags": [ + "Container" + ], + "summary": "List processes running inside a container", + "description": "On Unix systems, this is done by running the `ps` command. This endpoint\nis not supported on Windows.\n", + "operationId": "ContainerTop", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "ps_args", + "in": "query", + "description": "The arguments to pass to `ps`. For example, `aux`", + "schema": { + "type": "string", + "default": "-ef" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "ContainerTopResponse", + "type": "object", + "properties": { + "Titles": { + "type": "array", + "description": "The ps column titles", + "items": { + "type": "string" + } + }, + "Processes": { + "type": "array", + "description": "Each process running in the container, where each is process\nis an array of values corresponding to the titles.\n", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "description": "OK response to ContainerTop operation" + }, + "example": { + "Titles": [ + "UID", + "PID", + "PPID", + "C", + "STIME", + "TTY", + "TIME", + "CMD" + ], + "Processes": [ + [ + "root", + "13642", + "882", + "0", + "17:03", + "pts/0", + "00:00:00", + "/bin/bash" + ], + [ + "root", + "13735", + "13642", + "0", + "17:06", + "pts/0", + "00:00:00", + "sleep 10" + ] + ] + } + }, + "text/plain": { + "schema": { + "title": "ContainerTopResponse", + "type": "object", + "properties": { + "Titles": { + "type": "array", + "description": "The ps column titles", + "items": { + "type": "string" + } + }, + "Processes": { + "type": "array", + "description": "Each process running in the container, where each is process\nis an array of values corresponding to the titles.\n", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "description": "OK response to ContainerTop operation" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/logs": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get container logs", + "description": "Get `stdout` and `stderr` logs from a container.\n\nNote: This endpoint works only for containers with the `json-file` or\n`journald` logging driver.\n", + "operationId": "ContainerLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "follow", + "in": "query", + "description": "Keep connection after returning logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "until", + "in": "query", + "description": "Only return logs before this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs.\nSpecify as an integer or `all` to output all log lines.\n", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "200": { + "description": "logs returned as a stream in response body.\nFor the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach).\nNote that unlike the attach endpoint, the logs endpoint does not\nupgrade the connection and does not set Content-Type.\n", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/changes": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get changes on a container’s filesystem", + "description": "Returns which files in a container's filesystem have been added, deleted,\nor modified. The `Kind` of modification can be one of:\n\n- `0`: Modified\n- `1`: Added\n- `2`: Deleted\n", + "operationId": "ContainerChanges", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The list of changes", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "ContainerChangeResponseItem", + "required": [ + "Kind", + "Path" + ], + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Path to file that has changed", + "nullable": false + }, + "Kind": { + "type": "integer", + "description": "Kind of change", + "format": "uint8", + "nullable": false + } + }, + "description": "change item in response to ContainerChanges operation", + "x-go-name": "ContainerChangeResponseItem" + } + }, + "example": [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/export": { + "get": { + "tags": [ + "Container" + ], + "summary": "Export a container", + "description": "Export the contents of a container as a tarball.", + "operationId": "ContainerExport", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/stats": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get container stats based on resource usage", + "description": "This endpoint returns a live stream of a container’s resource usage\nstatistics.\n\nThe `precpu_stats` is the CPU statistic of the *previous* read, and is\nused to calculate the CPU usage percentage. It is not an exact copy\nof the `cpu_stats` field.\n\nIf either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is\nnil then for compatibility with older daemons the length of the\ncorresponding `cpu_usage.percpu_usage` array should be used.\n\nOn a cgroup v2 host, the following fields are not set\n* `blkio_stats`: all fields other than `io_service_bytes_recursive`\n* `cpu_stats`: `cpu_usage.percpu_usage`\n* `memory_stats`: `max_usage` and `failcnt`\nAlso, `memory_stats.stats` fields are incompatible with cgroup v1.\n\nTo calculate the values shown by the `stats` command of the docker cli tool\nthe following formulas can be used:\n* used_memory = `memory_stats.usage - memory_stats.stats.cache`\n* available_memory = `memory_stats.limit`\n* Memory usage % = `(used_memory / available_memory) * 100.0`\n* cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage`\n* system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage`\n* number_cpus = `lenght(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus`\n* CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0`\n", + "operationId": "ContainerStats", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "stream", + "in": "query", + "description": "Stream the output. If false, the stats will be output once and then\nit will disconnect.\n", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "one-shot", + "in": "query", + "description": "Only get a single stat instead of waiting for 2 cycles. Must be used\nwith `stream=false`.\n", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "read": "2015-01-08T22:57:31.547920715Z", + "pids_stats": { + "current": 3 + }, + "networks": { + "eth0": { + "rx_bytes": 5338, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 36, + "tx_bytes": 648, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 8 + }, + "eth5": { + "rx_bytes": 4641, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 26, + "tx_bytes": 690, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 9 + } + }, + "memory_stats": { + "stats": { + "total_pgmajfault": 0, + "cache": 0, + "mapped_file": 0, + "total_inactive_file": 0, + "pgpgout": 414, + "rss": 6537216, + "total_mapped_file": 0, + "writeback": 0, + "unevictable": 0, + "pgpgin": 477, + "total_unevictable": 0, + "pgmajfault": 0, + "total_rss": 6537216, + "total_rss_huge": 6291456, + "total_writeback": 0, + "total_inactive_anon": 0, + "rss_huge": 6291456, + "hierarchical_memory_limit": 67108864, + "total_pgfault": 964, + "total_active_file": 0, + "active_anon": 6537216, + "total_active_anon": 6537216, + "total_pgpgout": 414, + "total_cache": 0, + "inactive_anon": 0, + "active_file": 0, + "pgfault": 964, + "inactive_file": 0, + "total_pgpgin": 477 + }, + "max_usage": 6651904, + "usage": 6537216, + "failcnt": 0, + "limit": 67108864 + }, + "blkio_stats": {}, + "cpu_stats": { + "cpu_usage": { + "percpu_usage": [ + 8646879, + 24472255, + 36438778, + 30657443 + ], + "usage_in_usermode": 50000000, + "total_usage": 100215355, + "usage_in_kernelmode": 30000000 + }, + "system_cpu_usage": 739306590000000, + "online_cpus": 4, + "throttling_data": { + "periods": 0, + "throttled_periods": 0, + "throttled_time": 0 + } + }, + "precpu_stats": { + "cpu_usage": { + "percpu_usage": [ + 8646879, + 24350896, + 36438778, + 30657443 + ], + "usage_in_usermode": 50000000, + "total_usage": 100093996, + "usage_in_kernelmode": 30000000 + }, + "system_cpu_usage": 9492140000000, + "online_cpus": 4, + "throttling_data": { + "periods": 0, + "throttled_periods": 0, + "throttled_time": 0 + } + } + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/resize": { + "post": { + "tags": [ + "Container" + ], + "summary": "Resize a container TTY", + "description": "Resize the TTY for a container.", + "operationId": "ContainerResize", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "h", + "in": "query", + "description": "Height of the TTY session in characters", + "schema": { + "type": "integer" + } + }, + { + "name": "w", + "in": "query", + "description": "Width of the TTY session in characters", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "cannot resize container", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/start": { + "post": { + "tags": [ + "Container" + ], + "summary": "Start a container", + "operationId": "ContainerStart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container. Format is a\nsingle character `[a-Z]` or `ctrl-` where `` is one\nof: `a-z`, `@`, `^`, `[`, `,` or `_`.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "304": { + "description": "container already started", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/stop": { + "post": { + "tags": [ + "Container" + ], + "summary": "Stop a container", + "operationId": "ContainerStop", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "signal", + "in": "query", + "description": "Signal to send to the container as an integer or string (e.g. `SIGINT`).\n", + "schema": { + "type": "string" + } + }, + { + "name": "t", + "in": "query", + "description": "Number of seconds to wait before killing the container", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "304": { + "description": "container already stopped", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/restart": { + "post": { + "tags": [ + "Container" + ], + "summary": "Restart a container", + "operationId": "ContainerRestart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "signal", + "in": "query", + "description": "Signal to send to the container as an integer or string (e.g. `SIGINT`).\n", + "schema": { + "type": "string" + } + }, + { + "name": "t", + "in": "query", + "description": "Number of seconds to wait before killing the container", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/kill": { + "post": { + "tags": [ + "Container" + ], + "summary": "Kill a container", + "description": "Send a POSIX signal to a container, defaulting to killing to the\ncontainer.\n", + "operationId": "ContainerKill", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "signal", + "in": "query", + "description": "Signal to send to the container as an integer or string (e.g. `SIGINT`).\n", + "schema": { + "type": "string", + "default": "SIGKILL" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "container is not running", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "Container d37cde0fe4ad63c3a7252023b2f9800282894247d145cb5933ddf6e52cc03a28 is not running" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/update": { + "post": { + "tags": [ + "Container" + ], + "summary": "Update a container", + "description": "Change various configuration options of a container without having to\nrecreate it.\n", + "operationId": "ContainerUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Resources" + }, + { + "type": "object", + "properties": { + "RestartPolicy": { + "$ref": "#/components/schemas/RestartPolicy" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The container has been updated.", + "content": { + "application/json": { + "schema": { + "title": "ContainerUpdateResponse", + "type": "object", + "properties": { + "Warnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "OK response to ContainerUpdate operation" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "update" + } + }, + "/containers/{id}/rename": { + "post": { + "tags": [ + "Container" + ], + "summary": "Rename a container", + "operationId": "ContainerRename", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "description": "New name for the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "name already in use", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/pause": { + "post": { + "tags": [ + "Container" + ], + "summary": "Pause a container", + "description": "Use the freezer cgroup to suspend all processes in a container.\n\nTraditionally, when suspending a process the `SIGSTOP` signal is used,\nwhich is observable by the process being suspended. With the freezer\ncgroup the process is unaware, and unable to capture, that it is being\nsuspended, and subsequently resumed.\n", + "operationId": "ContainerPause", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/unpause": { + "post": { + "tags": [ + "Container" + ], + "summary": "Unpause a container", + "description": "Resume a container which has been paused.", + "operationId": "ContainerUnpause", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/attach": { + "post": { + "tags": [ + "Container" + ], + "summary": "Attach to a container", + "description": "Attach to a container to read its output or send it input. You can attach\nto the same container multiple times and you can reattach to containers\nthat have been detached.\n\nEither the `stream` or `logs` parameter must be `true` for this endpoint\nto do anything.\n\nSee the [documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/)\nfor more details.\n\n### Hijacking\n\nThis endpoint hijacks the HTTP connection to transport `stdin`, `stdout`,\nand `stderr` on the same socket.\n\nThis is the response from the daemon for an attach request:\n\n```\nHTTP/1.1 200 OK\nContent-Type: application/vnd.docker.raw-stream\n\n[STREAM]\n```\n\nAfter the headers and two new lines, the TCP connection can now be used\nfor raw, bidirectional communication between the client and server.\n\nTo hint potential proxies about connection hijacking, the Docker client\ncan also optionally send connection upgrade headers.\n\nFor example, the client sends this request to upgrade the connection:\n\n```\nPOST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1\nUpgrade: tcp\nConnection: Upgrade\n```\n\nThe Docker daemon will respond with a `101 UPGRADED` response, and will\nsimilarly follow with the raw stream:\n\n```\nHTTP/1.1 101 UPGRADED\nContent-Type: application/vnd.docker.raw-stream\nConnection: Upgrade\nUpgrade: tcp\n\n[STREAM]\n```\n\n### Stream format\n\nWhen the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate),\nthe HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream\nand the stream over the hijacked connected is multiplexed to separate out\n`stdout` and `stderr`. The stream consists of a series of frames, each\ncontaining a header and a payload.\n\nThe header contains the information which the stream writes (`stdout` or\n`stderr`). It also contains the size of the associated frame encoded in\nthe last four bytes (`uint32`).\n\nIt is encoded on the first eight bytes like this:\n\n```go\nheader := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n```\n\n`STREAM_TYPE` can be:\n\n- 0: `stdin` (is written on `stdout`)\n- 1: `stdout`\n- 2: `stderr`\n\n`SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size\nencoded as big endian.\n\nFollowing the header is the payload, which is the specified number of\nbytes of `STREAM_TYPE`.\n\nThe simplest way to implement this protocol is the following:\n\n1. Read 8 bytes.\n2. Choose `stdout` or `stderr` depending on the first byte.\n3. Extract the frame size from the last four bytes.\n4. Read the extracted size and output it on the correct output.\n5. Goto 1.\n\n### Stream format when using a TTY\n\nWhen the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate),\nthe stream is not multiplexed. The data exchanged over the hijacked\nconnection is simply the raw data from the process PTY and client's\n`stdin`.\n", + "operationId": "ContainerAttach", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container.Format is a single\ncharacter `[a-Z]` or `ctrl-` where `` is one of: `a-z`,\n`@`, `^`, `[`, `,` or `_`.\n", + "schema": { + "type": "string" + } + }, + { + "name": "logs", + "in": "query", + "description": "Replay previous logs from the container.\n\nThis is useful for attaching to a container that has started and you\nwant to output everything since the container started.\n\nIf `stream` is also enabled, once all the previous output has been\nreturned, it will seamlessly transition into streaming current\noutput.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stream", + "in": "query", + "description": "Stream attached streams from the time the request was made onwards.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdin", + "in": "query", + "description": "Attach to `stdin`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Attach to `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Attach to `stderr`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "101": { + "description": "no error, hints proxy about hijacking", + "content": {} + }, + "200": { + "description": "no error, no upgrade header found", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/attach/ws": { + "get": { + "tags": [ + "Container" + ], + "summary": "Attach to a container via a websocket", + "operationId": "ContainerAttachWebsocket", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container.Format is a single\ncharacter `[a-Z]` or `ctrl-` where `` is one of: `a-z`,\n`@`, `^`, `[`, `,`, or `_`.\n", + "schema": { + "type": "string" + } + }, + { + "name": "logs", + "in": "query", + "description": "Return logs", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stream", + "in": "query", + "description": "Return stream", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdin", + "in": "query", + "description": "Attach to `stdin`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Attach to `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Attach to `stderr`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "101": { + "description": "no error, hints proxy about hijacking", + "content": {} + }, + "200": { + "description": "no error, no upgrade header found", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/wait": { + "post": { + "tags": [ + "Container" + ], + "summary": "Wait for a container", + "description": "Block until a container stops, then returns the exit code.", + "operationId": "ContainerWait", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "condition", + "in": "query", + "description": "Wait until a container state reaches the given condition.\n\nDefaults to `not-running` if omitted or empty.\n", + "schema": { + "type": "string", + "default": "not-running", + "enum": [ + "not-running", + "next-exit", + "removed" + ] + } + } + ], + "responses": { + "200": { + "description": "The container has exit.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContainerWaitResponse" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}": { + "delete": { + "tags": [ + "Container" + ], + "summary": "Remove a container", + "operationId": "ContainerDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "v", + "in": "query", + "description": "Remove anonymous volumes associated with the container.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "force", + "in": "query", + "description": "If the container is running, kill it before removing it.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "link", + "in": "query", + "description": "Remove the specified link associated with the container.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "You cannot remove a running container: c2ada9df5af8. Stop the\ncontainer before attempting removal or force remove\n" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/archive": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get an archive of a filesystem resource in a container", + "description": "Get a tar archive of a resource in the filesystem of container id.", + "operationId": "ContainerArchive", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Resource in the container’s filesystem to archive.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Container or path does not exist", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Container" + ], + "summary": "Extract an archive of files or folders to a directory in a container", + "description": "Upload a tar archive to be extracted to a path in the filesystem of container id.\n`path` parameter is asserted to be a directory. If it exists as a file, 400 error\nwill be returned with message \"not a directory\".\n", + "operationId": "PutContainerArchive", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Path to a directory in the container to extract the archive’s contents into. ", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "noOverwriteDirNonDir", + "in": "query", + "description": "If `1`, `true`, or `True` then it will be an error if unpacking the\ngiven content would cause an existing directory to be replaced with\na non-directory and vice versa.\n", + "schema": { + "type": "string" + } + }, + { + "name": "copyUIDGID", + "in": "query", + "description": "If `1`, `true`, then it will copy UID/GID maps to the dest file or\ndir\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The input stream must be a tar archive compressed with one of the\nfollowing algorithms: `identity` (no compression), `gzip`, `bzip2`,\nor `xz`.\n", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The content was extracted successfully", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "not a directory" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "Permission denied, the volume or container rootfs is marked as read-only.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "No such container or path does not exist inside the container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputStream" + }, + "head": { + "tags": [ + "Container" + ], + "summary": "Get information about files in a container", + "description": "A response header `X-Docker-Container-Path-Stat` is returned, containing\na base64 - encoded JSON object with some filesystem header information\nabout the path.\n", + "operationId": "ContainerArchiveInfo", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Resource in the container’s filesystem to archive.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "headers": { + "X-Docker-Container-Path-Stat": { + "description": "A base64 - encoded JSON object with some filesystem header\ninformation about the path\n", + "schema": { + "type": "string" + } + } + }, + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Container or path does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/prune": { + "post": { + "tags": [ + "Container" + ], + "summary": "Delete stopped containers", + "operationId": "ContainerPrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `until=` Prune containers created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune containers with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ContainerPruneResponse", + "type": "object", + "properties": { + "ContainersDeleted": { + "type": "array", + "description": "Container IDs that were deleted", + "items": { + "type": "string" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/json": { + "get": { + "tags": [ + "Image" + ], + "summary": "List Images", + "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.", + "operationId": "ImageList", + "parameters": [ + { + "name": "all", + "in": "query", + "description": "Show all images. Only images from a final layer (no children) are shown by default.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the images list.\n\nAvailable filters:\n\n- `before`=(`[:]`, `` or ``)\n- `dangling=true`\n- `label=key` or `label=\"key=value\"` of an image label\n- `reference`=(`[:]`)\n- `since`=(`[:]`, `` or ``)\n", + "schema": { + "type": "string" + } + }, + { + "name": "shared-size", + "in": "query", + "description": "Compute and show shared size as a `SharedSize` field on each image.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "digests", + "in": "query", + "description": "Show digest information as a `RepoDigests` field on each image.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Summary image data for the images matching the query", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/build": { + "post": { + "tags": [ + "Image" + ], + "summary": "Build an image", + "description": "Build an image from a tar archive with a `Dockerfile` in it.\n\nThe `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/).\n\nThe 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.\n\nThe build is canceled if the client drops the connection by quitting or being killed.\n", + "operationId": "ImageBuild", + "parameters": [ + { + "name": "dockerfile", + "in": "query", + "description": "Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`.", + "schema": { + "type": "string", + "default": "Dockerfile" + } + }, + { + "name": "t", + "in": "query", + "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.", + "schema": { + "type": "string" + } + }, + { + "name": "extrahosts", + "in": "query", + "description": "Extra hosts to add to /etc/hosts", + "schema": { + "type": "string" + } + }, + { + "name": "remote", + "in": "query", + "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.", + "schema": { + "type": "string" + } + }, + { + "name": "q", + "in": "query", + "description": "Suppress verbose build output.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "nocache", + "in": "query", + "description": "Do not use the cache when building the image.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "cachefrom", + "in": "query", + "description": "JSON array of images used for build cache resolution.", + "schema": { + "type": "string" + } + }, + { + "name": "pull", + "in": "query", + "description": "Attempt to pull the image even if an older image exists locally.", + "schema": { + "type": "string" + } + }, + { + "name": "rm", + "in": "query", + "description": "Remove intermediate containers after a successful build.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "forcerm", + "in": "query", + "description": "Always remove intermediate containers, even upon failure.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "memory", + "in": "query", + "description": "Set memory limit for build.", + "schema": { + "type": "integer" + } + }, + { + "name": "memswap", + "in": "query", + "description": "Total memory (memory + swap). Set as `-1` to disable swap.", + "schema": { + "type": "integer" + } + }, + { + "name": "cpushares", + "in": "query", + "description": "CPU shares (relative weight).", + "schema": { + "type": "integer" + } + }, + { + "name": "cpusetcpus", + "in": "query", + "description": "CPUs in which to allow execution (e.g., `0-3`, `0,1`).", + "schema": { + "type": "string" + } + }, + { + "name": "cpuperiod", + "in": "query", + "description": "The length of a CPU period in microseconds.", + "schema": { + "type": "integer" + } + }, + { + "name": "cpuquota", + "in": "query", + "description": "Microseconds of CPU time that the container can get in a CPU period.", + "schema": { + "type": "integer" + } + }, + { + "name": "buildargs", + "in": "query", + "description": "JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values.\n\nFor example, the build arg `FOO=bar` would become `{\"FOO\":\"bar\"}` in JSON. This would result in the query parameter `buildargs={\"FOO\":\"bar\"}`. Note that `{\"FOO\":\"bar\"}` should be URI component encoded.\n\n[Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg)\n", + "schema": { + "type": "string" + } + }, + { + "name": "shmsize", + "in": "query", + "description": "Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB.", + "schema": { + "type": "integer" + } + }, + { + "name": "squash", + "in": "query", + "description": "Squash the resulting images layers into a single layer. *(Experimental release only.)*", + "schema": { + "type": "boolean" + } + }, + { + "name": "labels", + "in": "query", + "description": "Arbitrary key/value labels to set on the image, as a JSON map of string pairs.", + "schema": { + "type": "string" + } + }, + { + "name": "networkmode", + "in": "query", + "description": "Sets the networking mode for the run commands during build. Supported\nstandard values are: `bridge`, `host`, `none`, and `container:`.\nAny other value is taken as a custom network's name or ID to which this\ncontainer should connect to.\n", + "schema": { + "type": "string" + } + }, + { + "name": "Content-type", + "in": "header", + "schema": { + "type": "string", + "default": "application/x-tar", + "enum": [ + "application/x-tar" + ] + } + }, + { + "name": "X-Registry-Config", + "in": "header", + "description": "This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to.\n\nThe key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example:\n\n```\n{\n \"docker.example.com\": {\n \"username\": \"janedoe\",\n \"password\": \"hunter2\"\n },\n \"https://index.docker.io/v1/\": {\n \"username\": \"mobydock\",\n \"password\": \"conta1n3rize14\"\n }\n}\n```\n\nOnly 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.\n", + "schema": { + "type": "string" + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform in the format os[/arch[/variant]]", + "schema": { + "type": "string" + } + }, + { + "name": "target", + "in": "query", + "description": "Target build stage", + "schema": { + "type": "string" + } + }, + { + "name": "outputs", + "in": "query", + "description": "BuildKit output configuration", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz.", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputStream" + } + }, + "/build/prune": { + "post": { + "tags": [ + "Image" + ], + "summary": "Delete builder cache", + "operationId": "BuildPrune", + "parameters": [ + { + "name": "keep-storage", + "in": "query", + "description": "Amount of disk space in bytes to keep for cache", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "all", + "in": "query", + "description": "Remove all types of build cache", + "schema": { + "type": "boolean" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the list of build cache objects.\n\nAvailable filters:\n\n- `until=`: duration relative to daemon's time, during which build cache was not used, in Go's duration format (e.g., '24h')\n- `id=`\n- `parent=`\n- `type=`\n- `description=`\n- `inuse`\n- `shared`\n- `private`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "BuildPruneResponse", + "type": "object", + "properties": { + "CachesDeleted": { + "type": "array", + "items": { + "type": "string", + "description": "ID of build cache object" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/create": { + "post": { + "tags": [ + "Image" + ], + "summary": "Create an image", + "description": "Create an image by either pulling it from a registry or importing it.", + "operationId": "ImageCreate", + "parameters": [ + { + "name": "fromImage", + "in": "query", + "description": "Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed.", + "schema": { + "type": "string" + } + }, + { + "name": "fromSrc", + "in": "query", + "description": "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image.", + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled.", + "schema": { + "type": "string" + } + }, + { + "name": "message", + "in": "query", + "description": "Set commit message for imported image.", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + }, + { + "name": "changes", + "in": "query", + "description": "Apply `Dockerfile` instructions to the image that is created,\nfor example: `changes=ENV DEBUG=true`.\nNote that `ENV DEBUG=true` should be URI component encoded.\n\nSupported `Dockerfile` instructions:\n`CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR`\n", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform in the format os[/arch[/variant]].\n\nWhen used in combination with the `fromImage` option, the daemon checks\nif the given image is present in the local image cache with the given\nOS and Architecture, and otherwise attempts to pull the image. If the\noption is not set, the host's native OS and Architecture are used.\nIf the given image does not exist in the local image cache, the daemon\nattempts to pull the image with the host's native OS and Architecture.\nIf the given image does exists in the local image cache, but its OS or\narchitecture does not match, a warning is produced.\n\nWhen used with the `fromSrc` option to import an image from an archive,\nthis option sets the platform information for the imported image. If\nthe option is not set, the host's native OS and Architecture are used\nfor the imported image.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Image content if the value `-` has been specified in fromSrc query parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/octet-stream": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "repository does not exist or no read access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputImage" + } + }, + "/images/{name}/json": { + "get": { + "tags": [ + "Image" + ], + "summary": "Inspect an image", + "description": "Return low-level information about an image.", + "operationId": "ImageInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ImageInspect" + } + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such image: someimage (tag: latest)" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/history": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get the history of an image", + "description": "Return parent layers of an image.", + "operationId": "ImageHistory", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "List of image layers", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "HistoryResponseItem", + "required": [ + "Comment", + "Created", + "CreatedBy", + "Id", + "Size", + "Tags" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": false + }, + "Created": { + "type": "integer", + "format": "int64", + "nullable": false + }, + "CreatedBy": { + "type": "string", + "nullable": false + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "Size": { + "type": "integer", + "format": "int64", + "nullable": false + }, + "Comment": { + "type": "string", + "nullable": false + } + }, + "description": "individual image layer information in response to ImageHistory operation", + "x-go-name": "HistoryResponseItem" + } + }, + "example": [ + { + "Id": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710", + "Created": 1398108230, + "CreatedBy": "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /", + "Tags": [ + "ubuntu:lucid", + "ubuntu:10.04" + ], + "Size": 182964289, + "Comment": "" + }, + { + "Id": "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8", + "Created": 1398108222, + "CreatedBy": "/bin/sh -c #(nop) MAINTAINER Tianon Gravi - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/", + "Tags": [], + "Size": 0, + "Comment": "" + }, + { + "Id": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158", + "Created": 1371157430, + "CreatedBy": "", + "Tags": [ + "scratch12:latest", + "scratch:latest" + ], + "Size": 0, + "Comment": "Imported from -" + } + ] + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/push": { + "post": { + "tags": [ + "Image" + ], + "summary": "Push an image", + "description": "Push an image to a registry.\n\nIf you wish to push an image on to a private registry, that image must\nalready have a tag which references the registry. For example,\n`registry.example.com/myimage:latest`.\n\nThe push is cancelled if the HTTP connection is closed.\n", + "operationId": "ImagePush", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag to associate with the image on the registry.", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/tag": { + "post": { + "tags": [ + "Image" + ], + "summary": "Tag an image", + "description": "Tag an image so that it becomes part of a repository.", + "operationId": "ImageTag", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID to tag.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "The repository to tag in. For example, `someuser/someimage`.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The name of the new tag.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "No error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}": { + "delete": { + "tags": [ + "Image" + ], + "summary": "Remove an image", + "description": "Remove an image, along with any untagged parent images that were\nreferenced by that image.\n\nImages can't be removed if they have descendant images, are being\nused by a running container or are being used by a build.\n", + "operationId": "ImageDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Remove the image even if it is being used by stopped containers or has other tags", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "noprune", + "in": "query", + "description": "Do not delete untagged parent images", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "The image was deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageDeleteResponseItem" + } + }, + "example": [ + { + "Untagged": "3e2f21a89f" + }, + { + "Deleted": "3e2f21a89f" + }, + { + "Deleted": "53b4f83ac9" + } + ] + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/search": { + "get": { + "tags": [ + "Image" + ], + "summary": "Search images", + "description": "Search for an image on Docker Hub.", + "operationId": "ImageSearch", + "parameters": [ + { + "name": "term", + "in": "query", + "description": "Term to search", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "schema": { + "type": "integer" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:\n\n- `is-automated=(true|false)`\n- `is-official=(true|false)`\n- `stars=` Matches images that has at least 'number' stars.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "ImageSearchResponseItem", + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "is_official": { + "type": "boolean" + }, + "is_automated": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "star_count": { + "type": "integer" + } + } + } + }, + "example": [ + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ] + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/prune": { + "post": { + "tags": [ + "Image" + ], + "summary": "Delete unused images", + "operationId": "ImagePrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters:\n\n- `dangling=` When set to `true` (or `1`), prune only\n unused *and* untagged images. When set to `false`\n (or `0`), all unused images are pruned.\n- `until=` Prune images created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune images with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ImagePruneResponse", + "type": "object", + "properties": { + "ImagesDeleted": { + "type": "array", + "description": "Images that were deleted", + "items": { + "$ref": "#/components/schemas/ImageDeleteResponseItem" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/auth": { + "post": { + "tags": [ + "System" + ], + "summary": "Check auth configuration", + "description": "Validate credentials for a registry and, if available, get an identity\ntoken for accessing the registry without password.\n", + "operationId": "SystemAuth", + "requestBody": { + "description": "Authentication to check", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthConfig" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "An identity token was generated successfully.", + "content": { + "application/json": { + "schema": { + "title": "SystemAuthResponse", + "required": [ + "Status" + ], + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "The status of the authentication", + "nullable": false + }, + "IdentityToken": { + "type": "string", + "description": "An opaque token used to authenticate a user after a successful login", + "nullable": false + } + } + }, + "example": { + "Status": "Login Succeeded", + "IdentityToken": "9cbaf023786cd7..." + } + } + } + }, + "204": { + "description": "No error", + "content": {} + }, + "401": { + "description": "Auth error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "authConfig" + } + }, + "/info": { + "get": { + "tags": [ + "System" + ], + "summary": "Get system information", + "operationId": "SystemInfo", + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/version": { + "get": { + "tags": [ + "System" + ], + "summary": "Get version", + "description": "Returns the version of Docker that is running and various information about the system that Docker is running on.", + "operationId": "SystemVersion", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemVersion" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/_ping": { + "get": { + "tags": [ + "System" + ], + "summary": "Ping", + "description": "This is a dummy endpoint you can use to test if the server is accessible.", + "operationId": "SystemPing", + "responses": { + "200": { + "description": "no error", + "headers": { + "Swarm": { + "description": "Contains information about Swarm status of the daemon,\nand if the daemon is acting as a manager or worker node.\n", + "schema": { + "type": "string", + "default": "inactive", + "enum": [ + "inactive", + "pending", + "error", + "locked", + "active/worker", + "active/manager" + ] + } + }, + "Docker-Experimental": { + "description": "If the server is running with experimental mode enabled", + "schema": { + "type": "boolean" + } + }, + "Cache-Control": { + "schema": { + "type": "string", + "default": "no-cache, no-store, must-revalidate" + } + }, + "Pragma": { + "schema": { + "type": "string", + "default": "no-cache" + } + }, + "API-Version": { + "description": "Max API Version the server supports", + "schema": { + "type": "string" + } + }, + "Builder-Version": { + "description": "Default version of docker image builder\n\nThe default on Linux is version \"2\" (BuildKit), but the daemon\ncan be configured to recommend version \"1\" (classic Builder).\nWindows does not yet support BuildKit for native Windows images,\nand uses \"1\" (classic builder) as a default.\n\nThis value is a recommendation as advertised by the daemon, and\nit is up to the client to choose which builder to use.\n", + "schema": { + "type": "string", + "default": "2" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string", + "example": "OK" + } + } + } + }, + "500": { + "description": "server error", + "headers": { + "Cache-Control": { + "schema": { + "type": "string", + "default": "no-cache, no-store, must-revalidate" + } + }, + "Pragma": { + "schema": { + "type": "string", + "default": "no-cache" + } + } + }, + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "head": { + "tags": [ + "System" + ], + "summary": "Ping", + "description": "This is a dummy endpoint you can use to test if the server is accessible.", + "operationId": "SystemPingHead", + "responses": { + "200": { + "description": "no error", + "headers": { + "Swarm": { + "description": "Contains information about Swarm status of the daemon,\nand if the daemon is acting as a manager or worker node.\n", + "schema": { + "type": "string", + "default": "inactive", + "enum": [ + "inactive", + "pending", + "error", + "locked", + "active/worker", + "active/manager" + ] + } + }, + "Docker-Experimental": { + "description": "If the server is running with experimental mode enabled", + "schema": { + "type": "boolean" + } + }, + "Cache-Control": { + "schema": { + "type": "string", + "default": "no-cache, no-store, must-revalidate" + } + }, + "Pragma": { + "schema": { + "type": "string", + "default": "no-cache" + } + }, + "API-Version": { + "description": "Max API Version the server supports", + "schema": { + "type": "string" + } + }, + "Builder-Version": { + "description": "Default version of docker image builder", + "schema": { + "type": "string" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string", + "example": "(empty)" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/commit": { + "post": { + "tags": [ + "Image" + ], + "summary": "Create a new image from a container", + "operationId": "ImageCommit", + "parameters": [ + { + "name": "container", + "in": "query", + "description": "The ID or name of the container to commit", + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "Repository name for the created image", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "Tag name for the create image", + "schema": { + "type": "string" + } + }, + { + "name": "comment", + "in": "query", + "description": "Commit message", + "schema": { + "type": "string" + } + }, + { + "name": "author", + "in": "query", + "description": "Author of the image (e.g., `John Hannibal Smith `)", + "schema": { + "type": "string" + } + }, + { + "name": "pause", + "in": "query", + "description": "Whether to pause the container before committing", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "changes", + "in": "query", + "description": "`Dockerfile` instructions to apply while committing", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The container configuration", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContainerConfig" + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "containerConfig" + } + }, + "/events": { + "get": { + "tags": [ + "System" + ], + "summary": "Monitor events", + "description": "Stream real-time events from the server.\n\nVarious objects within Docker report events when something happens to them.\n\nContainers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune`\n\nImages report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune`\n\nVolumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune`\n\nNetworks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune`\n\nThe Docker daemon reports these events: `reload`\n\nServices report these events: `create`, `update`, and `remove`\n\nNodes report these events: `create`, `update`, and `remove`\n\nSecrets report these events: `create`, `update`, and `remove`\n\nConfigs report these events: `create`, `update`, and `remove`\n\nThe Builder reports `prune` events\n", + "operationId": "SystemEvents", + "parameters": [ + { + "name": "since", + "in": "query", + "description": "Show events created since this timestamp then stream new events.", + "schema": { + "type": "string" + } + }, + { + "name": "until", + "in": "query", + "description": "Show events created until this timestamp then stop streaming.", + "schema": { + "type": "string" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters:\n\n- `config=` config name or ID\n- `container=` container name or ID\n- `daemon=` daemon name or ID\n- `event=` event type\n- `image=` image name or ID\n- `label=` image or container label\n- `network=` network name or ID\n- `node=` node ID\n- `plugin`= plugin name or ID\n- `scope`= local or swarm\n- `secret=` secret name or ID\n- `service=` service name or ID\n- `type=` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config`\n- `volume=` volume name\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventMessage" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/system/df": { + "get": { + "tags": [ + "System" + ], + "summary": "Get data usage information", + "operationId": "SystemDataUsage", + "parameters": [ + { + "name": "type", + "in": "query", + "description": "Object types, for which to compute and return data.\n", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "container", + "image", + "volume", + "build-cache" + ] + } + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "SystemDataUsageResponse", + "type": "object", + "properties": { + "LayersSize": { + "type": "integer", + "format": "int64" + }, + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + }, + "Containers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerSummary" + } + }, + "Volumes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Volume" + } + }, + "BuildCache": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BuildCache" + } + } + }, + "example": { + "LayersSize": 1092588, + "Images": [ + { + "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "ParentId": "", + "RepoTags": [ + "busybox:latest" + ], + "RepoDigests": [ + "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + ], + "Created": 1466724217, + "Size": 1092588, + "SharedSize": 0, + "VirtualSize": 1092588, + "Labels": {}, + "Containers": 1 + } + ], + "Containers": [ + { + "Id": "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148", + "Names": [ + "/top" + ], + "Image": "busybox", + "ImageID": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "Command": "top", + "Created": 1472592424, + "Ports": [], + "SizeRootFs": 1092588, + "Labels": {}, + "State": "exited", + "Status": "Exited (0) 56 minutes ago", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92", + "EndpointID": "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a", + "Gateway": "172.18.0.1", + "IPAddress": "172.18.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Mounts": [] + } + ], + "Volumes": [ + { + "Name": "my-volume", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/my-volume/_data", + "Scope": "local", + "UsageData": { + "Size": 10920104, + "RefCount": 2 + } + } + ], + "BuildCache": [ + { + "ID": "hw53o5aio51xtltp5xjp8v7fx", + "Parents": [], + "Type": "regular", + "Description": "pulled from docker.io/library/debian@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0", + "InUse": false, + "Shared": true, + "Size": 0, + "CreatedAt": "2021-06-28T13:31:01.474619385Z", + "LastUsedAt": "2021-07-07T22:02:32.738075951Z", + "UsageCount": 26 + }, + { + "ID": "ndlpt0hhvkqcdfkputsk4cq9c", + "Parents": [ + "ndlpt0hhvkqcdfkputsk4cq9c" + ], + "Type": "regular", + "Description": "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache", + "InUse": false, + "Shared": true, + "Size": 51, + "CreatedAt": "2021-06-28T13:31:03.002625487Z", + "LastUsedAt": "2021-07-07T22:02:32.773909517Z", + "UsageCount": 26 + } + ] + } + } + }, + "text/plain": { + "schema": { + "title": "SystemDataUsageResponse", + "type": "object", + "properties": { + "LayersSize": { + "type": "integer", + "format": "int64" + }, + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + }, + "Containers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerSummary" + } + }, + "Volumes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Volume" + } + }, + "BuildCache": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BuildCache" + } + } + }, + "example": { + "LayersSize": 1092588, + "Images": [ + { + "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "ParentId": "", + "RepoTags": [ + "busybox:latest" + ], + "RepoDigests": [ + "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + ], + "Created": 1466724217, + "Size": 1092588, + "SharedSize": 0, + "VirtualSize": 1092588, + "Labels": {}, + "Containers": 1 + } + ], + "Containers": [ + { + "Id": "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148", + "Names": [ + "/top" + ], + "Image": "busybox", + "ImageID": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "Command": "top", + "Created": 1472592424, + "Ports": [], + "SizeRootFs": 1092588, + "Labels": {}, + "State": "exited", + "Status": "Exited (0) 56 minutes ago", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92", + "EndpointID": "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a", + "Gateway": "172.18.0.1", + "IPAddress": "172.18.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Mounts": [] + } + ], + "Volumes": [ + { + "Name": "my-volume", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/my-volume/_data", + "Scope": "local", + "UsageData": { + "Size": 10920104, + "RefCount": 2 + } + } + ], + "BuildCache": [ + { + "ID": "hw53o5aio51xtltp5xjp8v7fx", + "Parents": [], + "Type": "regular", + "Description": "pulled from docker.io/library/debian@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0", + "InUse": false, + "Shared": true, + "Size": 0, + "CreatedAt": "2021-06-28T13:31:01.474619385Z", + "LastUsedAt": "2021-07-07T22:02:32.738075951Z", + "UsageCount": 26 + }, + { + "ID": "ndlpt0hhvkqcdfkputsk4cq9c", + "Parents": [ + "ndlpt0hhvkqcdfkputsk4cq9c" + ], + "Type": "regular", + "Description": "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache", + "InUse": false, + "Shared": true, + "Size": 51, + "CreatedAt": "2021-06-28T13:31:03.002625487Z", + "LastUsedAt": "2021-07-07T22:02:32.773909517Z", + "UsageCount": 26 + } + ] + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/get": { + "get": { + "tags": [ + "Image" + ], + "summary": "Export an image", + "description": "Get a tarball containing all images and metadata for a repository.\n\nIf `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.\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID), each containing these files:\n\n- `VERSION`: currently `1.0` - the file format version\n- `json`: detailed layer information, similar to `docker inspect layer_id`\n- `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions.\n\nIf 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.\n\n```json\n{\n \"hello-world\": {\n \"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"\n }\n}\n```\n", + "operationId": "ImageGet", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/get": { + "get": { + "tags": [ + "Image" + ], + "summary": "Export several images", + "description": "Get a tarball containing all images and metadata for several image\nrepositories.\n\nFor each value of the `names` parameter: if it is a specific name and\ntag (e.g. `ubuntu:latest`), then only that image (and its parents) are\nreturned; if it is an image ID, similarly only that image (and its parents)\nare returned and there would be no names referenced in the 'repositories'\nfile for this image ID.\n\nFor details on the format, see the [export image endpoint](#operation/ImageGet).\n", + "operationId": "ImageGetAll", + "parameters": [ + { + "name": "names", + "in": "query", + "description": "Image names to filter by", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/load": { + "post": { + "tags": [ + "Image" + ], + "summary": "Import images", + "description": "Load a set of images and tags into a repository.\n\nFor details on the format, see the [export image endpoint](#operation/ImageGet).\n", + "operationId": "ImageLoad", + "parameters": [ + { + "name": "quiet", + "in": "query", + "description": "Suppress progress details during load.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "Tar archive containing images", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "imagesTarball" + } + }, + "/containers/{id}/exec": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Create an exec instance", + "description": "Run a command inside a running container.", + "operationId": "ContainerExec", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Exec configuration", + "content": { + "application/json": { + "schema": { + "title": "ExecConfig", + "type": "object", + "properties": { + "AttachStdin": { + "type": "boolean", + "description": "Attach to `stdin` of the exec command." + }, + "AttachStdout": { + "type": "boolean", + "description": "Attach to `stdout` of the exec command." + }, + "AttachStderr": { + "type": "boolean", + "description": "Attach to `stderr` of the exec command." + }, + "ConsoleSize": { + "maxItems": 2, + "minItems": 2, + "type": "array", + "description": "Initial console size, as an `[height, width]` array.", + "nullable": true, + "items": { + "minimum": 0, + "type": "integer" + } + }, + "DetachKeys": { + "type": "string", + "description": "Override the key sequence for detaching a container. Format is\na single character `[a-Z]` or `ctrl-` where ``\nis one of: `a-z`, `@`, `^`, `[`, `,` or `_`.\n" + }, + "Tty": { + "type": "boolean", + "description": "Allocate a pseudo-TTY." + }, + "Env": { + "type": "array", + "description": "A list of environment variables in the form `[\"VAR=value\", ...]`.\n", + "items": { + "type": "string" + } + }, + "Cmd": { + "type": "array", + "description": "Command to run, as a string or array of strings.", + "items": { + "type": "string" + } + }, + "Privileged": { + "type": "boolean", + "description": "Runs the exec process with extended privileges.", + "default": false + }, + "User": { + "type": "string", + "description": "The user, and optionally, group to run the exec process inside\nthe container. Format is one of: `user`, `user:group`, `uid`,\nor `uid:gid`.\n" + }, + "WorkingDir": { + "type": "string", + "description": "The working directory for the exec process inside the container.\n" + } + }, + "example": { + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "DetachKeys": "ctrl-p,ctrl-q", + "Tty": false, + "Cmd": [ + "date" + ], + "Env": [ + "FOO=bar", + "BAZ=quux" + ] + } + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "409": { + "description": "container is paused", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "execConfig" + } + }, + "/exec/{id}/start": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Start an exec instance", + "description": "Starts a previously set up exec instance. If detach is true, this endpoint\nreturns immediately after starting the command. Otherwise, it sets up an\ninteractive session with the command.\n", + "operationId": "ExecStart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "ExecStartConfig", + "type": "object", + "properties": { + "Detach": { + "type": "boolean", + "description": "Detach from the command." + }, + "Tty": { + "type": "boolean", + "description": "Allocate a pseudo-TTY." + }, + "ConsoleSize": { + "maxItems": 2, + "minItems": 2, + "type": "array", + "description": "Initial console size, as an `[height, width]` array.", + "nullable": true, + "items": { + "minimum": 0, + "type": "integer" + } + } + }, + "example": { + "Detach": false, + "Tty": true, + "ConsoleSize": [ + 80, + 64 + ] + } + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "404": { + "description": "No such exec instance", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Container is stopped or paused", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "execStartConfig" + } + }, + "/exec/{id}/resize": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Resize an exec instance", + "description": "Resize the TTY session used by an exec instance. This endpoint only works\nif `tty` was specified as part of creating and starting the exec instance.\n", + "operationId": "ExecResize", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "h", + "in": "query", + "description": "Height of the TTY session in characters", + "schema": { + "type": "integer" + } + }, + { + "name": "w", + "in": "query", + "description": "Width of the TTY session in characters", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "No such exec instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/exec/{id}/json": { + "get": { + "tags": [ + "Exec" + ], + "summary": "Inspect an exec instance", + "description": "Return low-level information about an exec instance.", + "operationId": "ExecInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ExecInspectResponse", + "type": "object", + "properties": { + "CanRemove": { + "type": "boolean" + }, + "DetachKeys": { + "type": "string" + }, + "ID": { + "type": "string" + }, + "Running": { + "type": "boolean" + }, + "ExitCode": { + "type": "integer" + }, + "ProcessConfig": { + "$ref": "#/components/schemas/ProcessConfig" + }, + "OpenStdin": { + "type": "boolean" + }, + "OpenStderr": { + "type": "boolean" + }, + "OpenStdout": { + "type": "boolean" + }, + "ContainerID": { + "type": "string" + }, + "Pid": { + "type": "integer", + "description": "The system process ID for the exec process." + } + } + }, + "example": { + "CanRemove": false, + "ContainerID": "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126", + "DetachKeys": "", + "ExitCode": 2, + "ID": "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b", + "OpenStderr": true, + "OpenStdin": true, + "OpenStdout": true, + "ProcessConfig": { + "arguments": [ + "-c", + "exit 2" + ], + "entrypoint": "sh", + "privileged": false, + "tty": true, + "user": "1000" + }, + "Running": false, + "Pid": 42000 + } + } + } + }, + "404": { + "description": "No such exec instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes": { + "get": { + "tags": [ + "Volume" + ], + "summary": "List volumes", + "operationId": "VolumeList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the volumes list. Available filters:\n\n- `dangling=` When set to `true` (or `1`), returns all\n volumes that are not in use by a container. When set to `false`\n (or `0`), only volumes that are in use by one or more\n containers are returned.\n- `driver=` Matches volumes based on their driver.\n- `label=` or `label=:` Matches volumes based on\n the presence of a `label` alone or a `label` and a value.\n- `name=` Matches all or part of a volume name.\n", + "schema": { + "type": "string", + "format": "json" + } + } + ], + "responses": { + "200": { + "description": "Summary volume data that matches the query", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VolumeListResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes/create": { + "post": { + "tags": [ + "Volume" + ], + "summary": "Create a volume", + "operationId": "VolumeCreate", + "requestBody": { + "description": "Volume configuration", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VolumeCreateOptions" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "The volume was created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Volume" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "volumeConfig" + } + }, + "/volumes/{name}": { + "get": { + "tags": [ + "Volume" + ], + "summary": "Inspect a volume", + "operationId": "VolumeInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Volume name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Volume" + } + } + } + }, + "404": { + "description": "No such volume", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Volume" + ], + "summary": "\"Update a volume. Valid only for Swarm cluster volumes\"\n", + "operationId": "VolumeUpdate", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name or ID of the volume", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the volume being updated. This is required to\navoid conflicting writes. Found in the volume's `ClusterVolume`\nfield.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "The spec of the volume to update. Currently, only Availability may\nchange. All other fields must remain unchanged.\n", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "Spec": { + "$ref": "#/components/schemas/ClusterVolumeSpec" + } + }, + "description": "Volume configuration" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such volume", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + }, + "delete": { + "tags": [ + "Volume" + ], + "summary": "Remove a volume", + "description": "Instruct the driver to remove the volume.", + "operationId": "VolumeDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Volume name or ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force the removal of the volume", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "The volume was removed", + "content": {} + }, + "404": { + "description": "No such volume or volume driver", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Volume is in use and cannot be removed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes/prune": { + "post": { + "tags": [ + "Volume" + ], + "summary": "Delete unused volumes", + "operationId": "VolumePrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels.\n- `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "VolumePruneResponse", + "type": "object", + "properties": { + "VolumesDeleted": { + "type": "array", + "description": "Volumes that were deleted", + "items": { + "type": "string" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks": { + "get": { + "tags": [ + "Network" + ], + "summary": "List networks", + "description": "Returns a list of networks. For details on the format, see the\n[network inspect endpoint](#operation/NetworkInspect).\n\nNote that it uses a different, smaller representation of a network than\ninspecting a single network. For example, the list of containers attached\nto the network is not propagated in API versions 1.28 and up.\n", + "operationId": "NetworkList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "JSON encoded value of the filters (a `map[string][]string`) to process\non the networks list.\n\nAvailable filters:\n\n- `dangling=` When set to `true` (or `1`), returns all\n networks that are not in use by a container. When set to `false`\n (or `0`), only networks that are in use by one or more\n containers are returned.\n- `driver=` Matches a network's driver.\n- `id=` Matches all or part of a network ID.\n- `label=` or `label==` of a network label.\n- `name=` Matches all or part of a network name.\n- `scope=[\"swarm\"|\"global\"|\"local\"]` Filters networks by scope (`swarm`, `global`, or `local`).\n- `type=[\"custom\"|\"builtin\"]` Filters networks by type. The `custom` keyword returns all user-defined networks.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Network" + } + }, + "example": [ + { + "Name": "bridge", + "Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566", + "Created": "2016-10-19T06:21:00.416543526Z", + "Scope": "local", + "Driver": "bridge", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.17.0.0/16" + } + ] + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + } + }, + { + "Name": "none", + "Id": "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794", + "Created": "0001-01-01T00:00:00Z", + "Scope": "local", + "Driver": "null", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + }, + { + "Name": "host", + "Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e", + "Created": "0001-01-01T00:00:00Z", + "Scope": "local", + "Driver": "host", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + } + ] + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks/{id}": { + "get": { + "tags": [ + "Network" + ], + "summary": "Inspect a network", + "operationId": "NetworkInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "verbose", + "in": "query", + "description": "Detailed inspect output for troubleshooting", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "scope", + "in": "query", + "description": "Filter the network by scope (swarm, global, or local)", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Network" + } + } + } + }, + "404": { + "description": "Network not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Network" + ], + "summary": "Remove a network", + "operationId": "NetworkDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No error", + "content": {} + }, + "403": { + "description": "operation not supported for pre-defined networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such network", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks/create": { + "post": { + "tags": [ + "Network" + ], + "summary": "Create a network", + "operationId": "NetworkCreate", + "requestBody": { + "description": "Network configuration", + "content": { + "application/json": { + "schema": { + "title": "NetworkCreateRequest", + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The network's name." + }, + "CheckDuplicate": { + "type": "boolean", + "description": "Check for networks with duplicate names. Since Network is\nprimarily keyed based on a random ID and not on the name, and\nnetwork name is strictly a user-friendly alias to the network\nwhich is uniquely identified using ID, there is no guaranteed\nway to check for duplicates. CheckDuplicate is there to provide\na best effort checking of any networks which has the same name\nbut it is not guaranteed to catch all name collisions.\n" + }, + "Driver": { + "type": "string", + "description": "Name of the network driver plugin to use.", + "default": "bridge" + }, + "Internal": { + "type": "boolean", + "description": "Restrict external access to the network." + }, + "Attachable": { + "type": "boolean", + "description": "Globally scoped network is manually attachable by regular\ncontainers from workers in swarm mode.\n" + }, + "Ingress": { + "type": "boolean", + "description": "Ingress network is the network which provides the routing-mesh\nin swarm mode.\n" + }, + "IPAM": { + "$ref": "#/components/schemas/IPAM" + }, + "EnableIPv6": { + "type": "boolean", + "description": "Enable IPv6 on the network." + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Network specific options to be used by the drivers." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + } + }, + "example": { + "Name": "isolated_nw", + "CheckDuplicate": false, + "Driver": "bridge", + "EnableIPv6": true, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.20.0.0/16", + "IPRange": "172.20.10.0/24", + "Gateway": "172.20.10.11" + }, + { + "Subnet": "2001:db8:abcd::/64", + "Gateway": "2001:db8:abcd::1011" + } + ], + "Options": { + "foo": "bar" + } + }, + "Internal": true, + "Attachable": false, + "Ingress": false, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "NetworkCreateResponse", + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the created network." + }, + "Warning": { + "type": "string" + } + }, + "example": { + "Id": "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30", + "Warning": "" + } + } + } + } + }, + "403": { + "description": "operation not supported for pre-defined networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "plugin not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "networkConfig" + } + }, + "/networks/{id}/connect": { + "post": { + "tags": [ + "Network" + ], + "summary": "Connect a container to a network", + "operationId": "NetworkConnect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "NetworkConnectRequest", + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "The ID or name of the container to connect to the network." + }, + "EndpointConfig": { + "$ref": "#/components/schemas/EndpointSettings" + } + }, + "example": { + "Container": "3613f73ba0e4", + "EndpointConfig": { + "IPAMConfig": { + "IPv4Address": "172.24.56.89", + "IPv6Address": "2001:db8::5689" + } + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "403": { + "description": "Operation not supported for swarm scoped networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Network or container not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "container" + } + }, + "/networks/{id}/disconnect": { + "post": { + "tags": [ + "Network" + ], + "summary": "Disconnect a container from a network", + "operationId": "NetworkDisconnect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "NetworkDisconnectRequest", + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "The ID or name of the container to disconnect from the network.\n" + }, + "Force": { + "type": "boolean", + "description": "Force the container to disconnect from the network.\n" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "403": { + "description": "Operation not supported for swarm scoped networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Network or container not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "container" + } + }, + "/networks/prune": { + "post": { + "tags": [ + "Network" + ], + "summary": "Delete unused networks", + "operationId": "NetworkPrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `until=` Prune networks created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune networks with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "NetworkPruneResponse", + "type": "object", + "properties": { + "NetworksDeleted": { + "type": "array", + "description": "Networks that were deleted", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "List plugins", + "description": "Returns information about installed plugins.", + "operationId": "PluginList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the plugin list.\n\nAvailable filters:\n\n- `capability=`\n- `enable=|`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Plugin" + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/privileges": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "Get plugin privileges", + "operationId": "GetPluginPrivileges", + "parameters": [ + { + "name": "remote", + "in": "query", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/pull": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Install a plugin", + "description": "Pulls and installs a plugin. After the plugin is installed, it can be\nenabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable).\n", + "operationId": "PluginPull", + "parameters": [ + { + "name": "remote", + "in": "query", + "description": "Remote reference for plugin to install.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "description": "Local name for the pulled plugin.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration to use when pulling a plugin\nfrom a registry.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/plugins/{name}/json": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "Inspect a plugin", + "operationId": "PluginInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + } + } + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}": { + "delete": { + "tags": [ + "Plugin" + ], + "summary": "Remove a plugin", + "operationId": "PluginDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Disable the plugin before removing. This may result in issues if the\nplugin is in use by a container.\n", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + } + } + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/enable": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Enable a plugin", + "operationId": "PluginEnable", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Set the HTTP client timeout (in seconds)", + "schema": { + "type": "integer", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/disable": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Disable a plugin", + "operationId": "PluginDisable", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force disable a plugin even if still in use.\n", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/upgrade": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Upgrade a plugin", + "operationId": "PluginUpgrade", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "remote", + "in": "query", + "description": "Remote reference to upgrade to.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration to use when pulling a plugin\nfrom a registry.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/plugins/create": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Create a plugin", + "operationId": "PluginCreate", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Path to tar containing plugin rootfs and manifest", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "tarContext" + } + }, + "/plugins/{name}/push": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Push a plugin", + "description": "Push a plugin to the registry.\n", + "operationId": "PluginPush", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/set": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Configure a plugin", + "operationId": "PluginSet", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + "DEBUG=1" + ], + "items": { + "type": "string" + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "No error", + "content": {} + }, + "404": { + "description": "Plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/nodes": { + "get": { + "tags": [ + "Node" + ], + "summary": "List nodes", + "operationId": "NodeList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the nodes list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `id=`\n- `label=`\n- `membership=`(`accepted`|`pending`)`\n- `name=`\n- `node.label=`\n- `role=`(`manager`|`worker`)`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Node" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Node" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/nodes/{id}": { + "get": { + "tags": [ + "Node" + ], + "summary": "Inspect a node", + "operationId": "NodeInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the node", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Node" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Node" + } + } + } + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Node" + ], + "summary": "Delete a node", + "operationId": "NodeDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the node", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force remove a node from the swarm", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/nodes/{id}/update": { + "post": { + "tags": [ + "Node" + ], + "summary": "Update a node", + "operationId": "NodeUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the node", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the node object being updated. This is required\nto avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NodeSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/NodeSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm": { + "get": { + "tags": [ + "Swarm" + ], + "summary": "Inspect swarm", + "operationId": "SwarmInspect", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Swarm" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Swarm" + } + } + } + }, + "404": { + "description": "no such swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/init": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Initialize a new swarm", + "operationId": "SwarmInit", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "SwarmInitRequest", + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication, as well\nas determining the networking interface used for the VXLAN\nTunnel Endpoint (VTEP). This can either be an address/port\ncombination in the form `192.168.1.1:4567`, or an interface\nfollowed by a port number, like `eth0:4567`. If the port number\nis omitted, the default swarm listening port is used.\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "DataPathPort": { + "type": "integer", + "description": "DataPathPort specifies the data path port number for data traffic.\nAcceptable port range is 1024 to 49151.\nif no port is set or is set to 0, default port 4789 will be used.\n", + "format": "uint32" + }, + "DefaultAddrPool": { + "type": "array", + "description": "Default Address Pool specifies default subnet pools for global\nscope networks.\n", + "items": { + "type": "string", + "example": "" + } + }, + "ForceNewCluster": { + "type": "boolean", + "description": "Force creation of a new swarm." + }, + "SubnetSize": { + "type": "integer", + "description": "SubnetSize specifies the subnet size of the networks created\nfrom the default subnet pool.\n", + "format": "uint32" + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "DataPathPort": 4789, + "DefaultAddrPool": [ + "10.10.0.0/8", + "20.20.0.0/8" + ], + "SubnetSize": 24, + "ForceNewCluster": false, + "Spec": { + "Orchestration": {}, + "Raft": {}, + "Dispatcher": {}, + "CAConfig": {}, + "EncryptionConfig": { + "AutoLockManagers": false + } + } + } + } + }, + "text/plain": { + "schema": { + "title": "SwarmInitRequest", + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication, as well\nas determining the networking interface used for the VXLAN\nTunnel Endpoint (VTEP). This can either be an address/port\ncombination in the form `192.168.1.1:4567`, or an interface\nfollowed by a port number, like `eth0:4567`. If the port number\nis omitted, the default swarm listening port is used.\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "DataPathPort": { + "type": "integer", + "description": "DataPathPort specifies the data path port number for data traffic.\nAcceptable port range is 1024 to 49151.\nif no port is set or is set to 0, default port 4789 will be used.\n", + "format": "uint32" + }, + "DefaultAddrPool": { + "type": "array", + "description": "Default Address Pool specifies default subnet pools for global\nscope networks.\n", + "items": { + "type": "string", + "example": "" + } + }, + "ForceNewCluster": { + "type": "boolean", + "description": "Force creation of a new swarm." + }, + "SubnetSize": { + "type": "integer", + "description": "SubnetSize specifies the subnet size of the networks created\nfrom the default subnet pool.\n", + "format": "uint32" + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "DataPathPort": 4789, + "DefaultAddrPool": [ + "10.10.0.0/8", + "20.20.0.0/8" + ], + "SubnetSize": 24, + "ForceNewCluster": false, + "Spec": { + "Orchestration": {}, + "Raft": {}, + "Dispatcher": {}, + "CAConfig": {}, + "EncryptionConfig": { + "AutoLockManagers": false + } + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "string", + "description": "The node ID", + "example": "7v2t30z9blmxuhnyo6s4cpenp" + } + }, + "text/plain": { + "schema": { + "type": "string", + "description": "The node ID", + "example": "7v2t30z9blmxuhnyo6s4cpenp" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is already part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/join": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Join an existing swarm", + "operationId": "SwarmJoin", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "SwarmJoinRequest", + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication if the node\ngets promoted to manager, as well as determining the networking\ninterface used for the VXLAN Tunnel Endpoint (VTEP).\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "RemoteAddrs": { + "type": "array", + "description": "Addresses of manager nodes already participating in the swarm.\n", + "items": { + "type": "string" + } + }, + "JoinToken": { + "type": "string", + "description": "Secret token for joining this swarm." + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "RemoteAddrs": [ + "node1:2377" + ], + "JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + } + }, + "text/plain": { + "schema": { + "title": "SwarmJoinRequest", + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication if the node\ngets promoted to manager, as well as determining the networking\ninterface used for the VXLAN Tunnel Endpoint (VTEP).\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "RemoteAddrs": { + "type": "array", + "description": "Addresses of manager nodes already participating in the swarm.\n", + "items": { + "type": "string" + } + }, + "JoinToken": { + "type": "string", + "description": "Secret token for joining this swarm." + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "RemoteAddrs": [ + "node1:2377" + ], + "JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is already part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/leave": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Leave a swarm", + "operationId": "SwarmLeave", + "parameters": [ + { + "name": "force", + "in": "query", + "description": "Force leave swarm, even if this is the last manager or that it will\nbreak the cluster.\n", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/update": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Update a swarm", + "operationId": "SwarmUpdate", + "parameters": [ + { + "name": "version", + "in": "query", + "description": "The version number of the swarm object being updated. This is\nrequired to avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "rotateWorkerToken", + "in": "query", + "description": "Rotate the worker join token.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "rotateManagerToken", + "in": "query", + "description": "Rotate the manager join token.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "rotateManagerUnlockKey", + "in": "query", + "description": "Rotate the manager unlock key.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/SwarmSpec" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/unlockkey": { + "get": { + "tags": [ + "Swarm" + ], + "summary": "Get the unlock key", + "operationId": "SwarmUnlockkey", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "UnlockKeyResponse", + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + }, + "text/plain": { + "schema": { + "title": "UnlockKeyResponse", + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/unlock": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Unlock a locked manager", + "operationId": "SwarmUnlock", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "SwarmUnlockRequest", + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services": { + "get": { + "tags": [ + "Service" + ], + "summary": "List services", + "operationId": "ServiceList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the services list.\n\nAvailable filters:\n\n- `id=`\n- `label=`\n- `mode=[\"replicated\"|\"global\"]`\n- `name=`\n", + "schema": { + "type": "string" + } + }, + { + "name": "status", + "in": "query", + "description": "Include service status, with count of running and desired tasks.\n", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/services/create": { + "post": { + "tags": [ + "Service" + ], + "summary": "Create a service", + "operationId": "ServiceCreate", + "parameters": [ + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration for pulling from private\nregistries.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServiceSpec" + }, + { + "type": "object", + "example": { + "Name": "web", + "TaskTemplate": { + "ContainerSpec": { + "Image": "nginx:alpine", + "Mounts": [ + { + "ReadOnly": true, + "Source": "web-data", + "Target": "/usr/share/nginx/html", + "Type": "volume", + "VolumeOptions": { + "DriverConfig": {}, + "Labels": { + "com.example.something": "something-value" + } + } + } + ], + "Hosts": [ + "10.10.10.10 host1", + "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 host2" + ], + "User": "33", + "DNSConfig": { + "Nameservers": [ + "8.8.8.8" + ], + "Search": [ + "example.org" + ], + "Options": [ + "timeout:3" + ] + }, + "Secrets": [ + { + "File": { + "Name": "www.example.org.key", + "UID": "33", + "GID": "33", + "Mode": 384 + }, + "SecretID": "fpjqlhnwb19zds35k8wn80lq9", + "SecretName": "example_org_domain_key" + } + ] + }, + "LogDriver": { + "Name": "json-file", + "Options": { + "max-file": "3", + "max-size": "10M" + } + }, + "Placement": {}, + "Resources": { + "Limits": { + "MemoryBytes": 104857600 + }, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "on-failure", + "Delay": 10000000000, + "MaxAttempts": 10 + } + }, + "Mode": { + "Replicated": { + "Replicas": 4 + } + }, + "UpdateConfig": { + "Parallelism": 2, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Ports": [ + { + "Protocol": "tcp", + "PublishedPort": 8080, + "TargetPort": 80 + } + ] + }, + "Labels": { + "foo": "bar" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "ServiceCreateResponse", + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the created service." + }, + "Warning": { + "type": "string", + "description": "Optional warning message" + } + }, + "example": { + "ID": "ak7w3gjqoa3kuz8xcpnyy0pvl", + "Warning": "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + } + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "network is not eligible for services", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services/{id}": { + "get": { + "tags": [ + "Service" + ], + "summary": "Inspect a service", + "operationId": "ServiceInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "insertDefaults", + "in": "query", + "description": "Fill empty fields with default values.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Service" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Service" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Service" + ], + "summary": "Delete a service", + "operationId": "ServiceDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/services/{id}/update": { + "post": { + "tags": [ + "Service" + ], + "summary": "Update a service", + "operationId": "ServiceUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the service object being updated. This is\nrequired to avoid conflicting writes.\nThis version number should be the value as currently set on the\nservice *before* the update. You can find the current version by\ncalling `GET /services/{id}`\n", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "registryAuthFrom", + "in": "query", + "description": "If the `X-Registry-Auth` header is not specified, this parameter\nindicates where to find registry authorization credentials.\n", + "schema": { + "type": "string", + "default": "spec", + "enum": [ + "spec", + "previous-spec" + ] + } + }, + { + "name": "rollback", + "in": "query", + "description": "Set to this parameter to `previous` to cause a server-side rollback\nto the previous service spec. The supplied spec will be ignored in\nthis case.\n", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration for pulling from private\nregistries.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServiceSpec" + }, + { + "type": "object", + "example": { + "Name": "top", + "TaskTemplate": { + "ContainerSpec": { + "Image": "busybox", + "Args": [ + "top" + ] + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {}, + "ForceUpdate": 0 + }, + "Mode": { + "Replicated": { + "Replicas": 1 + } + }, + "UpdateConfig": { + "Parallelism": 2, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Mode": "vip" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUpdateResponse" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services/{id}/logs": { + "get": { + "tags": [ + "Service" + ], + "summary": "Get service logs", + "description": "Get `stdout` and `stderr` logs from a service. See also\n[`/containers/{id}/logs`](#operation/ContainerLogs).\n\n**Note**: This endpoint works only for services with the `local`,\n`json-file` or `journald` logging drivers.\n", + "operationId": "ServiceLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the service", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "details", + "in": "query", + "description": "Show service context and extra details provided to logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "follow", + "in": "query", + "description": "Keep connection after returning logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs.\nSpecify as an integer or `all` to output all log lines.\n", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "200": { + "description": "logs returned as a stream in response body", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such service: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks": { + "get": { + "tags": [ + "Task" + ], + "summary": "List tasks", + "operationId": "TaskList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the tasks list.\n\nAvailable filters:\n\n- `desired-state=(running | shutdown | accepted)`\n- `id=`\n- `label=key` or `label=\"key=value\"`\n- `name=`\n- `node=`\n- `service=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "0kzzo1i0y4jz6027t0k7aezc7", + "Version": { + "Index": 71 + }, + "CreatedAt": "2016-06-07T21:07:31.171892745Z", + "UpdatedAt": "2016-06-07T21:07:31.376370513Z", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:31.290032978Z", + "State": "running", + "Message": "started", + "ContainerStatus": { + "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035", + "PID": 677 + } + }, + "DesiredState": "running", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.10/16" + ] + } + ] + }, + { + "ID": "1yljwbmlr8er2waf8orvqpwms", + "Version": { + "Index": 30 + }, + "CreatedAt": "2016-06-07T21:07:30.019104782Z", + "UpdatedAt": "2016-06-07T21:07:30.231958098Z", + "Name": "hopeful_cori", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:30.202183143Z", + "State": "shutdown", + "Message": "shutdown", + "ContainerStatus": { + "ContainerID": "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213" + } + }, + "DesiredState": "shutdown", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.5/16" + ] + } + ] + } + ], + "items": { + "$ref": "#/components/schemas/Task" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks/{id}": { + "get": { + "tags": [ + "Task" + ], + "summary": "Inspect a task", + "operationId": "TaskInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the task", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Task" + } + } + } + }, + "404": { + "description": "no such task", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks/{id}/logs": { + "get": { + "tags": [ + "Task" + ], + "summary": "Get task logs", + "description": "Get `stdout` and `stderr` logs from a task.\nSee also [`/containers/{id}/logs`](#operation/ContainerLogs).\n\n**Note**: This endpoint works only for services with the `local`,\n`json-file` or `journald` logging drivers.\n", + "operationId": "TaskLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the task", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "details", + "in": "query", + "description": "Show task context and extra details provided to logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "follow", + "in": "query", + "description": "Keep connection after returning logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs.\nSpecify as an integer or `all` to output all log lines.\n", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "200": { + "description": "logs returned as a stream in response body", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "no such task", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such task: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets": { + "get": { + "tags": [ + "Secret" + ], + "summary": "List secrets", + "operationId": "SecretList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the secrets list.\n\nAvailable filters:\n\n- `id=`\n- `label= or label==value`\n- `name=`\n- `names=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "blt1owaxmitz71s9v5zh81zun", + "Version": { + "Index": 85 + }, + "CreatedAt": "2017-07-20T13:55:28.678958722Z", + "UpdatedAt": "2017-07-20T13:55:28.678958722Z", + "Spec": { + "Name": "mysql-passwd", + "Labels": { + "some.label": "some.value" + }, + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + }, + { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt", + "Labels": { + "foo": "bar" + } + } + } + ], + "items": { + "$ref": "#/components/schemas/Secret" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets/create": { + "post": { + "tags": [ + "Secret" + ], + "summary": "Create a secret", + "operationId": "SecretCreate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SecretSpec" + }, + { + "type": "object", + "example": { + "Name": "app-key.crt", + "Labels": { + "foo": "bar" + }, + "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==", + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + } + ] + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/secrets/{id}": { + "get": { + "tags": [ + "Secret" + ], + "summary": "Inspect a secret", + "operationId": "SecretInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the secret", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Secret" + }, + "example": { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt", + "Labels": { + "foo": "bar" + }, + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + } + } + } + }, + "404": { + "description": "secret not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Secret" + ], + "summary": "Delete a secret", + "operationId": "SecretDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the secret", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "secret not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets/{id}/update": { + "post": { + "tags": [ + "Secret" + ], + "summary": "Update a Secret", + "operationId": "SecretUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the secret", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the secret object being updated. This is\nrequired to avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "The spec of the secret to update. Currently, only the Labels field\ncan be updated. All other fields must remain unchanged from the\n[SecretInspect endpoint](#operation/SecretInspect) response values.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SecretSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/SecretSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such secret", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/configs": { + "get": { + "tags": [ + "Config" + ], + "summary": "List configs", + "operationId": "ConfigList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the configs list.\n\nAvailable filters:\n\n- `id=`\n- `label= or label==value`\n- `name=`\n- `names=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "server.conf" + } + } + ], + "items": { + "$ref": "#/components/schemas/Config" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/configs/create": { + "post": { + "tags": [ + "Config" + ], + "summary": "Create a config", + "operationId": "ConfigCreate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ConfigSpec" + }, + { + "type": "object", + "example": { + "Name": "server.conf", + "Labels": { + "foo": "bar" + }, + "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + } + } + ] + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/configs/{id}": { + "get": { + "tags": [ + "Config" + ], + "summary": "Inspect a config", + "operationId": "ConfigInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the config", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Config" + }, + "example": { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt" + } + } + } + } + }, + "404": { + "description": "config not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Config" + ], + "summary": "Delete a config", + "operationId": "ConfigDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the config", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "config not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/configs/{id}/update": { + "post": { + "tags": [ + "Config" + ], + "summary": "Update a Config", + "operationId": "ConfigUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the config", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the config object being updated. This is\nrequired to avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "The spec of the config to update. Currently, only the Labels field\ncan be updated. All other fields must remain unchanged from the\n[ConfigInspect endpoint](#operation/ConfigInspect) response values.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ConfigSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such config", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/distribution/{name}/json": { + "get": { + "tags": [ + "Distribution" + ], + "summary": "Get image information from the registry", + "description": "Return image digest and platform information by contacting the registry.\n", + "operationId": "DistributionInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "descriptor and platform information", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DistributionInspect" + } + } + } + }, + "401": { + "description": "Failed authentication or no image found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such image: someimage (tag: latest)" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/session": { + "post": { + "tags": [ + "Session" + ], + "summary": "Initialize interactive session", + "description": "Start a new interactive session with a server. Session allows server to\ncall back to the client for advanced capabilities.\n\n### Hijacking\n\nThis endpoint hijacks the HTTP connection to HTTP2 transport that allows\nthe client to expose gPRC services on that connection.\n\nFor example, the client sends this request to upgrade the connection:\n\n```\nPOST /session HTTP/1.1\nUpgrade: h2c\nConnection: Upgrade\n```\n\nThe Docker daemon responds with a `101 UPGRADED` response follow with\nthe raw stream:\n\n```\nHTTP/1.1 101 UPGRADED\nConnection: Upgrade\nUpgrade: h2c\n```\n", + "operationId": "Session", + "responses": { + "101": { + "description": "no error, hijacking successful", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Port": { + "required": [ + "PrivatePort", + "Type" + ], + "type": "object", + "properties": { + "IP": { + "type": "string", + "description": "Host IP address that the container's port is mapped to", + "format": "ip-address" + }, + "PrivatePort": { + "type": "integer", + "description": "Port on the container", + "format": "uint16", + "nullable": false + }, + "PublicPort": { + "type": "integer", + "description": "Port exposed on the host", + "format": "uint16" + }, + "Type": { + "type": "string", + "nullable": false, + "enum": [ + "tcp", + "udp", + "sctp" + ] + } + }, + "description": "An open port on a container", + "example": { + "PrivatePort": 8080, + "PublicPort": 80, + "Type": "tcp" + } + }, + "MountPoint": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "description": "The mount type:\n\n- `bind` a mount of a file or directory from the host into the container.\n- `volume` a docker volume with the given `Name`.\n- `tmpfs` a `tmpfs`.\n- `npipe` a named pipe from the host into the container.\n- `cluster` a Swarm cluster volume\n", + "example": "volume", + "enum": [ + "bind", + "volume", + "tmpfs", + "npipe", + "cluster" + ] + }, + "Name": { + "type": "string", + "description": "Name is the name reference to the underlying data defined by `Source`\ne.g., the volume name.\n", + "example": "myvolume" + }, + "Source": { + "type": "string", + "description": "Source location of the mount.\n\nFor volumes, this contains the storage location of the volume (within\n`/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains\nthe source (host) part of the bind-mount. For `tmpfs` mount points, this\nfield is empty.\n", + "example": "/var/lib/docker/volumes/myvolume/_data" + }, + "Destination": { + "type": "string", + "description": "Destination is the path relative to the container root (`/`) where\nthe `Source` is mounted inside the container.\n", + "example": "/usr/share/nginx/html/" + }, + "Driver": { + "type": "string", + "description": "Driver is the volume driver used to create the volume (if it is a volume).\n", + "example": "local" + }, + "Mode": { + "type": "string", + "description": "Mode is a comma separated list of options supplied by the user when\ncreating the bind/volume mount.\n\nThe default is platform-specific (`\"z\"` on Linux, empty on Windows).\n", + "example": "z" + }, + "RW": { + "type": "boolean", + "description": "Whether the mount is mounted writable (read-write).\n", + "example": true + }, + "Propagation": { + "type": "string", + "description": "Propagation describes how mounts are propagated from the host into the\nmount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt)\nfor details. This field is not used on Windows.\n", + "example": "" + } + }, + "description": "MountPoint represents a mount point configuration inside the container.\nThis is used for reporting the mountpoints in use by a container.\n" + }, + "DeviceMapping": { + "type": "object", + "properties": { + "PathOnHost": { + "type": "string" + }, + "PathInContainer": { + "type": "string" + }, + "CgroupPermissions": { + "type": "string" + } + }, + "description": "A device mapping between the host and container", + "example": { + "PathOnHost": "/dev/deviceName", + "PathInContainer": "/dev/deviceName", + "CgroupPermissions": "mrw" + } + }, + "DeviceRequest": { + "type": "object", + "properties": { + "Driver": { + "type": "string", + "example": "nvidia" + }, + "Count": { + "type": "integer", + "example": -1 + }, + "DeviceIDs": { + "type": "array", + "example": [ + "0", + "1", + "GPU-fef8089b-4820-abfc-e83e-94318197576e" + ], + "items": { + "type": "string" + } + }, + "Capabilities": { + "type": "array", + "description": "A list of capabilities; an OR list of AND lists of capabilities.\n", + "example": [ + [ + "gpu", + "nvidia", + "compute" + ] + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver-specific options, specified as a key/value pairs. These options\nare passed directly to the driver.\n" + } + }, + "description": "A request for devices to be sent to device drivers" + }, + "ThrottleDevice": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Device path" + }, + "Rate": { + "minimum": 0, + "type": "integer", + "description": "Rate", + "format": "int64" + } + } + }, + "Mount": { + "type": "object", + "properties": { + "Target": { + "type": "string", + "description": "Container path." + }, + "Source": { + "type": "string", + "description": "Mount source (e.g. a volume name, a host path)." + }, + "Type": { + "type": "string", + "description": "The mount type. Available types:\n\n- `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container.\n- `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.\n- `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs.\n- `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container.\n- `cluster` a Swarm cluster volume\n", + "enum": [ + "bind", + "volume", + "tmpfs", + "npipe", + "cluster" + ] + }, + "ReadOnly": { + "type": "boolean", + "description": "Whether the mount should be read-only." + }, + "Consistency": { + "type": "string", + "description": "The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`." + }, + "BindOptions": { + "type": "object", + "properties": { + "Propagation": { + "type": "string", + "description": "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.", + "enum": [ + "private", + "rprivate", + "shared", + "rshared", + "slave", + "rslave" + ] + }, + "NonRecursive": { + "type": "boolean", + "description": "Disable recursive bind mount.", + "default": false + }, + "CreateMountpoint": { + "type": "boolean", + "description": "Create mount point on host if missing", + "default": false + } + }, + "description": "Optional configuration for the `bind` type." + }, + "VolumeOptions": { + "type": "object", + "properties": { + "NoCopy": { + "type": "boolean", + "description": "Populate volume with data from the target.", + "default": false + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "DriverConfig": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the driver to use to create the volume." + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "key/value map of driver specific options." + } + }, + "description": "Map of driver specific options" + } + }, + "description": "Optional configuration for the `volume` type." + }, + "TmpfsOptions": { + "type": "object", + "properties": { + "SizeBytes": { + "type": "integer", + "description": "The size for the tmpfs mount in bytes.", + "format": "int64" + }, + "Mode": { + "type": "integer", + "description": "The permission mode for the tmpfs mount in an integer." + } + }, + "description": "Optional configuration for the `tmpfs` type." + } + } + }, + "RestartPolicy": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "- Empty string means not to restart\n- `no` Do not automatically restart\n- `always` Always restart\n- `unless-stopped` Restart always except when the user has manually stopped the container\n- `on-failure` Restart only when the container exit code is non-zero\n", + "enum": [ + "", + "no", + "always", + "unless-stopped", + "on-failure" + ] + }, + "MaximumRetryCount": { + "type": "integer", + "description": "If `on-failure` is used, the number of times to retry before giving up.\n" + } + }, + "description": "The behavior to apply when the container exits. The default is not to\nrestart.\n\nAn ever increasing delay (double the previous delay, starting at 100ms) is\nadded before each restart to prevent flooding the server.\n" + }, + "Resources": { + "type": "object", + "properties": { + "CpuShares": { + "type": "integer", + "description": "An integer value representing this container's relative CPU weight\nversus other containers.\n" + }, + "Memory": { + "type": "integer", + "description": "Memory limit in bytes.", + "format": "int64", + "default": 0 + }, + "CgroupParent": { + "type": "string", + "description": "Path to `cgroups` under which the container's `cgroup` is created. If\nthe path is not absolute, the path is considered to be relative to the\n`cgroups` path of the init process. Cgroups are created if they do not\nalready exist.\n" + }, + "BlkioWeight": { + "maximum": 1000, + "minimum": 0, + "type": "integer", + "description": "Block IO weight (relative weight)." + }, + "BlkioWeightDevice": { + "type": "array", + "description": "Block IO weight (relative device weight) in the form:\n\n```\n[{\"Path\": \"device_path\", \"Weight\": weight}]\n```\n", + "items": { + "type": "object", + "properties": { + "Path": { + "type": "string" + }, + "Weight": { + "minimum": 0, + "type": "integer" + } + } + } + }, + "BlkioDeviceReadBps": { + "type": "array", + "description": "Limit read rate (bytes per second) from a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceWriteBps": { + "type": "array", + "description": "Limit write rate (bytes per second) to a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceReadIOps": { + "type": "array", + "description": "Limit read rate (IO per second) from a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceWriteIOps": { + "type": "array", + "description": "Limit write rate (IO per second) to a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "CpuPeriod": { + "type": "integer", + "description": "The length of a CPU period in microseconds.", + "format": "int64" + }, + "CpuQuota": { + "type": "integer", + "description": "Microseconds of CPU time that the container can get in a CPU period.\n", + "format": "int64" + }, + "CpuRealtimePeriod": { + "type": "integer", + "description": "The length of a CPU real-time period in microseconds. Set to 0 to\nallocate no time allocated to real-time tasks.\n", + "format": "int64" + }, + "CpuRealtimeRuntime": { + "type": "integer", + "description": "The length of a CPU real-time runtime in microseconds. Set to 0 to\nallocate no time allocated to real-time tasks.\n", + "format": "int64" + }, + "CpusetCpus": { + "type": "string", + "description": "CPUs in which to allow execution (e.g., `0-3`, `0,1`).\n", + "example": "0-3" + }, + "CpusetMems": { + "type": "string", + "description": "Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only\neffective on NUMA systems.\n" + }, + "Devices": { + "type": "array", + "description": "A list of devices to add to the container.", + "items": { + "$ref": "#/components/schemas/DeviceMapping" + } + }, + "DeviceCgroupRules": { + "type": "array", + "description": "a list of cgroup rules to apply to the container", + "items": { + "type": "string", + "example": "c 13:* rwm" + } + }, + "DeviceRequests": { + "type": "array", + "description": "A list of requests for devices to be sent to device drivers.\n", + "items": { + "$ref": "#/components/schemas/DeviceRequest" + } + }, + "KernelMemoryTCP": { + "type": "integer", + "description": "Hard limit for kernel TCP buffer memory (in bytes). Depending on the\nOCI runtime in use, this option may be ignored. It is no longer supported\nby the default (runc) runtime.\n\nThis field is omitted when empty.\n", + "format": "int64" + }, + "MemoryReservation": { + "type": "integer", + "description": "Memory soft limit in bytes.", + "format": "int64" + }, + "MemorySwap": { + "type": "integer", + "description": "Total memory limit (memory + swap). Set as `-1` to enable unlimited\nswap.\n", + "format": "int64" + }, + "MemorySwappiness": { + "maximum": 100, + "minimum": 0, + "type": "integer", + "description": "Tune a container's memory swappiness behavior. Accepts an integer\nbetween 0 and 100.\n", + "format": "int64" + }, + "NanoCpus": { + "type": "integer", + "description": "CPU quota in units of 10-9 CPUs.", + "format": "int64" + }, + "OomKillDisable": { + "type": "boolean", + "description": "Disable OOM Killer for the container." + }, + "Init": { + "type": "boolean", + "description": "Run an init inside the container that forwards signals and reaps\nprocesses. This field is omitted if empty, and the default (as\nconfigured on the daemon) is used.\n", + "nullable": true + }, + "PidsLimit": { + "type": "integer", + "description": "Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null`\nto not change.\n", + "format": "int64", + "nullable": true + }, + "Ulimits": { + "type": "array", + "description": "A list of resource limits to set in the container. For example:\n\n```\n{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}\n```\n", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of ulimit" + }, + "Soft": { + "type": "integer", + "description": "Soft limit" + }, + "Hard": { + "type": "integer", + "description": "Hard limit" + } + } + } + }, + "CpuCount": { + "type": "integer", + "description": "The number of usable CPUs (Windows only).\n\nOn Windows Server containers, the processor resource controls are\nmutually exclusive. The order of precedence is `CPUCount` first, then\n`CPUShares`, and `CPUPercent` last.\n", + "format": "int64" + }, + "CpuPercent": { + "type": "integer", + "description": "The usable percentage of the available CPUs (Windows only).\n\nOn Windows Server containers, the processor resource controls are\nmutually exclusive. The order of precedence is `CPUCount` first, then\n`CPUShares`, and `CPUPercent` last.\n", + "format": "int64" + }, + "IOMaximumIOps": { + "type": "integer", + "description": "Maximum IOps for the container system drive (Windows only)", + "format": "int64" + }, + "IOMaximumBandwidth": { + "type": "integer", + "description": "Maximum IO in bytes per second for the container system drive\n(Windows only).\n", + "format": "int64" + } + }, + "description": "A container's resources (cgroups config, ulimits, etc)" + }, + "Limit": { + "type": "object", + "properties": { + "NanoCPUs": { + "type": "integer", + "format": "int64", + "example": 4000000000 + }, + "MemoryBytes": { + "type": "integer", + "format": "int64", + "example": 8272408576 + }, + "Pids": { + "type": "integer", + "description": "Limits the maximum number of PIDs in the container. Set `0` for unlimited.\n", + "format": "int64", + "example": 100, + "default": 0 + } + }, + "description": "An object describing a limit on resources which can be requested by a task.\n" + }, + "ResourceObject": { + "type": "object", + "properties": { + "NanoCPUs": { + "type": "integer", + "format": "int64", + "example": 4000000000 + }, + "MemoryBytes": { + "type": "integer", + "format": "int64", + "example": 8272408576 + }, + "GenericResources": { + "$ref": "#/components/schemas/GenericResources" + } + }, + "description": "An object describing the resources which can be advertised by a node and\nrequested by a task.\n" + }, + "GenericResources": { + "type": "array", + "description": "User-defined resources can be either Integer resources (e.g, `SSD=3`) or\nString resources (e.g, `GPU=UUID1`).\n", + "example": [ + { + "DiscreteResourceSpec": { + "Kind": "SSD", + "Value": 3 + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID1" + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID2" + } + } + ], + "items": { + "type": "object", + "properties": { + "NamedResourceSpec": { + "type": "object", + "properties": { + "Kind": { + "type": "string" + }, + "Value": { + "type": "string" + } + } + }, + "DiscreteResourceSpec": { + "type": "object", + "properties": { + "Kind": { + "type": "string" + }, + "Value": { + "type": "integer", + "format": "int64" + } + } + } + } + } + }, + "HealthConfig": { + "type": "object", + "properties": { + "Test": { + "type": "array", + "description": "The test to perform. Possible values are:\n\n- `[]` inherit healthcheck from image or parent image\n- `[\"NONE\"]` disable healthcheck\n- `[\"CMD\", args...]` exec arguments directly\n- `[\"CMD-SHELL\", command]` run command with system's default shell\n", + "items": { + "type": "string" + } + }, + "Interval": { + "type": "integer", + "description": "The time to wait between checks in nanoseconds. It should be 0 or at\nleast 1000000 (1 ms). 0 means inherit.\n", + "format": "int64" + }, + "Timeout": { + "type": "integer", + "description": "The time to wait before considering the check to have hung. It should\nbe 0 or at least 1000000 (1 ms). 0 means inherit.\n", + "format": "int64" + }, + "Retries": { + "type": "integer", + "description": "The number of consecutive failures needed to consider a container as\nunhealthy. 0 means inherit.\n" + }, + "StartPeriod": { + "type": "integer", + "description": "Start period for the container to initialize before starting\nhealth-retries countdown in nanoseconds. It should be 0 or at least\n1000000 (1 ms). 0 means inherit.\n", + "format": "int64" + } + }, + "description": "A test to perform to check that the container is healthy." + }, + "Health": { + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "Status is one of `none`, `starting`, `healthy` or `unhealthy`\n\n- \"none\" Indicates there is no healthcheck\n- \"starting\" Starting indicates that the container is not yet ready\n- \"healthy\" Healthy indicates that the container is running correctly\n- \"unhealthy\" Unhealthy indicates that the container has a problem\n", + "example": "healthy", + "enum": [ + "none", + "starting", + "healthy", + "unhealthy" + ] + }, + "FailingStreak": { + "type": "integer", + "description": "FailingStreak is the number of consecutive failures", + "example": 0 + }, + "Log": { + "type": "array", + "description": "Log contains the last few results (oldest first)\n", + "items": { + "$ref": "#/components/schemas/HealthcheckResult" + } + } + }, + "description": "Health stores information about the container's healthcheck results.\n", + "nullable": true, + "x-nullable": true + }, + "HealthcheckResult": { + "type": "object", + "properties": { + "Start": { + "type": "string", + "description": "Date and time at which this check started in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "date-time", + "example": "2020-01-04T10:44:24.496525531Z" + }, + "End": { + "type": "string", + "description": "Date and time at which this check ended in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2020-01-04T10:45:21.364524523Z" + }, + "ExitCode": { + "type": "integer", + "description": "ExitCode meanings:\n\n- `0` healthy\n- `1` unhealthy\n- `2` reserved (considered unhealthy)\n- other values: error running probe\n", + "example": 0 + }, + "Output": { + "type": "string", + "description": "Output from last check" + } + }, + "description": "HealthcheckResult stores information about a single run of a healthcheck probe\n", + "nullable": true, + "x-nullable": true + }, + "HostConfig": { + "description": "Container configuration that depends on the host we are running on", + "allOf": [ + { + "$ref": "#/components/schemas/Resources" + }, + { + "type": "object", + "properties": { + "Binds": { + "type": "array", + "description": "A list of volume bindings for this container. Each volume binding\nis a string in one of these forms:\n\n- `host-src:container-dest[:options]` to bind-mount a host path\n into the container. Both `host-src`, and `container-dest` must\n be an _absolute_ path.\n- `volume-name:container-dest[:options]` to bind-mount a volume\n managed by a volume driver into the container. `container-dest`\n must be an _absolute_ path.\n\n`options` is an optional, comma-delimited list of:\n\n- `nocopy` disables automatic copying of data from the container\n path to the volume. The `nocopy` flag only applies to named volumes.\n- `[ro|rw]` mounts a volume read-only or read-write, respectively.\n If omitted or set to `rw`, volumes are mounted read-write.\n- `[z|Z]` applies SELinux labels to allow or deny multiple containers\n to read and write to the same volume.\n - `z`: a _shared_ content label is applied to the content. This\n label indicates that multiple containers can share the volume\n content, for both reading and writing.\n - `Z`: a _private unshared_ label is applied to the content.\n This label indicates that only the current container can use\n a private volume. Labeling systems such as SELinux require\n proper labels to be placed on volume content that is mounted\n into a container. Without a label, the security system can\n prevent a container's processes from using the content. By\n default, the labels set by the host operating system are not\n modified.\n- `[[r]shared|[r]slave|[r]private]` specifies mount\n [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt).\n This only applies to bind-mounted volumes, not internal volumes\n or named volumes. Mount propagation requires the source mount\n point (the location where the source directory is mounted in the\n host operating system) to have the correct propagation properties.\n For shared volumes, the source mount point must be set to `shared`.\n For slave volumes, the mount must be set to either `shared` or\n `slave`.\n", + "items": { + "type": "string" + } + }, + "ContainerIDFile": { + "type": "string", + "description": "Path to a file where the container ID is written" + }, + "LogConfig": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "enum": [ + "json-file", + "syslog", + "journald", + "gelf", + "fluentd", + "awslogs", + "splunk", + "etwlogs", + "none" + ] + }, + "Config": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "The logging configuration for this container" + }, + "NetworkMode": { + "type": "string", + "description": "Network mode to use for this container. Supported standard values\nare: `bridge`, `host`, `none`, and `container:`. Any\nother value is taken as a custom network's name to which this\ncontainer should connect to.\n" + }, + "PortBindings": { + "$ref": "#/components/schemas/PortMap" + }, + "RestartPolicy": { + "$ref": "#/components/schemas/RestartPolicy" + }, + "AutoRemove": { + "type": "boolean", + "description": "Automatically remove the container when the container's process\nexits. This has no effect if `RestartPolicy` is set.\n" + }, + "VolumeDriver": { + "type": "string", + "description": "Driver that this container uses to mount volumes." + }, + "VolumesFrom": { + "type": "array", + "description": "A list of volumes to inherit from another container, specified in\nthe form `[:]`.\n", + "items": { + "type": "string" + } + }, + "Mounts": { + "type": "array", + "description": "Specification for mounts to be added to the container.\n", + "items": { + "$ref": "#/components/schemas/Mount" + } + }, + "ConsoleSize": { + "maxItems": 2, + "minItems": 2, + "type": "array", + "description": "Initial console size, as an `[height, width]` array.\n", + "nullable": true, + "items": { + "minimum": 0, + "type": "integer" + } + }, + "CapAdd": { + "type": "array", + "description": "A list of kernel capabilities to add to the container. Conflicts\nwith option 'Capabilities'.\n", + "items": { + "type": "string" + } + }, + "CapDrop": { + "type": "array", + "description": "A list of kernel capabilities to drop from the container. Conflicts\nwith option 'Capabilities'.\n", + "items": { + "type": "string" + } + }, + "CgroupnsMode": { + "type": "string", + "description": "cgroup namespace mode for the container. Possible values are:\n\n- `\"private\"`: the container runs in its own private cgroup namespace\n- `\"host\"`: use the host system's cgroup namespace\n\nIf not specified, the daemon default is used, which can either be `\"private\"`\nor `\"host\"`, depending on daemon version, kernel support and configuration.\n", + "enum": [ + "private", + "host" + ] + }, + "Dns": { + "type": "array", + "description": "A list of DNS servers for the container to use.", + "items": { + "type": "string" + } + }, + "DnsOptions": { + "type": "array", + "description": "A list of DNS options.", + "items": { + "type": "string" + } + }, + "DnsSearch": { + "type": "array", + "description": "A list of DNS search domains.", + "items": { + "type": "string" + } + }, + "ExtraHosts": { + "type": "array", + "description": "A list of hostnames/IP mappings to add to the container's `/etc/hosts`\nfile. Specified in the form `[\"hostname:IP\"]`.\n", + "items": { + "type": "string" + } + }, + "GroupAdd": { + "type": "array", + "description": "A list of additional groups that the container process will run as.\n", + "items": { + "type": "string" + } + }, + "IpcMode": { + "type": "string", + "description": "IPC sharing mode for the container. Possible values are:\n\n- `\"none\"`: own private IPC namespace, with /dev/shm not mounted\n- `\"private\"`: own private IPC namespace\n- `\"shareable\"`: own private IPC namespace, with a possibility to share it with other containers\n- `\"container:\"`: join another (shareable) container's IPC namespace\n- `\"host\"`: use the host system's IPC namespace\n\nIf not specified, daemon default is used, which can either be `\"private\"`\nor `\"shareable\"`, depending on daemon version and configuration.\n" + }, + "Cgroup": { + "type": "string", + "description": "Cgroup to use for the container." + }, + "Links": { + "type": "array", + "description": "A list of links for the container in the form `container_name:alias`.\n", + "items": { + "type": "string" + } + }, + "OomScoreAdj": { + "type": "integer", + "description": "An integer value containing the score given to the container in\norder to tune OOM killer preferences.\n", + "example": 500 + }, + "PidMode": { + "type": "string", + "description": "Set the PID (Process) Namespace mode for the container. It can be\neither:\n\n- `\"container:\"`: joins another container's PID namespace\n- `\"host\"`: use the host's PID namespace inside the container\n" + }, + "Privileged": { + "type": "boolean", + "description": "Gives the container full access to the host." + }, + "PublishAllPorts": { + "type": "boolean", + "description": "Allocates an ephemeral host port for all of a container's\nexposed ports.\n\nPorts are de-allocated when the container stops and allocated when\nthe container starts. The allocated port might be changed when\nrestarting the container.\n\nThe port is selected from the ephemeral port range that depends on\nthe kernel. For example, on Linux the range is defined by\n`/proc/sys/net/ipv4/ip_local_port_range`.\n" + }, + "ReadonlyRootfs": { + "type": "boolean", + "description": "Mount the container's root filesystem as read only." + }, + "SecurityOpt": { + "type": "array", + "description": "A list of string values to customize labels for MLS systems, such\nas SELinux.\n", + "items": { + "type": "string" + } + }, + "StorageOpt": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Storage driver options for this container, in the form `{\"size\": \"120G\"}`.\n" + }, + "Tmpfs": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of container directories which should be replaced by tmpfs\nmounts, and their corresponding mount options. For example:\n\n```\n{ \"/run\": \"rw,noexec,nosuid,size=65536k\" }\n```\n" + }, + "UTSMode": { + "type": "string", + "description": "UTS namespace to use for the container." + }, + "UsernsMode": { + "type": "string", + "description": "Sets the usernamespace mode for the container when usernamespace\nremapping option is enabled.\n" + }, + "ShmSize": { + "minimum": 0, + "type": "integer", + "description": "Size of `/dev/shm` in bytes. If omitted, the system uses 64MB.\n", + "format": "int64" + }, + "Sysctls": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A list of kernel parameters (sysctls) to set in the container.\nFor example:\n\n```\n{\"net.ipv4.ip_forward\": \"1\"}\n```\n" + }, + "Runtime": { + "type": "string", + "description": "Runtime to use with this container." + }, + "Isolation": { + "type": "string", + "description": "Isolation technology of the container. (Windows only)\n", + "enum": [ + "default", + "process", + "hyperv" + ] + }, + "MaskedPaths": { + "type": "array", + "description": "The list of paths to be masked inside the container (this overrides\nthe default set of paths).\n", + "items": { + "type": "string" + } + }, + "ReadonlyPaths": { + "type": "array", + "description": "The list of paths to be set as read-only inside the container\n(this overrides the default set of paths).\n", + "items": { + "type": "string" + } + } + } + } + ] + }, + "ContainerConfig": { + "type": "object", + "properties": { + "Hostname": { + "type": "string", + "description": "The hostname to use for the container, as a valid RFC 1123 hostname.\n", + "example": "439f4e91bd1d" + }, + "Domainname": { + "type": "string", + "description": "The domain name to use for the container.\n" + }, + "User": { + "type": "string", + "description": "The user that commands are run as inside the container." + }, + "AttachStdin": { + "type": "boolean", + "description": "Whether to attach to `stdin`.", + "default": false + }, + "AttachStdout": { + "type": "boolean", + "description": "Whether to attach to `stdout`.", + "default": true + }, + "AttachStderr": { + "type": "boolean", + "description": "Whether to attach to `stderr`.", + "default": true + }, + "ExposedPorts": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "An object mapping ports to an empty object in the form:\n\n`{\"/\": {}}`\n", + "nullable": true, + "example": { + "80/tcp": {}, + "443/tcp": {} + } + }, + "Tty": { + "type": "boolean", + "description": "Attach standard streams to a TTY, including `stdin` if it is not closed.\n", + "default": false + }, + "OpenStdin": { + "type": "boolean", + "description": "Open `stdin`", + "default": false + }, + "StdinOnce": { + "type": "boolean", + "description": "Close `stdin` after one attached client disconnects", + "default": false + }, + "Env": { + "type": "array", + "description": "A list of environment variables to set inside the container in the\nform `[\"VAR=value\", ...]`. A variable without `=` is removed from the\nenvironment, rather than to have an empty value.\n", + "example": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "items": { + "type": "string" + } + }, + "Cmd": { + "type": "array", + "description": "Command to run specified as a string or an array of strings.\n", + "example": [ + "/bin/sh" + ], + "items": { + "type": "string" + } + }, + "Healthcheck": { + "$ref": "#/components/schemas/HealthConfig" + }, + "ArgsEscaped": { + "type": "boolean", + "description": "Command is already escaped (Windows only)", + "nullable": true, + "example": false, + "default": false + }, + "Image": { + "type": "string", + "description": "The name (or reference) of the image to use when creating the container,\nor which was used when the container was created.\n", + "example": "example-image:1.0" + }, + "Volumes": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "An object mapping mount point paths inside the container to empty\nobjects.\n" + }, + "WorkingDir": { + "type": "string", + "description": "The working directory for commands to run in.", + "example": "/public/" + }, + "Entrypoint": { + "type": "array", + "description": "The entry point for the container as a string or an array of strings.\n\nIf the array consists of exactly one empty string (`[\"\"]`) then the\nentry point is reset to system default (i.e., the entry point used by\ndocker when there is no `ENTRYPOINT` instruction in the `Dockerfile`).\n", + "example": [], + "items": { + "type": "string" + } + }, + "NetworkDisabled": { + "type": "boolean", + "description": "Disable networking for the container.", + "nullable": true + }, + "MacAddress": { + "type": "string", + "description": "MAC address of the container.", + "nullable": true + }, + "OnBuild": { + "type": "array", + "description": "`ONBUILD` metadata that were defined in the image's `Dockerfile`.\n", + "nullable": true, + "example": [], + "items": { + "type": "string" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "StopSignal": { + "type": "string", + "description": "Signal to stop a container as a string or unsigned integer.\n", + "nullable": true, + "example": "SIGTERM" + }, + "StopTimeout": { + "type": "integer", + "description": "Timeout to stop a container in seconds.", + "nullable": true + }, + "Shell": { + "type": "array", + "description": "Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell.\n", + "nullable": true, + "example": [ + "/bin/sh", + "-c" + ], + "items": { + "type": "string" + } + } + }, + "description": "Configuration for a container that is portable between hosts.\n\nWhen used as `ContainerConfig` field in an image, `ContainerConfig` is an\noptional field containing the configuration of the container that was last\ncommitted when creating the image.\n\nPrevious versions of Docker builder used this field to store build cache,\nand it is not in active use anymore.\n" + }, + "NetworkingConfig": { + "type": "object", + "properties": { + "EndpointsConfig": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + }, + "description": "A mapping of network name to endpoint configuration for that network.\n" + } + }, + "description": "NetworkingConfig represents the container's networking configuration for\neach of its interfaces.\nIt is used for the networking configs specified in the `docker create`\nand `docker network connect` commands.\n", + "example": { + "EndpointsConfig": { + "isolated_nw": { + "IPAMConfig": { + "IPv4Address": "172.20.30.33", + "IPv6Address": "2001:db8:abcd::3033", + "LinkLocalIPs": [ + "169.254.34.68", + "fe80::3468" + ] + }, + "Links": [ + "container_1", + "container_2" + ], + "Aliases": [ + "server_x", + "server_y" + ] + } + } + } + }, + "NetworkSettings": { + "type": "object", + "properties": { + "Bridge": { + "type": "string", + "description": "Name of the network's bridge (for example, `docker0`).", + "example": "docker0" + }, + "SandboxID": { + "type": "string", + "description": "SandboxID uniquely represents a container's network stack.", + "example": "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3" + }, + "HairpinMode": { + "type": "boolean", + "description": "Indicates if hairpin NAT should be enabled on the virtual interface.\n", + "example": false + }, + "LinkLocalIPv6Address": { + "type": "string", + "description": "IPv6 unicast address using the link-local prefix.", + "example": "fe80::42:acff:fe11:1" + }, + "LinkLocalIPv6PrefixLen": { + "type": "integer", + "description": "Prefix length of the IPv6 unicast address.", + "example": 64 + }, + "Ports": { + "$ref": "#/components/schemas/PortMap" + }, + "SandboxKey": { + "type": "string", + "description": "SandboxKey identifies the sandbox", + "example": "/var/run/docker/netns/8ab54b426c38" + }, + "SecondaryIPAddresses": { + "type": "array", + "description": "", + "nullable": true, + "items": { + "$ref": "#/components/schemas/Address" + } + }, + "SecondaryIPv6Addresses": { + "type": "array", + "description": "", + "nullable": true, + "items": { + "$ref": "#/components/schemas/Address" + } + }, + "EndpointID": { + "type": "string", + "description": "EndpointID uniquely represents a service endpoint in a Sandbox.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + }, + "Gateway": { + "type": "string", + "description": "Gateway address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "172.17.0.1" + }, + "GlobalIPv6Address": { + "type": "string", + "description": "Global IPv6 address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "2001:db8::5689" + }, + "GlobalIPv6PrefixLen": { + "type": "integer", + "description": "Mask length of the global IPv6 address.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": 64 + }, + "IPAddress": { + "type": "string", + "description": "IPv4 address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "172.17.0.4" + }, + "IPPrefixLen": { + "type": "integer", + "description": "Mask length of the IPv4 address.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": 16 + }, + "IPv6Gateway": { + "type": "string", + "description": "IPv6 gateway address for this network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "2001:db8:2::100" + }, + "MacAddress": { + "type": "string", + "description": "MAC address for the container on the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "02:42:ac:11:00:04" + }, + "Networks": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + }, + "description": "Information about all networks that the container is connected to.\n" + } + }, + "description": "NetworkSettings exposes the network settings in the API" + }, + "Address": { + "type": "object", + "properties": { + "Addr": { + "type": "string", + "description": "IP address." + }, + "PrefixLen": { + "type": "integer", + "description": "Mask length of the IP address." + } + }, + "description": "Address represents an IPv4 or IPv6 IP address." + }, + "PortMap": { + "type": "object", + "additionalProperties": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/PortBinding" + } + }, + "description": "PortMap describes the mapping of container ports to host ports, using the\ncontainer's port-number and protocol as key in the format `/`,\nfor example, `80/udp`.\n\nIf a container's port is mapped for multiple protocols, separate entries\nare added to the mapping table.\n", + "example": { + "443/tcp": [ + { + "HostIp": "127.0.0.1", + "HostPort": "4443" + } + ], + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "80" + }, + { + "HostIp": "0.0.0.0", + "HostPort": "8080" + } + ], + "80/udp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "80" + } + ], + "53/udp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "53" + } + ] + } + }, + "PortBinding": { + "type": "object", + "properties": { + "HostIp": { + "type": "string", + "description": "Host IP address that the container's port is mapped to.", + "example": "127.0.0.1" + }, + "HostPort": { + "type": "string", + "description": "Host port number that the container's port is mapped to.", + "example": "4443" + } + }, + "description": "PortBinding represents a binding between a host IP address and a host\nport.\n" + }, + "GraphDriverData": { + "required": [ + "Data", + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the storage driver.", + "nullable": false, + "example": "overlay2" + }, + "Data": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Low-level storage metadata, provided as key/value pairs.\n\nThis information is driver-specific, and depends on the storage-driver\nin use, and should be used for informational purposes only.\n", + "nullable": false, + "example": { + "MergedDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/merged", + "UpperDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/diff", + "WorkDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/work" + } + } + }, + "description": "Information about the storage driver used to store the container's and\nimage's filesystem.\n" + }, + "ImageInspect": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "ID is the content-addressable ID of an image.\n\nThis identifier is a content-addressable digest calculated from the\nimage's configuration (which includes the digests of layers used by\nthe image).\n\nNote that this digest differs from the `RepoDigests` below, which\nholds digests of image manifests that reference the image.\n", + "nullable": false, + "example": "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + }, + "RepoTags": { + "type": "array", + "description": "List of image names/tags in the local image cache that reference this\nimage.\n\nMultiple image tags can refer to the same image, and this list may be\nempty if no tags reference the image, in which case the image is\n\"untagged\", in which case it can still be referenced by its ID.\n", + "example": [ + "example:1.0", + "example:latest", + "example:stable", + "internal.registry.example.com:5000/example:1.0" + ], + "items": { + "type": "string" + } + }, + "RepoDigests": { + "type": "array", + "description": "List of content-addressable digests of locally available image manifests\nthat the image is referenced from. Multiple manifests can refer to the\nsame image.\n\nThese digests are usually only available if the image was either pulled\nfrom a registry, or if the image was pushed to a registry, which is when\nthe manifest is generated and its digest calculated.\n", + "example": [ + "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", + "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + ], + "items": { + "type": "string" + } + }, + "Parent": { + "type": "string", + "description": "ID of the parent image.\n\nDepending on how the image was created, this field may be empty and\nis only set for images that were built/created locally. This field\nis empty if the image was pulled from an image registry.\n", + "nullable": false, + "example": "" + }, + "Comment": { + "type": "string", + "description": "Optional message that was set when committing or importing the image.\n", + "nullable": false, + "example": "" + }, + "Created": { + "type": "string", + "description": "Date and time at which the image was created, formatted in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "nullable": false, + "example": "2022-02-04T21:20:12.497794809Z" + }, + "Container": { + "type": "string", + "description": "The ID of the container that was used to create the image.\n\nDepending on how the image was created, this field may be empty.\n", + "nullable": false, + "example": "65974bc86f1770ae4bff79f651ebdbce166ae9aada632ee3fa9af3a264911735" + }, + "ContainerConfig": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "DockerVersion": { + "type": "string", + "description": "The version of Docker that was used to build the image.\n\nDepending on how the image was created, this field may be empty.\n", + "nullable": false, + "example": "20.10.7" + }, + "Author": { + "type": "string", + "description": "Name of the author that was specified when committing the image, or as\nspecified through MAINTAINER (deprecated) in the Dockerfile.\n", + "nullable": false, + "example": "" + }, + "Config": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "Architecture": { + "type": "string", + "description": "Hardware CPU architecture that the image runs on.\n", + "nullable": false, + "example": "arm" + }, + "Variant": { + "type": "string", + "description": "CPU architecture variant (presently ARM-only).\n", + "nullable": true, + "example": "v7" + }, + "Os": { + "type": "string", + "description": "Operating System the image is built to run on.\n", + "nullable": false, + "example": "linux" + }, + "OsVersion": { + "type": "string", + "description": "Operating System version the image is built to run on (especially\nfor Windows).\n", + "nullable": true, + "example": "" + }, + "Size": { + "type": "integer", + "description": "Total size of the image including all layers it is composed of.\n", + "format": "int64", + "nullable": false, + "example": 1239828 + }, + "VirtualSize": { + "type": "integer", + "description": "Total size of the image including all layers it is composed of.\n\nIn versions of Docker before v1.10, this field was calculated from\nthe image itself and all of its parent images. Docker v1.10 and up\nstore images self-contained, and no longer use a parent-chain, making\nthis field an equivalent of the Size field.\n\nThis field is kept for backward compatibility, but may be removed in\na future version of the API.\n", + "format": "int64", + "nullable": false, + "example": 1239828 + }, + "GraphDriver": { + "$ref": "#/components/schemas/GraphDriverData" + }, + "RootFS": { + "required": [ + "Type" + ], + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": false, + "example": "layers" + }, + "Layers": { + "type": "array", + "example": [ + "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6", + "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" + ], + "items": { + "type": "string" + } + } + }, + "description": "Information about the image's RootFS, including the layer IDs.\n" + }, + "Metadata": { + "type": "object", + "properties": { + "LastTagTime": { + "type": "string", + "description": "Date and time at which the image was last tagged in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n\nThis information is only available if the image was tagged locally,\nand omitted otherwise.\n", + "format": "dateTime", + "nullable": true, + "example": "2022-02-28T14:40:02.623929178Z" + } + }, + "description": "Additional metadata of the image in the local cache. This information\nis local to the daemon, and not part of the image itself.\n" + } + }, + "description": "Information about an image in the local image cache.\n" + }, + "ImageSummary": { + "required": [ + "Containers", + "Created", + "Id", + "Labels", + "ParentId", + "RepoDigests", + "RepoTags", + "SharedSize", + "Size", + "VirtualSize" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "ID is the content-addressable ID of an image.\n\nThis identifier is a content-addressable digest calculated from the\nimage's configuration (which includes the digests of layers used by\nthe image).\n\nNote that this digest differs from the `RepoDigests` below, which\nholds digests of image manifests that reference the image.\n", + "nullable": false, + "example": "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + }, + "ParentId": { + "type": "string", + "description": "ID of the parent image.\n\nDepending on how the image was created, this field may be empty and\nis only set for images that were built/created locally. This field\nis empty if the image was pulled from an image registry.\n", + "nullable": false, + "example": "" + }, + "RepoTags": { + "type": "array", + "description": "List of image names/tags in the local image cache that reference this\nimage.\n\nMultiple image tags can refer to the same image, and this list may be\nempty if no tags reference the image, in which case the image is\n\"untagged\", in which case it can still be referenced by its ID.\n", + "nullable": false, + "example": [ + "example:1.0", + "example:latest", + "example:stable", + "internal.registry.example.com:5000/example:1.0" + ], + "items": { + "type": "string" + } + }, + "RepoDigests": { + "type": "array", + "description": "List of content-addressable digests of locally available image manifests\nthat the image is referenced from. Multiple manifests can refer to the\nsame image.\n\nThese digests are usually only available if the image was either pulled\nfrom a registry, or if the image was pushed to a registry, which is when\nthe manifest is generated and its digest calculated.\n", + "nullable": false, + "example": [ + "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", + "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + ], + "items": { + "type": "string" + } + }, + "Created": { + "type": "integer", + "description": "Date and time at which the image was created as a Unix timestamp\n(number of seconds sinds EPOCH).\n", + "nullable": false, + "example": 1644009612 + }, + "Size": { + "type": "integer", + "description": "Total size of the image including all layers it is composed of.\n", + "format": "int64", + "nullable": false, + "example": 172064416 + }, + "SharedSize": { + "type": "integer", + "description": "Total size of image layers that are shared between this image and other\nimages.\n\nThis size is not calculated by default. `-1` indicates that the value\nhas not been set / calculated.\n", + "format": "int64", + "nullable": false, + "example": 1239828 + }, + "VirtualSize": { + "type": "integer", + "description": "Total size of the image including all layers it is composed of.\n\nIn versions of Docker before v1.10, this field was calculated from\nthe image itself and all of its parent images. Docker v1.10 and up\nstore images self-contained, and no longer use a parent-chain, making\nthis field an equivalent of the Size field.\n\nThis field is kept for backward compatibility, but may be removed in\na future version of the API.\n", + "format": "int64", + "nullable": false, + "example": 172064416 + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "nullable": false, + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "Containers": { + "type": "integer", + "description": "Number of containers using this image. Includes both stopped and running\ncontainers.\n\nThis size is not calculated by default, and depends on which API endpoint\nis used. `-1` indicates that the value has not been set / calculated.\n", + "nullable": false, + "example": 2 + } + } + }, + "AuthConfig": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "email": { + "type": "string" + }, + "serveraddress": { + "type": "string" + } + }, + "example": { + "username": "hannibal", + "password": "xxxx", + "serveraddress": "https://index.docker.io/v1/" + } + }, + "ProcessConfig": { + "type": "object", + "properties": { + "privileged": { + "type": "boolean" + }, + "user": { + "type": "string" + }, + "tty": { + "type": "boolean" + }, + "entrypoint": { + "type": "string" + }, + "arguments": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Volume": { + "required": [ + "Driver", + "Labels", + "Mountpoint", + "Name", + "Options", + "Scope" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the volume.", + "nullable": false, + "example": "tardis" + }, + "Driver": { + "type": "string", + "description": "Name of the volume driver used by the volume.", + "nullable": false, + "example": "custom" + }, + "Mountpoint": { + "type": "string", + "description": "Mount path of the volume on the host.", + "nullable": false, + "example": "/var/lib/docker/volumes/tardis" + }, + "CreatedAt": { + "type": "string", + "description": "Date/Time the volume was created.", + "format": "dateTime", + "example": "2016-06-07T20:31:11.853781916Z" + }, + "Status": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "Low-level details about the volume, provided by the volume driver.\nDetails are returned as a map with key/value pairs:\n`{\"key\":\"value\",\"key2\":\"value2\"}`.\n\nThe `Status` field is optional, and is omitted if the volume driver\ndoes not support this feature.\n", + "example": { + "hello": "world" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "nullable": false, + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "Scope": { + "type": "string", + "description": "The level at which the volume exists. Either `global` for cluster-wide,\nor `local` for machine level.\n", + "nullable": false, + "example": "local", + "default": "local", + "enum": [ + "local", + "global" + ] + }, + "ClusterVolume": { + "$ref": "#/components/schemas/ClusterVolume" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The driver specific options used when creating the volume.\n", + "example": { + "device": "tmpfs", + "o": "size=100m,uid=1000", + "type": "tmpfs" + } + }, + "UsageData": { + "required": [ + "RefCount", + "Size" + ], + "type": "object", + "properties": { + "Size": { + "type": "integer", + "description": "Amount of disk space used by the volume (in bytes). This information\nis only available for volumes created with the `\"local\"` volume\ndriver. For volumes created with other volume drivers, this field\nis set to `-1` (\"not available\")\n", + "format": "int64", + "nullable": false, + "default": -1 + }, + "RefCount": { + "type": "integer", + "description": "The number of containers referencing this volume. This field\nis set to `-1` if the reference-count is not available.\n", + "format": "int64", + "nullable": false, + "default": -1 + } + }, + "description": "Usage details about the volume. This information is used by the\n`GET /system/df` endpoint, and omitted in other endpoints.\n", + "nullable": true, + "x-go-name": "UsageData" + } + } + }, + "VolumeCreateOptions": { + "title": "VolumeConfig", + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The new volume's name. If not specified, Docker generates a name.\n", + "nullable": false, + "example": "tardis" + }, + "Driver": { + "type": "string", + "description": "Name of the volume driver to use.", + "nullable": false, + "example": "custom", + "default": "local" + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A mapping of driver options and values. These options are\npassed directly to the driver and are driver specific.\n", + "example": { + "device": "tmpfs", + "o": "size=100m,uid=1000", + "type": "tmpfs" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "ClusterVolumeSpec": { + "$ref": "#/components/schemas/ClusterVolumeSpec" + } + }, + "description": "Volume configuration", + "x-go-name": "CreateOptions" + }, + "VolumeListResponse": { + "title": "VolumeListResponse", + "type": "object", + "properties": { + "Volumes": { + "type": "array", + "description": "List of volumes", + "items": { + "$ref": "#/components/schemas/Volume" + } + }, + "Warnings": { + "type": "array", + "description": "Warnings that occurred when fetching the list of volumes.\n", + "example": [], + "items": { + "type": "string" + } + } + }, + "description": "Volume list response", + "x-go-name": "ListResponse" + }, + "Network": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Id": { + "type": "string" + }, + "Created": { + "type": "string", + "format": "dateTime" + }, + "Scope": { + "type": "string" + }, + "Driver": { + "type": "string" + }, + "EnableIPv6": { + "type": "boolean" + }, + "IPAM": { + "$ref": "#/components/schemas/IPAM" + }, + "Internal": { + "type": "boolean" + }, + "Attachable": { + "type": "boolean" + }, + "Ingress": { + "type": "boolean" + }, + "Containers": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/NetworkContainer" + } + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "example": { + "Name": "net01", + "Id": "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99", + "Created": "2016-10-19T04:33:30.360899459Z", + "Scope": "local", + "Driver": "bridge", + "EnableIPv6": false, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.19.0.0/16", + "Gateway": "172.19.0.1" + } + ], + "Options": { + "foo": "bar" + } + }, + "Internal": false, + "Attachable": false, + "Ingress": false, + "Containers": { + "19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c": { + "Name": "test", + "EndpointID": "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a", + "MacAddress": "02:42:ac:13:00:02", + "IPv4Address": "172.19.0.2/16", + "IPv6Address": "" + } + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + }, + "IPAM": { + "type": "object", + "properties": { + "Driver": { + "type": "string", + "description": "Name of the IPAM driver to use.", + "default": "default" + }, + "Config": { + "type": "array", + "description": "List of IPAM configuration options, specified as a map:\n\n```\n{\"Subnet\": , \"IPRange\": , \"Gateway\": , \"AuxAddress\": }\n```\n", + "items": { + "$ref": "#/components/schemas/IPAMConfig" + } + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver-specific options, specified as a map." + } + } + }, + "IPAMConfig": { + "type": "object", + "properties": { + "Subnet": { + "type": "string" + }, + "IPRange": { + "type": "string" + }, + "Gateway": { + "type": "string" + }, + "AuxiliaryAddresses": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "NetworkContainer": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "EndpointID": { + "type": "string" + }, + "MacAddress": { + "type": "string" + }, + "IPv4Address": { + "type": "string" + }, + "IPv6Address": { + "type": "string" + } + } + }, + "BuildInfo": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "stream": { + "type": "string" + }, + "error": { + "type": "string" + }, + "errorDetail": { + "$ref": "#/components/schemas/ErrorDetail" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + }, + "aux": { + "$ref": "#/components/schemas/ImageID" + } + } + }, + "BuildCache": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Unique ID of the build cache record.\n", + "example": "ndlpt0hhvkqcdfkputsk4cq9c" + }, + "Parent": { + "type": "string", + "description": "ID of the parent build cache record.\n\n> **Deprecated**: This field is deprecated, and omitted if empty.\n", + "nullable": true, + "example": "" + }, + "Parents": { + "type": "array", + "description": "List of parent build cache record IDs.\n", + "nullable": true, + "example": [ + "hw53o5aio51xtltp5xjp8v7fx" + ], + "items": { + "type": "string" + } + }, + "Type": { + "type": "string", + "description": "Cache record type.\n", + "example": "regular", + "enum": [ + "internal", + "frontend", + "source.local", + "source.git.checkout", + "exec.cachemount", + "regular" + ] + }, + "Description": { + "type": "string", + "description": "Description of the build-step that produced the build cache.\n", + "example": "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache" + }, + "InUse": { + "type": "boolean", + "description": "Indicates if the build cache is in use.\n", + "example": false + }, + "Shared": { + "type": "boolean", + "description": "Indicates if the build cache is shared.\n", + "example": true + }, + "Size": { + "type": "integer", + "description": "Amount of disk space used by the build cache (in bytes).\n", + "example": 51 + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the build cache was created in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "LastUsedAt": { + "type": "string", + "description": "Date and time at which the build cache was last used in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "nullable": true, + "example": "2017-08-09T07:09:37.632105588Z" + }, + "UsageCount": { + "type": "integer", + "example": 26 + } + }, + "description": "BuildCache contains information about a build cache record.\n" + }, + "ImageID": { + "type": "object", + "properties": { + "ID": { + "type": "string" + } + }, + "description": "Image ID or Digest", + "example": { + "ID": "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" + } + }, + "CreateImageInfo": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "error": { + "type": "string" + }, + "errorDetail": { + "$ref": "#/components/schemas/ErrorDetail" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + } + } + }, + "PushImageInfo": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + } + } + }, + "ErrorDetail": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + }, + "ProgressDetail": { + "type": "object", + "properties": { + "current": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "ErrorResponse": { + "required": [ + "message" + ], + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "The error message.", + "nullable": false + } + }, + "description": "Represents an error.", + "example": { + "message": "Something went wrong." + } + }, + "IdResponse": { + "required": [ + "Id" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The id of the newly created object.", + "nullable": false + } + }, + "description": "Response to an API call that returns just an Id" + }, + "EndpointSettings": { + "type": "object", + "properties": { + "IPAMConfig": { + "$ref": "#/components/schemas/EndpointIPAMConfig" + }, + "Links": { + "type": "array", + "example": [ + "container_1", + "container_2" + ], + "items": { + "type": "string" + } + }, + "Aliases": { + "type": "array", + "example": [ + "server_x", + "server_y" + ], + "items": { + "type": "string" + } + }, + "NetworkID": { + "type": "string", + "description": "Unique ID of the network.\n", + "example": "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a" + }, + "EndpointID": { + "type": "string", + "description": "Unique ID for the service endpoint in a Sandbox.\n", + "example": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + }, + "Gateway": { + "type": "string", + "description": "Gateway address for this network.\n", + "example": "172.17.0.1" + }, + "IPAddress": { + "type": "string", + "description": "IPv4 address.\n", + "example": "172.17.0.4" + }, + "IPPrefixLen": { + "type": "integer", + "description": "Mask length of the IPv4 address.\n", + "example": 16 + }, + "IPv6Gateway": { + "type": "string", + "description": "IPv6 gateway address.\n", + "example": "2001:db8:2::100" + }, + "GlobalIPv6Address": { + "type": "string", + "description": "Global IPv6 address.\n", + "example": "2001:db8::5689" + }, + "GlobalIPv6PrefixLen": { + "type": "integer", + "description": "Mask length of the global IPv6 address.\n", + "format": "int64", + "example": 64 + }, + "MacAddress": { + "type": "string", + "description": "MAC address for the endpoint on this network.\n", + "example": "02:42:ac:11:00:04" + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "DriverOpts is a mapping of driver options and values. These options\nare passed directly to the driver and are driver specific.\n", + "nullable": true, + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + }, + "description": "Configuration for a network endpoint." + }, + "EndpointIPAMConfig": { + "type": "object", + "properties": { + "IPv4Address": { + "type": "string", + "example": "172.20.30.33" + }, + "IPv6Address": { + "type": "string", + "example": "2001:db8:abcd::3033" + }, + "LinkLocalIPs": { + "type": "array", + "example": [ + "169.254.34.68", + "fe80::3468" + ], + "items": { + "type": "string" + } + } + }, + "description": "EndpointIPAMConfig represents an endpoint's IPAM configuration.\n", + "nullable": true, + "x-nullable": true + }, + "PluginMount": { + "required": [ + "Description", + "Destination", + "Name", + "Options", + "Settable", + "Source", + "Type" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false, + "example": "some-mount" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "This is a mount that's used by the plugin." + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Source": { + "type": "string", + "example": "/var/lib/docker/plugins/" + }, + "Destination": { + "type": "string", + "nullable": false, + "example": "/mnt/state" + }, + "Type": { + "type": "string", + "nullable": false, + "example": "bind" + }, + "Options": { + "type": "array", + "example": [ + "rbind", + "rw" + ], + "items": { + "type": "string" + } + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginDevice": { + "required": [ + "Description", + "Name", + "Path", + "Settable" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false + }, + "Description": { + "type": "string", + "nullable": false + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Path": { + "type": "string", + "example": "/dev/fuse" + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginEnv": { + "required": [ + "Description", + "Name", + "Settable", + "Value" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false + }, + "Description": { + "type": "string", + "nullable": false + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Value": { + "type": "string" + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginInterfaceType": { + "required": [ + "Capability", + "Prefix", + "Version" + ], + "type": "object", + "properties": { + "Prefix": { + "type": "string", + "nullable": false + }, + "Capability": { + "type": "string", + "nullable": false + }, + "Version": { + "type": "string", + "nullable": false + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginPrivilege": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "example": "network" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "example": [ + "host" + ], + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission the user has to accept upon installing\nthe plugin.\n", + "x-go-name": "PluginPrivilege" + }, + "Plugin": { + "required": [ + "Config", + "Enabled", + "Name", + "Settings" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "example": "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" + }, + "Name": { + "type": "string", + "nullable": false, + "example": "tiborvass/sample-volume-plugin" + }, + "Enabled": { + "type": "boolean", + "description": "True if the plugin is running. False if the plugin is not running, only installed.", + "nullable": false, + "example": true + }, + "Settings": { + "required": [ + "Args", + "Devices", + "Env", + "Mounts" + ], + "type": "object", + "properties": { + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginMount" + } + }, + "Env": { + "type": "array", + "example": [ + "DEBUG=0" + ], + "items": { + "type": "string" + } + }, + "Args": { + "type": "array", + "items": { + "type": "string" + } + }, + "Devices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginDevice" + } + } + }, + "description": "Settings that can be modified by users.", + "nullable": false + }, + "PluginReference": { + "type": "string", + "description": "plugin remote reference used to push/pull the plugin", + "nullable": false, + "example": "localhost:5000/tiborvass/sample-volume-plugin:latest" + }, + "Config": { + "required": [ + "Args", + "Description", + "Documentation", + "Entrypoint", + "Env", + "Interface", + "IpcHost", + "Linux", + "Mounts", + "Network", + "PidHost", + "PropagatedMount", + "WorkDir" + ], + "type": "object", + "properties": { + "DockerVersion": { + "type": "string", + "description": "Docker Version used to create the plugin", + "nullable": false, + "example": "17.06.0-ce" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "A sample volume plugin for Docker" + }, + "Documentation": { + "type": "string", + "nullable": false, + "example": "https://docs.docker.com/engine/extend/plugins/" + }, + "Interface": { + "required": [ + "Socket", + "Types" + ], + "type": "object", + "properties": { + "Types": { + "type": "array", + "example": [ + "docker.volumedriver/1.0" + ], + "items": { + "$ref": "#/components/schemas/PluginInterfaceType" + } + }, + "Socket": { + "type": "string", + "nullable": false, + "example": "plugins.sock" + }, + "ProtocolScheme": { + "type": "string", + "description": "Protocol to use for clients connecting to the plugin.", + "example": "some.protocol/v1.0", + "enum": [ + "", + "moby.plugins.http/v1" + ] + } + }, + "description": "The interface between Docker and the plugin", + "nullable": false + }, + "Entrypoint": { + "type": "array", + "example": [ + "/usr/bin/sample-volume-plugin", + "/data" + ], + "items": { + "type": "string" + } + }, + "WorkDir": { + "type": "string", + "nullable": false, + "example": "/bin/" + }, + "User": { + "type": "object", + "properties": { + "UID": { + "type": "integer", + "format": "uint32", + "example": 1000 + }, + "GID": { + "type": "integer", + "format": "uint32", + "example": 1000 + } + }, + "nullable": false + }, + "Network": { + "required": [ + "Type" + ], + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": false, + "example": "host" + } + }, + "nullable": false + }, + "Linux": { + "required": [ + "AllowAllDevices", + "Capabilities", + "Devices" + ], + "type": "object", + "properties": { + "Capabilities": { + "type": "array", + "example": [ + "CAP_SYS_ADMIN", + "CAP_SYSLOG" + ], + "items": { + "type": "string" + } + }, + "AllowAllDevices": { + "type": "boolean", + "nullable": false, + "example": false + }, + "Devices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginDevice" + } + } + }, + "nullable": false + }, + "PropagatedMount": { + "type": "string", + "nullable": false, + "example": "/mnt/volumes" + }, + "IpcHost": { + "type": "boolean", + "nullable": false, + "example": false + }, + "PidHost": { + "type": "boolean", + "nullable": false, + "example": false + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginMount" + } + }, + "Env": { + "type": "array", + "example": [ + { + "Name": "DEBUG", + "Description": "If set, prints debug messages", + "Value": "0" + } + ], + "items": { + "$ref": "#/components/schemas/PluginEnv" + } + }, + "Args": { + "required": [ + "Description", + "Name", + "Settable", + "Value" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false, + "example": "args" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "command line arguments" + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "nullable": false + }, + "rootfs": { + "type": "object", + "properties": { + "type": { + "type": "string", + "example": "layers" + }, + "diff_ids": { + "type": "array", + "example": [ + "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887", + "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" + ], + "items": { + "type": "string" + } + } + } + } + }, + "description": "The config of a plugin.", + "nullable": false + } + }, + "description": "A plugin for the Engine API" + }, + "ObjectVersion": { + "type": "object", + "properties": { + "Index": { + "type": "integer", + "format": "uint64", + "example": 373531 + } + }, + "description": "The version number of the object such as node, service, etc. This is needed\nto avoid conflicting writes. The client must send the version number along\nwith the modified specification when updating these objects.\n\nThis approach ensures safe concurrency and determinism in that the change\non the object may not be applied if the version number has changed from the\nlast read. In other words, if two update requests specify the same base\nversion, only one of the requests can succeed. As a result, two separate\nupdate requests that happen at the same time will not unintentionally\noverwrite each other.\n" + }, + "NodeSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name for the node.", + "example": "my-node" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Role": { + "type": "string", + "description": "Role of the node.", + "example": "manager", + "enum": [ + "worker", + "manager" + ] + }, + "Availability": { + "type": "string", + "description": "Availability of the node.", + "example": "active", + "enum": [ + "active", + "pause", + "drain" + ] + } + }, + "example": { + "Availability": "active", + "Name": "node-name", + "Role": "manager", + "Labels": { + "foo": "bar" + } + } + }, + "Node": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "example": "24ifsmvkjbyhk" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the node was added to the swarm in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "UpdatedAt": { + "type": "string", + "description": "Date and time at which the node was last updated in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2017-08-09T07:09:37.632105588Z" + }, + "Spec": { + "$ref": "#/components/schemas/NodeSpec" + }, + "Description": { + "$ref": "#/components/schemas/NodeDescription" + }, + "Status": { + "$ref": "#/components/schemas/NodeStatus" + }, + "ManagerStatus": { + "$ref": "#/components/schemas/ManagerStatus" + } + } + }, + "NodeDescription": { + "type": "object", + "properties": { + "Hostname": { + "type": "string", + "example": "bf3067039e47" + }, + "Platform": { + "$ref": "#/components/schemas/Platform" + }, + "Resources": { + "$ref": "#/components/schemas/ResourceObject" + }, + "Engine": { + "$ref": "#/components/schemas/EngineDescription" + }, + "TLSInfo": { + "$ref": "#/components/schemas/TLSInfo" + } + }, + "description": "NodeDescription encapsulates the properties of the Node as reported by the\nagent.\n" + }, + "Platform": { + "type": "object", + "properties": { + "Architecture": { + "type": "string", + "description": "Architecture represents the hardware architecture (for example,\n`x86_64`).\n", + "example": "x86_64" + }, + "OS": { + "type": "string", + "description": "OS represents the Operating System (for example, `linux` or `windows`).\n", + "example": "linux" + } + }, + "description": "Platform represents the platform (Arch/OS).\n" + }, + "EngineDescription": { + "type": "object", + "properties": { + "EngineVersion": { + "type": "string", + "example": "17.06.0" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "example": { + "foo": "bar" + } + }, + "Plugins": { + "type": "array", + "example": [ + { + "Type": "Log", + "Name": "awslogs" + }, + { + "Type": "Log", + "Name": "fluentd" + }, + { + "Type": "Log", + "Name": "gcplogs" + }, + { + "Type": "Log", + "Name": "gelf" + }, + { + "Type": "Log", + "Name": "journald" + }, + { + "Type": "Log", + "Name": "json-file" + }, + { + "Type": "Log", + "Name": "logentries" + }, + { + "Type": "Log", + "Name": "splunk" + }, + { + "Type": "Log", + "Name": "syslog" + }, + { + "Type": "Network", + "Name": "bridge" + }, + { + "Type": "Network", + "Name": "host" + }, + { + "Type": "Network", + "Name": "ipvlan" + }, + { + "Type": "Network", + "Name": "macvlan" + }, + { + "Type": "Network", + "Name": "null" + }, + { + "Type": "Network", + "Name": "overlay" + }, + { + "Type": "Volume", + "Name": "local" + }, + { + "Type": "Volume", + "Name": "localhost:5000/vieux/sshfs:latest" + }, + { + "Type": "Volume", + "Name": "vieux/sshfs:latest" + } + ], + "items": { + "type": "object", + "properties": { + "Type": { + "type": "string" + }, + "Name": { + "type": "string" + } + } + } + } + }, + "description": "EngineDescription provides information about an engine." + }, + "TLSInfo": { + "type": "object", + "properties": { + "TrustRoot": { + "type": "string", + "description": "The root CA certificate(s) that are used to validate leaf TLS\ncertificates.\n" + }, + "CertIssuerSubject": { + "type": "string", + "description": "The base64-url-safe-encoded raw subject bytes of the issuer." + }, + "CertIssuerPublicKey": { + "type": "string", + "description": "The base64-url-safe-encoded raw public key bytes of the issuer.\n" + } + }, + "description": "Information about the issuer of leaf TLS certificates and the trusted root\nCA certificate.\n", + "example": { + "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0\nMzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf\n3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO\nPQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz\npxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H\n-----END CERTIFICATE-----\n", + "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh", + "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A==" + } + }, + "NodeStatus": { + "type": "object", + "properties": { + "State": { + "$ref": "#/components/schemas/NodeState" + }, + "Message": { + "type": "string", + "example": "" + }, + "Addr": { + "type": "string", + "description": "IP address of the node.", + "example": "172.17.0.2" + } + }, + "description": "NodeStatus represents the status of a node.\n\nIt provides the current status of the node, as seen by the manager.\n" + }, + "NodeState": { + "type": "string", + "description": "NodeState represents the state of a node.", + "example": "ready", + "enum": [ + "unknown", + "down", + "ready", + "disconnected" + ] + }, + "ManagerStatus": { + "type": "object", + "properties": { + "Leader": { + "type": "boolean", + "example": true, + "default": false + }, + "Reachability": { + "$ref": "#/components/schemas/Reachability" + }, + "Addr": { + "type": "string", + "description": "The IP address and port at which the manager is reachable.\n", + "example": "10.0.0.46:2377" + } + }, + "description": "ManagerStatus represents the status of a manager.\n\nIt provides the current status of a node's manager component, if the node\nis a manager.\n", + "nullable": true, + "x-nullable": true + }, + "Reachability": { + "type": "string", + "description": "Reachability represents the reachability of a node.", + "example": "reachable", + "enum": [ + "unknown", + "unreachable", + "reachable" + ] + }, + "SwarmSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the swarm.", + "example": "default" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.corp.type": "production", + "com.example.corp.department": "engineering" + } + }, + "Orchestration": { + "type": "object", + "properties": { + "TaskHistoryRetentionLimit": { + "type": "integer", + "description": "The number of historic tasks to keep per instance or node. If\nnegative, never remove completed or failed tasks.\n", + "format": "int64", + "example": 10 + } + }, + "description": "Orchestration configuration.", + "nullable": true + }, + "Raft": { + "type": "object", + "properties": { + "SnapshotInterval": { + "type": "integer", + "description": "The number of log entries between snapshots.", + "format": "uint64", + "example": 10000 + }, + "KeepOldSnapshots": { + "type": "integer", + "description": "The number of snapshots to keep beyond the current snapshot.\n", + "format": "uint64" + }, + "LogEntriesForSlowFollowers": { + "type": "integer", + "description": "The number of log entries to keep around to sync up slow followers\nafter a snapshot is created.\n", + "format": "uint64", + "example": 500 + }, + "ElectionTick": { + "type": "integer", + "description": "The number of ticks that a follower will wait for a message from\nthe leader before becoming a candidate and starting an election.\n`ElectionTick` must be greater than `HeartbeatTick`.\n\nA tick currently defaults to one second, so these translate\ndirectly to seconds currently, but this is NOT guaranteed.\n", + "example": 3 + }, + "HeartbeatTick": { + "type": "integer", + "description": "The number of ticks between heartbeats. Every HeartbeatTick ticks,\nthe leader will send a heartbeat to the followers.\n\nA tick currently defaults to one second, so these translate\ndirectly to seconds currently, but this is NOT guaranteed.\n", + "example": 1 + } + }, + "description": "Raft configuration." + }, + "Dispatcher": { + "type": "object", + "properties": { + "HeartbeatPeriod": { + "type": "integer", + "description": "The delay for an agent to send a heartbeat to the dispatcher.\n", + "format": "int64", + "example": 5000000000 + } + }, + "description": "Dispatcher configuration.", + "nullable": true + }, + "CAConfig": { + "type": "object", + "properties": { + "NodeCertExpiry": { + "type": "integer", + "description": "The duration node certificates are issued for.", + "format": "int64", + "example": 7776000000000000 + }, + "ExternalCAs": { + "type": "array", + "description": "Configuration for forwarding signing requests to an external\ncertificate authority.\n", + "items": { + "type": "object", + "properties": { + "Protocol": { + "type": "string", + "description": "Protocol for communication with the external CA (currently\nonly `cfssl` is supported).\n", + "default": "cfssl", + "enum": [ + "cfssl" + ] + }, + "URL": { + "type": "string", + "description": "URL where certificate signing requests should be sent.\n" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "An object with key/value pairs that are interpreted as\nprotocol-specific options for the external CA driver.\n" + }, + "CACert": { + "type": "string", + "description": "The root CA certificate (in PEM format) this external CA uses\nto issue TLS certificates (assumed to be to the current swarm\nroot CA certificate if not provided).\n" + } + } + } + }, + "SigningCACert": { + "type": "string", + "description": "The desired signing CA certificate for all swarm node TLS leaf\ncertificates, in PEM format.\n" + }, + "SigningCAKey": { + "type": "string", + "description": "The desired signing CA key for all swarm node TLS leaf certificates,\nin PEM format.\n" + }, + "ForceRotate": { + "type": "integer", + "description": "An integer whose purpose is to force swarm to generate a new\nsigning CA certificate and key, if none have been specified in\n`SigningCACert` and `SigningCAKey`\n", + "format": "uint64" + } + }, + "description": "CA configuration.", + "nullable": true + }, + "EncryptionConfig": { + "type": "object", + "properties": { + "AutoLockManagers": { + "type": "boolean", + "description": "If set, generate a key and use it to lock data stored on the\nmanagers.\n", + "example": false + } + }, + "description": "Parameters related to encryption-at-rest." + }, + "TaskDefaults": { + "type": "object", + "properties": { + "LogDriver": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The log driver to use as a default for new tasks.\n", + "example": "json-file" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver-specific options for the selectd log driver, specified\nas key/value pairs.\n", + "example": { + "max-file": "10", + "max-size": "100m" + } + } + }, + "description": "The log driver to use for tasks created in the orchestrator if\nunspecified by a service.\n\nUpdating this value only affects new tasks. Existing tasks continue\nto use their previously configured log driver until recreated.\n" + } + }, + "description": "Defaults for creating tasks in this cluster." + } + }, + "description": "User modifiable swarm configuration." + }, + "ClusterInfo": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the swarm.", + "example": "abajmipo7b4xz5ip2nrla6b11" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the swarm was initialised in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "UpdatedAt": { + "type": "string", + "description": "Date and time at which the swarm was last updated in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2017-08-09T07:09:37.632105588Z" + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + }, + "TLSInfo": { + "$ref": "#/components/schemas/TLSInfo" + }, + "RootRotationInProgress": { + "type": "boolean", + "description": "Whether there is currently a root CA rotation in progress for the swarm\n", + "example": false + }, + "DataPathPort": { + "type": "integer", + "description": "DataPathPort specifies the data path port number for data traffic.\nAcceptable port range is 1024 to 49151.\nIf no port is set or is set to 0, the default port (4789) is used.\n", + "format": "uint32", + "example": 4789 + }, + "DefaultAddrPool": { + "type": "array", + "description": "Default Address Pool specifies default subnet pools for global scope\nnetworks.\n", + "items": { + "type": "string", + "format": "CIDR", + "example": "" + } + }, + "SubnetSize": { + "maximum": 29, + "type": "integer", + "description": "SubnetSize specifies the subnet size of the networks created from the\ndefault subnet pool.\n", + "format": "uint32", + "example": 24 + } + }, + "description": "ClusterInfo represents information about the swarm as is returned by the\n\"/info\" endpoint. Join-tokens are not included.\n", + "nullable": true, + "x-nullable": true + }, + "JoinTokens": { + "type": "object", + "properties": { + "Worker": { + "type": "string", + "description": "The token workers can use to join the swarm.\n", + "example": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx" + }, + "Manager": { + "type": "string", + "description": "The token managers can use to join the swarm.\n", + "example": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + }, + "description": "JoinTokens contains the tokens workers and managers need to join the swarm.\n" + }, + "Swarm": { + "allOf": [ + { + "$ref": "#/components/schemas/ClusterInfo" + }, + { + "type": "object", + "properties": { + "JoinTokens": { + "$ref": "#/components/schemas/JoinTokens" + } + } + } + ] + }, + "TaskSpec": { + "type": "object", + "properties": { + "PluginSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The name or 'alias' to use for the plugin." + }, + "Remote": { + "type": "string", + "description": "The plugin image reference to use." + }, + "Disabled": { + "type": "boolean", + "description": "Disable the plugin once scheduled." + }, + "PluginPrivilege": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + }, + "description": "Plugin spec for the service. *(Experimental release only.)*\n\n


\n\n> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n> mutually exclusive. PluginSpec is only used when the Runtime field\n> is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n> field is set to `attachment`.\n" + }, + "ContainerSpec": { + "type": "object", + "properties": { + "Image": { + "type": "string", + "description": "The image name to use for the container" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value data." + }, + "Command": { + "type": "array", + "description": "The command to be run in the image.", + "items": { + "type": "string" + } + }, + "Args": { + "type": "array", + "description": "Arguments to the command.", + "items": { + "type": "string" + } + }, + "Hostname": { + "type": "string", + "description": "The hostname to use for the container, as a valid\n[RFC 1123](https://tools.ietf.org/html/rfc1123) hostname.\n" + }, + "Env": { + "type": "array", + "description": "A list of environment variables in the form `VAR=value`.\n", + "items": { + "type": "string" + } + }, + "Dir": { + "type": "string", + "description": "The working directory for commands to run in." + }, + "User": { + "type": "string", + "description": "The user inside the container." + }, + "Groups": { + "type": "array", + "description": "A list of additional groups that the container process will run as.\n", + "items": { + "type": "string" + } + }, + "Privileges": { + "type": "object", + "properties": { + "CredentialSpec": { + "type": "object", + "properties": { + "Config": { + "type": "string", + "description": "Load credential spec from a Swarm Config with the given ID.\nThe specified config must also be present in the Configs\nfield with the Runtime property set.\n\n


\n\n\n> **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n> and `CredentialSpec.Config` are mutually exclusive.\n", + "example": "0bt9dmxjvjiqermk6xrop3ekq" + }, + "File": { + "type": "string", + "description": "Load credential spec from this file. The file is read by\nthe daemon, and must be present in the `CredentialSpecs`\nsubdirectory in the docker data directory, which defaults\nto `C:\\ProgramData\\Docker\\` on Windows.\n\nFor example, specifying `spec.json` loads\n`C:\\ProgramData\\Docker\\CredentialSpecs\\spec.json`.\n\n


\n\n> **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n> and `CredentialSpec.Config` are mutually exclusive.\n", + "example": "spec.json" + }, + "Registry": { + "type": "string", + "description": "Load credential spec from this value in the Windows\nregistry. The specified registry value must be located in:\n\n`HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Virtualization\\Containers\\CredentialSpecs`\n\n


\n\n\n> **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n> and `CredentialSpec.Config` are mutually exclusive.\n" + } + }, + "description": "CredentialSpec for managed service account (Windows only)" + }, + "SELinuxContext": { + "type": "object", + "properties": { + "Disable": { + "type": "boolean", + "description": "Disable SELinux" + }, + "User": { + "type": "string", + "description": "SELinux user label" + }, + "Role": { + "type": "string", + "description": "SELinux role label" + }, + "Type": { + "type": "string", + "description": "SELinux type label" + }, + "Level": { + "type": "string", + "description": "SELinux level label" + } + }, + "description": "SELinux labels of the container" + } + }, + "description": "Security options for the container" + }, + "TTY": { + "type": "boolean", + "description": "Whether a pseudo-TTY should be allocated." + }, + "OpenStdin": { + "type": "boolean", + "description": "Open `stdin`" + }, + "ReadOnly": { + "type": "boolean", + "description": "Mount the container's root filesystem as read only." + }, + "Mounts": { + "type": "array", + "description": "Specification for mounts to be added to containers created as part\nof the service.\n", + "items": { + "$ref": "#/components/schemas/Mount" + } + }, + "StopSignal": { + "type": "string", + "description": "Signal to stop the container." + }, + "StopGracePeriod": { + "type": "integer", + "description": "Amount of time to wait for the container to terminate before\nforcefully killing it.\n", + "format": "int64" + }, + "HealthCheck": { + "$ref": "#/components/schemas/HealthConfig" + }, + "Hosts": { + "type": "array", + "description": "A list of hostname/IP mappings to add to the container's `hosts`\nfile. The format of extra hosts is specified in the\n[hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html)\nman page:\n\n IP_address canonical_hostname [aliases...]\n", + "items": { + "type": "string" + } + }, + "DNSConfig": { + "type": "object", + "properties": { + "Nameservers": { + "type": "array", + "description": "The IP addresses of the name servers.", + "items": { + "type": "string" + } + }, + "Search": { + "type": "array", + "description": "A search list for host-name lookup.", + "items": { + "type": "string" + } + }, + "Options": { + "type": "array", + "description": "A list of internal resolver variables to be modified (e.g.,\n`debug`, `ndots:3`, etc.).\n", + "items": { + "type": "string" + } + } + }, + "description": "Specification for DNS related configurations in resolver configuration\nfile (`resolv.conf`).\n" + }, + "Secrets": { + "type": "array", + "description": "Secrets contains references to zero or more secrets that will be\nexposed to the service.\n", + "items": { + "type": "object", + "properties": { + "File": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name represents the final filename in the filesystem.\n" + }, + "UID": { + "type": "string", + "description": "UID represents the file UID." + }, + "GID": { + "type": "string", + "description": "GID represents the file GID." + }, + "Mode": { + "type": "integer", + "description": "Mode represents the FileMode of the file.", + "format": "uint32" + } + }, + "description": "File represents a specific target that is backed by a file.\n" + }, + "SecretID": { + "type": "string", + "description": "SecretID represents the ID of the specific secret that we're\nreferencing.\n" + }, + "SecretName": { + "type": "string", + "description": "SecretName is the name of the secret that this references,\nbut this is just provided for lookup/display purposes. The\nsecret in the reference will be identified by its ID.\n" + } + } + } + }, + "Configs": { + "type": "array", + "description": "Configs contains references to zero or more configs that will be\nexposed to the service.\n", + "items": { + "type": "object", + "properties": { + "File": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name represents the final filename in the filesystem.\n" + }, + "UID": { + "type": "string", + "description": "UID represents the file UID." + }, + "GID": { + "type": "string", + "description": "GID represents the file GID." + }, + "Mode": { + "type": "integer", + "description": "Mode represents the FileMode of the file.", + "format": "uint32" + } + }, + "description": "File represents a specific target that is backed by a file.\n\n


\n\n> **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive\n" + }, + "Runtime": { + "type": "object", + "properties": {}, + "description": "Runtime represents a target that is not mounted into the\ncontainer but is used by the task\n\n


\n\n> **Note**: `Configs.File` and `Configs.Runtime` are mutually\n> exclusive\n" + }, + "ConfigID": { + "type": "string", + "description": "ConfigID represents the ID of the specific config that we're\nreferencing.\n" + }, + "ConfigName": { + "type": "string", + "description": "ConfigName is the name of the config that this references,\nbut this is just provided for lookup/display purposes. The\nconfig in the reference will be identified by its ID.\n" + } + } + } + }, + "Isolation": { + "type": "string", + "description": "Isolation technology of the containers running the service.\n(Windows only)\n", + "enum": [ + "default", + "process", + "hyperv" + ] + }, + "Init": { + "type": "boolean", + "description": "Run an init inside the container that forwards signals and reaps\nprocesses. This field is omitted if empty, and the default (as\nconfigured on the daemon) is used.\n", + "nullable": true + }, + "Sysctls": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Set kernel namedspaced parameters (sysctls) in the container.\nThe Sysctls option on services accepts the same sysctls as the\nare supported on containers. Note that while the same sysctls are\nsupported, no guarantees or checks are made about their\nsuitability for a clustered environment, and it's up to the user\nto determine whether a given sysctl will work properly in a\nService.\n" + }, + "CapabilityAdd": { + "type": "array", + "description": "A list of kernel capabilities to add to the default set\nfor the container.\n", + "example": [ + "CAP_NET_RAW", + "CAP_SYS_ADMIN", + "CAP_SYS_CHROOT", + "CAP_SYSLOG" + ], + "items": { + "type": "string" + } + }, + "CapabilityDrop": { + "type": "array", + "description": "A list of kernel capabilities to drop from the default set\nfor the container.\n", + "example": [ + "CAP_NET_RAW" + ], + "items": { + "type": "string" + } + }, + "Ulimits": { + "type": "array", + "description": "A list of resource limits to set in the container. For example: `{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}`\"\n", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of ulimit" + }, + "Soft": { + "type": "integer", + "description": "Soft limit" + }, + "Hard": { + "type": "integer", + "description": "Hard limit" + } + } + } + } + }, + "description": "Container spec for the service.\n\n


\n\n> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n> mutually exclusive. PluginSpec is only used when the Runtime field\n> is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n> field is set to `attachment`.\n" + }, + "NetworkAttachmentSpec": { + "type": "object", + "properties": { + "ContainerID": { + "type": "string", + "description": "ID of the container represented by this task" + } + }, + "description": "Read-only spec type for non-swarm containers attached to swarm overlay\nnetworks.\n\n


\n\n> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n> mutually exclusive. PluginSpec is only used when the Runtime field\n> is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n> field is set to `attachment`.\n" + }, + "Resources": { + "type": "object", + "properties": { + "Limits": { + "$ref": "#/components/schemas/Limit" + }, + "Reservations": { + "$ref": "#/components/schemas/ResourceObject" + } + }, + "description": "Resource requirements which apply to each individual container created\nas part of the service.\n" + }, + "RestartPolicy": { + "type": "object", + "properties": { + "Condition": { + "type": "string", + "description": "Condition for restart.", + "enum": [ + "none", + "on-failure", + "any" + ] + }, + "Delay": { + "type": "integer", + "description": "Delay between restart attempts.", + "format": "int64" + }, + "MaxAttempts": { + "type": "integer", + "description": "Maximum attempts to restart a given container before giving up\n(default value is 0, which is ignored).\n", + "format": "int64", + "default": 0 + }, + "Window": { + "type": "integer", + "description": "Windows is the time window used to evaluate the restart policy\n(default value is 0, which is unbounded).\n", + "format": "int64", + "default": 0 + } + }, + "description": "Specification for the restart policy which applies to containers\ncreated as part of this service.\n" + }, + "Placement": { + "type": "object", + "properties": { + "Constraints": { + "type": "array", + "description": "An array of constraint expressions to limit the set of nodes where\na task can be scheduled. Constraint expressions can either use a\n_match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find\nnodes that satisfy every expression (AND match). Constraints can\nmatch node or Docker Engine labels as follows:\n\nnode attribute | matches | example\n---------------------|--------------------------------|-----------------------------------------------\n`node.id` | Node ID | `node.id==2ivku8v2gvtg4`\n`node.hostname` | Node hostname | `node.hostname!=node-2`\n`node.role` | Node role (`manager`/`worker`) | `node.role==manager`\n`node.platform.os` | Node operating system | `node.platform.os==windows`\n`node.platform.arch` | Node architecture | `node.platform.arch==x86_64`\n`node.labels` | User-defined node labels | `node.labels.security==high`\n`engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-14.04`\n\n`engine.labels` apply to Docker Engine labels like operating system,\ndrivers, etc. Swarm administrators add `node.labels` for operational\npurposes by using the [`node update endpoint`](#operation/NodeUpdate).\n", + "example": [ + "node.hostname!=node3.corp.example.com", + "node.role!=manager", + "node.labels.type==production", + "node.platform.os==linux", + "node.platform.arch==x86_64" + ], + "items": { + "type": "string" + } + }, + "Preferences": { + "type": "array", + "description": "Preferences provide a way to make the scheduler aware of factors\nsuch as topology. They are provided in order from highest to\nlowest precedence.\n", + "example": [ + { + "Spread": { + "SpreadDescriptor": "node.labels.datacenter" + } + }, + { + "Spread": { + "SpreadDescriptor": "node.labels.rack" + } + } + ], + "items": { + "type": "object", + "properties": { + "Spread": { + "type": "object", + "properties": { + "SpreadDescriptor": { + "type": "string", + "description": "label descriptor, such as `engine.labels.az`.\n" + } + } + } + } + } + }, + "MaxReplicas": { + "type": "integer", + "description": "Maximum number of replicas for per node (default value is 0, which\nis unlimited)\n", + "format": "int64", + "default": 0 + }, + "Platforms": { + "type": "array", + "description": "Platforms stores all the platforms that the service's image can\nrun on. This field is used in the platform filter for scheduling.\nIf empty, then the platform filter is off, meaning there are no\nscheduling restrictions.\n", + "items": { + "$ref": "#/components/schemas/Platform" + } + } + } + }, + "ForceUpdate": { + "type": "integer", + "description": "A counter that triggers an update even if no relevant parameters have\nbeen changed.\n" + }, + "Runtime": { + "type": "string", + "description": "Runtime is the type of runtime specified for the task executor.\n" + }, + "Networks": { + "type": "array", + "description": "Specifies which networks the service should attach to.", + "items": { + "$ref": "#/components/schemas/NetworkAttachmentConfig" + } + }, + "LogDriver": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "Specifies the log driver to use for tasks created from this spec. If\nnot present, the default one for the swarm will be used, finally\nfalling back to the engine default if not specified.\n" + } + }, + "description": "User modifiable task configuration." + }, + "TaskState": { + "type": "string", + "enum": [ + "new", + "allocated", + "pending", + "assigned", + "accepted", + "preparing", + "ready", + "starting", + "running", + "complete", + "shutdown", + "failed", + "rejected", + "remove", + "orphaned" + ] + }, + "Task": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the task." + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Name": { + "type": "string", + "description": "Name of the task." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Spec": { + "$ref": "#/components/schemas/TaskSpec" + }, + "ServiceID": { + "type": "string", + "description": "The ID of the service this task is part of." + }, + "Slot": { + "type": "integer" + }, + "NodeID": { + "type": "string", + "description": "The ID of the node that this task is on." + }, + "AssignedGenericResources": { + "$ref": "#/components/schemas/GenericResources" + }, + "Status": { + "type": "object", + "properties": { + "Timestamp": { + "type": "string", + "format": "dateTime" + }, + "State": { + "$ref": "#/components/schemas/TaskState" + }, + "Message": { + "type": "string" + }, + "Err": { + "type": "string" + }, + "ContainerStatus": { + "type": "object", + "properties": { + "ContainerID": { + "type": "string" + }, + "PID": { + "type": "integer" + }, + "ExitCode": { + "type": "integer" + } + } + } + } + }, + "DesiredState": { + "$ref": "#/components/schemas/TaskState" + }, + "JobIteration": { + "$ref": "#/components/schemas/ObjectVersion" + } + }, + "example": { + "ID": "0kzzo1i0y4jz6027t0k7aezc7", + "Version": { + "Index": 71 + }, + "CreatedAt": "2016-06-07T21:07:31.171892745Z", + "UpdatedAt": "2016-06-07T21:07:31.376370513Z", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:31.290032978Z", + "State": "running", + "Message": "started", + "ContainerStatus": { + "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035", + "PID": 677 + } + }, + "DesiredState": "running", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.10/16" + ] + } + ], + "AssignedGenericResources": [ + { + "DiscreteResourceSpec": { + "Kind": "SSD", + "Value": 3 + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID1" + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID2" + } + } + ] + } + }, + "ServiceSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the service." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "TaskTemplate": { + "$ref": "#/components/schemas/TaskSpec" + }, + "Mode": { + "type": "object", + "properties": { + "Replicated": { + "type": "object", + "properties": { + "Replicas": { + "type": "integer", + "format": "int64" + } + } + }, + "Global": { + "type": "object", + "properties": {} + }, + "ReplicatedJob": { + "type": "object", + "properties": { + "MaxConcurrent": { + "type": "integer", + "description": "The maximum number of replicas to run simultaneously.\n", + "format": "int64", + "default": 1 + }, + "TotalCompletions": { + "type": "integer", + "description": "The total number of replicas desired to reach the Completed\nstate. If unset, will default to the value of `MaxConcurrent`\n", + "format": "int64" + } + }, + "description": "The mode used for services with a finite number of tasks that run\nto a completed state.\n" + }, + "GlobalJob": { + "type": "object", + "properties": {}, + "description": "The mode used for services which run a task to the completed state\non each valid node.\n" + } + }, + "description": "Scheduling mode for the service." + }, + "UpdateConfig": { + "type": "object", + "properties": { + "Parallelism": { + "type": "integer", + "description": "Maximum number of tasks to be updated in one iteration (0 means\nunlimited parallelism).\n", + "format": "int64" + }, + "Delay": { + "type": "integer", + "description": "Amount of time between updates, in nanoseconds.", + "format": "int64" + }, + "FailureAction": { + "type": "string", + "description": "Action to take if an updated task fails to run, or stops running\nduring the update.\n", + "enum": [ + "continue", + "pause", + "rollback" + ] + }, + "Monitor": { + "type": "integer", + "description": "Amount of time to monitor each updated task for failures, in\nnanoseconds.\n", + "format": "int64" + }, + "MaxFailureRatio": { + "type": "number", + "description": "The fraction of tasks that may fail during an update before the\nfailure action is invoked, specified as a floating point number\nbetween 0 and 1.\n" + }, + "Order": { + "type": "string", + "description": "The order of operations when rolling out an updated task. Either\nthe old task is shut down before the new task is started, or the\nnew task is started before the old task is shut down.\n", + "enum": [ + "stop-first", + "start-first" + ] + } + }, + "description": "Specification for the update strategy of the service." + }, + "RollbackConfig": { + "type": "object", + "properties": { + "Parallelism": { + "type": "integer", + "description": "Maximum number of tasks to be rolled back in one iteration (0 means\nunlimited parallelism).\n", + "format": "int64" + }, + "Delay": { + "type": "integer", + "description": "Amount of time between rollback iterations, in nanoseconds.\n", + "format": "int64" + }, + "FailureAction": { + "type": "string", + "description": "Action to take if an rolled back task fails to run, or stops\nrunning during the rollback.\n", + "enum": [ + "continue", + "pause" + ] + }, + "Monitor": { + "type": "integer", + "description": "Amount of time to monitor each rolled back task for failures, in\nnanoseconds.\n", + "format": "int64" + }, + "MaxFailureRatio": { + "type": "number", + "description": "The fraction of tasks that may fail during a rollback before the\nfailure action is invoked, specified as a floating point number\nbetween 0 and 1.\n" + }, + "Order": { + "type": "string", + "description": "The order of operations when rolling back a task. Either the old\ntask is shut down before the new task is started, or the new task\nis started before the old task is shut down.\n", + "enum": [ + "stop-first", + "start-first" + ] + } + }, + "description": "Specification for the rollback strategy of the service." + }, + "Networks": { + "type": "array", + "description": "Specifies which networks the service should attach to.", + "items": { + "$ref": "#/components/schemas/NetworkAttachmentConfig" + } + }, + "EndpointSpec": { + "$ref": "#/components/schemas/EndpointSpec" + } + }, + "description": "User modifiable configuration for a service." + }, + "EndpointPortConfig": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Protocol": { + "type": "string", + "enum": [ + "tcp", + "udp", + "sctp" + ] + }, + "TargetPort": { + "type": "integer", + "description": "The port inside the container." + }, + "PublishedPort": { + "type": "integer", + "description": "The port on the swarm hosts." + }, + "PublishMode": { + "type": "string", + "description": "The mode in which port is published.\n\n


\n\n- \"ingress\" makes the target port accessible on every node,\n regardless of whether there is a task for the service running on\n that node or not.\n- \"host\" bypasses the routing mesh and publish the port directly on\n the swarm node where that service is running.\n", + "example": "ingress", + "default": "ingress", + "enum": [ + "ingress", + "host" + ] + } + } + }, + "EndpointSpec": { + "type": "object", + "properties": { + "Mode": { + "type": "string", + "description": "The mode of resolution to use for internal load balancing between tasks.\n", + "default": "vip", + "enum": [ + "vip", + "dnsrr" + ] + }, + "Ports": { + "type": "array", + "description": "List of exposed ports that this service is accessible on from the\noutside. Ports can only be provided if `vip` resolution mode is used.\n", + "items": { + "$ref": "#/components/schemas/EndpointPortConfig" + } + } + }, + "description": "Properties that can be configured to access and load balance a service." + }, + "Service": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Spec": { + "$ref": "#/components/schemas/ServiceSpec" + }, + "Endpoint": { + "type": "object", + "properties": { + "Spec": { + "$ref": "#/components/schemas/EndpointSpec" + }, + "Ports": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EndpointPortConfig" + } + }, + "VirtualIPs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "NetworkID": { + "type": "string" + }, + "Addr": { + "type": "string" + } + } + } + } + } + }, + "UpdateStatus": { + "type": "object", + "properties": { + "State": { + "type": "string", + "enum": [ + "updating", + "paused", + "completed" + ] + }, + "StartedAt": { + "type": "string", + "format": "dateTime" + }, + "CompletedAt": { + "type": "string", + "format": "dateTime" + }, + "Message": { + "type": "string" + } + }, + "description": "The status of a service update." + }, + "ServiceStatus": { + "type": "object", + "properties": { + "RunningTasks": { + "type": "integer", + "description": "The number of tasks for the service currently in the Running state.\n", + "format": "uint64", + "example": 7 + }, + "DesiredTasks": { + "type": "integer", + "description": "The number of tasks for the service desired to be running.\nFor replicated services, this is the replica count from the\nservice spec. For global services, this is computed by taking\ncount of all tasks for the service with a Desired State other\nthan Shutdown.\n", + "format": "uint64", + "example": 10 + }, + "CompletedTasks": { + "type": "integer", + "description": "The number of tasks for a job that are in the Completed state.\nThis field must be cross-referenced with the service type, as the\nvalue of 0 may mean the service is not in a job mode, or it may\nmean the job-mode service has no tasks yet Completed.\n", + "format": "uint64" + } + }, + "description": "The status of the service's tasks. Provided only when requested as\npart of a ServiceList operation.\n" + }, + "JobStatus": { + "type": "object", + "properties": { + "JobIteration": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "LastExecution": { + "type": "string", + "description": "The last time, as observed by the server, that this job was\nstarted.\n", + "format": "dateTime" + } + }, + "description": "The status of the service when it is in one of ReplicatedJob or\nGlobalJob modes. Absent on Replicated and Global mode services. The\nJobIteration is an ObjectVersion, but unlike the Service's version,\ndoes not need to be sent with an update request.\n" + } + }, + "example": { + "ID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Version": { + "Index": 19 + }, + "CreatedAt": "2016-06-07T21:05:51.880065305Z", + "UpdatedAt": "2016-06-07T21:07:29.962229872Z", + "Spec": { + "Name": "hopeful_cori", + "TaskTemplate": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {}, + "ForceUpdate": 0 + }, + "Mode": { + "Replicated": { + "Replicas": 1 + } + }, + "UpdateConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Mode": "vip", + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ] + } + }, + "Endpoint": { + "Spec": { + "Mode": "vip", + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ] + }, + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ], + "VirtualIPs": [ + { + "NetworkID": "4qvuz4ko70xaltuqbt8956gd1", + "Addr": "10.255.0.2/16" + }, + { + "NetworkID": "4qvuz4ko70xaltuqbt8956gd1", + "Addr": "10.255.0.3/16" + } + ] + } + } + }, + "ImageDeleteResponseItem": { + "type": "object", + "properties": { + "Untagged": { + "type": "string", + "description": "The image ID of an image that was untagged" + }, + "Deleted": { + "type": "string", + "description": "The image ID of an image that was deleted" + } + } + }, + "ServiceUpdateResponse": { + "type": "object", + "properties": { + "Warnings": { + "type": "array", + "description": "Optional warning messages", + "items": { + "type": "string" + } + } + }, + "example": { + "Warning": "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + } + }, + "ContainerSummary": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of this container", + "x-go-name": "ID" + }, + "Names": { + "type": "array", + "description": "The names that this container has been given", + "items": { + "type": "string" + } + }, + "Image": { + "type": "string", + "description": "The name of the image used when creating this container" + }, + "ImageID": { + "type": "string", + "description": "The ID of the image that this container was created from" + }, + "Command": { + "type": "string", + "description": "Command to run when starting the container" + }, + "Created": { + "type": "integer", + "description": "When the container was created", + "format": "int64" + }, + "Ports": { + "type": "array", + "description": "The ports exposed by this container", + "items": { + "$ref": "#/components/schemas/Port" + } + }, + "SizeRw": { + "type": "integer", + "description": "The size of files that have been created or changed by this container", + "format": "int64" + }, + "SizeRootFs": { + "type": "integer", + "description": "The total size of all the files in this container", + "format": "int64" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "State": { + "type": "string", + "description": "The state of this container (e.g. `Exited`)" + }, + "Status": { + "type": "string", + "description": "Additional human-readable status of this container (e.g. `Exit 0`)" + }, + "HostConfig": { + "type": "object", + "properties": { + "NetworkMode": { + "type": "string" + } + } + }, + "NetworkSettings": { + "type": "object", + "properties": { + "Networks": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + } + } + }, + "description": "A summary of the container's network settings" + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MountPoint" + } + } + } + }, + "Driver": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the driver.", + "nullable": false, + "example": "some-driver" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Key/value map of driver-specific options.", + "nullable": false, + "example": { + "OptionA": "value for driver-specific option A", + "OptionB": "value for driver-specific option B" + } + } + }, + "description": "Driver represents a driver (network, logging, secrets)." + }, + "SecretSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "User-defined name of the secret." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "Data": { + "type": "string", + "description": "Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5))\ndata to store as secret.\n\nThis field is only used to _create_ a secret, and is not returned by\nother endpoints.\n", + "example": "" + }, + "Driver": { + "$ref": "#/components/schemas/Driver" + }, + "Templating": { + "$ref": "#/components/schemas/Driver" + } + } + }, + "Secret": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "example": "blt1owaxmitz71s9v5zh81zun" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime", + "example": "2017-07-20T13:55:28.678958722Z" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime", + "example": "2017-07-20T13:55:28.678958722Z" + }, + "Spec": { + "$ref": "#/components/schemas/SecretSpec" + } + } + }, + "ConfigSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "User-defined name of the config." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Data": { + "type": "string", + "description": "Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5))\nconfig data.\n" + }, + "Templating": { + "$ref": "#/components/schemas/Driver" + } + } + }, + "Config": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Spec": { + "$ref": "#/components/schemas/ConfigSpec" + } + } + }, + "ContainerState": { + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "String representation of the container state. Can be one of \"created\",\n\"running\", \"paused\", \"restarting\", \"removing\", \"exited\", or \"dead\".\n", + "example": "running", + "enum": [ + "created", + "running", + "paused", + "restarting", + "removing", + "exited", + "dead" + ] + }, + "Running": { + "type": "boolean", + "description": "Whether this container is running.\n\nNote that a running container can be _paused_. The `Running` and `Paused`\nbooleans are not mutually exclusive:\n\nWhen pausing a container (on Linux), the freezer cgroup is used to suspend\nall processes in the container. Freezing the process requires the process to\nbe running. As a result, paused containers are both `Running` _and_ `Paused`.\n\nUse the `Status` field instead to determine if a container's state is \"running\".\n", + "example": true + }, + "Paused": { + "type": "boolean", + "description": "Whether this container is paused.", + "example": false + }, + "Restarting": { + "type": "boolean", + "description": "Whether this container is restarting.", + "example": false + }, + "OOMKilled": { + "type": "boolean", + "description": "Whether this container has been killed because it ran out of memory.\n", + "example": false + }, + "Dead": { + "type": "boolean", + "example": false + }, + "Pid": { + "type": "integer", + "description": "The process ID of this container", + "example": 1234 + }, + "ExitCode": { + "type": "integer", + "description": "The last exit code of this container", + "example": 0 + }, + "Error": { + "type": "string" + }, + "StartedAt": { + "type": "string", + "description": "The time when this container was last started.", + "example": "2020-01-06T09:06:59.461876391Z" + }, + "FinishedAt": { + "type": "string", + "description": "The time when this container last exited.", + "example": "2020-01-06T09:07:59.461876391Z" + }, + "Health": { + "$ref": "#/components/schemas/Health" + } + }, + "description": "ContainerState stores container's running state. It's part of ContainerJSONBase\nand will be returned by the \"inspect\" command.\n", + "nullable": true, + "x-nullable": true + }, + "ContainerCreateResponse": { + "title": "ContainerCreateResponse", + "required": [ + "Id", + "Warnings" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the created container", + "nullable": false, + "example": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + }, + "Warnings": { + "type": "array", + "description": "Warnings encountered when creating the container", + "nullable": false, + "example": [], + "items": { + "type": "string" + } + } + }, + "description": "OK response to ContainerCreate operation", + "x-go-name": "CreateResponse" + }, + "ContainerWaitResponse": { + "title": "ContainerWaitResponse", + "required": [ + "StatusCode" + ], + "type": "object", + "properties": { + "StatusCode": { + "type": "integer", + "description": "Exit code of the container", + "format": "int64", + "nullable": false + }, + "Error": { + "$ref": "#/components/schemas/ContainerWaitExitError" + } + }, + "description": "OK response to ContainerWait operation", + "x-go-name": "WaitResponse" + }, + "ContainerWaitExitError": { + "type": "object", + "properties": { + "Message": { + "type": "string", + "description": "Details of an error" + } + }, + "description": "container waiting error, if any", + "x-go-name": "WaitExitError" + }, + "SystemVersion": { + "type": "object", + "properties": { + "Platform": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string" + } + } + }, + "Components": { + "type": "array", + "description": "Information about system components\n", + "items": { + "required": [ + "Name", + "Version" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the component\n", + "example": "Engine" + }, + "Version": { + "type": "string", + "description": "Version of the component\n", + "nullable": false, + "example": "19.03.12" + }, + "Details": { + "type": "object", + "properties": {}, + "description": "Key/value pairs of strings with additional information about the\ncomponent. These values are intended for informational purposes\nonly, and their content is not defined, and not part of the API\nspecification.\n\nThese messages can be printed by the client as information to the user.\n", + "nullable": true + } + }, + "x-go-name": "ComponentVersion" + } + }, + "Version": { + "type": "string", + "description": "The version of the daemon", + "example": "19.03.12" + }, + "ApiVersion": { + "type": "string", + "description": "The default (and highest) API version that is supported by the daemon\n", + "example": "1.40" + }, + "MinAPIVersion": { + "type": "string", + "description": "The minimum API version that is supported by the daemon\n", + "example": "1.12" + }, + "GitCommit": { + "type": "string", + "description": "The Git commit of the source code that was used to build the daemon\n", + "example": "48a66213fe" + }, + "GoVersion": { + "type": "string", + "description": "The version Go used to compile the daemon, and the version of the Go\nruntime in use.\n", + "example": "go1.13.14" + }, + "Os": { + "type": "string", + "description": "The operating system that the daemon is running on (\"linux\" or \"windows\")\n", + "example": "linux" + }, + "Arch": { + "type": "string", + "description": "The architecture that the daemon is running on\n", + "example": "amd64" + }, + "KernelVersion": { + "type": "string", + "description": "The kernel version (`uname -r`) that the daemon is running on.\n\nThis field is omitted when empty.\n", + "example": "4.19.76-linuxkit" + }, + "Experimental": { + "type": "boolean", + "description": "Indicates if the daemon is started with experimental features enabled.\n\nThis field is omitted when empty / false.\n", + "example": true + }, + "BuildTime": { + "type": "string", + "description": "The date and time that the daemon was compiled.\n", + "example": "2020-06-22T15:49:27.000000000+00:00" + } + }, + "description": "Response of Engine API: GET \"/version\"\n" + }, + "SystemInfo": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Unique identifier of the daemon.\n\n


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


\n\n> **Note**: The information returned in this field, including the\n> formatting of values and labels, should not be considered stable,\n> and may change without notice.\n", + "example": [ + [ + "Backing Filesystem", + "extfs" + ], + [ + "Supports d_type", + "true" + ], + [ + "Native Overlay Diff", + "true" + ] + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "DockerRootDir": { + "type": "string", + "description": "Root directory of persistent Docker state.\n\nDefaults to `/var/lib/docker` on Linux, and `C:\\ProgramData\\docker`\non Windows.\n", + "example": "/var/lib/docker" + }, + "Plugins": { + "$ref": "#/components/schemas/PluginsInfo" + }, + "MemoryLimit": { + "type": "boolean", + "description": "Indicates if the host has memory limit support enabled.", + "example": true + }, + "SwapLimit": { + "type": "boolean", + "description": "Indicates if the host has memory swap limit support enabled.", + "example": true + }, + "KernelMemoryTCP": { + "type": "boolean", + "description": "Indicates if the host has kernel memory TCP limit support enabled. This\nfield is omitted if not supported.\n\nKernel memory TCP limits are not supported when using cgroups v2, which\ndoes not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup.\n", + "example": true + }, + "CpuCfsPeriod": { + "type": "boolean", + "description": "Indicates if CPU CFS(Completely Fair Scheduler) period is supported by\nthe host.\n", + "example": true + }, + "CpuCfsQuota": { + "type": "boolean", + "description": "Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by\nthe host.\n", + "example": true + }, + "CPUShares": { + "type": "boolean", + "description": "Indicates if CPU Shares limiting is supported by the host.\n", + "example": true + }, + "CPUSet": { + "type": "boolean", + "description": "Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host.\n\nSee [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt)\n", + "example": true + }, + "PidsLimit": { + "type": "boolean", + "description": "Indicates if the host kernel has PID limit support enabled.", + "example": true + }, + "OomKillDisable": { + "type": "boolean", + "description": "Indicates if OOM killer disable is supported on the host." + }, + "IPv4Forwarding": { + "type": "boolean", + "description": "Indicates IPv4 forwarding is enabled.", + "example": true + }, + "BridgeNfIptables": { + "type": "boolean", + "description": "Indicates if `bridge-nf-call-iptables` is available on the host.", + "example": true + }, + "BridgeNfIp6tables": { + "type": "boolean", + "description": "Indicates if `bridge-nf-call-ip6tables` is available on the host.", + "example": true + }, + "Debug": { + "type": "boolean", + "description": "Indicates if the daemon is running in debug-mode / with debug-level\nlogging enabled.\n", + "example": true + }, + "NFd": { + "type": "integer", + "description": "The total number of file Descriptors in use by the daemon process.\n\nThis information is only returned if debug-mode is enabled.\n", + "example": 64 + }, + "NGoroutines": { + "type": "integer", + "description": "The number of goroutines that currently exist.\n\nThis information is only returned if debug-mode is enabled.\n", + "example": 174 + }, + "SystemTime": { + "type": "string", + "description": "Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt)\nformat with nano-seconds.\n", + "example": "2017-08-08T20:28:29.06202363Z" + }, + "LoggingDriver": { + "type": "string", + "description": "The logging driver to use as a default for new containers.\n" + }, + "CgroupDriver": { + "type": "string", + "description": "The driver to use for managing cgroups.\n", + "example": "cgroupfs", + "default": "cgroupfs", + "enum": [ + "cgroupfs", + "systemd", + "none" + ] + }, + "CgroupVersion": { + "type": "string", + "description": "The version of the cgroup.\n", + "example": "1", + "default": "1", + "enum": [ + "1", + "2" + ] + }, + "NEventsListener": { + "type": "integer", + "description": "Number of event listeners subscribed.", + "example": 30 + }, + "KernelVersion": { + "type": "string", + "description": "Kernel version of the host.\n\nOn Linux, this information obtained from `uname`. On Windows this\ninformation is queried from the HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\\nregistry value, for example _\"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)\"_.\n", + "example": "4.9.38-moby" + }, + "OperatingSystem": { + "type": "string", + "description": "Name of the host's operating system, for example: \"Ubuntu 16.04.2 LTS\"\nor \"Windows Server 2016 Datacenter\"\n", + "example": "Alpine Linux v3.5" + }, + "OSVersion": { + "type": "string", + "description": "Version of the host's operating system\n\n


\n\n> **Note**: The information returned in this field, including its\n> very existence, and the formatting of values, should not be considered\n> stable, and may change without notice.\n", + "example": "16.04" + }, + "OSType": { + "type": "string", + "description": "Generic type of the operating system of the host, as returned by the\nGo runtime (`GOOS`).\n\nCurrently returned values are \"linux\" and \"windows\". A full list of\npossible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment).\n", + "example": "linux" + }, + "Architecture": { + "type": "string", + "description": "Hardware architecture of the host, as returned by the Go runtime\n(`GOARCH`).\n\nA full list of possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment).\n", + "example": "x86_64" + }, + "NCPU": { + "type": "integer", + "description": "The number of logical CPUs usable by the daemon.\n\nThe number of available CPUs is checked by querying the operating\nsystem when the daemon starts. Changes to operating system CPU\nallocation after the daemon is started are not reflected.\n", + "example": 4 + }, + "MemTotal": { + "type": "integer", + "description": "Total amount of physical memory available on the host, in bytes.\n", + "format": "int64", + "example": 2095882240 + }, + "IndexServerAddress": { + "type": "string", + "description": "Address / URL of the index server that is used for image search,\nand as a default for user authentication for Docker Hub and Docker Cloud.\n", + "example": "https://index.docker.io/v1/", + "default": "https://index.docker.io/v1/" + }, + "RegistryConfig": { + "$ref": "#/components/schemas/RegistryServiceConfig" + }, + "GenericResources": { + "$ref": "#/components/schemas/GenericResources" + }, + "HttpProxy": { + "type": "string", + "description": "HTTP-proxy configured for the daemon. This value is obtained from the\n[`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable.\nCredentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL\nare masked in the API response.\n\nContainers do not automatically inherit this configuration.\n", + "example": "http://xxxxx:xxxxx@proxy.corp.example.com:8080" + }, + "HttpsProxy": { + "type": "string", + "description": "HTTPS-proxy configured for the daemon. This value is obtained from the\n[`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable.\nCredentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL\nare masked in the API response.\n\nContainers do not automatically inherit this configuration.\n", + "example": "https://xxxxx:xxxxx@proxy.corp.example.com:4443" + }, + "NoProxy": { + "type": "string", + "description": "Comma-separated list of domain extensions for which no proxy should be\nused. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html)\nenvironment variable.\n\nContainers do not automatically inherit this configuration.\n", + "example": "*.local, 169.254/16" + }, + "Name": { + "type": "string", + "description": "Hostname of the host.", + "example": "node5.corp.example.com" + }, + "Labels": { + "type": "array", + "description": "User-defined labels (key/value metadata) as set on the daemon.\n\n


\n\n> **Note**: When part of a Swarm, nodes can both have _daemon_ labels,\n> set through the daemon configuration, and _node_ labels, set from a\n> manager node in the Swarm. Node labels are not included in this\n> field. Node labels can be retrieved using the `/nodes/(id)` endpoint\n> on a manager node in the Swarm.\n", + "example": [ + "storage=ssd", + "production" + ], + "items": { + "type": "string" + } + }, + "ExperimentalBuild": { + "type": "boolean", + "description": "Indicates if experimental features are enabled on the daemon.\n", + "example": true + }, + "ServerVersion": { + "type": "string", + "description": "Version string of the daemon.\n", + "example": "23.0.0" + }, + "Runtimes": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Runtime" + }, + "description": "List of [OCI compliant](https://github.com/opencontainers/runtime-spec)\nruntimes configured on the daemon. Keys hold the \"name\" used to\nreference the runtime.\n\nThe Docker daemon relies on an OCI compliant runtime (invoked via the\n`containerd` daemon) as its interface to the Linux kernel namespaces,\ncgroups, and SELinux.\n\nThe default runtime is `runc`, and automatically configured. Additional\nruntimes can be configured by the user and will be listed here.\n", + "example": { + "runc": { + "path": "runc" + }, + "runc-master": { + "path": "/go/bin/runc" + }, + "custom": { + "path": "/usr/local/bin/my-oci-runtime", + "runtimeArgs": [ + "--debug", + "--systemd-cgroup=false" + ] + } + } + }, + "DefaultRuntime": { + "type": "string", + "description": "Name of the default OCI runtime that is used when starting containers.\n\nThe default can be overridden per-container at create time.\n", + "example": "runc", + "default": "runc" + }, + "Swarm": { + "$ref": "#/components/schemas/SwarmInfo" + }, + "LiveRestoreEnabled": { + "type": "boolean", + "description": "Indicates if live restore is enabled.\n\nIf enabled, containers are kept running when the daemon is shutdown\nor upon daemon start if running containers are detected.\n", + "example": false, + "default": false + }, + "Isolation": { + "type": "string", + "description": "Represents the isolation technology to use as a default for containers.\nThe supported values are platform-specific.\n\nIf no isolation value is specified on daemon start, on Windows client,\nthe default is `hyperv`, and on Windows server, the default is `process`.\n\nThis option is currently not used on other platforms.\n", + "default": "default", + "enum": [ + "default", + "hyperv", + "process" + ] + }, + "InitBinary": { + "type": "string", + "description": "Name and, optional, path of the `docker-init` binary.\n\nIf the path is omitted, the daemon searches the host's `$PATH` for the\nbinary and uses the first result.\n", + "example": "docker-init" + }, + "ContainerdCommit": { + "$ref": "#/components/schemas/Commit" + }, + "RuncCommit": { + "$ref": "#/components/schemas/Commit" + }, + "InitCommit": { + "$ref": "#/components/schemas/Commit" + }, + "SecurityOptions": { + "type": "array", + "description": "List of security features that are enabled on the daemon, such as\napparmor, seccomp, SELinux, user-namespaces (userns), and rootless.\n\nAdditional configuration options for each security feature may\nbe present, and are included as a comma-separated list of key/value\npairs.\n", + "example": [ + "name=apparmor", + "name=seccomp,profile=default", + "name=selinux", + "name=userns", + "name=rootless" + ], + "items": { + "type": "string" + } + }, + "ProductLicense": { + "type": "string", + "description": "Reports a summary of the product license on the daemon.\n\nIf a commercial license has been applied to the daemon, information\nsuch as number of nodes, and expiration are included.\n", + "example": "Community Engine" + }, + "DefaultAddressPools": { + "type": "array", + "description": "List of custom default address pools for local networks, which can be\nspecified in the daemon.json file or dockerd option.\n\nExample: a Base \"10.10.0.0/16\" with Size 24 will define the set of 256\n10.10.[0-255].0/24 address pools.\n", + "items": { + "type": "object", + "properties": { + "Base": { + "type": "string", + "description": "The network address in CIDR format", + "example": "10.10.0.0/16" + }, + "Size": { + "type": "integer", + "description": "The network pool size", + "example": 24 + } + } + } + }, + "Warnings": { + "type": "array", + "description": "List of warnings / informational messages about missing features, or\nissues related to the daemon configuration.\n\nThese messages can be printed by the client as information to the user.\n", + "example": [ + "WARNING: No memory limit support", + "WARNING: bridge-nf-call-iptables is disabled", + "WARNING: bridge-nf-call-ip6tables is disabled" + ], + "items": { + "type": "string" + } + } + } + }, + "PluginsInfo": { + "type": "object", + "properties": { + "Volume": { + "type": "array", + "description": "Names of available volume-drivers, and network-driver plugins.", + "example": [ + "local" + ], + "items": { + "type": "string" + } + }, + "Network": { + "type": "array", + "description": "Names of available network-drivers, and network-driver plugins.", + "example": [ + "bridge", + "host", + "ipvlan", + "macvlan", + "null", + "overlay" + ], + "items": { + "type": "string" + } + }, + "Authorization": { + "type": "array", + "description": "Names of available authorization plugins.", + "example": [ + "img-authz-plugin", + "hbm" + ], + "items": { + "type": "string" + } + }, + "Log": { + "type": "array", + "description": "Names of available logging-drivers, and logging-driver plugins.", + "example": [ + "awslogs", + "fluentd", + "gcplogs", + "gelf", + "journald", + "json-file", + "logentries", + "splunk", + "syslog" + ], + "items": { + "type": "string" + } + } + }, + "description": "Available plugins per type.\n\n


\n\n> **Note**: Only unmanaged (V1) plugins are included in this list.\n> V1 plugins are \"lazily\" loaded, and are not returned in this list\n> if there is no resource using the plugin.\n" + }, + "RegistryServiceConfig": { + "type": "object", + "properties": { + "AllowNondistributableArtifactsCIDRs": { + "type": "array", + "description": "List of IP ranges to which nondistributable artifacts can be pushed,\nusing the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632).\n\nSome images (for example, Windows base images) contain artifacts\nwhose distribution is restricted by license. When these images are\npushed to a registry, restricted artifacts are not included.\n\nThis configuration override this behavior, and enables the daemon to\npush nondistributable artifacts to all registries whose resolved IP\naddress is within the subnet described by the CIDR syntax.\n\nThis option is useful when pushing images containing\nnondistributable artifacts to a registry on an air-gapped network so\nhosts on that network can pull the images without connecting to\nanother server.\n\n> **Warning**: Nondistributable artifacts typically have restrictions\n> on how and where they can be distributed and shared. Only use this\n> feature to push artifacts to private registries and ensure that you\n> are in compliance with any terms that cover redistributing\n> nondistributable artifacts.\n", + "example": [ + "::1/128", + "127.0.0.0/8" + ], + "items": { + "type": "string" + } + }, + "AllowNondistributableArtifactsHostnames": { + "type": "array", + "description": "List of registry hostnames to which nondistributable artifacts can be\npushed, using the format `[:]` or `[:]`.\n\nSome images (for example, Windows base images) contain artifacts\nwhose distribution is restricted by license. When these images are\npushed to a registry, restricted artifacts are not included.\n\nThis configuration override this behavior for the specified\nregistries.\n\nThis option is useful when pushing images containing\nnondistributable artifacts to a registry on an air-gapped network so\nhosts on that network can pull the images without connecting to\nanother server.\n\n> **Warning**: Nondistributable artifacts typically have restrictions\n> on how and where they can be distributed and shared. Only use this\n> feature to push artifacts to private registries and ensure that you\n> are in compliance with any terms that cover redistributing\n> nondistributable artifacts.\n", + "example": [ + "registry.internal.corp.example.com:3000", + "[2001:db8:a0b:12f0::1]:443" + ], + "items": { + "type": "string" + } + }, + "InsecureRegistryCIDRs": { + "type": "array", + "description": "List of IP ranges of insecure registries, using the CIDR syntax\n([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries\naccept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates\nfrom unknown CAs) communication.\n\nBy default, local registries (`127.0.0.0/8`) are configured as\ninsecure. All other registries are secure. Communicating with an\ninsecure registry is not possible if the daemon assumes that registry\nis secure.\n\nThis configuration override this behavior, insecure communication with\nregistries whose resolved IP address is within the subnet described by\nthe CIDR syntax.\n\nRegistries can also be marked insecure by hostname. Those registries\nare listed under `IndexConfigs` and have their `Secure` field set to\n`false`.\n\n> **Warning**: Using this option can be useful when running a local\n> registry, but introduces security vulnerabilities. This option\n> should therefore ONLY be used for testing purposes. For increased\n> security, users should add their CA to their system's list of trusted\n> CAs instead of enabling this option.\n", + "example": [ + "::1/128", + "127.0.0.0/8" + ], + "items": { + "type": "string" + } + }, + "IndexConfigs": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/IndexInfo" + }, + "example": { + "127.0.0.1:5000": { + "Name": "127.0.0.1:5000", + "Mirrors": [], + "Secure": false, + "Official": false + }, + "[2001:db8:a0b:12f0::1]:80": { + "Name": "[2001:db8:a0b:12f0::1]:80", + "Mirrors": [], + "Secure": false, + "Official": false + }, + "docker.io": { + "Name": "docker.io", + "Mirrors": [ + "https://hub-mirror.corp.example.com:5000/" + ], + "Secure": true, + "Official": true + }, + "registry.internal.corp.example.com:3000": { + "Name": "registry.internal.corp.example.com:3000", + "Mirrors": [], + "Secure": false, + "Official": false + } + } + }, + "Mirrors": { + "type": "array", + "description": "List of registry URLs that act as a mirror for the official\n(`docker.io`) registry.\n", + "example": [ + "https://hub-mirror.corp.example.com:5000/", + "https://[2001:db8:a0b:12f0::1]/" + ], + "items": { + "type": "string" + } + } + }, + "description": "RegistryServiceConfig stores daemon registry services configuration.\n", + "nullable": true, + "x-nullable": true + }, + "IndexInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the registry, such as \"docker.io\".\n", + "example": "docker.io" + }, + "Mirrors": { + "type": "array", + "description": "List of mirrors, expressed as URIs.\n", + "example": [ + "https://hub-mirror.corp.example.com:5000/", + "https://registry-2.docker.io/", + "https://registry-3.docker.io/" + ], + "items": { + "type": "string" + } + }, + "Secure": { + "type": "boolean", + "description": "Indicates if the registry is part of the list of insecure\nregistries.\n\nIf `false`, the registry is insecure. Insecure registries accept\nun-encrypted (HTTP) and/or untrusted (HTTPS with certificates from\nunknown CAs) communication.\n\n> **Warning**: Insecure registries can be useful when running a local\n> registry. However, because its use creates security vulnerabilities\n> it should ONLY be enabled for testing purposes. For increased\n> security, users should add their CA to their system's list of\n> trusted CAs instead of enabling this option.\n", + "example": true + }, + "Official": { + "type": "boolean", + "description": "Indicates whether this is an official registry (i.e., Docker Hub / docker.io)\n", + "example": true + } + }, + "description": "IndexInfo contains information about a registry.", + "nullable": true, + "x-nullable": true + }, + "Runtime": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "Name and, optional, path, of the OCI executable binary.\n\nIf the path is omitted, the daemon searches the host's `$PATH` for the\nbinary and uses the first result.\n", + "example": "/usr/local/bin/my-oci-runtime" + }, + "runtimeArgs": { + "type": "array", + "description": "List of command-line arguments to pass to the runtime when invoked.\n", + "nullable": true, + "example": [ + "--debug", + "--systemd-cgroup=false" + ], + "items": { + "type": "string" + } + } + }, + "description": "Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec)\nruntime.\n\nThe runtime is invoked by the daemon via the `containerd` daemon. OCI\nruntimes act as an interface to the Linux kernel namespaces, cgroups,\nand SELinux.\n" + }, + "Commit": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Actual commit ID of external tool.", + "example": "cfb82a876ecc11b5ca0977d1733adbe58599088a" + }, + "Expected": { + "type": "string", + "description": "Commit ID of external tool expected by dockerd as set at build time.\n", + "example": "2d41c047c83e09a6d61d464906feb2a2f3c52aa4" + } + }, + "description": "Commit holds the Git-commit (SHA1) that a binary was built from, as\nreported in the version-string of external tools, such as `containerd`,\nor `runC`.\n" + }, + "SwarmInfo": { + "type": "object", + "properties": { + "NodeID": { + "type": "string", + "description": "Unique identifier of for this node in the swarm.", + "example": "k67qz4598weg5unwwffg6z1m1", + "default": "" + }, + "NodeAddr": { + "type": "string", + "description": "IP address at which this node can be reached by other nodes in the\nswarm.\n", + "example": "10.0.0.46", + "default": "" + }, + "LocalNodeState": { + "$ref": "#/components/schemas/LocalNodeState" + }, + "ControlAvailable": { + "type": "boolean", + "example": true, + "default": false + }, + "Error": { + "type": "string", + "default": "" + }, + "RemoteManagers": { + "type": "array", + "description": "List of ID's and addresses of other managers in the swarm.\n", + "nullable": true, + "example": [ + { + "NodeID": "71izy0goik036k48jg985xnds", + "Addr": "10.0.0.158:2377" + }, + { + "NodeID": "79y6h1o4gv8n120drcprv5nmc", + "Addr": "10.0.0.159:2377" + }, + { + "NodeID": "k67qz4598weg5unwwffg6z1m1", + "Addr": "10.0.0.46:2377" + } + ], + "items": { + "$ref": "#/components/schemas/PeerNode" + } + }, + "Nodes": { + "type": "integer", + "description": "Total number of nodes in the swarm.", + "nullable": true, + "example": 4 + }, + "Managers": { + "type": "integer", + "description": "Total number of managers in the swarm.", + "nullable": true, + "example": 3 + }, + "Cluster": { + "$ref": "#/components/schemas/ClusterInfo" + } + }, + "description": "Represents generic information about swarm.\n" + }, + "LocalNodeState": { + "type": "string", + "description": "Current local status of this node.", + "example": "active", + "default": "", + "enum": [ + "", + "inactive", + "pending", + "active", + "error", + "locked" + ] + }, + "PeerNode": { + "type": "object", + "properties": { + "NodeID": { + "type": "string", + "description": "Unique identifier of for this node in the swarm." + }, + "Addr": { + "type": "string", + "description": "IP address and ports at which this node can be reached.\n" + } + }, + "description": "Represents a peer-node in the swarm" + }, + "NetworkAttachmentConfig": { + "type": "object", + "properties": { + "Target": { + "type": "string", + "description": "The target network for attachment. Must be a network name or ID.\n" + }, + "Aliases": { + "type": "array", + "description": "Discoverable alternate names for the service on this network.\n", + "items": { + "type": "string" + } + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver attachment options for the network target.\n" + } + }, + "description": "Specifies how a service should be attached to a particular network.\n" + }, + "EventActor": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the object emitting the event", + "example": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + }, + "Attributes": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Various key/value attributes of the object, depending on its type.\n", + "example": { + "com.example.some-label": "some-label-value", + "image": "alpine:latest", + "name": "my-container" + } + } + }, + "description": "Actor describes something that generates events, like a container, network,\nor a volume.\n" + }, + "EventMessage": { + "title": "SystemEventsResponse", + "type": "object", + "properties": { + "Type": { + "type": "string", + "description": "The type of object emitting the event", + "example": "container", + "enum": [ + "builder", + "config", + "container", + "daemon", + "image", + "network", + "node", + "plugin", + "secret", + "service", + "volume" + ] + }, + "Action": { + "type": "string", + "description": "The type of event", + "example": "create" + }, + "Actor": { + "$ref": "#/components/schemas/EventActor" + }, + "scope": { + "type": "string", + "description": "Scope of the event. Engine events are `local` scope. Cluster (Swarm)\nevents are `swarm` scope.\n", + "enum": [ + "local", + "swarm" + ] + }, + "time": { + "type": "integer", + "description": "Timestamp of event", + "format": "int64", + "example": 1629574695 + }, + "timeNano": { + "type": "integer", + "description": "Timestamp of event, with nanosecond accuracy", + "format": "int64", + "example": 1629574695515050000 + } + }, + "description": "EventMessage represents the information an event contains.\n" + }, + "OCIDescriptor": { + "type": "object", + "properties": { + "mediaType": { + "type": "string", + "description": "The media type of the object this schema refers to.\n", + "example": "application/vnd.docker.distribution.manifest.v2+json" + }, + "digest": { + "type": "string", + "description": "The digest of the targeted content.\n", + "example": "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96" + }, + "size": { + "type": "integer", + "description": "The size in bytes of the blob.\n", + "format": "int64", + "example": 3987495 + } + }, + "description": "A descriptor struct containing digest, media type, and size, as defined in\nthe [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md).\n", + "x-go-name": "Descriptor" + }, + "OCIPlatform": { + "type": "object", + "properties": { + "architecture": { + "type": "string", + "description": "The CPU architecture, for example `amd64` or `ppc64`.\n", + "example": "arm" + }, + "os": { + "type": "string", + "description": "The operating system, for example `linux` or `windows`.\n", + "example": "windows" + }, + "os.version": { + "type": "string", + "description": "Optional field specifying the operating system version, for example on\nWindows `10.0.19041.1165`.\n", + "example": "10.0.19041.1165" + }, + "os.features": { + "type": "array", + "description": "Optional field specifying an array of strings, each listing a required\nOS feature (for example on Windows `win32k`).\n", + "example": [ + "win32k" + ], + "items": { + "type": "string" + } + }, + "variant": { + "type": "string", + "description": "Optional field specifying a variant of the CPU, for example `v7` to\nspecify ARMv7 when architecture is `arm`.\n", + "example": "v7" + } + }, + "description": "Describes the platform which the image in the manifest runs on, as defined\nin the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md).\n", + "x-go-name": "Platform" + }, + "DistributionInspect": { + "title": "DistributionInspectResponse", + "required": [ + "Descriptor", + "Platforms" + ], + "type": "object", + "properties": { + "Descriptor": { + "$ref": "#/components/schemas/OCIDescriptor" + }, + "Platforms": { + "type": "array", + "description": "An array containing all platforms supported by the image.\n", + "items": { + "$ref": "#/components/schemas/OCIPlatform" + } + } + }, + "description": "Describes the result obtained from contacting the registry to retrieve\nimage metadata.\n", + "x-go-name": "DistributionInspect" + }, + "ClusterVolume": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The Swarm ID of this volume. Because cluster volumes are Swarm\nobjects, they have an ID, unlike non-cluster volumes. This ID can\nbe used to refer to the Volume instead of the name.\n" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Spec": { + "$ref": "#/components/schemas/ClusterVolumeSpec" + }, + "Info": { + "type": "object", + "properties": { + "CapacityBytes": { + "type": "integer", + "description": "The capacity of the volume in bytes. A value of 0 indicates that\nthe capacity is unknown.\n", + "format": "int64" + }, + "VolumeContext": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of strings to strings returned from the storage plugin when\nthe volume is created.\n" + }, + "VolumeID": { + "type": "string", + "description": "The ID of the volume as returned by the CSI storage plugin. This\nis distinct from the volume's ID as provided by Docker. This ID\nis never used by the user when communicating with Docker to refer\nto this volume. If the ID is blank, then the Volume has not been\nsuccessfully created in the plugin yet.\n" + }, + "AccessibleTopology": { + "type": "array", + "description": "The topology this volume is actually accessible from.\n", + "items": { + "$ref": "#/components/schemas/Topology" + } + } + }, + "description": "Information about the global status of the volume.\n" + }, + "PublishStatus": { + "type": "array", + "description": "The status of the volume as it pertains to its publishing and use on\nspecific nodes\n", + "items": { + "type": "object", + "properties": { + "NodeID": { + "type": "string", + "description": "The ID of the Swarm node the volume is published on.\n" + }, + "State": { + "type": "string", + "description": "The published state of the volume.\n* `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed.\n* `published` The volume is published successfully to the node.\n* `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so.\n* `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller.\n", + "enum": [ + "pending-publish", + "published", + "pending-node-unpublish", + "pending-controller-unpublish" + ] + }, + "PublishContext": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of strings to strings returned by the CSI controller\nplugin when a volume is published.\n" + } + } + } + } + }, + "description": "Options and information specific to, and only present on, Swarm CSI\ncluster volumes.\n" + }, + "ClusterVolumeSpec": { + "type": "object", + "properties": { + "Group": { + "type": "string", + "description": "Group defines the volume group of this volume. Volumes belonging to\nthe same group can be referred to by group name when creating\nServices. Referring to a volume by group instructs Swarm to treat\nvolumes in that group interchangeably for the purpose of scheduling.\nVolumes with an empty string for a group technically all belong to\nthe same, emptystring group.\n" + }, + "AccessMode": { + "type": "object", + "properties": { + "Scope": { + "type": "string", + "description": "The set of nodes this volume can be used on at one time.\n- `single` The volume may only be scheduled to one node at a time.\n- `multi` the volume may be scheduled to any supported number of nodes at a time.\n", + "nullable": false, + "default": "single", + "enum": [ + "single", + "multi" + ] + }, + "Sharing": { + "type": "string", + "description": "The number and way that different tasks can use this volume\nat one time.\n- `none` The volume may only be used by one task at a time.\n- `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly\n- `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write.\n- `all` The volume may have any number of readers and writers.\n", + "nullable": false, + "default": "none", + "enum": [ + "none", + "readonly", + "onewriter", + "all" + ] + }, + "MountVolume": { + "type": "object", + "properties": {}, + "description": "Options for using this volume as a Mount-type volume.\n\n Either MountVolume or BlockVolume, but not both, must be\n present.\n properties:\n FsType:\n type: \"string\"\n description: |\n Specifies the filesystem type for the mount volume.\n Optional.\n MountFlags:\n type: \"array\"\n description: |\n Flags to pass when mounting the volume. Optional.\n items:\n type: \"string\"\nBlockVolume:\n type: \"object\"\n description: |\n Options for using this volume as a Block-type volume.\n Intentionally empty.\n" + }, + "Secrets": { + "type": "array", + "description": "Swarm Secrets that are passed to the CSI storage plugin when\noperating on this volume.\n", + "items": { + "type": "object", + "properties": { + "Key": { + "type": "string", + "description": "Key is the name of the key of the key-value pair passed to\nthe plugin.\n" + }, + "Secret": { + "type": "string", + "description": "Secret is the swarm Secret object from which to read data.\nThis can be a Secret name or ID. The Secret data is\nretrieved by swarm and used as the value of the key-value\npair passed to the plugin.\n" + } + }, + "description": "One cluster volume secret entry. Defines a key-value pair that\nis passed to the plugin.\n" + } + }, + "AccessibilityRequirements": { + "type": "object", + "properties": { + "Requisite": { + "type": "array", + "description": "A list of required topologies, at least one of which the\nvolume must be accessible from.\n", + "items": { + "$ref": "#/components/schemas/Topology" + } + }, + "Preferred": { + "type": "array", + "description": "A list of topologies that the volume should attempt to be\nprovisioned in.\n", + "items": { + "$ref": "#/components/schemas/Topology" + } + } + }, + "description": "Requirements for the accessible topology of the volume. These\nfields are optional. For an in-depth description of what these\nfields mean, see the CSI specification.\n" + }, + "CapacityRange": { + "type": "object", + "properties": { + "RequiredBytes": { + "type": "integer", + "description": "The volume must be at least this big. The value of 0\nindicates an unspecified minimum\n", + "format": "int64" + }, + "LimitBytes": { + "type": "integer", + "description": "The volume must not be bigger than this. The value of 0\nindicates an unspecified maximum.\n", + "format": "int64" + } + }, + "description": "The desired capacity that the volume should be created with. If\nempty, the plugin will decide the capacity.\n" + }, + "Availability": { + "type": "string", + "description": "The availability of the volume for use in tasks.\n- `active` The volume is fully available for scheduling on the cluster\n- `pause` No new workloads should use the volume, but existing workloads are not stopped.\n- `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started.\n", + "nullable": false, + "default": "active", + "enum": [ + "active", + "pause", + "drain" + ] + } + }, + "description": "Defines how the volume is used by tasks.\n" + } + }, + "description": "Cluster-specific options used to create the volume.\n" + }, + "Topology": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of topological domains to topological segments. For in depth\ndetails, see documentation for the Topology object in the CSI\nspecification.\n" + } + } + } +} \ No newline at end of file diff --git a/spec/v1.43.json b/spec/v1.43.json new file mode 100644 index 00000000..6207d5cc --- /dev/null +++ b/spec/v1.43.json @@ -0,0 +1,16645 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Docker Engine API", + "description": "The Engine API is an HTTP API served by Docker Engine. It is the API the\nDocker client uses to communicate with the Engine, so everything the Docker\nclient can do can be done with the API.\n\nMost of the client's commands map directly to API endpoints (e.g. `docker ps`\nis `GET /containers/json`). The notable exception is running containers,\nwhich consists of several API calls.\n\n# Errors\n\nThe API uses standard HTTP status codes to indicate the success or failure\nof the API call. The body of the response will be JSON in the following\nformat:\n\n```\n{\n \"message\": \"page not found\"\n}\n```\n\n# Versioning\n\nThe API is usually changed in each release, so API calls are versioned to\nensure that clients don't break. To lock to a specific version of the API,\nyou prefix the URL with its version, for example, call `/v1.30/info` to use\nthe v1.30 version of the `/info` endpoint. If the API version specified in\nthe URL is not supported by the daemon, a HTTP `400 Bad Request` error message\nis returned.\n\nIf you omit the version-prefix, the current version of the API (v1.43) is used.\nFor example, calling `/info` is the same as calling `/v1.43/info`. Using the\nAPI without a version-prefix is deprecated and will be removed in a future release.\n\nEngine releases in the near future should support this version of the API,\nso your client will continue to work even if it is talking to a newer Engine.\n\nThe API uses an open schema model, which means server may add extra properties\nto responses. Likewise, the server will ignore any extra query parameters and\nrequest body properties. When you write clients, you need to ignore additional\nproperties in responses to ensure they do not break when talking to newer\ndaemons.\n\n\n# Authentication\n\nAuthentication for registries is handled client side. The client has to send\nauthentication details to various endpoints that need to communicate with\nregistries, such as `POST /images/(name)/push`. These are sent as\n`X-Registry-Auth` header as a [base64url encoded](https://tools.ietf.org/html/rfc4648#section-5)\n(JSON) string with the following structure:\n\n```\n{\n \"username\": \"string\",\n \"password\": \"string\",\n \"email\": \"string\",\n \"serveraddress\": \"string\"\n}\n```\n\nThe `serveraddress` is a domain/IP without a protocol. Throughout this\nstructure, double quotes are required.\n\nIf you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth),\nyou can just pass this instead of credentials:\n\n```\n{\n \"identitytoken\": \"9cbaf023786cd7...\"\n}\n```\n", + "version": "1.43", + "x-logo": { + "url": "https://docs.docker.com/assets/images/logo-docker-main.png" + } + }, + "servers": [ + { + "url": "/v1.43" + } + ], + "tags": [ + { + "name": "Container", + "description": "Create and manage containers.\n", + "x-displayName": "Containers" + }, + { + "name": "Image", + "x-displayName": "Images" + }, + { + "name": "Network", + "description": "Networks are user-defined networks that containers can be attached to.\nSee the [networking documentation](https://docs.docker.com/network/)\nfor more information.\n", + "x-displayName": "Networks" + }, + { + "name": "Volume", + "description": "Create and manage persistent storage that can be attached to containers.\n", + "x-displayName": "Volumes" + }, + { + "name": "Exec", + "description": "Run new commands inside running containers. Refer to the\n[command-line reference](https://docs.docker.com/engine/reference/commandline/exec/)\nfor more information.\n\nTo exec a command in a container, you first need to create an exec instance,\nthen start it. These two API endpoints are wrapped up in a single command-line\ncommand, `docker exec`.\n", + "x-displayName": "Exec" + }, + { + "name": "Swarm", + "description": "Engines can be clustered together in a swarm. Refer to the\n[swarm mode documentation](https://docs.docker.com/engine/swarm/)\nfor more information.\n", + "x-displayName": "Swarm" + }, + { + "name": "Node", + "description": "Nodes are instances of the Engine participating in a swarm. Swarm mode\nmust be enabled for these endpoints to work.\n", + "x-displayName": "Nodes" + }, + { + "name": "Service", + "description": "Services are the definitions of tasks to run on a swarm. Swarm mode must\nbe enabled for these endpoints to work.\n", + "x-displayName": "Services" + }, + { + "name": "Task", + "description": "A task is a container running on a swarm. It is the atomic scheduling unit\nof swarm. Swarm mode must be enabled for these endpoints to work.\n", + "x-displayName": "Tasks" + }, + { + "name": "Secret", + "description": "Secrets are sensitive data that can be used by services. Swarm mode must\nbe enabled for these endpoints to work.\n", + "x-displayName": "Secrets" + }, + { + "name": "Config", + "description": "Configs are application configurations that can be used by services. Swarm\nmode must be enabled for these endpoints to work.\n", + "x-displayName": "Configs" + }, + { + "name": "Plugin", + "x-displayName": "Plugins" + }, + { + "name": "System", + "x-displayName": "System" + } + ], + "paths": { + "/containers/json": { + "get": { + "tags": [ + "Container" + ], + "summary": "List containers", + "description": "Returns a list of containers. For details on the format, see the\n[inspect endpoint](#operation/ContainerInspect).\n\nNote that it uses a different, smaller representation of a container\nthan inspecting a single container. For example, the list of linked\ncontainers is not propagated .\n", + "operationId": "ContainerList", + "parameters": [ + { + "name": "all", + "in": "query", + "description": "Return all containers. By default, only running containers are shown.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "limit", + "in": "query", + "description": "Return this number of most recently created containers, including\nnon-running ones.\n", + "schema": { + "type": "integer" + } + }, + { + "name": "size", + "in": "query", + "description": "Return the size of container as fields `SizeRw` and `SizeRootFs`.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "filters", + "in": "query", + "description": "Filters to process on the container list, encoded as JSON (a\n`map[string][]string`). For example, `{\"status\": [\"paused\"]}` will\nonly return paused containers.\n\nAvailable filters:\n\n- `ancestor`=(`[:]`, ``, or ``)\n- `before`=(`` or ``)\n- `expose`=(`[/]`|`/[]`)\n- `exited=` containers with exit code of ``\n- `health`=(`starting`|`healthy`|`unhealthy`|`none`)\n- `id=` a container's ID\n- `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only)\n- `is-task=`(`true`|`false`)\n- `label=key` or `label=\"key=value\"` of a container label\n- `name=` a container's name\n- `network`=(`` or ``)\n- `publish`=(`[/]`|`/[]`)\n- `since`=(`` or ``)\n- `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`)\n- `volume`=(`` or ``)\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerSummary" + } + }, + "example": [ + { + "Id": "8dfafdbc3a40", + "Names": [ + "/boring_feynman" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 1", + "Created": 1367854155, + "State": "Exited", + "Status": "Exit 0", + "Ports": [ + { + "PrivatePort": 2222, + "PublicPort": 3333, + "Type": "tcp" + } + ], + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "2cdc4edb1ded3631c81f57966563e5c8525b81121bb3706a9a9a3ae102711f3f", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:02" + } + } + }, + "Mounts": [ + { + "Name": "fac362...80535", + "Source": "/data", + "Destination": "/data", + "Driver": "local", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" + } + ] + }, + { + "Id": "9cd87474be90", + "Names": [ + "/coolName" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 222222", + "Created": 1367854155, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "88eaed7b37b38c2a3f0c4bc796494fdf51b270c2d22656412a2ca5d559a64d7a", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.8", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:08" + } + } + }, + "Mounts": [] + }, + { + "Id": "3176a2479c92", + "Names": [ + "/sleepy_dog" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "8b27c041c30326d59cd6e6f510d4f8d1d570a228466f956edf7815508f78e30d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.6", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:06" + } + } + }, + "Mounts": [] + }, + { + "Id": "4cb07b47f9fb", + "Names": [ + "/running_cat" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "d91c7b2f0644403d7ef3095985ea0e2370325cd2332ff3a3225c4247328e66e9", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.5", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:05" + } + } + }, + "Mounts": [] + } + ] + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/create": { + "post": { + "tags": [ + "Container" + ], + "summary": "Create a container", + "operationId": "ContainerCreate", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Assign the specified name to the container. Must match\n`/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`.\n", + "schema": { + "pattern": "^/?[a-zA-Z0-9][a-zA-Z0-9_.-]+$", + "type": "string" + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform in the format `os[/arch[/variant]]` used for image lookup.\n\nWhen specified, the daemon checks if the requested image is present\nin the local image cache with the given OS and Architecture, and\notherwise returns a `404` status.\n\nIf the option is not set, the host's native OS and Architecture are\nused to look up the image in the image cache. However, if no platform\nis passed and the given image does exist in the local image cache,\nbut its OS or architecture does not match, the container is created\nwith the available image, and a warning is added to the `Warnings`\nfield in the response, for example;\n\n WARNING: The requested image's platform (linux/arm64/v8) does not\n match the detected host platform (linux/amd64) and no\n specific platform was requested\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Container to create", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ContainerConfig" + }, + { + "type": "object", + "properties": { + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "NetworkingConfig": { + "$ref": "#/components/schemas/NetworkingConfig" + } + } + } + ] + } + }, + "application/octet-stream": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ContainerConfig" + }, + { + "type": "object", + "properties": { + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "NetworkingConfig": { + "$ref": "#/components/schemas/NetworkingConfig" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Container created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContainerCreateResponse" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such image: c2ada9df5af8" + } + } + } + }, + "409": { + "description": "conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/containers/{id}/json": { + "get": { + "tags": [ + "Container" + ], + "summary": "Inspect a container", + "description": "Return low-level information about a container.", + "operationId": "ContainerInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "size", + "in": "query", + "description": "Return the size of container as fields `SizeRw` and `SizeRootFs`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "ContainerInspectResponse", + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the container" + }, + "Created": { + "type": "string", + "description": "The time the container was created" + }, + "Path": { + "type": "string", + "description": "The path to the command being run" + }, + "Args": { + "type": "array", + "description": "The arguments to the command being run", + "items": { + "type": "string" + } + }, + "State": { + "$ref": "#/components/schemas/ContainerState" + }, + "Image": { + "type": "string", + "description": "The container's image ID" + }, + "ResolvConfPath": { + "type": "string" + }, + "HostnamePath": { + "type": "string" + }, + "HostsPath": { + "type": "string" + }, + "LogPath": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "RestartCount": { + "type": "integer" + }, + "Driver": { + "type": "string" + }, + "Platform": { + "type": "string" + }, + "MountLabel": { + "type": "string" + }, + "ProcessLabel": { + "type": "string" + }, + "AppArmorProfile": { + "type": "string" + }, + "ExecIDs": { + "type": "array", + "description": "IDs of exec instances that are running in the container.", + "nullable": true, + "items": { + "type": "string" + } + }, + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "GraphDriver": { + "$ref": "#/components/schemas/GraphDriverData" + }, + "SizeRw": { + "type": "integer", + "description": "The size of files that have been created or changed by this\ncontainer.\n", + "format": "int64" + }, + "SizeRootFs": { + "type": "integer", + "description": "The total size of all the files in this container.", + "format": "int64" + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MountPoint" + } + }, + "Config": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "NetworkSettings": { + "$ref": "#/components/schemas/NetworkSettings" + } + } + }, + "example": { + "AppArmorProfile": "", + "Args": [ + "-c", + "exit 9" + ], + "Config": { + "AttachStderr": true, + "AttachStdin": false, + "AttachStdout": true, + "Cmd": [ + "/bin/sh", + "-c", + "exit 9" + ], + "Domainname": "", + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Healthcheck": { + "Test": [ + "CMD-SHELL", + "exit 0" + ] + }, + "Hostname": "ba033ac44011", + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "MacAddress": "", + "NetworkDisabled": false, + "OpenStdin": false, + "StdinOnce": false, + "Tty": false, + "User": "", + "Volumes": { + "/volumes/data": {} + }, + "WorkingDir": "", + "StopSignal": "SIGTERM", + "StopTimeout": 10 + }, + "Created": "2015-01-06T15:47:31.485331387Z", + "Driver": "devicemapper", + "ExecIDs": [ + "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca", + "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4" + ], + "HostConfig": { + "MaximumIOps": 0, + "MaximumIOBps": 0, + "BlkioWeight": 0, + "BlkioWeightDevice": [ + {} + ], + "BlkioDeviceReadBps": [ + {} + ], + "BlkioDeviceWriteBps": [ + {} + ], + "BlkioDeviceReadIOps": [ + {} + ], + "BlkioDeviceWriteIOps": [ + {} + ], + "ContainerIDFile": "", + "CpusetCpus": "", + "CpusetMems": "", + "CpuPercent": 80, + "CpuShares": 0, + "CpuPeriod": 100000, + "CpuRealtimePeriod": 1000000, + "CpuRealtimeRuntime": 10000, + "Devices": [], + "DeviceRequests": [ + { + "Driver": "nvidia", + "Count": -1, + "DeviceIDs\"": [ + "0", + "1", + "GPU-fef8089b-4820-abfc-e83e-94318197576e" + ], + "Capabilities": [ + [ + "gpu", + "nvidia", + "compute" + ] + ], + "Options": { + "property1": "string", + "property2": "string" + } + } + ], + "IpcMode": "", + "Memory": 0, + "MemorySwap": 0, + "MemoryReservation": 0, + "OomKillDisable": false, + "OomScoreAdj": 500, + "NetworkMode": "bridge", + "PidMode": "", + "PortBindings": {}, + "Privileged": false, + "ReadonlyRootfs": false, + "PublishAllPorts": false, + "RestartPolicy": { + "MaximumRetryCount": 2, + "Name": "on-failure" + }, + "LogConfig": { + "Type": "json-file" + }, + "Sysctls": { + "net.ipv4.ip_forward": "1" + }, + "Ulimits": [ + {} + ], + "VolumeDriver": "", + "ShmSize": 67108864 + }, + "HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname", + "HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts", + "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log", + "Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39", + "Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2", + "MountLabel": "", + "Name": "/boring_euclid", + "NetworkSettings": { + "Bridge": "", + "SandboxID": "", + "HairpinMode": false, + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + "SandboxKey": "", + "EndpointID": "", + "Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "IPAddress": "", + "IPPrefixLen": 0, + "IPv6Gateway": "", + "MacAddress": "", + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Path": "/bin/sh", + "ProcessLabel": "", + "ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf", + "RestartCount": 1, + "State": { + "Error": "", + "ExitCode": 9, + "FinishedAt": "2015-01-06T15:47:32.080254511Z", + "Health": { + "Status": "healthy", + "FailingStreak": 0, + "Log": [ + { + "Start": "2019-12-22T10:59:05.6385933Z", + "End": "2019-12-22T10:59:05.8078452Z", + "ExitCode": 0, + "Output": "" + } + ] + }, + "OOMKilled": false, + "Dead": false, + "Paused": false, + "Pid": 0, + "Restarting": false, + "Running": true, + "StartedAt": "2015-01-06T15:47:32.072697474Z", + "Status": "running" + }, + "Mounts": [ + { + "Name": "fac362...80535", + "Source": "/data", + "Destination": "/data", + "Driver": "local", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" + } + ] + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/top": { + "get": { + "tags": [ + "Container" + ], + "summary": "List processes running inside a container", + "description": "On Unix systems, this is done by running the `ps` command. This endpoint\nis not supported on Windows.\n", + "operationId": "ContainerTop", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "ps_args", + "in": "query", + "description": "The arguments to pass to `ps`. For example, `aux`", + "schema": { + "type": "string", + "default": "-ef" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "ContainerTopResponse", + "type": "object", + "properties": { + "Titles": { + "type": "array", + "description": "The ps column titles", + "items": { + "type": "string" + } + }, + "Processes": { + "type": "array", + "description": "Each process running in the container, where each is process\nis an array of values corresponding to the titles.\n", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "description": "OK response to ContainerTop operation" + }, + "example": { + "Titles": [ + "UID", + "PID", + "PPID", + "C", + "STIME", + "TTY", + "TIME", + "CMD" + ], + "Processes": [ + [ + "root", + "13642", + "882", + "0", + "17:03", + "pts/0", + "00:00:00", + "/bin/bash" + ], + [ + "root", + "13735", + "13642", + "0", + "17:06", + "pts/0", + "00:00:00", + "sleep 10" + ] + ] + } + }, + "text/plain": { + "schema": { + "title": "ContainerTopResponse", + "type": "object", + "properties": { + "Titles": { + "type": "array", + "description": "The ps column titles", + "items": { + "type": "string" + } + }, + "Processes": { + "type": "array", + "description": "Each process running in the container, where each is process\nis an array of values corresponding to the titles.\n", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "description": "OK response to ContainerTop operation" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/logs": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get container logs", + "description": "Get `stdout` and `stderr` logs from a container.\n\nNote: This endpoint works only for containers with the `json-file` or\n`journald` logging driver.\n", + "operationId": "ContainerLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "follow", + "in": "query", + "description": "Keep connection after returning logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "until", + "in": "query", + "description": "Only return logs before this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs.\nSpecify as an integer or `all` to output all log lines.\n", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "200": { + "description": "logs returned as a stream in response body.\nFor the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach).\nNote that unlike the attach endpoint, the logs endpoint does not\nupgrade the connection and does not set Content-Type.\n", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/changes": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get changes on a container’s filesystem", + "description": "Returns which files in a container's filesystem have been added, deleted,\nor modified. The `Kind` of modification can be one of:\n\n- `0`: Modified (\"C\")\n- `1`: Added (\"A\")\n- `2`: Deleted (\"D\")\n", + "operationId": "ContainerChanges", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The list of changes", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FilesystemChange" + } + }, + "example": [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/export": { + "get": { + "tags": [ + "Container" + ], + "summary": "Export a container", + "description": "Export the contents of a container as a tarball.", + "operationId": "ContainerExport", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/stats": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get container stats based on resource usage", + "description": "This endpoint returns a live stream of a container’s resource usage\nstatistics.\n\nThe `precpu_stats` is the CPU statistic of the *previous* read, and is\nused to calculate the CPU usage percentage. It is not an exact copy\nof the `cpu_stats` field.\n\nIf either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is\nnil then for compatibility with older daemons the length of the\ncorresponding `cpu_usage.percpu_usage` array should be used.\n\nOn a cgroup v2 host, the following fields are not set\n* `blkio_stats`: all fields other than `io_service_bytes_recursive`\n* `cpu_stats`: `cpu_usage.percpu_usage`\n* `memory_stats`: `max_usage` and `failcnt`\nAlso, `memory_stats.stats` fields are incompatible with cgroup v1.\n\nTo calculate the values shown by the `stats` command of the docker cli tool\nthe following formulas can be used:\n* used_memory = `memory_stats.usage - memory_stats.stats.cache`\n* available_memory = `memory_stats.limit`\n* Memory usage % = `(used_memory / available_memory) * 100.0`\n* cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage`\n* system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage`\n* number_cpus = `lenght(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus`\n* CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0`\n", + "operationId": "ContainerStats", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "stream", + "in": "query", + "description": "Stream the output. If false, the stats will be output once and then\nit will disconnect.\n", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "one-shot", + "in": "query", + "description": "Only get a single stat instead of waiting for 2 cycles. Must be used\nwith `stream=false`.\n", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "read": "2015-01-08T22:57:31.547920715Z", + "pids_stats": { + "current": 3 + }, + "networks": { + "eth0": { + "rx_bytes": 5338, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 36, + "tx_bytes": 648, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 8 + }, + "eth5": { + "rx_bytes": 4641, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 26, + "tx_bytes": 690, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 9 + } + }, + "memory_stats": { + "stats": { + "total_pgmajfault": 0, + "cache": 0, + "mapped_file": 0, + "total_inactive_file": 0, + "pgpgout": 414, + "rss": 6537216, + "total_mapped_file": 0, + "writeback": 0, + "unevictable": 0, + "pgpgin": 477, + "total_unevictable": 0, + "pgmajfault": 0, + "total_rss": 6537216, + "total_rss_huge": 6291456, + "total_writeback": 0, + "total_inactive_anon": 0, + "rss_huge": 6291456, + "hierarchical_memory_limit": 67108864, + "total_pgfault": 964, + "total_active_file": 0, + "active_anon": 6537216, + "total_active_anon": 6537216, + "total_pgpgout": 414, + "total_cache": 0, + "inactive_anon": 0, + "active_file": 0, + "pgfault": 964, + "inactive_file": 0, + "total_pgpgin": 477 + }, + "max_usage": 6651904, + "usage": 6537216, + "failcnt": 0, + "limit": 67108864 + }, + "blkio_stats": {}, + "cpu_stats": { + "cpu_usage": { + "percpu_usage": [ + 8646879, + 24472255, + 36438778, + 30657443 + ], + "usage_in_usermode": 50000000, + "total_usage": 100215355, + "usage_in_kernelmode": 30000000 + }, + "system_cpu_usage": 739306590000000, + "online_cpus": 4, + "throttling_data": { + "periods": 0, + "throttled_periods": 0, + "throttled_time": 0 + } + }, + "precpu_stats": { + "cpu_usage": { + "percpu_usage": [ + 8646879, + 24350896, + 36438778, + 30657443 + ], + "usage_in_usermode": 50000000, + "total_usage": 100093996, + "usage_in_kernelmode": 30000000 + }, + "system_cpu_usage": 9492140000000, + "online_cpus": 4, + "throttling_data": { + "periods": 0, + "throttled_periods": 0, + "throttled_time": 0 + } + } + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/resize": { + "post": { + "tags": [ + "Container" + ], + "summary": "Resize a container TTY", + "description": "Resize the TTY for a container.", + "operationId": "ContainerResize", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "h", + "in": "query", + "description": "Height of the TTY session in characters", + "schema": { + "type": "integer" + } + }, + { + "name": "w", + "in": "query", + "description": "Width of the TTY session in characters", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "cannot resize container", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/start": { + "post": { + "tags": [ + "Container" + ], + "summary": "Start a container", + "operationId": "ContainerStart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container. Format is a\nsingle character `[a-Z]` or `ctrl-` where `` is one\nof: `a-z`, `@`, `^`, `[`, `,` or `_`.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "304": { + "description": "container already started", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/stop": { + "post": { + "tags": [ + "Container" + ], + "summary": "Stop a container", + "operationId": "ContainerStop", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "signal", + "in": "query", + "description": "Signal to send to the container as an integer or string (e.g. `SIGINT`).\n", + "schema": { + "type": "string" + } + }, + { + "name": "t", + "in": "query", + "description": "Number of seconds to wait before killing the container", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "304": { + "description": "container already stopped", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/restart": { + "post": { + "tags": [ + "Container" + ], + "summary": "Restart a container", + "operationId": "ContainerRestart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "signal", + "in": "query", + "description": "Signal to send to the container as an integer or string (e.g. `SIGINT`).\n", + "schema": { + "type": "string" + } + }, + { + "name": "t", + "in": "query", + "description": "Number of seconds to wait before killing the container", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/kill": { + "post": { + "tags": [ + "Container" + ], + "summary": "Kill a container", + "description": "Send a POSIX signal to a container, defaulting to killing to the\ncontainer.\n", + "operationId": "ContainerKill", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "signal", + "in": "query", + "description": "Signal to send to the container as an integer or string (e.g. `SIGINT`).\n", + "schema": { + "type": "string", + "default": "SIGKILL" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "container is not running", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "Container d37cde0fe4ad63c3a7252023b2f9800282894247d145cb5933ddf6e52cc03a28 is not running" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/update": { + "post": { + "tags": [ + "Container" + ], + "summary": "Update a container", + "description": "Change various configuration options of a container without having to\nrecreate it.\n", + "operationId": "ContainerUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Resources" + }, + { + "type": "object", + "properties": { + "RestartPolicy": { + "$ref": "#/components/schemas/RestartPolicy" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The container has been updated.", + "content": { + "application/json": { + "schema": { + "title": "ContainerUpdateResponse", + "type": "object", + "properties": { + "Warnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "OK response to ContainerUpdate operation" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "update" + } + }, + "/containers/{id}/rename": { + "post": { + "tags": [ + "Container" + ], + "summary": "Rename a container", + "operationId": "ContainerRename", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "description": "New name for the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "name already in use", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/pause": { + "post": { + "tags": [ + "Container" + ], + "summary": "Pause a container", + "description": "Use the freezer cgroup to suspend all processes in a container.\n\nTraditionally, when suspending a process the `SIGSTOP` signal is used,\nwhich is observable by the process being suspended. With the freezer\ncgroup the process is unaware, and unable to capture, that it is being\nsuspended, and subsequently resumed.\n", + "operationId": "ContainerPause", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/unpause": { + "post": { + "tags": [ + "Container" + ], + "summary": "Unpause a container", + "description": "Resume a container which has been paused.", + "operationId": "ContainerUnpause", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/attach": { + "post": { + "tags": [ + "Container" + ], + "summary": "Attach to a container", + "description": "Attach to a container to read its output or send it input. You can attach\nto the same container multiple times and you can reattach to containers\nthat have been detached.\n\nEither the `stream` or `logs` parameter must be `true` for this endpoint\nto do anything.\n\nSee the [documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/)\nfor more details.\n\n### Hijacking\n\nThis endpoint hijacks the HTTP connection to transport `stdin`, `stdout`,\nand `stderr` on the same socket.\n\nThis is the response from the daemon for an attach request:\n\n```\nHTTP/1.1 200 OK\nContent-Type: application/vnd.docker.raw-stream\n\n[STREAM]\n```\n\nAfter the headers and two new lines, the TCP connection can now be used\nfor raw, bidirectional communication between the client and server.\n\nTo hint potential proxies about connection hijacking, the Docker client\ncan also optionally send connection upgrade headers.\n\nFor example, the client sends this request to upgrade the connection:\n\n```\nPOST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1\nUpgrade: tcp\nConnection: Upgrade\n```\n\nThe Docker daemon will respond with a `101 UPGRADED` response, and will\nsimilarly follow with the raw stream:\n\n```\nHTTP/1.1 101 UPGRADED\nContent-Type: application/vnd.docker.raw-stream\nConnection: Upgrade\nUpgrade: tcp\n\n[STREAM]\n```\n\n### Stream format\n\nWhen the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate),\nthe HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream\nand the stream over the hijacked connected is multiplexed to separate out\n`stdout` and `stderr`. The stream consists of a series of frames, each\ncontaining a header and a payload.\n\nThe header contains the information which the stream writes (`stdout` or\n`stderr`). It also contains the size of the associated frame encoded in\nthe last four bytes (`uint32`).\n\nIt is encoded on the first eight bytes like this:\n\n```go\nheader := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n```\n\n`STREAM_TYPE` can be:\n\n- 0: `stdin` (is written on `stdout`)\n- 1: `stdout`\n- 2: `stderr`\n\n`SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size\nencoded as big endian.\n\nFollowing the header is the payload, which is the specified number of\nbytes of `STREAM_TYPE`.\n\nThe simplest way to implement this protocol is the following:\n\n1. Read 8 bytes.\n2. Choose `stdout` or `stderr` depending on the first byte.\n3. Extract the frame size from the last four bytes.\n4. Read the extracted size and output it on the correct output.\n5. Goto 1.\n\n### Stream format when using a TTY\n\nWhen the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate),\nthe stream is not multiplexed. The data exchanged over the hijacked\nconnection is simply the raw data from the process PTY and client's\n`stdin`.\n", + "operationId": "ContainerAttach", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container.Format is a single\ncharacter `[a-Z]` or `ctrl-` where `` is one of: `a-z`,\n`@`, `^`, `[`, `,` or `_`.\n", + "schema": { + "type": "string" + } + }, + { + "name": "logs", + "in": "query", + "description": "Replay previous logs from the container.\n\nThis is useful for attaching to a container that has started and you\nwant to output everything since the container started.\n\nIf `stream` is also enabled, once all the previous output has been\nreturned, it will seamlessly transition into streaming current\noutput.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stream", + "in": "query", + "description": "Stream attached streams from the time the request was made onwards.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdin", + "in": "query", + "description": "Attach to `stdin`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Attach to `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Attach to `stderr`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "101": { + "description": "no error, hints proxy about hijacking", + "content": {} + }, + "200": { + "description": "no error, no upgrade header found", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/attach/ws": { + "get": { + "tags": [ + "Container" + ], + "summary": "Attach to a container via a websocket", + "operationId": "ContainerAttachWebsocket", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container.Format is a single\ncharacter `[a-Z]` or `ctrl-` where `` is one of: `a-z`,\n`@`, `^`, `[`, `,`, or `_`.\n", + "schema": { + "type": "string" + } + }, + { + "name": "logs", + "in": "query", + "description": "Return logs", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stream", + "in": "query", + "description": "Return stream", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdin", + "in": "query", + "description": "Attach to `stdin`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Attach to `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Attach to `stderr`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "101": { + "description": "no error, hints proxy about hijacking", + "content": {} + }, + "200": { + "description": "no error, no upgrade header found", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/wait": { + "post": { + "tags": [ + "Container" + ], + "summary": "Wait for a container", + "description": "Block until a container stops, then returns the exit code.", + "operationId": "ContainerWait", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "condition", + "in": "query", + "description": "Wait until a container state reaches the given condition.\n\nDefaults to `not-running` if omitted or empty.\n", + "schema": { + "type": "string", + "default": "not-running", + "enum": [ + "not-running", + "next-exit", + "removed" + ] + } + } + ], + "responses": { + "200": { + "description": "The container has exit.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContainerWaitResponse" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}": { + "delete": { + "tags": [ + "Container" + ], + "summary": "Remove a container", + "operationId": "ContainerDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "v", + "in": "query", + "description": "Remove anonymous volumes associated with the container.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "force", + "in": "query", + "description": "If the container is running, kill it before removing it.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "link", + "in": "query", + "description": "Remove the specified link associated with the container.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "You cannot remove a running container: c2ada9df5af8. Stop the\ncontainer before attempting removal or force remove\n" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/archive": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get an archive of a filesystem resource in a container", + "description": "Get a tar archive of a resource in the filesystem of container id.", + "operationId": "ContainerArchive", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Resource in the container’s filesystem to archive.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Container or path does not exist", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Container" + ], + "summary": "Extract an archive of files or folders to a directory in a container", + "description": "Upload a tar archive to be extracted to a path in the filesystem of container id.\n`path` parameter is asserted to be a directory. If it exists as a file, 400 error\nwill be returned with message \"not a directory\".\n", + "operationId": "PutContainerArchive", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Path to a directory in the container to extract the archive’s contents into. ", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "noOverwriteDirNonDir", + "in": "query", + "description": "If `1`, `true`, or `True` then it will be an error if unpacking the\ngiven content would cause an existing directory to be replaced with\na non-directory and vice versa.\n", + "schema": { + "type": "string" + } + }, + { + "name": "copyUIDGID", + "in": "query", + "description": "If `1`, `true`, then it will copy UID/GID maps to the dest file or\ndir\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The input stream must be a tar archive compressed with one of the\nfollowing algorithms: `identity` (no compression), `gzip`, `bzip2`,\nor `xz`.\n", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The content was extracted successfully", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "not a directory" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "Permission denied, the volume or container rootfs is marked as read-only.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "No such container or path does not exist inside the container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputStream" + }, + "head": { + "tags": [ + "Container" + ], + "summary": "Get information about files in a container", + "description": "A response header `X-Docker-Container-Path-Stat` is returned, containing\na base64 - encoded JSON object with some filesystem header information\nabout the path.\n", + "operationId": "ContainerArchiveInfo", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Resource in the container’s filesystem to archive.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "headers": { + "X-Docker-Container-Path-Stat": { + "description": "A base64 - encoded JSON object with some filesystem header\ninformation about the path\n", + "schema": { + "type": "string" + } + } + }, + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Container or path does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/prune": { + "post": { + "tags": [ + "Container" + ], + "summary": "Delete stopped containers", + "operationId": "ContainerPrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `until=` Prune containers created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune containers with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ContainerPruneResponse", + "type": "object", + "properties": { + "ContainersDeleted": { + "type": "array", + "description": "Container IDs that were deleted", + "items": { + "type": "string" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/json": { + "get": { + "tags": [ + "Image" + ], + "summary": "List Images", + "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.", + "operationId": "ImageList", + "parameters": [ + { + "name": "all", + "in": "query", + "description": "Show all images. Only images from a final layer (no children) are shown by default.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the images list.\n\nAvailable filters:\n\n- `before`=(`[:]`, `` or ``)\n- `dangling=true`\n- `label=key` or `label=\"key=value\"` of an image label\n- `reference`=(`[:]`)\n- `since`=(`[:]`, `` or ``)\n", + "schema": { + "type": "string" + } + }, + { + "name": "shared-size", + "in": "query", + "description": "Compute and show shared size as a `SharedSize` field on each image.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "digests", + "in": "query", + "description": "Show digest information as a `RepoDigests` field on each image.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Summary image data for the images matching the query", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/build": { + "post": { + "tags": [ + "Image" + ], + "summary": "Build an image", + "description": "Build an image from a tar archive with a `Dockerfile` in it.\n\nThe `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/).\n\nThe 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.\n\nThe build is canceled if the client drops the connection by quitting or being killed.\n", + "operationId": "ImageBuild", + "parameters": [ + { + "name": "dockerfile", + "in": "query", + "description": "Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`.", + "schema": { + "type": "string", + "default": "Dockerfile" + } + }, + { + "name": "t", + "in": "query", + "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.", + "schema": { + "type": "string" + } + }, + { + "name": "extrahosts", + "in": "query", + "description": "Extra hosts to add to /etc/hosts", + "schema": { + "type": "string" + } + }, + { + "name": "remote", + "in": "query", + "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.", + "schema": { + "type": "string" + } + }, + { + "name": "q", + "in": "query", + "description": "Suppress verbose build output.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "nocache", + "in": "query", + "description": "Do not use the cache when building the image.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "cachefrom", + "in": "query", + "description": "JSON array of images used for build cache resolution.", + "schema": { + "type": "string" + } + }, + { + "name": "pull", + "in": "query", + "description": "Attempt to pull the image even if an older image exists locally.", + "schema": { + "type": "string" + } + }, + { + "name": "rm", + "in": "query", + "description": "Remove intermediate containers after a successful build.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "forcerm", + "in": "query", + "description": "Always remove intermediate containers, even upon failure.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "memory", + "in": "query", + "description": "Set memory limit for build.", + "schema": { + "type": "integer" + } + }, + { + "name": "memswap", + "in": "query", + "description": "Total memory (memory + swap). Set as `-1` to disable swap.", + "schema": { + "type": "integer" + } + }, + { + "name": "cpushares", + "in": "query", + "description": "CPU shares (relative weight).", + "schema": { + "type": "integer" + } + }, + { + "name": "cpusetcpus", + "in": "query", + "description": "CPUs in which to allow execution (e.g., `0-3`, `0,1`).", + "schema": { + "type": "string" + } + }, + { + "name": "cpuperiod", + "in": "query", + "description": "The length of a CPU period in microseconds.", + "schema": { + "type": "integer" + } + }, + { + "name": "cpuquota", + "in": "query", + "description": "Microseconds of CPU time that the container can get in a CPU period.", + "schema": { + "type": "integer" + } + }, + { + "name": "buildargs", + "in": "query", + "description": "JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values.\n\nFor example, the build arg `FOO=bar` would become `{\"FOO\":\"bar\"}` in JSON. This would result in the query parameter `buildargs={\"FOO\":\"bar\"}`. Note that `{\"FOO\":\"bar\"}` should be URI component encoded.\n\n[Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg)\n", + "schema": { + "type": "string" + } + }, + { + "name": "shmsize", + "in": "query", + "description": "Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB.", + "schema": { + "type": "integer" + } + }, + { + "name": "squash", + "in": "query", + "description": "Squash the resulting images layers into a single layer. *(Experimental release only.)*", + "schema": { + "type": "boolean" + } + }, + { + "name": "labels", + "in": "query", + "description": "Arbitrary key/value labels to set on the image, as a JSON map of string pairs.", + "schema": { + "type": "string" + } + }, + { + "name": "networkmode", + "in": "query", + "description": "Sets the networking mode for the run commands during build. Supported\nstandard values are: `bridge`, `host`, `none`, and `container:`.\nAny other value is taken as a custom network's name or ID to which this\ncontainer should connect to.\n", + "schema": { + "type": "string" + } + }, + { + "name": "Content-type", + "in": "header", + "schema": { + "type": "string", + "default": "application/x-tar", + "enum": [ + "application/x-tar" + ] + } + }, + { + "name": "X-Registry-Config", + "in": "header", + "description": "This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to.\n\nThe key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example:\n\n```\n{\n \"docker.example.com\": {\n \"username\": \"janedoe\",\n \"password\": \"hunter2\"\n },\n \"https://index.docker.io/v1/\": {\n \"username\": \"mobydock\",\n \"password\": \"conta1n3rize14\"\n }\n}\n```\n\nOnly 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.\n", + "schema": { + "type": "string" + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform in the format os[/arch[/variant]]", + "schema": { + "type": "string" + } + }, + { + "name": "target", + "in": "query", + "description": "Target build stage", + "schema": { + "type": "string" + } + }, + { + "name": "outputs", + "in": "query", + "description": "BuildKit output configuration", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz.", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputStream" + } + }, + "/build/prune": { + "post": { + "tags": [ + "Image" + ], + "summary": "Delete builder cache", + "operationId": "BuildPrune", + "parameters": [ + { + "name": "keep-storage", + "in": "query", + "description": "Amount of disk space in bytes to keep for cache", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "all", + "in": "query", + "description": "Remove all types of build cache", + "schema": { + "type": "boolean" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the list of build cache objects.\n\nAvailable filters:\n\n- `until=` remove cache older than ``. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time.\n- `id=`\n- `parent=`\n- `type=`\n- `description=`\n- `inuse`\n- `shared`\n- `private`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "BuildPruneResponse", + "type": "object", + "properties": { + "CachesDeleted": { + "type": "array", + "items": { + "type": "string", + "description": "ID of build cache object" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/create": { + "post": { + "tags": [ + "Image" + ], + "summary": "Create an image", + "description": "Create an image by either pulling it from a registry or importing it.", + "operationId": "ImageCreate", + "parameters": [ + { + "name": "fromImage", + "in": "query", + "description": "Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed.", + "schema": { + "type": "string" + } + }, + { + "name": "fromSrc", + "in": "query", + "description": "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image.", + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled.", + "schema": { + "type": "string" + } + }, + { + "name": "message", + "in": "query", + "description": "Set commit message for imported image.", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + }, + { + "name": "changes", + "in": "query", + "description": "Apply `Dockerfile` instructions to the image that is created,\nfor example: `changes=ENV DEBUG=true`.\nNote that `ENV DEBUG=true` should be URI component encoded.\n\nSupported `Dockerfile` instructions:\n`CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR`\n", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform in the format os[/arch[/variant]].\n\nWhen used in combination with the `fromImage` option, the daemon checks\nif the given image is present in the local image cache with the given\nOS and Architecture, and otherwise attempts to pull the image. If the\noption is not set, the host's native OS and Architecture are used.\nIf the given image does not exist in the local image cache, the daemon\nattempts to pull the image with the host's native OS and Architecture.\nIf the given image does exists in the local image cache, but its OS or\narchitecture does not match, a warning is produced.\n\nWhen used with the `fromSrc` option to import an image from an archive,\nthis option sets the platform information for the imported image. If\nthe option is not set, the host's native OS and Architecture are used\nfor the imported image.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Image content if the value `-` has been specified in fromSrc query parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/octet-stream": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "repository does not exist or no read access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputImage" + } + }, + "/images/{name}/json": { + "get": { + "tags": [ + "Image" + ], + "summary": "Inspect an image", + "description": "Return low-level information about an image.", + "operationId": "ImageInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ImageInspect" + } + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such image: someimage (tag: latest)" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/history": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get the history of an image", + "description": "Return parent layers of an image.", + "operationId": "ImageHistory", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "List of image layers", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "HistoryResponseItem", + "required": [ + "Comment", + "Created", + "CreatedBy", + "Id", + "Size", + "Tags" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": false + }, + "Created": { + "type": "integer", + "format": "int64", + "nullable": false + }, + "CreatedBy": { + "type": "string", + "nullable": false + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "Size": { + "type": "integer", + "format": "int64", + "nullable": false + }, + "Comment": { + "type": "string", + "nullable": false + } + }, + "description": "individual image layer information in response to ImageHistory operation", + "x-go-name": "HistoryResponseItem" + } + }, + "example": [ + { + "Id": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710", + "Created": 1398108230, + "CreatedBy": "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /", + "Tags": [ + "ubuntu:lucid", + "ubuntu:10.04" + ], + "Size": 182964289, + "Comment": "" + }, + { + "Id": "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8", + "Created": 1398108222, + "CreatedBy": "/bin/sh -c #(nop) MAINTAINER Tianon Gravi - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/", + "Tags": [], + "Size": 0, + "Comment": "" + }, + { + "Id": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158", + "Created": 1371157430, + "CreatedBy": "", + "Tags": [ + "scratch12:latest", + "scratch:latest" + ], + "Size": 0, + "Comment": "Imported from -" + } + ] + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/push": { + "post": { + "tags": [ + "Image" + ], + "summary": "Push an image", + "description": "Push an image to a registry.\n\nIf you wish to push an image on to a private registry, that image must\nalready have a tag which references the registry. For example,\n`registry.example.com/myimage:latest`.\n\nThe push is cancelled if the HTTP connection is closed.\n", + "operationId": "ImagePush", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag to associate with the image on the registry.", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/tag": { + "post": { + "tags": [ + "Image" + ], + "summary": "Tag an image", + "description": "Tag an image so that it becomes part of a repository.", + "operationId": "ImageTag", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID to tag.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "The repository to tag in. For example, `someuser/someimage`.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The name of the new tag.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "No error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}": { + "delete": { + "tags": [ + "Image" + ], + "summary": "Remove an image", + "description": "Remove an image, along with any untagged parent images that were\nreferenced by that image.\n\nImages can't be removed if they have descendant images, are being\nused by a running container or are being used by a build.\n", + "operationId": "ImageDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Remove the image even if it is being used by stopped containers or has other tags", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "noprune", + "in": "query", + "description": "Do not delete untagged parent images", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "The image was deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageDeleteResponseItem" + } + }, + "example": [ + { + "Untagged": "3e2f21a89f" + }, + { + "Deleted": "3e2f21a89f" + }, + { + "Deleted": "53b4f83ac9" + } + ] + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/search": { + "get": { + "tags": [ + "Image" + ], + "summary": "Search images", + "description": "Search for an image on Docker Hub.", + "operationId": "ImageSearch", + "parameters": [ + { + "name": "term", + "in": "query", + "description": "Term to search", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "schema": { + "type": "integer" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:\n\n- `is-automated=(true|false)`\n- `is-official=(true|false)`\n- `stars=` Matches images that has at least 'number' stars.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "ImageSearchResponseItem", + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "is_official": { + "type": "boolean" + }, + "is_automated": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "star_count": { + "type": "integer" + } + } + } + }, + "example": [ + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ] + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/prune": { + "post": { + "tags": [ + "Image" + ], + "summary": "Delete unused images", + "operationId": "ImagePrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters:\n\n- `dangling=` When set to `true` (or `1`), prune only\n unused *and* untagged images. When set to `false`\n (or `0`), all unused images are pruned.\n- `until=` Prune images created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune images with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ImagePruneResponse", + "type": "object", + "properties": { + "ImagesDeleted": { + "type": "array", + "description": "Images that were deleted", + "items": { + "$ref": "#/components/schemas/ImageDeleteResponseItem" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/auth": { + "post": { + "tags": [ + "System" + ], + "summary": "Check auth configuration", + "description": "Validate credentials for a registry and, if available, get an identity\ntoken for accessing the registry without password.\n", + "operationId": "SystemAuth", + "requestBody": { + "description": "Authentication to check", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthConfig" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "An identity token was generated successfully.", + "content": { + "application/json": { + "schema": { + "title": "SystemAuthResponse", + "required": [ + "Status" + ], + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "The status of the authentication", + "nullable": false + }, + "IdentityToken": { + "type": "string", + "description": "An opaque token used to authenticate a user after a successful login", + "nullable": false + } + } + }, + "example": { + "Status": "Login Succeeded", + "IdentityToken": "9cbaf023786cd7..." + } + } + } + }, + "204": { + "description": "No error", + "content": {} + }, + "401": { + "description": "Auth error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "authConfig" + } + }, + "/info": { + "get": { + "tags": [ + "System" + ], + "summary": "Get system information", + "operationId": "SystemInfo", + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/version": { + "get": { + "tags": [ + "System" + ], + "summary": "Get version", + "description": "Returns the version of Docker that is running and various information about the system that Docker is running on.", + "operationId": "SystemVersion", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemVersion" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/_ping": { + "get": { + "tags": [ + "System" + ], + "summary": "Ping", + "description": "This is a dummy endpoint you can use to test if the server is accessible.", + "operationId": "SystemPing", + "responses": { + "200": { + "description": "no error", + "headers": { + "Swarm": { + "description": "Contains information about Swarm status of the daemon,\nand if the daemon is acting as a manager or worker node.\n", + "schema": { + "type": "string", + "default": "inactive", + "enum": [ + "inactive", + "pending", + "error", + "locked", + "active/worker", + "active/manager" + ] + } + }, + "Docker-Experimental": { + "description": "If the server is running with experimental mode enabled", + "schema": { + "type": "boolean" + } + }, + "Cache-Control": { + "schema": { + "type": "string", + "default": "no-cache, no-store, must-revalidate" + } + }, + "Pragma": { + "schema": { + "type": "string", + "default": "no-cache" + } + }, + "API-Version": { + "description": "Max API Version the server supports", + "schema": { + "type": "string" + } + }, + "Builder-Version": { + "description": "Default version of docker image builder\n\nThe default on Linux is version \"2\" (BuildKit), but the daemon\ncan be configured to recommend version \"1\" (classic Builder).\nWindows does not yet support BuildKit for native Windows images,\nand uses \"1\" (classic builder) as a default.\n\nThis value is a recommendation as advertised by the daemon, and\nit is up to the client to choose which builder to use.\n", + "schema": { + "type": "string", + "default": "2" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string", + "example": "OK" + } + } + } + }, + "500": { + "description": "server error", + "headers": { + "Cache-Control": { + "schema": { + "type": "string", + "default": "no-cache, no-store, must-revalidate" + } + }, + "Pragma": { + "schema": { + "type": "string", + "default": "no-cache" + } + } + }, + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "head": { + "tags": [ + "System" + ], + "summary": "Ping", + "description": "This is a dummy endpoint you can use to test if the server is accessible.", + "operationId": "SystemPingHead", + "responses": { + "200": { + "description": "no error", + "headers": { + "Swarm": { + "description": "Contains information about Swarm status of the daemon,\nand if the daemon is acting as a manager or worker node.\n", + "schema": { + "type": "string", + "default": "inactive", + "enum": [ + "inactive", + "pending", + "error", + "locked", + "active/worker", + "active/manager" + ] + } + }, + "Docker-Experimental": { + "description": "If the server is running with experimental mode enabled", + "schema": { + "type": "boolean" + } + }, + "Cache-Control": { + "schema": { + "type": "string", + "default": "no-cache, no-store, must-revalidate" + } + }, + "Pragma": { + "schema": { + "type": "string", + "default": "no-cache" + } + }, + "API-Version": { + "description": "Max API Version the server supports", + "schema": { + "type": "string" + } + }, + "Builder-Version": { + "description": "Default version of docker image builder", + "schema": { + "type": "string" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string", + "example": "(empty)" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/commit": { + "post": { + "tags": [ + "Image" + ], + "summary": "Create a new image from a container", + "operationId": "ImageCommit", + "parameters": [ + { + "name": "container", + "in": "query", + "description": "The ID or name of the container to commit", + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "Repository name for the created image", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "Tag name for the create image", + "schema": { + "type": "string" + } + }, + { + "name": "comment", + "in": "query", + "description": "Commit message", + "schema": { + "type": "string" + } + }, + { + "name": "author", + "in": "query", + "description": "Author of the image (e.g., `John Hannibal Smith `)", + "schema": { + "type": "string" + } + }, + { + "name": "pause", + "in": "query", + "description": "Whether to pause the container before committing", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "changes", + "in": "query", + "description": "`Dockerfile` instructions to apply while committing", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The container configuration", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContainerConfig" + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "containerConfig" + } + }, + "/events": { + "get": { + "tags": [ + "System" + ], + "summary": "Monitor events", + "description": "Stream real-time events from the server.\n\nVarious objects within Docker report events when something happens to them.\n\nContainers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune`\n\nImages report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune`\n\nVolumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune`\n\nNetworks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune`\n\nThe Docker daemon reports these events: `reload`\n\nServices report these events: `create`, `update`, and `remove`\n\nNodes report these events: `create`, `update`, and `remove`\n\nSecrets report these events: `create`, `update`, and `remove`\n\nConfigs report these events: `create`, `update`, and `remove`\n\nThe Builder reports `prune` events\n", + "operationId": "SystemEvents", + "parameters": [ + { + "name": "since", + "in": "query", + "description": "Show events created since this timestamp then stream new events.", + "schema": { + "type": "string" + } + }, + { + "name": "until", + "in": "query", + "description": "Show events created until this timestamp then stop streaming.", + "schema": { + "type": "string" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters:\n\n- `config=` config name or ID\n- `container=` container name or ID\n- `daemon=` daemon name or ID\n- `event=` event type\n- `image=` image name or ID\n- `label=` image or container label\n- `network=` network name or ID\n- `node=` node ID\n- `plugin`= plugin name or ID\n- `scope`= local or swarm\n- `secret=` secret name or ID\n- `service=` service name or ID\n- `type=` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config`\n- `volume=` volume name\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventMessage" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/system/df": { + "get": { + "tags": [ + "System" + ], + "summary": "Get data usage information", + "operationId": "SystemDataUsage", + "parameters": [ + { + "name": "type", + "in": "query", + "description": "Object types, for which to compute and return data.\n", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "container", + "image", + "volume", + "build-cache" + ] + } + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "SystemDataUsageResponse", + "type": "object", + "properties": { + "LayersSize": { + "type": "integer", + "format": "int64" + }, + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + }, + "Containers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerSummary" + } + }, + "Volumes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Volume" + } + }, + "BuildCache": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BuildCache" + } + } + }, + "example": { + "LayersSize": 1092588, + "Images": [ + { + "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "ParentId": "", + "RepoTags": [ + "busybox:latest" + ], + "RepoDigests": [ + "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + ], + "Created": 1466724217, + "Size": 1092588, + "SharedSize": 0, + "VirtualSize": 1092588, + "Labels": {}, + "Containers": 1 + } + ], + "Containers": [ + { + "Id": "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148", + "Names": [ + "/top" + ], + "Image": "busybox", + "ImageID": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "Command": "top", + "Created": 1472592424, + "Ports": [], + "SizeRootFs": 1092588, + "Labels": {}, + "State": "exited", + "Status": "Exited (0) 56 minutes ago", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92", + "EndpointID": "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a", + "Gateway": "172.18.0.1", + "IPAddress": "172.18.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Mounts": [] + } + ], + "Volumes": [ + { + "Name": "my-volume", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/my-volume/_data", + "Scope": "local", + "UsageData": { + "Size": 10920104, + "RefCount": 2 + } + } + ], + "BuildCache": [ + { + "ID": "hw53o5aio51xtltp5xjp8v7fx", + "Parents": [], + "Type": "regular", + "Description": "pulled from docker.io/library/debian@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0", + "InUse": false, + "Shared": true, + "Size": 0, + "CreatedAt": "2021-06-28T13:31:01.474619385Z", + "LastUsedAt": "2021-07-07T22:02:32.738075951Z", + "UsageCount": 26 + }, + { + "ID": "ndlpt0hhvkqcdfkputsk4cq9c", + "Parents": [ + "ndlpt0hhvkqcdfkputsk4cq9c" + ], + "Type": "regular", + "Description": "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache", + "InUse": false, + "Shared": true, + "Size": 51, + "CreatedAt": "2021-06-28T13:31:03.002625487Z", + "LastUsedAt": "2021-07-07T22:02:32.773909517Z", + "UsageCount": 26 + } + ] + } + } + }, + "text/plain": { + "schema": { + "title": "SystemDataUsageResponse", + "type": "object", + "properties": { + "LayersSize": { + "type": "integer", + "format": "int64" + }, + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + }, + "Containers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerSummary" + } + }, + "Volumes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Volume" + } + }, + "BuildCache": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BuildCache" + } + } + }, + "example": { + "LayersSize": 1092588, + "Images": [ + { + "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "ParentId": "", + "RepoTags": [ + "busybox:latest" + ], + "RepoDigests": [ + "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + ], + "Created": 1466724217, + "Size": 1092588, + "SharedSize": 0, + "VirtualSize": 1092588, + "Labels": {}, + "Containers": 1 + } + ], + "Containers": [ + { + "Id": "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148", + "Names": [ + "/top" + ], + "Image": "busybox", + "ImageID": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "Command": "top", + "Created": 1472592424, + "Ports": [], + "SizeRootFs": 1092588, + "Labels": {}, + "State": "exited", + "Status": "Exited (0) 56 minutes ago", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92", + "EndpointID": "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a", + "Gateway": "172.18.0.1", + "IPAddress": "172.18.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Mounts": [] + } + ], + "Volumes": [ + { + "Name": "my-volume", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/my-volume/_data", + "Scope": "local", + "UsageData": { + "Size": 10920104, + "RefCount": 2 + } + } + ], + "BuildCache": [ + { + "ID": "hw53o5aio51xtltp5xjp8v7fx", + "Parents": [], + "Type": "regular", + "Description": "pulled from docker.io/library/debian@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0", + "InUse": false, + "Shared": true, + "Size": 0, + "CreatedAt": "2021-06-28T13:31:01.474619385Z", + "LastUsedAt": "2021-07-07T22:02:32.738075951Z", + "UsageCount": 26 + }, + { + "ID": "ndlpt0hhvkqcdfkputsk4cq9c", + "Parents": [ + "ndlpt0hhvkqcdfkputsk4cq9c" + ], + "Type": "regular", + "Description": "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache", + "InUse": false, + "Shared": true, + "Size": 51, + "CreatedAt": "2021-06-28T13:31:03.002625487Z", + "LastUsedAt": "2021-07-07T22:02:32.773909517Z", + "UsageCount": 26 + } + ] + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/get": { + "get": { + "tags": [ + "Image" + ], + "summary": "Export an image", + "description": "Get a tarball containing all images and metadata for a repository.\n\nIf `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.\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID), each containing these files:\n\n- `VERSION`: currently `1.0` - the file format version\n- `json`: detailed layer information, similar to `docker inspect layer_id`\n- `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions.\n\nIf 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.\n\n```json\n{\n \"hello-world\": {\n \"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"\n }\n}\n```\n", + "operationId": "ImageGet", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/get": { + "get": { + "tags": [ + "Image" + ], + "summary": "Export several images", + "description": "Get a tarball containing all images and metadata for several image\nrepositories.\n\nFor each value of the `names` parameter: if it is a specific name and\ntag (e.g. `ubuntu:latest`), then only that image (and its parents) are\nreturned; if it is an image ID, similarly only that image (and its parents)\nare returned and there would be no names referenced in the 'repositories'\nfile for this image ID.\n\nFor details on the format, see the [export image endpoint](#operation/ImageGet).\n", + "operationId": "ImageGetAll", + "parameters": [ + { + "name": "names", + "in": "query", + "description": "Image names to filter by", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/load": { + "post": { + "tags": [ + "Image" + ], + "summary": "Import images", + "description": "Load a set of images and tags into a repository.\n\nFor details on the format, see the [export image endpoint](#operation/ImageGet).\n", + "operationId": "ImageLoad", + "parameters": [ + { + "name": "quiet", + "in": "query", + "description": "Suppress progress details during load.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "Tar archive containing images", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "imagesTarball" + } + }, + "/containers/{id}/exec": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Create an exec instance", + "description": "Run a command inside a running container.", + "operationId": "ContainerExec", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Exec configuration", + "content": { + "application/json": { + "schema": { + "title": "ExecConfig", + "type": "object", + "properties": { + "AttachStdin": { + "type": "boolean", + "description": "Attach to `stdin` of the exec command." + }, + "AttachStdout": { + "type": "boolean", + "description": "Attach to `stdout` of the exec command." + }, + "AttachStderr": { + "type": "boolean", + "description": "Attach to `stderr` of the exec command." + }, + "ConsoleSize": { + "maxItems": 2, + "minItems": 2, + "type": "array", + "description": "Initial console size, as an `[height, width]` array.", + "nullable": true, + "items": { + "minimum": 0, + "type": "integer" + } + }, + "DetachKeys": { + "type": "string", + "description": "Override the key sequence for detaching a container. Format is\na single character `[a-Z]` or `ctrl-` where ``\nis one of: `a-z`, `@`, `^`, `[`, `,` or `_`.\n" + }, + "Tty": { + "type": "boolean", + "description": "Allocate a pseudo-TTY." + }, + "Env": { + "type": "array", + "description": "A list of environment variables in the form `[\"VAR=value\", ...]`.\n", + "items": { + "type": "string" + } + }, + "Cmd": { + "type": "array", + "description": "Command to run, as a string or array of strings.", + "items": { + "type": "string" + } + }, + "Privileged": { + "type": "boolean", + "description": "Runs the exec process with extended privileges.", + "default": false + }, + "User": { + "type": "string", + "description": "The user, and optionally, group to run the exec process inside\nthe container. Format is one of: `user`, `user:group`, `uid`,\nor `uid:gid`.\n" + }, + "WorkingDir": { + "type": "string", + "description": "The working directory for the exec process inside the container.\n" + } + }, + "example": { + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "DetachKeys": "ctrl-p,ctrl-q", + "Tty": false, + "Cmd": [ + "date" + ], + "Env": [ + "FOO=bar", + "BAZ=quux" + ] + } + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "409": { + "description": "container is paused", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "execConfig" + } + }, + "/exec/{id}/start": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Start an exec instance", + "description": "Starts a previously set up exec instance. If detach is true, this endpoint\nreturns immediately after starting the command. Otherwise, it sets up an\ninteractive session with the command.\n", + "operationId": "ExecStart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "ExecStartConfig", + "type": "object", + "properties": { + "Detach": { + "type": "boolean", + "description": "Detach from the command." + }, + "Tty": { + "type": "boolean", + "description": "Allocate a pseudo-TTY." + }, + "ConsoleSize": { + "maxItems": 2, + "minItems": 2, + "type": "array", + "description": "Initial console size, as an `[height, width]` array.", + "nullable": true, + "items": { + "minimum": 0, + "type": "integer" + } + } + }, + "example": { + "Detach": false, + "Tty": true, + "ConsoleSize": [ + 80, + 64 + ] + } + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "404": { + "description": "No such exec instance", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Container is stopped or paused", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "execStartConfig" + } + }, + "/exec/{id}/resize": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Resize an exec instance", + "description": "Resize the TTY session used by an exec instance. This endpoint only works\nif `tty` was specified as part of creating and starting the exec instance.\n", + "operationId": "ExecResize", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "h", + "in": "query", + "description": "Height of the TTY session in characters", + "schema": { + "type": "integer" + } + }, + { + "name": "w", + "in": "query", + "description": "Width of the TTY session in characters", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "No such exec instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/exec/{id}/json": { + "get": { + "tags": [ + "Exec" + ], + "summary": "Inspect an exec instance", + "description": "Return low-level information about an exec instance.", + "operationId": "ExecInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ExecInspectResponse", + "type": "object", + "properties": { + "CanRemove": { + "type": "boolean" + }, + "DetachKeys": { + "type": "string" + }, + "ID": { + "type": "string" + }, + "Running": { + "type": "boolean" + }, + "ExitCode": { + "type": "integer" + }, + "ProcessConfig": { + "$ref": "#/components/schemas/ProcessConfig" + }, + "OpenStdin": { + "type": "boolean" + }, + "OpenStderr": { + "type": "boolean" + }, + "OpenStdout": { + "type": "boolean" + }, + "ContainerID": { + "type": "string" + }, + "Pid": { + "type": "integer", + "description": "The system process ID for the exec process." + } + } + }, + "example": { + "CanRemove": false, + "ContainerID": "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126", + "DetachKeys": "", + "ExitCode": 2, + "ID": "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b", + "OpenStderr": true, + "OpenStdin": true, + "OpenStdout": true, + "ProcessConfig": { + "arguments": [ + "-c", + "exit 2" + ], + "entrypoint": "sh", + "privileged": false, + "tty": true, + "user": "1000" + }, + "Running": false, + "Pid": 42000 + } + } + } + }, + "404": { + "description": "No such exec instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes": { + "get": { + "tags": [ + "Volume" + ], + "summary": "List volumes", + "operationId": "VolumeList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the volumes list. Available filters:\n\n- `dangling=` When set to `true` (or `1`), returns all\n volumes that are not in use by a container. When set to `false`\n (or `0`), only volumes that are in use by one or more\n containers are returned.\n- `driver=` Matches volumes based on their driver.\n- `label=` or `label=:` Matches volumes based on\n the presence of a `label` alone or a `label` and a value.\n- `name=` Matches all or part of a volume name.\n", + "schema": { + "type": "string", + "format": "json" + } + } + ], + "responses": { + "200": { + "description": "Summary volume data that matches the query", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VolumeListResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes/create": { + "post": { + "tags": [ + "Volume" + ], + "summary": "Create a volume", + "operationId": "VolumeCreate", + "requestBody": { + "description": "Volume configuration", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VolumeCreateOptions" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "The volume was created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Volume" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "volumeConfig" + } + }, + "/volumes/{name}": { + "get": { + "tags": [ + "Volume" + ], + "summary": "Inspect a volume", + "operationId": "VolumeInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Volume name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Volume" + } + } + } + }, + "404": { + "description": "No such volume", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Volume" + ], + "summary": "\"Update a volume. Valid only for Swarm cluster volumes\"\n", + "operationId": "VolumeUpdate", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name or ID of the volume", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the volume being updated. This is required to\navoid conflicting writes. Found in the volume's `ClusterVolume`\nfield.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "The spec of the volume to update. Currently, only Availability may\nchange. All other fields must remain unchanged.\n", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "Spec": { + "$ref": "#/components/schemas/ClusterVolumeSpec" + } + }, + "description": "Volume configuration" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such volume", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + }, + "delete": { + "tags": [ + "Volume" + ], + "summary": "Remove a volume", + "description": "Instruct the driver to remove the volume.", + "operationId": "VolumeDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Volume name or ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force the removal of the volume", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "The volume was removed", + "content": {} + }, + "404": { + "description": "No such volume or volume driver", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Volume is in use and cannot be removed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes/prune": { + "post": { + "tags": [ + "Volume" + ], + "summary": "Delete unused volumes", + "operationId": "VolumePrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels.\n- `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "VolumePruneResponse", + "type": "object", + "properties": { + "VolumesDeleted": { + "type": "array", + "description": "Volumes that were deleted", + "items": { + "type": "string" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks": { + "get": { + "tags": [ + "Network" + ], + "summary": "List networks", + "description": "Returns a list of networks. For details on the format, see the\n[network inspect endpoint](#operation/NetworkInspect).\n\nNote that it uses a different, smaller representation of a network than\ninspecting a single network. For example, the list of containers attached\nto the network is not propagated in API versions 1.28 and up.\n", + "operationId": "NetworkList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "JSON encoded value of the filters (a `map[string][]string`) to process\non the networks list.\n\nAvailable filters:\n\n- `dangling=` When set to `true` (or `1`), returns all\n networks that are not in use by a container. When set to `false`\n (or `0`), only networks that are in use by one or more\n containers are returned.\n- `driver=` Matches a network's driver.\n- `id=` Matches all or part of a network ID.\n- `label=` or `label==` of a network label.\n- `name=` Matches all or part of a network name.\n- `scope=[\"swarm\"|\"global\"|\"local\"]` Filters networks by scope (`swarm`, `global`, or `local`).\n- `type=[\"custom\"|\"builtin\"]` Filters networks by type. The `custom` keyword returns all user-defined networks.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Network" + } + }, + "example": [ + { + "Name": "bridge", + "Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566", + "Created": "2016-10-19T06:21:00.416543526Z", + "Scope": "local", + "Driver": "bridge", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.17.0.0/16" + } + ] + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + } + }, + { + "Name": "none", + "Id": "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794", + "Created": "0001-01-01T00:00:00Z", + "Scope": "local", + "Driver": "null", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + }, + { + "Name": "host", + "Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e", + "Created": "0001-01-01T00:00:00Z", + "Scope": "local", + "Driver": "host", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + } + ] + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks/{id}": { + "get": { + "tags": [ + "Network" + ], + "summary": "Inspect a network", + "operationId": "NetworkInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "verbose", + "in": "query", + "description": "Detailed inspect output for troubleshooting", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "scope", + "in": "query", + "description": "Filter the network by scope (swarm, global, or local)", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Network" + } + } + } + }, + "404": { + "description": "Network not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Network" + ], + "summary": "Remove a network", + "operationId": "NetworkDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No error", + "content": {} + }, + "403": { + "description": "operation not supported for pre-defined networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such network", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks/create": { + "post": { + "tags": [ + "Network" + ], + "summary": "Create a network", + "operationId": "NetworkCreate", + "requestBody": { + "description": "Network configuration", + "content": { + "application/json": { + "schema": { + "title": "NetworkCreateRequest", + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The network's name." + }, + "CheckDuplicate": { + "type": "boolean", + "description": "Check for networks with duplicate names. Since Network is\nprimarily keyed based on a random ID and not on the name, and\nnetwork name is strictly a user-friendly alias to the network\nwhich is uniquely identified using ID, there is no guaranteed\nway to check for duplicates. CheckDuplicate is there to provide\na best effort checking of any networks which has the same name\nbut it is not guaranteed to catch all name collisions.\n" + }, + "Driver": { + "type": "string", + "description": "Name of the network driver plugin to use.", + "default": "bridge" + }, + "Internal": { + "type": "boolean", + "description": "Restrict external access to the network." + }, + "Attachable": { + "type": "boolean", + "description": "Globally scoped network is manually attachable by regular\ncontainers from workers in swarm mode.\n" + }, + "Ingress": { + "type": "boolean", + "description": "Ingress network is the network which provides the routing-mesh\nin swarm mode.\n" + }, + "IPAM": { + "$ref": "#/components/schemas/IPAM" + }, + "EnableIPv6": { + "type": "boolean", + "description": "Enable IPv6 on the network." + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Network specific options to be used by the drivers." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + } + }, + "example": { + "Name": "isolated_nw", + "CheckDuplicate": false, + "Driver": "bridge", + "EnableIPv6": true, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.20.0.0/16", + "IPRange": "172.20.10.0/24", + "Gateway": "172.20.10.11" + }, + { + "Subnet": "2001:db8:abcd::/64", + "Gateway": "2001:db8:abcd::1011" + } + ], + "Options": { + "foo": "bar" + } + }, + "Internal": true, + "Attachable": false, + "Ingress": false, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "NetworkCreateResponse", + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the created network." + }, + "Warning": { + "type": "string" + } + }, + "example": { + "Id": "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30", + "Warning": "" + } + } + } + } + }, + "403": { + "description": "operation not supported for pre-defined networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "plugin not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "networkConfig" + } + }, + "/networks/{id}/connect": { + "post": { + "tags": [ + "Network" + ], + "summary": "Connect a container to a network", + "operationId": "NetworkConnect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "NetworkConnectRequest", + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "The ID or name of the container to connect to the network." + }, + "EndpointConfig": { + "$ref": "#/components/schemas/EndpointSettings" + } + }, + "example": { + "Container": "3613f73ba0e4", + "EndpointConfig": { + "IPAMConfig": { + "IPv4Address": "172.24.56.89", + "IPv6Address": "2001:db8::5689" + } + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "403": { + "description": "Operation not supported for swarm scoped networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Network or container not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "container" + } + }, + "/networks/{id}/disconnect": { + "post": { + "tags": [ + "Network" + ], + "summary": "Disconnect a container from a network", + "operationId": "NetworkDisconnect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "NetworkDisconnectRequest", + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "The ID or name of the container to disconnect from the network.\n" + }, + "Force": { + "type": "boolean", + "description": "Force the container to disconnect from the network.\n" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "403": { + "description": "Operation not supported for swarm scoped networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Network or container not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "container" + } + }, + "/networks/prune": { + "post": { + "tags": [ + "Network" + ], + "summary": "Delete unused networks", + "operationId": "NetworkPrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `until=` Prune networks created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune networks with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "NetworkPruneResponse", + "type": "object", + "properties": { + "NetworksDeleted": { + "type": "array", + "description": "Networks that were deleted", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "List plugins", + "description": "Returns information about installed plugins.", + "operationId": "PluginList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the plugin list.\n\nAvailable filters:\n\n- `capability=`\n- `enable=|`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Plugin" + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/privileges": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "Get plugin privileges", + "operationId": "GetPluginPrivileges", + "parameters": [ + { + "name": "remote", + "in": "query", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/pull": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Install a plugin", + "description": "Pulls and installs a plugin. After the plugin is installed, it can be\nenabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable).\n", + "operationId": "PluginPull", + "parameters": [ + { + "name": "remote", + "in": "query", + "description": "Remote reference for plugin to install.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "description": "Local name for the pulled plugin.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration to use when pulling a plugin\nfrom a registry.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/plugins/{name}/json": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "Inspect a plugin", + "operationId": "PluginInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + } + } + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}": { + "delete": { + "tags": [ + "Plugin" + ], + "summary": "Remove a plugin", + "operationId": "PluginDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Disable the plugin before removing. This may result in issues if the\nplugin is in use by a container.\n", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + } + } + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/enable": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Enable a plugin", + "operationId": "PluginEnable", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Set the HTTP client timeout (in seconds)", + "schema": { + "type": "integer", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/disable": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Disable a plugin", + "operationId": "PluginDisable", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force disable a plugin even if still in use.\n", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/upgrade": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Upgrade a plugin", + "operationId": "PluginUpgrade", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "remote", + "in": "query", + "description": "Remote reference to upgrade to.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration to use when pulling a plugin\nfrom a registry.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/plugins/create": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Create a plugin", + "operationId": "PluginCreate", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Path to tar containing plugin rootfs and manifest", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "tarContext" + } + }, + "/plugins/{name}/push": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Push a plugin", + "description": "Push a plugin to the registry.\n", + "operationId": "PluginPush", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/set": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Configure a plugin", + "operationId": "PluginSet", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + "DEBUG=1" + ], + "items": { + "type": "string" + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "No error", + "content": {} + }, + "404": { + "description": "Plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/nodes": { + "get": { + "tags": [ + "Node" + ], + "summary": "List nodes", + "operationId": "NodeList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the nodes list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `id=`\n- `label=`\n- `membership=`(`accepted`|`pending`)`\n- `name=`\n- `node.label=`\n- `role=`(`manager`|`worker`)`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Node" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Node" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/nodes/{id}": { + "get": { + "tags": [ + "Node" + ], + "summary": "Inspect a node", + "operationId": "NodeInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the node", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Node" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Node" + } + } + } + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Node" + ], + "summary": "Delete a node", + "operationId": "NodeDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the node", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force remove a node from the swarm", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/nodes/{id}/update": { + "post": { + "tags": [ + "Node" + ], + "summary": "Update a node", + "operationId": "NodeUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the node", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the node object being updated. This is required\nto avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NodeSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/NodeSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm": { + "get": { + "tags": [ + "Swarm" + ], + "summary": "Inspect swarm", + "operationId": "SwarmInspect", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Swarm" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Swarm" + } + } + } + }, + "404": { + "description": "no such swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/init": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Initialize a new swarm", + "operationId": "SwarmInit", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "SwarmInitRequest", + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication, as well\nas determining the networking interface used for the VXLAN\nTunnel Endpoint (VTEP). This can either be an address/port\ncombination in the form `192.168.1.1:4567`, or an interface\nfollowed by a port number, like `eth0:4567`. If the port number\nis omitted, the default swarm listening port is used.\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "DataPathPort": { + "type": "integer", + "description": "DataPathPort specifies the data path port number for data traffic.\nAcceptable port range is 1024 to 49151.\nif no port is set or is set to 0, default port 4789 will be used.\n", + "format": "uint32" + }, + "DefaultAddrPool": { + "type": "array", + "description": "Default Address Pool specifies default subnet pools for global\nscope networks.\n", + "items": { + "type": "string", + "example": "" + } + }, + "ForceNewCluster": { + "type": "boolean", + "description": "Force creation of a new swarm." + }, + "SubnetSize": { + "type": "integer", + "description": "SubnetSize specifies the subnet size of the networks created\nfrom the default subnet pool.\n", + "format": "uint32" + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "DataPathPort": 4789, + "DefaultAddrPool": [ + "10.10.0.0/8", + "20.20.0.0/8" + ], + "SubnetSize": 24, + "ForceNewCluster": false, + "Spec": { + "Orchestration": {}, + "Raft": {}, + "Dispatcher": {}, + "CAConfig": {}, + "EncryptionConfig": { + "AutoLockManagers": false + } + } + } + } + }, + "text/plain": { + "schema": { + "title": "SwarmInitRequest", + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication, as well\nas determining the networking interface used for the VXLAN\nTunnel Endpoint (VTEP). This can either be an address/port\ncombination in the form `192.168.1.1:4567`, or an interface\nfollowed by a port number, like `eth0:4567`. If the port number\nis omitted, the default swarm listening port is used.\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "DataPathPort": { + "type": "integer", + "description": "DataPathPort specifies the data path port number for data traffic.\nAcceptable port range is 1024 to 49151.\nif no port is set or is set to 0, default port 4789 will be used.\n", + "format": "uint32" + }, + "DefaultAddrPool": { + "type": "array", + "description": "Default Address Pool specifies default subnet pools for global\nscope networks.\n", + "items": { + "type": "string", + "example": "" + } + }, + "ForceNewCluster": { + "type": "boolean", + "description": "Force creation of a new swarm." + }, + "SubnetSize": { + "type": "integer", + "description": "SubnetSize specifies the subnet size of the networks created\nfrom the default subnet pool.\n", + "format": "uint32" + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "DataPathPort": 4789, + "DefaultAddrPool": [ + "10.10.0.0/8", + "20.20.0.0/8" + ], + "SubnetSize": 24, + "ForceNewCluster": false, + "Spec": { + "Orchestration": {}, + "Raft": {}, + "Dispatcher": {}, + "CAConfig": {}, + "EncryptionConfig": { + "AutoLockManagers": false + } + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "string", + "description": "The node ID", + "example": "7v2t30z9blmxuhnyo6s4cpenp" + } + }, + "text/plain": { + "schema": { + "type": "string", + "description": "The node ID", + "example": "7v2t30z9blmxuhnyo6s4cpenp" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is already part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/join": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Join an existing swarm", + "operationId": "SwarmJoin", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "SwarmJoinRequest", + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication if the node\ngets promoted to manager, as well as determining the networking\ninterface used for the VXLAN Tunnel Endpoint (VTEP).\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "RemoteAddrs": { + "type": "array", + "description": "Addresses of manager nodes already participating in the swarm.\n", + "items": { + "type": "string" + } + }, + "JoinToken": { + "type": "string", + "description": "Secret token for joining this swarm." + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "RemoteAddrs": [ + "node1:2377" + ], + "JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + } + }, + "text/plain": { + "schema": { + "title": "SwarmJoinRequest", + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication if the node\ngets promoted to manager, as well as determining the networking\ninterface used for the VXLAN Tunnel Endpoint (VTEP).\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "RemoteAddrs": { + "type": "array", + "description": "Addresses of manager nodes already participating in the swarm.\n", + "items": { + "type": "string" + } + }, + "JoinToken": { + "type": "string", + "description": "Secret token for joining this swarm." + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "RemoteAddrs": [ + "node1:2377" + ], + "JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is already part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/leave": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Leave a swarm", + "operationId": "SwarmLeave", + "parameters": [ + { + "name": "force", + "in": "query", + "description": "Force leave swarm, even if this is the last manager or that it will\nbreak the cluster.\n", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/update": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Update a swarm", + "operationId": "SwarmUpdate", + "parameters": [ + { + "name": "version", + "in": "query", + "description": "The version number of the swarm object being updated. This is\nrequired to avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "rotateWorkerToken", + "in": "query", + "description": "Rotate the worker join token.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "rotateManagerToken", + "in": "query", + "description": "Rotate the manager join token.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "rotateManagerUnlockKey", + "in": "query", + "description": "Rotate the manager unlock key.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/SwarmSpec" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/unlockkey": { + "get": { + "tags": [ + "Swarm" + ], + "summary": "Get the unlock key", + "operationId": "SwarmUnlockkey", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "UnlockKeyResponse", + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + }, + "text/plain": { + "schema": { + "title": "UnlockKeyResponse", + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/unlock": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Unlock a locked manager", + "operationId": "SwarmUnlock", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "SwarmUnlockRequest", + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services": { + "get": { + "tags": [ + "Service" + ], + "summary": "List services", + "operationId": "ServiceList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the services list.\n\nAvailable filters:\n\n- `id=`\n- `label=`\n- `mode=[\"replicated\"|\"global\"]`\n- `name=`\n", + "schema": { + "type": "string" + } + }, + { + "name": "status", + "in": "query", + "description": "Include service status, with count of running and desired tasks.\n", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/services/create": { + "post": { + "tags": [ + "Service" + ], + "summary": "Create a service", + "operationId": "ServiceCreate", + "parameters": [ + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration for pulling from private\nregistries.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServiceSpec" + }, + { + "type": "object", + "example": { + "Name": "web", + "TaskTemplate": { + "ContainerSpec": { + "Image": "nginx:alpine", + "Mounts": [ + { + "ReadOnly": true, + "Source": "web-data", + "Target": "/usr/share/nginx/html", + "Type": "volume", + "VolumeOptions": { + "DriverConfig": {}, + "Labels": { + "com.example.something": "something-value" + } + } + } + ], + "Hosts": [ + "10.10.10.10 host1", + "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 host2" + ], + "User": "33", + "DNSConfig": { + "Nameservers": [ + "8.8.8.8" + ], + "Search": [ + "example.org" + ], + "Options": [ + "timeout:3" + ] + }, + "Secrets": [ + { + "File": { + "Name": "www.example.org.key", + "UID": "33", + "GID": "33", + "Mode": 384 + }, + "SecretID": "fpjqlhnwb19zds35k8wn80lq9", + "SecretName": "example_org_domain_key" + } + ] + }, + "LogDriver": { + "Name": "json-file", + "Options": { + "max-file": "3", + "max-size": "10M" + } + }, + "Placement": {}, + "Resources": { + "Limits": { + "MemoryBytes": 104857600 + }, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "on-failure", + "Delay": 10000000000, + "MaxAttempts": 10 + } + }, + "Mode": { + "Replicated": { + "Replicas": 4 + } + }, + "UpdateConfig": { + "Parallelism": 2, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Ports": [ + { + "Protocol": "tcp", + "PublishedPort": 8080, + "TargetPort": 80 + } + ] + }, + "Labels": { + "foo": "bar" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "ServiceCreateResponse", + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the created service." + }, + "Warning": { + "type": "string", + "description": "Optional warning message" + } + }, + "example": { + "ID": "ak7w3gjqoa3kuz8xcpnyy0pvl", + "Warning": "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + } + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "network is not eligible for services", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services/{id}": { + "get": { + "tags": [ + "Service" + ], + "summary": "Inspect a service", + "operationId": "ServiceInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "insertDefaults", + "in": "query", + "description": "Fill empty fields with default values.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Service" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Service" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Service" + ], + "summary": "Delete a service", + "operationId": "ServiceDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/services/{id}/update": { + "post": { + "tags": [ + "Service" + ], + "summary": "Update a service", + "operationId": "ServiceUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the service object being updated. This is\nrequired to avoid conflicting writes.\nThis version number should be the value as currently set on the\nservice *before* the update. You can find the current version by\ncalling `GET /services/{id}`\n", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "registryAuthFrom", + "in": "query", + "description": "If the `X-Registry-Auth` header is not specified, this parameter\nindicates where to find registry authorization credentials.\n", + "schema": { + "type": "string", + "default": "spec", + "enum": [ + "spec", + "previous-spec" + ] + } + }, + { + "name": "rollback", + "in": "query", + "description": "Set to this parameter to `previous` to cause a server-side rollback\nto the previous service spec. The supplied spec will be ignored in\nthis case.\n", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration for pulling from private\nregistries.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServiceSpec" + }, + { + "type": "object", + "example": { + "Name": "top", + "TaskTemplate": { + "ContainerSpec": { + "Image": "busybox", + "Args": [ + "top" + ] + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {}, + "ForceUpdate": 0 + }, + "Mode": { + "Replicated": { + "Replicas": 1 + } + }, + "UpdateConfig": { + "Parallelism": 2, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Mode": "vip" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUpdateResponse" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services/{id}/logs": { + "get": { + "tags": [ + "Service" + ], + "summary": "Get service logs", + "description": "Get `stdout` and `stderr` logs from a service. See also\n[`/containers/{id}/logs`](#operation/ContainerLogs).\n\n**Note**: This endpoint works only for services with the `local`,\n`json-file` or `journald` logging drivers.\n", + "operationId": "ServiceLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the service", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "details", + "in": "query", + "description": "Show service context and extra details provided to logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "follow", + "in": "query", + "description": "Keep connection after returning logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs.\nSpecify as an integer or `all` to output all log lines.\n", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "200": { + "description": "logs returned as a stream in response body", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such service: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks": { + "get": { + "tags": [ + "Task" + ], + "summary": "List tasks", + "operationId": "TaskList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the tasks list.\n\nAvailable filters:\n\n- `desired-state=(running | shutdown | accepted)`\n- `id=`\n- `label=key` or `label=\"key=value\"`\n- `name=`\n- `node=`\n- `service=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "0kzzo1i0y4jz6027t0k7aezc7", + "Version": { + "Index": 71 + }, + "CreatedAt": "2016-06-07T21:07:31.171892745Z", + "UpdatedAt": "2016-06-07T21:07:31.376370513Z", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:31.290032978Z", + "State": "running", + "Message": "started", + "ContainerStatus": { + "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035", + "PID": 677 + } + }, + "DesiredState": "running", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.10/16" + ] + } + ] + }, + { + "ID": "1yljwbmlr8er2waf8orvqpwms", + "Version": { + "Index": 30 + }, + "CreatedAt": "2016-06-07T21:07:30.019104782Z", + "UpdatedAt": "2016-06-07T21:07:30.231958098Z", + "Name": "hopeful_cori", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:30.202183143Z", + "State": "shutdown", + "Message": "shutdown", + "ContainerStatus": { + "ContainerID": "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213" + } + }, + "DesiredState": "shutdown", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.5/16" + ] + } + ] + } + ], + "items": { + "$ref": "#/components/schemas/Task" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks/{id}": { + "get": { + "tags": [ + "Task" + ], + "summary": "Inspect a task", + "operationId": "TaskInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the task", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Task" + } + } + } + }, + "404": { + "description": "no such task", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks/{id}/logs": { + "get": { + "tags": [ + "Task" + ], + "summary": "Get task logs", + "description": "Get `stdout` and `stderr` logs from a task.\nSee also [`/containers/{id}/logs`](#operation/ContainerLogs).\n\n**Note**: This endpoint works only for services with the `local`,\n`json-file` or `journald` logging drivers.\n", + "operationId": "TaskLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the task", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "details", + "in": "query", + "description": "Show task context and extra details provided to logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "follow", + "in": "query", + "description": "Keep connection after returning logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs.\nSpecify as an integer or `all` to output all log lines.\n", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "200": { + "description": "logs returned as a stream in response body", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "no such task", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such task: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets": { + "get": { + "tags": [ + "Secret" + ], + "summary": "List secrets", + "operationId": "SecretList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the secrets list.\n\nAvailable filters:\n\n- `id=`\n- `label= or label==value`\n- `name=`\n- `names=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "blt1owaxmitz71s9v5zh81zun", + "Version": { + "Index": 85 + }, + "CreatedAt": "2017-07-20T13:55:28.678958722Z", + "UpdatedAt": "2017-07-20T13:55:28.678958722Z", + "Spec": { + "Name": "mysql-passwd", + "Labels": { + "some.label": "some.value" + }, + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + }, + { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt", + "Labels": { + "foo": "bar" + } + } + } + ], + "items": { + "$ref": "#/components/schemas/Secret" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets/create": { + "post": { + "tags": [ + "Secret" + ], + "summary": "Create a secret", + "operationId": "SecretCreate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SecretSpec" + }, + { + "type": "object", + "example": { + "Name": "app-key.crt", + "Labels": { + "foo": "bar" + }, + "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==", + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + } + ] + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/secrets/{id}": { + "get": { + "tags": [ + "Secret" + ], + "summary": "Inspect a secret", + "operationId": "SecretInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the secret", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Secret" + }, + "example": { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt", + "Labels": { + "foo": "bar" + }, + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + } + } + } + }, + "404": { + "description": "secret not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Secret" + ], + "summary": "Delete a secret", + "operationId": "SecretDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the secret", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "secret not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets/{id}/update": { + "post": { + "tags": [ + "Secret" + ], + "summary": "Update a Secret", + "operationId": "SecretUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the secret", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the secret object being updated. This is\nrequired to avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "The spec of the secret to update. Currently, only the Labels field\ncan be updated. All other fields must remain unchanged from the\n[SecretInspect endpoint](#operation/SecretInspect) response values.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SecretSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/SecretSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such secret", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/configs": { + "get": { + "tags": [ + "Config" + ], + "summary": "List configs", + "operationId": "ConfigList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the configs list.\n\nAvailable filters:\n\n- `id=`\n- `label= or label==value`\n- `name=`\n- `names=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "server.conf" + } + } + ], + "items": { + "$ref": "#/components/schemas/Config" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/configs/create": { + "post": { + "tags": [ + "Config" + ], + "summary": "Create a config", + "operationId": "ConfigCreate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ConfigSpec" + }, + { + "type": "object", + "example": { + "Name": "server.conf", + "Labels": { + "foo": "bar" + }, + "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + } + } + ] + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/configs/{id}": { + "get": { + "tags": [ + "Config" + ], + "summary": "Inspect a config", + "operationId": "ConfigInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the config", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Config" + }, + "example": { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt" + } + } + } + } + }, + "404": { + "description": "config not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Config" + ], + "summary": "Delete a config", + "operationId": "ConfigDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the config", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "config not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/configs/{id}/update": { + "post": { + "tags": [ + "Config" + ], + "summary": "Update a Config", + "operationId": "ConfigUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the config", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the config object being updated. This is\nrequired to avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "The spec of the config to update. Currently, only the Labels field\ncan be updated. All other fields must remain unchanged from the\n[ConfigInspect endpoint](#operation/ConfigInspect) response values.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ConfigSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such config", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/distribution/{name}/json": { + "get": { + "tags": [ + "Distribution" + ], + "summary": "Get image information from the registry", + "description": "Return image digest and platform information by contacting the registry.\n", + "operationId": "DistributionInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "descriptor and platform information", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DistributionInspect" + } + } + } + }, + "401": { + "description": "Failed authentication or no image found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such image: someimage (tag: latest)" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/session": { + "post": { + "tags": [ + "Session" + ], + "summary": "Initialize interactive session", + "description": "Start a new interactive session with a server. Session allows server to\ncall back to the client for advanced capabilities.\n\n### Hijacking\n\nThis endpoint hijacks the HTTP connection to HTTP2 transport that allows\nthe client to expose gPRC services on that connection.\n\nFor example, the client sends this request to upgrade the connection:\n\n```\nPOST /session HTTP/1.1\nUpgrade: h2c\nConnection: Upgrade\n```\n\nThe Docker daemon responds with a `101 UPGRADED` response follow with\nthe raw stream:\n\n```\nHTTP/1.1 101 UPGRADED\nConnection: Upgrade\nUpgrade: h2c\n```\n", + "operationId": "Session", + "responses": { + "101": { + "description": "no error, hijacking successful", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Port": { + "required": [ + "PrivatePort", + "Type" + ], + "type": "object", + "properties": { + "IP": { + "type": "string", + "description": "Host IP address that the container's port is mapped to", + "format": "ip-address" + }, + "PrivatePort": { + "type": "integer", + "description": "Port on the container", + "format": "uint16", + "nullable": false + }, + "PublicPort": { + "type": "integer", + "description": "Port exposed on the host", + "format": "uint16" + }, + "Type": { + "type": "string", + "nullable": false, + "enum": [ + "tcp", + "udp", + "sctp" + ] + } + }, + "description": "An open port on a container", + "example": { + "PrivatePort": 8080, + "PublicPort": 80, + "Type": "tcp" + } + }, + "MountPoint": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "description": "The mount type:\n\n- `bind` a mount of a file or directory from the host into the container.\n- `volume` a docker volume with the given `Name`.\n- `tmpfs` a `tmpfs`.\n- `npipe` a named pipe from the host into the container.\n- `cluster` a Swarm cluster volume\n", + "example": "volume", + "enum": [ + "bind", + "volume", + "tmpfs", + "npipe", + "cluster" + ] + }, + "Name": { + "type": "string", + "description": "Name is the name reference to the underlying data defined by `Source`\ne.g., the volume name.\n", + "example": "myvolume" + }, + "Source": { + "type": "string", + "description": "Source location of the mount.\n\nFor volumes, this contains the storage location of the volume (within\n`/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains\nthe source (host) part of the bind-mount. For `tmpfs` mount points, this\nfield is empty.\n", + "example": "/var/lib/docker/volumes/myvolume/_data" + }, + "Destination": { + "type": "string", + "description": "Destination is the path relative to the container root (`/`) where\nthe `Source` is mounted inside the container.\n", + "example": "/usr/share/nginx/html/" + }, + "Driver": { + "type": "string", + "description": "Driver is the volume driver used to create the volume (if it is a volume).\n", + "example": "local" + }, + "Mode": { + "type": "string", + "description": "Mode is a comma separated list of options supplied by the user when\ncreating the bind/volume mount.\n\nThe default is platform-specific (`\"z\"` on Linux, empty on Windows).\n", + "example": "z" + }, + "RW": { + "type": "boolean", + "description": "Whether the mount is mounted writable (read-write).\n", + "example": true + }, + "Propagation": { + "type": "string", + "description": "Propagation describes how mounts are propagated from the host into the\nmount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt)\nfor details. This field is not used on Windows.\n", + "example": "" + } + }, + "description": "MountPoint represents a mount point configuration inside the container.\nThis is used for reporting the mountpoints in use by a container.\n" + }, + "DeviceMapping": { + "type": "object", + "properties": { + "PathOnHost": { + "type": "string" + }, + "PathInContainer": { + "type": "string" + }, + "CgroupPermissions": { + "type": "string" + } + }, + "description": "A device mapping between the host and container", + "example": { + "PathOnHost": "/dev/deviceName", + "PathInContainer": "/dev/deviceName", + "CgroupPermissions": "mrw" + } + }, + "DeviceRequest": { + "type": "object", + "properties": { + "Driver": { + "type": "string", + "example": "nvidia" + }, + "Count": { + "type": "integer", + "example": -1 + }, + "DeviceIDs": { + "type": "array", + "example": [ + "0", + "1", + "GPU-fef8089b-4820-abfc-e83e-94318197576e" + ], + "items": { + "type": "string" + } + }, + "Capabilities": { + "type": "array", + "description": "A list of capabilities; an OR list of AND lists of capabilities.\n", + "example": [ + [ + "gpu", + "nvidia", + "compute" + ] + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver-specific options, specified as a key/value pairs. These options\nare passed directly to the driver.\n" + } + }, + "description": "A request for devices to be sent to device drivers" + }, + "ThrottleDevice": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Device path" + }, + "Rate": { + "minimum": 0, + "type": "integer", + "description": "Rate", + "format": "int64" + } + } + }, + "Mount": { + "type": "object", + "properties": { + "Target": { + "type": "string", + "description": "Container path." + }, + "Source": { + "type": "string", + "description": "Mount source (e.g. a volume name, a host path)." + }, + "Type": { + "type": "string", + "description": "The mount type. Available types:\n\n- `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container.\n- `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.\n- `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs.\n- `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container.\n- `cluster` a Swarm cluster volume\n", + "enum": [ + "bind", + "volume", + "tmpfs", + "npipe", + "cluster" + ] + }, + "ReadOnly": { + "type": "boolean", + "description": "Whether the mount should be read-only." + }, + "Consistency": { + "type": "string", + "description": "The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`." + }, + "BindOptions": { + "type": "object", + "properties": { + "Propagation": { + "type": "string", + "description": "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.", + "enum": [ + "private", + "rprivate", + "shared", + "rshared", + "slave", + "rslave" + ] + }, + "NonRecursive": { + "type": "boolean", + "description": "Disable recursive bind mount.", + "default": false + }, + "CreateMountpoint": { + "type": "boolean", + "description": "Create mount point on host if missing", + "default": false + } + }, + "description": "Optional configuration for the `bind` type." + }, + "VolumeOptions": { + "type": "object", + "properties": { + "NoCopy": { + "type": "boolean", + "description": "Populate volume with data from the target.", + "default": false + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "DriverConfig": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the driver to use to create the volume." + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "key/value map of driver specific options." + } + }, + "description": "Map of driver specific options" + } + }, + "description": "Optional configuration for the `volume` type." + }, + "TmpfsOptions": { + "type": "object", + "properties": { + "SizeBytes": { + "type": "integer", + "description": "The size for the tmpfs mount in bytes.", + "format": "int64" + }, + "Mode": { + "type": "integer", + "description": "The permission mode for the tmpfs mount in an integer." + } + }, + "description": "Optional configuration for the `tmpfs` type." + } + } + }, + "RestartPolicy": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "- Empty string means not to restart\n- `no` Do not automatically restart\n- `always` Always restart\n- `unless-stopped` Restart always except when the user has manually stopped the container\n- `on-failure` Restart only when the container exit code is non-zero\n", + "enum": [ + "", + "no", + "always", + "unless-stopped", + "on-failure" + ] + }, + "MaximumRetryCount": { + "type": "integer", + "description": "If `on-failure` is used, the number of times to retry before giving up.\n" + } + }, + "description": "The behavior to apply when the container exits. The default is not to\nrestart.\n\nAn ever increasing delay (double the previous delay, starting at 100ms) is\nadded before each restart to prevent flooding the server.\n" + }, + "Resources": { + "type": "object", + "properties": { + "CpuShares": { + "type": "integer", + "description": "An integer value representing this container's relative CPU weight\nversus other containers.\n" + }, + "Memory": { + "type": "integer", + "description": "Memory limit in bytes.", + "format": "int64", + "default": 0 + }, + "CgroupParent": { + "type": "string", + "description": "Path to `cgroups` under which the container's `cgroup` is created. If\nthe path is not absolute, the path is considered to be relative to the\n`cgroups` path of the init process. Cgroups are created if they do not\nalready exist.\n" + }, + "BlkioWeight": { + "maximum": 1000, + "minimum": 0, + "type": "integer", + "description": "Block IO weight (relative weight)." + }, + "BlkioWeightDevice": { + "type": "array", + "description": "Block IO weight (relative device weight) in the form:\n\n```\n[{\"Path\": \"device_path\", \"Weight\": weight}]\n```\n", + "items": { + "type": "object", + "properties": { + "Path": { + "type": "string" + }, + "Weight": { + "minimum": 0, + "type": "integer" + } + } + } + }, + "BlkioDeviceReadBps": { + "type": "array", + "description": "Limit read rate (bytes per second) from a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceWriteBps": { + "type": "array", + "description": "Limit write rate (bytes per second) to a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceReadIOps": { + "type": "array", + "description": "Limit read rate (IO per second) from a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceWriteIOps": { + "type": "array", + "description": "Limit write rate (IO per second) to a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "CpuPeriod": { + "type": "integer", + "description": "The length of a CPU period in microseconds.", + "format": "int64" + }, + "CpuQuota": { + "type": "integer", + "description": "Microseconds of CPU time that the container can get in a CPU period.\n", + "format": "int64" + }, + "CpuRealtimePeriod": { + "type": "integer", + "description": "The length of a CPU real-time period in microseconds. Set to 0 to\nallocate no time allocated to real-time tasks.\n", + "format": "int64" + }, + "CpuRealtimeRuntime": { + "type": "integer", + "description": "The length of a CPU real-time runtime in microseconds. Set to 0 to\nallocate no time allocated to real-time tasks.\n", + "format": "int64" + }, + "CpusetCpus": { + "type": "string", + "description": "CPUs in which to allow execution (e.g., `0-3`, `0,1`).\n", + "example": "0-3" + }, + "CpusetMems": { + "type": "string", + "description": "Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only\neffective on NUMA systems.\n" + }, + "Devices": { + "type": "array", + "description": "A list of devices to add to the container.", + "items": { + "$ref": "#/components/schemas/DeviceMapping" + } + }, + "DeviceCgroupRules": { + "type": "array", + "description": "a list of cgroup rules to apply to the container", + "items": { + "type": "string", + "example": "c 13:* rwm" + } + }, + "DeviceRequests": { + "type": "array", + "description": "A list of requests for devices to be sent to device drivers.\n", + "items": { + "$ref": "#/components/schemas/DeviceRequest" + } + }, + "KernelMemoryTCP": { + "type": "integer", + "description": "Hard limit for kernel TCP buffer memory (in bytes). Depending on the\nOCI runtime in use, this option may be ignored. It is no longer supported\nby the default (runc) runtime.\n\nThis field is omitted when empty.\n", + "format": "int64" + }, + "MemoryReservation": { + "type": "integer", + "description": "Memory soft limit in bytes.", + "format": "int64" + }, + "MemorySwap": { + "type": "integer", + "description": "Total memory limit (memory + swap). Set as `-1` to enable unlimited\nswap.\n", + "format": "int64" + }, + "MemorySwappiness": { + "maximum": 100, + "minimum": 0, + "type": "integer", + "description": "Tune a container's memory swappiness behavior. Accepts an integer\nbetween 0 and 100.\n", + "format": "int64" + }, + "NanoCpus": { + "type": "integer", + "description": "CPU quota in units of 10-9 CPUs.", + "format": "int64" + }, + "OomKillDisable": { + "type": "boolean", + "description": "Disable OOM Killer for the container." + }, + "Init": { + "type": "boolean", + "description": "Run an init inside the container that forwards signals and reaps\nprocesses. This field is omitted if empty, and the default (as\nconfigured on the daemon) is used.\n", + "nullable": true + }, + "PidsLimit": { + "type": "integer", + "description": "Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null`\nto not change.\n", + "format": "int64", + "nullable": true + }, + "Ulimits": { + "type": "array", + "description": "A list of resource limits to set in the container. For example:\n\n```\n{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}\n```\n", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of ulimit" + }, + "Soft": { + "type": "integer", + "description": "Soft limit" + }, + "Hard": { + "type": "integer", + "description": "Hard limit" + } + } + } + }, + "CpuCount": { + "type": "integer", + "description": "The number of usable CPUs (Windows only).\n\nOn Windows Server containers, the processor resource controls are\nmutually exclusive. The order of precedence is `CPUCount` first, then\n`CPUShares`, and `CPUPercent` last.\n", + "format": "int64" + }, + "CpuPercent": { + "type": "integer", + "description": "The usable percentage of the available CPUs (Windows only).\n\nOn Windows Server containers, the processor resource controls are\nmutually exclusive. The order of precedence is `CPUCount` first, then\n`CPUShares`, and `CPUPercent` last.\n", + "format": "int64" + }, + "IOMaximumIOps": { + "type": "integer", + "description": "Maximum IOps for the container system drive (Windows only)", + "format": "int64" + }, + "IOMaximumBandwidth": { + "type": "integer", + "description": "Maximum IO in bytes per second for the container system drive\n(Windows only).\n", + "format": "int64" + } + }, + "description": "A container's resources (cgroups config, ulimits, etc)" + }, + "Limit": { + "type": "object", + "properties": { + "NanoCPUs": { + "type": "integer", + "format": "int64", + "example": 4000000000 + }, + "MemoryBytes": { + "type": "integer", + "format": "int64", + "example": 8272408576 + }, + "Pids": { + "type": "integer", + "description": "Limits the maximum number of PIDs in the container. Set `0` for unlimited.\n", + "format": "int64", + "example": 100, + "default": 0 + } + }, + "description": "An object describing a limit on resources which can be requested by a task.\n" + }, + "ResourceObject": { + "type": "object", + "properties": { + "NanoCPUs": { + "type": "integer", + "format": "int64", + "example": 4000000000 + }, + "MemoryBytes": { + "type": "integer", + "format": "int64", + "example": 8272408576 + }, + "GenericResources": { + "$ref": "#/components/schemas/GenericResources" + } + }, + "description": "An object describing the resources which can be advertised by a node and\nrequested by a task.\n" + }, + "GenericResources": { + "type": "array", + "description": "User-defined resources can be either Integer resources (e.g, `SSD=3`) or\nString resources (e.g, `GPU=UUID1`).\n", + "example": [ + { + "DiscreteResourceSpec": { + "Kind": "SSD", + "Value": 3 + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID1" + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID2" + } + } + ], + "items": { + "type": "object", + "properties": { + "NamedResourceSpec": { + "type": "object", + "properties": { + "Kind": { + "type": "string" + }, + "Value": { + "type": "string" + } + } + }, + "DiscreteResourceSpec": { + "type": "object", + "properties": { + "Kind": { + "type": "string" + }, + "Value": { + "type": "integer", + "format": "int64" + } + } + } + } + } + }, + "HealthConfig": { + "type": "object", + "properties": { + "Test": { + "type": "array", + "description": "The test to perform. Possible values are:\n\n- `[]` inherit healthcheck from image or parent image\n- `[\"NONE\"]` disable healthcheck\n- `[\"CMD\", args...]` exec arguments directly\n- `[\"CMD-SHELL\", command]` run command with system's default shell\n", + "items": { + "type": "string" + } + }, + "Interval": { + "type": "integer", + "description": "The time to wait between checks in nanoseconds. It should be 0 or at\nleast 1000000 (1 ms). 0 means inherit.\n", + "format": "int64" + }, + "Timeout": { + "type": "integer", + "description": "The time to wait before considering the check to have hung. It should\nbe 0 or at least 1000000 (1 ms). 0 means inherit.\n", + "format": "int64" + }, + "Retries": { + "type": "integer", + "description": "The number of consecutive failures needed to consider a container as\nunhealthy. 0 means inherit.\n" + }, + "StartPeriod": { + "type": "integer", + "description": "Start period for the container to initialize before starting\nhealth-retries countdown in nanoseconds. It should be 0 or at least\n1000000 (1 ms). 0 means inherit.\n", + "format": "int64" + } + }, + "description": "A test to perform to check that the container is healthy." + }, + "Health": { + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "Status is one of `none`, `starting`, `healthy` or `unhealthy`\n\n- \"none\" Indicates there is no healthcheck\n- \"starting\" Starting indicates that the container is not yet ready\n- \"healthy\" Healthy indicates that the container is running correctly\n- \"unhealthy\" Unhealthy indicates that the container has a problem\n", + "example": "healthy", + "enum": [ + "none", + "starting", + "healthy", + "unhealthy" + ] + }, + "FailingStreak": { + "type": "integer", + "description": "FailingStreak is the number of consecutive failures", + "example": 0 + }, + "Log": { + "type": "array", + "description": "Log contains the last few results (oldest first)\n", + "items": { + "$ref": "#/components/schemas/HealthcheckResult" + } + } + }, + "description": "Health stores information about the container's healthcheck results.\n", + "nullable": true, + "x-nullable": true + }, + "HealthcheckResult": { + "type": "object", + "properties": { + "Start": { + "type": "string", + "description": "Date and time at which this check started in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "date-time", + "example": "2020-01-04T10:44:24.496525531Z" + }, + "End": { + "type": "string", + "description": "Date and time at which this check ended in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2020-01-04T10:45:21.364524523Z" + }, + "ExitCode": { + "type": "integer", + "description": "ExitCode meanings:\n\n- `0` healthy\n- `1` unhealthy\n- `2` reserved (considered unhealthy)\n- other values: error running probe\n", + "example": 0 + }, + "Output": { + "type": "string", + "description": "Output from last check" + } + }, + "description": "HealthcheckResult stores information about a single run of a healthcheck probe\n", + "nullable": true, + "x-nullable": true + }, + "HostConfig": { + "description": "Container configuration that depends on the host we are running on", + "allOf": [ + { + "$ref": "#/components/schemas/Resources" + }, + { + "type": "object", + "properties": { + "Binds": { + "type": "array", + "description": "A list of volume bindings for this container. Each volume binding\nis a string in one of these forms:\n\n- `host-src:container-dest[:options]` to bind-mount a host path\n into the container. Both `host-src`, and `container-dest` must\n be an _absolute_ path.\n- `volume-name:container-dest[:options]` to bind-mount a volume\n managed by a volume driver into the container. `container-dest`\n must be an _absolute_ path.\n\n`options` is an optional, comma-delimited list of:\n\n- `nocopy` disables automatic copying of data from the container\n path to the volume. The `nocopy` flag only applies to named volumes.\n- `[ro|rw]` mounts a volume read-only or read-write, respectively.\n If omitted or set to `rw`, volumes are mounted read-write.\n- `[z|Z]` applies SELinux labels to allow or deny multiple containers\n to read and write to the same volume.\n - `z`: a _shared_ content label is applied to the content. This\n label indicates that multiple containers can share the volume\n content, for both reading and writing.\n - `Z`: a _private unshared_ label is applied to the content.\n This label indicates that only the current container can use\n a private volume. Labeling systems such as SELinux require\n proper labels to be placed on volume content that is mounted\n into a container. Without a label, the security system can\n prevent a container's processes from using the content. By\n default, the labels set by the host operating system are not\n modified.\n- `[[r]shared|[r]slave|[r]private]` specifies mount\n [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt).\n This only applies to bind-mounted volumes, not internal volumes\n or named volumes. Mount propagation requires the source mount\n point (the location where the source directory is mounted in the\n host operating system) to have the correct propagation properties.\n For shared volumes, the source mount point must be set to `shared`.\n For slave volumes, the mount must be set to either `shared` or\n `slave`.\n", + "items": { + "type": "string" + } + }, + "ContainerIDFile": { + "type": "string", + "description": "Path to a file where the container ID is written" + }, + "LogConfig": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "enum": [ + "json-file", + "syslog", + "journald", + "gelf", + "fluentd", + "awslogs", + "splunk", + "etwlogs", + "none" + ] + }, + "Config": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "The logging configuration for this container" + }, + "NetworkMode": { + "type": "string", + "description": "Network mode to use for this container. Supported standard values\nare: `bridge`, `host`, `none`, and `container:`. Any\nother value is taken as a custom network's name to which this\ncontainer should connect to.\n" + }, + "PortBindings": { + "$ref": "#/components/schemas/PortMap" + }, + "RestartPolicy": { + "$ref": "#/components/schemas/RestartPolicy" + }, + "AutoRemove": { + "type": "boolean", + "description": "Automatically remove the container when the container's process\nexits. This has no effect if `RestartPolicy` is set.\n" + }, + "VolumeDriver": { + "type": "string", + "description": "Driver that this container uses to mount volumes." + }, + "VolumesFrom": { + "type": "array", + "description": "A list of volumes to inherit from another container, specified in\nthe form `[:]`.\n", + "items": { + "type": "string" + } + }, + "Mounts": { + "type": "array", + "description": "Specification for mounts to be added to the container.\n", + "items": { + "$ref": "#/components/schemas/Mount" + } + }, + "ConsoleSize": { + "maxItems": 2, + "minItems": 2, + "type": "array", + "description": "Initial console size, as an `[height, width]` array.\n", + "nullable": true, + "items": { + "minimum": 0, + "type": "integer" + } + }, + "Annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Arbitrary non-identifying metadata attached to container and\nprovided to the runtime when the container is started.\n" + }, + "CapAdd": { + "type": "array", + "description": "A list of kernel capabilities to add to the container. Conflicts\nwith option 'Capabilities'.\n", + "items": { + "type": "string" + } + }, + "CapDrop": { + "type": "array", + "description": "A list of kernel capabilities to drop from the container. Conflicts\nwith option 'Capabilities'.\n", + "items": { + "type": "string" + } + }, + "CgroupnsMode": { + "type": "string", + "description": "cgroup namespace mode for the container. Possible values are:\n\n- `\"private\"`: the container runs in its own private cgroup namespace\n- `\"host\"`: use the host system's cgroup namespace\n\nIf not specified, the daemon default is used, which can either be `\"private\"`\nor `\"host\"`, depending on daemon version, kernel support and configuration.\n", + "enum": [ + "private", + "host" + ] + }, + "Dns": { + "type": "array", + "description": "A list of DNS servers for the container to use.", + "items": { + "type": "string" + } + }, + "DnsOptions": { + "type": "array", + "description": "A list of DNS options.", + "items": { + "type": "string" + } + }, + "DnsSearch": { + "type": "array", + "description": "A list of DNS search domains.", + "items": { + "type": "string" + } + }, + "ExtraHosts": { + "type": "array", + "description": "A list of hostnames/IP mappings to add to the container's `/etc/hosts`\nfile. Specified in the form `[\"hostname:IP\"]`.\n", + "items": { + "type": "string" + } + }, + "GroupAdd": { + "type": "array", + "description": "A list of additional groups that the container process will run as.\n", + "items": { + "type": "string" + } + }, + "IpcMode": { + "type": "string", + "description": "IPC sharing mode for the container. Possible values are:\n\n- `\"none\"`: own private IPC namespace, with /dev/shm not mounted\n- `\"private\"`: own private IPC namespace\n- `\"shareable\"`: own private IPC namespace, with a possibility to share it with other containers\n- `\"container:\"`: join another (shareable) container's IPC namespace\n- `\"host\"`: use the host system's IPC namespace\n\nIf not specified, daemon default is used, which can either be `\"private\"`\nor `\"shareable\"`, depending on daemon version and configuration.\n" + }, + "Cgroup": { + "type": "string", + "description": "Cgroup to use for the container." + }, + "Links": { + "type": "array", + "description": "A list of links for the container in the form `container_name:alias`.\n", + "items": { + "type": "string" + } + }, + "OomScoreAdj": { + "type": "integer", + "description": "An integer value containing the score given to the container in\norder to tune OOM killer preferences.\n", + "example": 500 + }, + "PidMode": { + "type": "string", + "description": "Set the PID (Process) Namespace mode for the container. It can be\neither:\n\n- `\"container:\"`: joins another container's PID namespace\n- `\"host\"`: use the host's PID namespace inside the container\n" + }, + "Privileged": { + "type": "boolean", + "description": "Gives the container full access to the host." + }, + "PublishAllPorts": { + "type": "boolean", + "description": "Allocates an ephemeral host port for all of a container's\nexposed ports.\n\nPorts are de-allocated when the container stops and allocated when\nthe container starts. The allocated port might be changed when\nrestarting the container.\n\nThe port is selected from the ephemeral port range that depends on\nthe kernel. For example, on Linux the range is defined by\n`/proc/sys/net/ipv4/ip_local_port_range`.\n" + }, + "ReadonlyRootfs": { + "type": "boolean", + "description": "Mount the container's root filesystem as read only." + }, + "SecurityOpt": { + "type": "array", + "description": "A list of string values to customize labels for MLS systems, such\nas SELinux.\n", + "items": { + "type": "string" + } + }, + "StorageOpt": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Storage driver options for this container, in the form `{\"size\": \"120G\"}`.\n" + }, + "Tmpfs": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of container directories which should be replaced by tmpfs\nmounts, and their corresponding mount options. For example:\n\n```\n{ \"/run\": \"rw,noexec,nosuid,size=65536k\" }\n```\n" + }, + "UTSMode": { + "type": "string", + "description": "UTS namespace to use for the container." + }, + "UsernsMode": { + "type": "string", + "description": "Sets the usernamespace mode for the container when usernamespace\nremapping option is enabled.\n" + }, + "ShmSize": { + "minimum": 0, + "type": "integer", + "description": "Size of `/dev/shm` in bytes. If omitted, the system uses 64MB.\n", + "format": "int64" + }, + "Sysctls": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A list of kernel parameters (sysctls) to set in the container.\nFor example:\n\n```\n{\"net.ipv4.ip_forward\": \"1\"}\n```\n" + }, + "Runtime": { + "type": "string", + "description": "Runtime to use with this container." + }, + "Isolation": { + "type": "string", + "description": "Isolation technology of the container. (Windows only)\n", + "enum": [ + "default", + "process", + "hyperv" + ] + }, + "MaskedPaths": { + "type": "array", + "description": "The list of paths to be masked inside the container (this overrides\nthe default set of paths).\n", + "items": { + "type": "string" + } + }, + "ReadonlyPaths": { + "type": "array", + "description": "The list of paths to be set as read-only inside the container\n(this overrides the default set of paths).\n", + "items": { + "type": "string" + } + } + } + } + ] + }, + "ContainerConfig": { + "type": "object", + "properties": { + "Hostname": { + "type": "string", + "description": "The hostname to use for the container, as a valid RFC 1123 hostname.\n", + "example": "439f4e91bd1d" + }, + "Domainname": { + "type": "string", + "description": "The domain name to use for the container.\n" + }, + "User": { + "type": "string", + "description": "The user that commands are run as inside the container." + }, + "AttachStdin": { + "type": "boolean", + "description": "Whether to attach to `stdin`.", + "default": false + }, + "AttachStdout": { + "type": "boolean", + "description": "Whether to attach to `stdout`.", + "default": true + }, + "AttachStderr": { + "type": "boolean", + "description": "Whether to attach to `stderr`.", + "default": true + }, + "ExposedPorts": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "An object mapping ports to an empty object in the form:\n\n`{\"/\": {}}`\n", + "nullable": true, + "example": { + "80/tcp": {}, + "443/tcp": {} + } + }, + "Tty": { + "type": "boolean", + "description": "Attach standard streams to a TTY, including `stdin` if it is not closed.\n", + "default": false + }, + "OpenStdin": { + "type": "boolean", + "description": "Open `stdin`", + "default": false + }, + "StdinOnce": { + "type": "boolean", + "description": "Close `stdin` after one attached client disconnects", + "default": false + }, + "Env": { + "type": "array", + "description": "A list of environment variables to set inside the container in the\nform `[\"VAR=value\", ...]`. A variable without `=` is removed from the\nenvironment, rather than to have an empty value.\n", + "example": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "items": { + "type": "string" + } + }, + "Cmd": { + "type": "array", + "description": "Command to run specified as a string or an array of strings.\n", + "example": [ + "/bin/sh" + ], + "items": { + "type": "string" + } + }, + "Healthcheck": { + "$ref": "#/components/schemas/HealthConfig" + }, + "ArgsEscaped": { + "type": "boolean", + "description": "Command is already escaped (Windows only)", + "nullable": true, + "example": false, + "default": false + }, + "Image": { + "type": "string", + "description": "The name (or reference) of the image to use when creating the container,\nor which was used when the container was created.\n", + "example": "example-image:1.0" + }, + "Volumes": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "An object mapping mount point paths inside the container to empty\nobjects.\n" + }, + "WorkingDir": { + "type": "string", + "description": "The working directory for commands to run in.", + "example": "/public/" + }, + "Entrypoint": { + "type": "array", + "description": "The entry point for the container as a string or an array of strings.\n\nIf the array consists of exactly one empty string (`[\"\"]`) then the\nentry point is reset to system default (i.e., the entry point used by\ndocker when there is no `ENTRYPOINT` instruction in the `Dockerfile`).\n", + "example": [], + "items": { + "type": "string" + } + }, + "NetworkDisabled": { + "type": "boolean", + "description": "Disable networking for the container.", + "nullable": true + }, + "MacAddress": { + "type": "string", + "description": "MAC address of the container.", + "nullable": true + }, + "OnBuild": { + "type": "array", + "description": "`ONBUILD` metadata that were defined in the image's `Dockerfile`.\n", + "nullable": true, + "example": [], + "items": { + "type": "string" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "StopSignal": { + "type": "string", + "description": "Signal to stop a container as a string or unsigned integer.\n", + "nullable": true, + "example": "SIGTERM" + }, + "StopTimeout": { + "type": "integer", + "description": "Timeout to stop a container in seconds.", + "nullable": true + }, + "Shell": { + "type": "array", + "description": "Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell.\n", + "nullable": true, + "example": [ + "/bin/sh", + "-c" + ], + "items": { + "type": "string" + } + } + }, + "description": "Configuration for a container that is portable between hosts.\n\nWhen used as `ContainerConfig` field in an image, `ContainerConfig` is an\noptional field containing the configuration of the container that was last\ncommitted when creating the image.\n\nPrevious versions of Docker builder used this field to store build cache,\nand it is not in active use anymore.\n" + }, + "NetworkingConfig": { + "type": "object", + "properties": { + "EndpointsConfig": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + }, + "description": "A mapping of network name to endpoint configuration for that network.\n" + } + }, + "description": "NetworkingConfig represents the container's networking configuration for\neach of its interfaces.\nIt is used for the networking configs specified in the `docker create`\nand `docker network connect` commands.\n", + "example": { + "EndpointsConfig": { + "isolated_nw": { + "IPAMConfig": { + "IPv4Address": "172.20.30.33", + "IPv6Address": "2001:db8:abcd::3033", + "LinkLocalIPs": [ + "169.254.34.68", + "fe80::3468" + ] + }, + "Links": [ + "container_1", + "container_2" + ], + "Aliases": [ + "server_x", + "server_y" + ] + } + } + } + }, + "NetworkSettings": { + "type": "object", + "properties": { + "Bridge": { + "type": "string", + "description": "Name of the network's bridge (for example, `docker0`).", + "example": "docker0" + }, + "SandboxID": { + "type": "string", + "description": "SandboxID uniquely represents a container's network stack.", + "example": "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3" + }, + "HairpinMode": { + "type": "boolean", + "description": "Indicates if hairpin NAT should be enabled on the virtual interface.\n", + "example": false + }, + "LinkLocalIPv6Address": { + "type": "string", + "description": "IPv6 unicast address using the link-local prefix.", + "example": "fe80::42:acff:fe11:1" + }, + "LinkLocalIPv6PrefixLen": { + "type": "integer", + "description": "Prefix length of the IPv6 unicast address.", + "example": 64 + }, + "Ports": { + "$ref": "#/components/schemas/PortMap" + }, + "SandboxKey": { + "type": "string", + "description": "SandboxKey identifies the sandbox", + "example": "/var/run/docker/netns/8ab54b426c38" + }, + "SecondaryIPAddresses": { + "type": "array", + "description": "", + "nullable": true, + "items": { + "$ref": "#/components/schemas/Address" + } + }, + "SecondaryIPv6Addresses": { + "type": "array", + "description": "", + "nullable": true, + "items": { + "$ref": "#/components/schemas/Address" + } + }, + "EndpointID": { + "type": "string", + "description": "EndpointID uniquely represents a service endpoint in a Sandbox.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + }, + "Gateway": { + "type": "string", + "description": "Gateway address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "172.17.0.1" + }, + "GlobalIPv6Address": { + "type": "string", + "description": "Global IPv6 address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "2001:db8::5689" + }, + "GlobalIPv6PrefixLen": { + "type": "integer", + "description": "Mask length of the global IPv6 address.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": 64 + }, + "IPAddress": { + "type": "string", + "description": "IPv4 address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "172.17.0.4" + }, + "IPPrefixLen": { + "type": "integer", + "description": "Mask length of the IPv4 address.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": 16 + }, + "IPv6Gateway": { + "type": "string", + "description": "IPv6 gateway address for this network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "2001:db8:2::100" + }, + "MacAddress": { + "type": "string", + "description": "MAC address for the container on the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "02:42:ac:11:00:04" + }, + "Networks": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + }, + "description": "Information about all networks that the container is connected to.\n" + } + }, + "description": "NetworkSettings exposes the network settings in the API" + }, + "Address": { + "type": "object", + "properties": { + "Addr": { + "type": "string", + "description": "IP address." + }, + "PrefixLen": { + "type": "integer", + "description": "Mask length of the IP address." + } + }, + "description": "Address represents an IPv4 or IPv6 IP address." + }, + "PortMap": { + "type": "object", + "additionalProperties": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/PortBinding" + } + }, + "description": "PortMap describes the mapping of container ports to host ports, using the\ncontainer's port-number and protocol as key in the format `/`,\nfor example, `80/udp`.\n\nIf a container's port is mapped for multiple protocols, separate entries\nare added to the mapping table.\n", + "example": { + "443/tcp": [ + { + "HostIp": "127.0.0.1", + "HostPort": "4443" + } + ], + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "80" + }, + { + "HostIp": "0.0.0.0", + "HostPort": "8080" + } + ], + "80/udp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "80" + } + ], + "53/udp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "53" + } + ] + } + }, + "PortBinding": { + "type": "object", + "properties": { + "HostIp": { + "type": "string", + "description": "Host IP address that the container's port is mapped to.", + "example": "127.0.0.1" + }, + "HostPort": { + "type": "string", + "description": "Host port number that the container's port is mapped to.", + "example": "4443" + } + }, + "description": "PortBinding represents a binding between a host IP address and a host\nport.\n" + }, + "GraphDriverData": { + "required": [ + "Data", + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the storage driver.", + "nullable": false, + "example": "overlay2" + }, + "Data": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Low-level storage metadata, provided as key/value pairs.\n\nThis information is driver-specific, and depends on the storage-driver\nin use, and should be used for informational purposes only.\n", + "nullable": false, + "example": { + "MergedDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/merged", + "UpperDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/diff", + "WorkDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/work" + } + } + }, + "description": "Information about the storage driver used to store the container's and\nimage's filesystem.\n" + }, + "FilesystemChange": { + "required": [ + "Kind", + "Path" + ], + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Path to file or directory that has changed.\n", + "nullable": false + }, + "Kind": { + "$ref": "#/components/schemas/ChangeType" + } + }, + "description": "Change in the container's filesystem.\n" + }, + "ChangeType": { + "type": "integer", + "description": "Kind of change\n\nCan be one of:\n\n- `0`: Modified (\"C\")\n- `1`: Added (\"A\")\n- `2`: Deleted (\"D\")\n", + "format": "uint8", + "nullable": false, + "enum": [ + 0, + 1, + 2 + ], + "x-nullable": false + }, + "ImageInspect": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "ID is the content-addressable ID of an image.\n\nThis identifier is a content-addressable digest calculated from the\nimage's configuration (which includes the digests of layers used by\nthe image).\n\nNote that this digest differs from the `RepoDigests` below, which\nholds digests of image manifests that reference the image.\n", + "nullable": false, + "example": "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + }, + "RepoTags": { + "type": "array", + "description": "List of image names/tags in the local image cache that reference this\nimage.\n\nMultiple image tags can refer to the same image, and this list may be\nempty if no tags reference the image, in which case the image is\n\"untagged\", in which case it can still be referenced by its ID.\n", + "example": [ + "example:1.0", + "example:latest", + "example:stable", + "internal.registry.example.com:5000/example:1.0" + ], + "items": { + "type": "string" + } + }, + "RepoDigests": { + "type": "array", + "description": "List of content-addressable digests of locally available image manifests\nthat the image is referenced from. Multiple manifests can refer to the\nsame image.\n\nThese digests are usually only available if the image was either pulled\nfrom a registry, or if the image was pushed to a registry, which is when\nthe manifest is generated and its digest calculated.\n", + "example": [ + "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", + "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + ], + "items": { + "type": "string" + } + }, + "Parent": { + "type": "string", + "description": "ID of the parent image.\n\nDepending on how the image was created, this field may be empty and\nis only set for images that were built/created locally. This field\nis empty if the image was pulled from an image registry.\n", + "nullable": false, + "example": "" + }, + "Comment": { + "type": "string", + "description": "Optional message that was set when committing or importing the image.\n", + "nullable": false, + "example": "" + }, + "Created": { + "type": "string", + "description": "Date and time at which the image was created, formatted in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "nullable": false, + "example": "2022-02-04T21:20:12.497794809Z" + }, + "Container": { + "type": "string", + "description": "The ID of the container that was used to create the image.\n\nDepending on how the image was created, this field may be empty.\n", + "nullable": false, + "example": "65974bc86f1770ae4bff79f651ebdbce166ae9aada632ee3fa9af3a264911735" + }, + "ContainerConfig": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "DockerVersion": { + "type": "string", + "description": "The version of Docker that was used to build the image.\n\nDepending on how the image was created, this field may be empty.\n", + "nullable": false, + "example": "20.10.7" + }, + "Author": { + "type": "string", + "description": "Name of the author that was specified when committing the image, or as\nspecified through MAINTAINER (deprecated) in the Dockerfile.\n", + "nullable": false, + "example": "" + }, + "Config": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "Architecture": { + "type": "string", + "description": "Hardware CPU architecture that the image runs on.\n", + "nullable": false, + "example": "arm" + }, + "Variant": { + "type": "string", + "description": "CPU architecture variant (presently ARM-only).\n", + "nullable": true, + "example": "v7" + }, + "Os": { + "type": "string", + "description": "Operating System the image is built to run on.\n", + "nullable": false, + "example": "linux" + }, + "OsVersion": { + "type": "string", + "description": "Operating System version the image is built to run on (especially\nfor Windows).\n", + "nullable": true, + "example": "" + }, + "Size": { + "type": "integer", + "description": "Total size of the image including all layers it is composed of.\n", + "format": "int64", + "nullable": false, + "example": 1239828 + }, + "VirtualSize": { + "type": "integer", + "description": "Total size of the image including all layers it is composed of.\n\nIn versions of Docker before v1.10, this field was calculated from\nthe image itself and all of its parent images. Images are now stored\nself-contained, and no longer use a parent-chain, making this field\nan equivalent of the Size field.\n\n> **Deprecated**: this field is kept for backward compatibility, but\n> will be removed in API v1.44.\n", + "format": "int64", + "example": 1239828 + }, + "GraphDriver": { + "$ref": "#/components/schemas/GraphDriverData" + }, + "RootFS": { + "required": [ + "Type" + ], + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": false, + "example": "layers" + }, + "Layers": { + "type": "array", + "example": [ + "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6", + "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" + ], + "items": { + "type": "string" + } + } + }, + "description": "Information about the image's RootFS, including the layer IDs.\n" + }, + "Metadata": { + "type": "object", + "properties": { + "LastTagTime": { + "type": "string", + "description": "Date and time at which the image was last tagged in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n\nThis information is only available if the image was tagged locally,\nand omitted otherwise.\n", + "format": "dateTime", + "nullable": true, + "example": "2022-02-28T14:40:02.623929178Z" + } + }, + "description": "Additional metadata of the image in the local cache. This information\nis local to the daemon, and not part of the image itself.\n" + } + }, + "description": "Information about an image in the local image cache.\n" + }, + "ImageSummary": { + "required": [ + "Containers", + "Created", + "Id", + "Labels", + "ParentId", + "RepoDigests", + "RepoTags", + "SharedSize", + "Size" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "ID is the content-addressable ID of an image.\n\nThis identifier is a content-addressable digest calculated from the\nimage's configuration (which includes the digests of layers used by\nthe image).\n\nNote that this digest differs from the `RepoDigests` below, which\nholds digests of image manifests that reference the image.\n", + "nullable": false, + "example": "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + }, + "ParentId": { + "type": "string", + "description": "ID of the parent image.\n\nDepending on how the image was created, this field may be empty and\nis only set for images that were built/created locally. This field\nis empty if the image was pulled from an image registry.\n", + "nullable": false, + "example": "" + }, + "RepoTags": { + "type": "array", + "description": "List of image names/tags in the local image cache that reference this\nimage.\n\nMultiple image tags can refer to the same image, and this list may be\nempty if no tags reference the image, in which case the image is\n\"untagged\", in which case it can still be referenced by its ID.\n", + "nullable": false, + "example": [ + "example:1.0", + "example:latest", + "example:stable", + "internal.registry.example.com:5000/example:1.0" + ], + "items": { + "type": "string" + } + }, + "RepoDigests": { + "type": "array", + "description": "List of content-addressable digests of locally available image manifests\nthat the image is referenced from. Multiple manifests can refer to the\nsame image.\n\nThese digests are usually only available if the image was either pulled\nfrom a registry, or if the image was pushed to a registry, which is when\nthe manifest is generated and its digest calculated.\n", + "nullable": false, + "example": [ + "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", + "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + ], + "items": { + "type": "string" + } + }, + "Created": { + "type": "integer", + "description": "Date and time at which the image was created as a Unix timestamp\n(number of seconds sinds EPOCH).\n", + "nullable": false, + "example": 1644009612 + }, + "Size": { + "type": "integer", + "description": "Total size of the image including all layers it is composed of.\n", + "format": "int64", + "nullable": false, + "example": 172064416 + }, + "SharedSize": { + "type": "integer", + "description": "Total size of image layers that are shared between this image and other\nimages.\n\nThis size is not calculated by default. `-1` indicates that the value\nhas not been set / calculated.\n", + "format": "int64", + "nullable": false, + "example": 1239828 + }, + "VirtualSize": { + "type": "integer", + "description": "Total size of the image including all layers it is composed of.\n\nIn versions of Docker before v1.10, this field was calculated from\nthe image itself and all of its parent images. Images are now stored\nself-contained, and no longer use a parent-chain, making this field\nan equivalent of the Size field.\n\nDeprecated: this field is kept for backward compatibility, and will be removed in API v1.44.", + "format": "int64", + "example": 172064416 + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "nullable": false, + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "Containers": { + "type": "integer", + "description": "Number of containers using this image. Includes both stopped and running\ncontainers.\n\nThis size is not calculated by default, and depends on which API endpoint\nis used. `-1` indicates that the value has not been set / calculated.\n", + "nullable": false, + "example": 2 + } + } + }, + "AuthConfig": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "email": { + "type": "string" + }, + "serveraddress": { + "type": "string" + } + }, + "example": { + "username": "hannibal", + "password": "xxxx", + "serveraddress": "https://index.docker.io/v1/" + } + }, + "ProcessConfig": { + "type": "object", + "properties": { + "privileged": { + "type": "boolean" + }, + "user": { + "type": "string" + }, + "tty": { + "type": "boolean" + }, + "entrypoint": { + "type": "string" + }, + "arguments": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Volume": { + "required": [ + "Driver", + "Labels", + "Mountpoint", + "Name", + "Options", + "Scope" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the volume.", + "nullable": false, + "example": "tardis" + }, + "Driver": { + "type": "string", + "description": "Name of the volume driver used by the volume.", + "nullable": false, + "example": "custom" + }, + "Mountpoint": { + "type": "string", + "description": "Mount path of the volume on the host.", + "nullable": false, + "example": "/var/lib/docker/volumes/tardis" + }, + "CreatedAt": { + "type": "string", + "description": "Date/Time the volume was created.", + "format": "dateTime", + "example": "2016-06-07T20:31:11.853781916Z" + }, + "Status": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "Low-level details about the volume, provided by the volume driver.\nDetails are returned as a map with key/value pairs:\n`{\"key\":\"value\",\"key2\":\"value2\"}`.\n\nThe `Status` field is optional, and is omitted if the volume driver\ndoes not support this feature.\n", + "example": { + "hello": "world" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "nullable": false, + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "Scope": { + "type": "string", + "description": "The level at which the volume exists. Either `global` for cluster-wide,\nor `local` for machine level.\n", + "nullable": false, + "example": "local", + "default": "local", + "enum": [ + "local", + "global" + ] + }, + "ClusterVolume": { + "$ref": "#/components/schemas/ClusterVolume" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The driver specific options used when creating the volume.\n", + "example": { + "device": "tmpfs", + "o": "size=100m,uid=1000", + "type": "tmpfs" + } + }, + "UsageData": { + "required": [ + "RefCount", + "Size" + ], + "type": "object", + "properties": { + "Size": { + "type": "integer", + "description": "Amount of disk space used by the volume (in bytes). This information\nis only available for volumes created with the `\"local\"` volume\ndriver. For volumes created with other volume drivers, this field\nis set to `-1` (\"not available\")\n", + "format": "int64", + "nullable": false, + "default": -1 + }, + "RefCount": { + "type": "integer", + "description": "The number of containers referencing this volume. This field\nis set to `-1` if the reference-count is not available.\n", + "format": "int64", + "nullable": false, + "default": -1 + } + }, + "description": "Usage details about the volume. This information is used by the\n`GET /system/df` endpoint, and omitted in other endpoints.\n", + "nullable": true, + "x-go-name": "UsageData" + } + } + }, + "VolumeCreateOptions": { + "title": "VolumeConfig", + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The new volume's name. If not specified, Docker generates a name.\n", + "nullable": false, + "example": "tardis" + }, + "Driver": { + "type": "string", + "description": "Name of the volume driver to use.", + "nullable": false, + "example": "custom", + "default": "local" + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A mapping of driver options and values. These options are\npassed directly to the driver and are driver specific.\n", + "example": { + "device": "tmpfs", + "o": "size=100m,uid=1000", + "type": "tmpfs" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "ClusterVolumeSpec": { + "$ref": "#/components/schemas/ClusterVolumeSpec" + } + }, + "description": "Volume configuration", + "x-go-name": "CreateOptions" + }, + "VolumeListResponse": { + "title": "VolumeListResponse", + "type": "object", + "properties": { + "Volumes": { + "type": "array", + "description": "List of volumes", + "items": { + "$ref": "#/components/schemas/Volume" + } + }, + "Warnings": { + "type": "array", + "description": "Warnings that occurred when fetching the list of volumes.\n", + "example": [], + "items": { + "type": "string" + } + } + }, + "description": "Volume list response", + "x-go-name": "ListResponse" + }, + "Network": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Id": { + "type": "string" + }, + "Created": { + "type": "string", + "format": "dateTime" + }, + "Scope": { + "type": "string" + }, + "Driver": { + "type": "string" + }, + "EnableIPv6": { + "type": "boolean" + }, + "IPAM": { + "$ref": "#/components/schemas/IPAM" + }, + "Internal": { + "type": "boolean" + }, + "Attachable": { + "type": "boolean" + }, + "Ingress": { + "type": "boolean" + }, + "Containers": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/NetworkContainer" + } + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "example": { + "Name": "net01", + "Id": "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99", + "Created": "2016-10-19T04:33:30.360899459Z", + "Scope": "local", + "Driver": "bridge", + "EnableIPv6": false, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.19.0.0/16", + "Gateway": "172.19.0.1" + } + ], + "Options": { + "foo": "bar" + } + }, + "Internal": false, + "Attachable": false, + "Ingress": false, + "Containers": { + "19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c": { + "Name": "test", + "EndpointID": "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a", + "MacAddress": "02:42:ac:13:00:02", + "IPv4Address": "172.19.0.2/16", + "IPv6Address": "" + } + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + }, + "IPAM": { + "type": "object", + "properties": { + "Driver": { + "type": "string", + "description": "Name of the IPAM driver to use.", + "default": "default" + }, + "Config": { + "type": "array", + "description": "List of IPAM configuration options, specified as a map:\n\n```\n{\"Subnet\": , \"IPRange\": , \"Gateway\": , \"AuxAddress\": }\n```\n", + "items": { + "$ref": "#/components/schemas/IPAMConfig" + } + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver-specific options, specified as a map." + } + } + }, + "IPAMConfig": { + "type": "object", + "properties": { + "Subnet": { + "type": "string" + }, + "IPRange": { + "type": "string" + }, + "Gateway": { + "type": "string" + }, + "AuxiliaryAddresses": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "NetworkContainer": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "EndpointID": { + "type": "string" + }, + "MacAddress": { + "type": "string" + }, + "IPv4Address": { + "type": "string" + }, + "IPv6Address": { + "type": "string" + } + } + }, + "BuildInfo": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "stream": { + "type": "string" + }, + "error": { + "type": "string" + }, + "errorDetail": { + "$ref": "#/components/schemas/ErrorDetail" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + }, + "aux": { + "$ref": "#/components/schemas/ImageID" + } + } + }, + "BuildCache": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Unique ID of the build cache record.\n", + "example": "ndlpt0hhvkqcdfkputsk4cq9c" + }, + "Parent": { + "type": "string", + "description": "ID of the parent build cache record.\n\n> **Deprecated**: This field is deprecated, and omitted if empty.\n", + "nullable": true, + "example": "" + }, + "Parents": { + "type": "array", + "description": "List of parent build cache record IDs.\n", + "nullable": true, + "example": [ + "hw53o5aio51xtltp5xjp8v7fx" + ], + "items": { + "type": "string" + } + }, + "Type": { + "type": "string", + "description": "Cache record type.\n", + "example": "regular", + "enum": [ + "internal", + "frontend", + "source.local", + "source.git.checkout", + "exec.cachemount", + "regular" + ] + }, + "Description": { + "type": "string", + "description": "Description of the build-step that produced the build cache.\n", + "example": "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache" + }, + "InUse": { + "type": "boolean", + "description": "Indicates if the build cache is in use.\n", + "example": false + }, + "Shared": { + "type": "boolean", + "description": "Indicates if the build cache is shared.\n", + "example": true + }, + "Size": { + "type": "integer", + "description": "Amount of disk space used by the build cache (in bytes).\n", + "example": 51 + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the build cache was created in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "LastUsedAt": { + "type": "string", + "description": "Date and time at which the build cache was last used in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "nullable": true, + "example": "2017-08-09T07:09:37.632105588Z" + }, + "UsageCount": { + "type": "integer", + "example": 26 + } + }, + "description": "BuildCache contains information about a build cache record.\n" + }, + "ImageID": { + "type": "object", + "properties": { + "ID": { + "type": "string" + } + }, + "description": "Image ID or Digest", + "example": { + "ID": "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" + } + }, + "CreateImageInfo": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "error": { + "type": "string" + }, + "errorDetail": { + "$ref": "#/components/schemas/ErrorDetail" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + } + } + }, + "PushImageInfo": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + } + } + }, + "ErrorDetail": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + }, + "ProgressDetail": { + "type": "object", + "properties": { + "current": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "ErrorResponse": { + "required": [ + "message" + ], + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "The error message.", + "nullable": false + } + }, + "description": "Represents an error.", + "example": { + "message": "Something went wrong." + } + }, + "IdResponse": { + "required": [ + "Id" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The id of the newly created object.", + "nullable": false + } + }, + "description": "Response to an API call that returns just an Id" + }, + "EndpointSettings": { + "type": "object", + "properties": { + "IPAMConfig": { + "$ref": "#/components/schemas/EndpointIPAMConfig" + }, + "Links": { + "type": "array", + "example": [ + "container_1", + "container_2" + ], + "items": { + "type": "string" + } + }, + "Aliases": { + "type": "array", + "example": [ + "server_x", + "server_y" + ], + "items": { + "type": "string" + } + }, + "NetworkID": { + "type": "string", + "description": "Unique ID of the network.\n", + "example": "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a" + }, + "EndpointID": { + "type": "string", + "description": "Unique ID for the service endpoint in a Sandbox.\n", + "example": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + }, + "Gateway": { + "type": "string", + "description": "Gateway address for this network.\n", + "example": "172.17.0.1" + }, + "IPAddress": { + "type": "string", + "description": "IPv4 address.\n", + "example": "172.17.0.4" + }, + "IPPrefixLen": { + "type": "integer", + "description": "Mask length of the IPv4 address.\n", + "example": 16 + }, + "IPv6Gateway": { + "type": "string", + "description": "IPv6 gateway address.\n", + "example": "2001:db8:2::100" + }, + "GlobalIPv6Address": { + "type": "string", + "description": "Global IPv6 address.\n", + "example": "2001:db8::5689" + }, + "GlobalIPv6PrefixLen": { + "type": "integer", + "description": "Mask length of the global IPv6 address.\n", + "format": "int64", + "example": 64 + }, + "MacAddress": { + "type": "string", + "description": "MAC address for the endpoint on this network.\n", + "example": "02:42:ac:11:00:04" + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "DriverOpts is a mapping of driver options and values. These options\nare passed directly to the driver and are driver specific.\n", + "nullable": true, + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + }, + "description": "Configuration for a network endpoint." + }, + "EndpointIPAMConfig": { + "type": "object", + "properties": { + "IPv4Address": { + "type": "string", + "example": "172.20.30.33" + }, + "IPv6Address": { + "type": "string", + "example": "2001:db8:abcd::3033" + }, + "LinkLocalIPs": { + "type": "array", + "example": [ + "169.254.34.68", + "fe80::3468" + ], + "items": { + "type": "string" + } + } + }, + "description": "EndpointIPAMConfig represents an endpoint's IPAM configuration.\n", + "nullable": true, + "x-nullable": true + }, + "PluginMount": { + "required": [ + "Description", + "Destination", + "Name", + "Options", + "Settable", + "Source", + "Type" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false, + "example": "some-mount" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "This is a mount that's used by the plugin." + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Source": { + "type": "string", + "example": "/var/lib/docker/plugins/" + }, + "Destination": { + "type": "string", + "nullable": false, + "example": "/mnt/state" + }, + "Type": { + "type": "string", + "nullable": false, + "example": "bind" + }, + "Options": { + "type": "array", + "example": [ + "rbind", + "rw" + ], + "items": { + "type": "string" + } + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginDevice": { + "required": [ + "Description", + "Name", + "Path", + "Settable" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false + }, + "Description": { + "type": "string", + "nullable": false + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Path": { + "type": "string", + "example": "/dev/fuse" + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginEnv": { + "required": [ + "Description", + "Name", + "Settable", + "Value" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false + }, + "Description": { + "type": "string", + "nullable": false + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Value": { + "type": "string" + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginInterfaceType": { + "required": [ + "Capability", + "Prefix", + "Version" + ], + "type": "object", + "properties": { + "Prefix": { + "type": "string", + "nullable": false + }, + "Capability": { + "type": "string", + "nullable": false + }, + "Version": { + "type": "string", + "nullable": false + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginPrivilege": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "example": "network" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "example": [ + "host" + ], + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission the user has to accept upon installing\nthe plugin.\n", + "x-go-name": "PluginPrivilege" + }, + "Plugin": { + "required": [ + "Config", + "Enabled", + "Name", + "Settings" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "example": "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" + }, + "Name": { + "type": "string", + "nullable": false, + "example": "tiborvass/sample-volume-plugin" + }, + "Enabled": { + "type": "boolean", + "description": "True if the plugin is running. False if the plugin is not running, only installed.", + "nullable": false, + "example": true + }, + "Settings": { + "required": [ + "Args", + "Devices", + "Env", + "Mounts" + ], + "type": "object", + "properties": { + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginMount" + } + }, + "Env": { + "type": "array", + "example": [ + "DEBUG=0" + ], + "items": { + "type": "string" + } + }, + "Args": { + "type": "array", + "items": { + "type": "string" + } + }, + "Devices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginDevice" + } + } + }, + "description": "Settings that can be modified by users.", + "nullable": false + }, + "PluginReference": { + "type": "string", + "description": "plugin remote reference used to push/pull the plugin", + "nullable": false, + "example": "localhost:5000/tiborvass/sample-volume-plugin:latest" + }, + "Config": { + "required": [ + "Args", + "Description", + "Documentation", + "Entrypoint", + "Env", + "Interface", + "IpcHost", + "Linux", + "Mounts", + "Network", + "PidHost", + "PropagatedMount", + "WorkDir" + ], + "type": "object", + "properties": { + "DockerVersion": { + "type": "string", + "description": "Docker Version used to create the plugin", + "nullable": false, + "example": "17.06.0-ce" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "A sample volume plugin for Docker" + }, + "Documentation": { + "type": "string", + "nullable": false, + "example": "https://docs.docker.com/engine/extend/plugins/" + }, + "Interface": { + "required": [ + "Socket", + "Types" + ], + "type": "object", + "properties": { + "Types": { + "type": "array", + "example": [ + "docker.volumedriver/1.0" + ], + "items": { + "$ref": "#/components/schemas/PluginInterfaceType" + } + }, + "Socket": { + "type": "string", + "nullable": false, + "example": "plugins.sock" + }, + "ProtocolScheme": { + "type": "string", + "description": "Protocol to use for clients connecting to the plugin.", + "example": "some.protocol/v1.0", + "enum": [ + "", + "moby.plugins.http/v1" + ] + } + }, + "description": "The interface between Docker and the plugin", + "nullable": false + }, + "Entrypoint": { + "type": "array", + "example": [ + "/usr/bin/sample-volume-plugin", + "/data" + ], + "items": { + "type": "string" + } + }, + "WorkDir": { + "type": "string", + "nullable": false, + "example": "/bin/" + }, + "User": { + "type": "object", + "properties": { + "UID": { + "type": "integer", + "format": "uint32", + "example": 1000 + }, + "GID": { + "type": "integer", + "format": "uint32", + "example": 1000 + } + }, + "nullable": false + }, + "Network": { + "required": [ + "Type" + ], + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": false, + "example": "host" + } + }, + "nullable": false + }, + "Linux": { + "required": [ + "AllowAllDevices", + "Capabilities", + "Devices" + ], + "type": "object", + "properties": { + "Capabilities": { + "type": "array", + "example": [ + "CAP_SYS_ADMIN", + "CAP_SYSLOG" + ], + "items": { + "type": "string" + } + }, + "AllowAllDevices": { + "type": "boolean", + "nullable": false, + "example": false + }, + "Devices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginDevice" + } + } + }, + "nullable": false + }, + "PropagatedMount": { + "type": "string", + "nullable": false, + "example": "/mnt/volumes" + }, + "IpcHost": { + "type": "boolean", + "nullable": false, + "example": false + }, + "PidHost": { + "type": "boolean", + "nullable": false, + "example": false + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginMount" + } + }, + "Env": { + "type": "array", + "example": [ + { + "Name": "DEBUG", + "Description": "If set, prints debug messages", + "Value": "0" + } + ], + "items": { + "$ref": "#/components/schemas/PluginEnv" + } + }, + "Args": { + "required": [ + "Description", + "Name", + "Settable", + "Value" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false, + "example": "args" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "command line arguments" + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "nullable": false + }, + "rootfs": { + "type": "object", + "properties": { + "type": { + "type": "string", + "example": "layers" + }, + "diff_ids": { + "type": "array", + "example": [ + "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887", + "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" + ], + "items": { + "type": "string" + } + } + } + } + }, + "description": "The config of a plugin.", + "nullable": false + } + }, + "description": "A plugin for the Engine API" + }, + "ObjectVersion": { + "type": "object", + "properties": { + "Index": { + "type": "integer", + "format": "uint64", + "example": 373531 + } + }, + "description": "The version number of the object such as node, service, etc. This is needed\nto avoid conflicting writes. The client must send the version number along\nwith the modified specification when updating these objects.\n\nThis approach ensures safe concurrency and determinism in that the change\non the object may not be applied if the version number has changed from the\nlast read. In other words, if two update requests specify the same base\nversion, only one of the requests can succeed. As a result, two separate\nupdate requests that happen at the same time will not unintentionally\noverwrite each other.\n" + }, + "NodeSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name for the node.", + "example": "my-node" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Role": { + "type": "string", + "description": "Role of the node.", + "example": "manager", + "enum": [ + "worker", + "manager" + ] + }, + "Availability": { + "type": "string", + "description": "Availability of the node.", + "example": "active", + "enum": [ + "active", + "pause", + "drain" + ] + } + }, + "example": { + "Availability": "active", + "Name": "node-name", + "Role": "manager", + "Labels": { + "foo": "bar" + } + } + }, + "Node": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "example": "24ifsmvkjbyhk" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the node was added to the swarm in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "UpdatedAt": { + "type": "string", + "description": "Date and time at which the node was last updated in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2017-08-09T07:09:37.632105588Z" + }, + "Spec": { + "$ref": "#/components/schemas/NodeSpec" + }, + "Description": { + "$ref": "#/components/schemas/NodeDescription" + }, + "Status": { + "$ref": "#/components/schemas/NodeStatus" + }, + "ManagerStatus": { + "$ref": "#/components/schemas/ManagerStatus" + } + } + }, + "NodeDescription": { + "type": "object", + "properties": { + "Hostname": { + "type": "string", + "example": "bf3067039e47" + }, + "Platform": { + "$ref": "#/components/schemas/Platform" + }, + "Resources": { + "$ref": "#/components/schemas/ResourceObject" + }, + "Engine": { + "$ref": "#/components/schemas/EngineDescription" + }, + "TLSInfo": { + "$ref": "#/components/schemas/TLSInfo" + } + }, + "description": "NodeDescription encapsulates the properties of the Node as reported by the\nagent.\n" + }, + "Platform": { + "type": "object", + "properties": { + "Architecture": { + "type": "string", + "description": "Architecture represents the hardware architecture (for example,\n`x86_64`).\n", + "example": "x86_64" + }, + "OS": { + "type": "string", + "description": "OS represents the Operating System (for example, `linux` or `windows`).\n", + "example": "linux" + } + }, + "description": "Platform represents the platform (Arch/OS).\n" + }, + "EngineDescription": { + "type": "object", + "properties": { + "EngineVersion": { + "type": "string", + "example": "17.06.0" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "example": { + "foo": "bar" + } + }, + "Plugins": { + "type": "array", + "example": [ + { + "Type": "Log", + "Name": "awslogs" + }, + { + "Type": "Log", + "Name": "fluentd" + }, + { + "Type": "Log", + "Name": "gcplogs" + }, + { + "Type": "Log", + "Name": "gelf" + }, + { + "Type": "Log", + "Name": "journald" + }, + { + "Type": "Log", + "Name": "json-file" + }, + { + "Type": "Log", + "Name": "logentries" + }, + { + "Type": "Log", + "Name": "splunk" + }, + { + "Type": "Log", + "Name": "syslog" + }, + { + "Type": "Network", + "Name": "bridge" + }, + { + "Type": "Network", + "Name": "host" + }, + { + "Type": "Network", + "Name": "ipvlan" + }, + { + "Type": "Network", + "Name": "macvlan" + }, + { + "Type": "Network", + "Name": "null" + }, + { + "Type": "Network", + "Name": "overlay" + }, + { + "Type": "Volume", + "Name": "local" + }, + { + "Type": "Volume", + "Name": "localhost:5000/vieux/sshfs:latest" + }, + { + "Type": "Volume", + "Name": "vieux/sshfs:latest" + } + ], + "items": { + "type": "object", + "properties": { + "Type": { + "type": "string" + }, + "Name": { + "type": "string" + } + } + } + } + }, + "description": "EngineDescription provides information about an engine." + }, + "TLSInfo": { + "type": "object", + "properties": { + "TrustRoot": { + "type": "string", + "description": "The root CA certificate(s) that are used to validate leaf TLS\ncertificates.\n" + }, + "CertIssuerSubject": { + "type": "string", + "description": "The base64-url-safe-encoded raw subject bytes of the issuer." + }, + "CertIssuerPublicKey": { + "type": "string", + "description": "The base64-url-safe-encoded raw public key bytes of the issuer.\n" + } + }, + "description": "Information about the issuer of leaf TLS certificates and the trusted root\nCA certificate.\n", + "example": { + "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0\nMzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf\n3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO\nPQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz\npxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H\n-----END CERTIFICATE-----\n", + "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh", + "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A==" + } + }, + "NodeStatus": { + "type": "object", + "properties": { + "State": { + "$ref": "#/components/schemas/NodeState" + }, + "Message": { + "type": "string", + "example": "" + }, + "Addr": { + "type": "string", + "description": "IP address of the node.", + "example": "172.17.0.2" + } + }, + "description": "NodeStatus represents the status of a node.\n\nIt provides the current status of the node, as seen by the manager.\n" + }, + "NodeState": { + "type": "string", + "description": "NodeState represents the state of a node.", + "example": "ready", + "enum": [ + "unknown", + "down", + "ready", + "disconnected" + ] + }, + "ManagerStatus": { + "type": "object", + "properties": { + "Leader": { + "type": "boolean", + "example": true, + "default": false + }, + "Reachability": { + "$ref": "#/components/schemas/Reachability" + }, + "Addr": { + "type": "string", + "description": "The IP address and port at which the manager is reachable.\n", + "example": "10.0.0.46:2377" + } + }, + "description": "ManagerStatus represents the status of a manager.\n\nIt provides the current status of a node's manager component, if the node\nis a manager.\n", + "nullable": true, + "x-nullable": true + }, + "Reachability": { + "type": "string", + "description": "Reachability represents the reachability of a node.", + "example": "reachable", + "enum": [ + "unknown", + "unreachable", + "reachable" + ] + }, + "SwarmSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the swarm.", + "example": "default" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.corp.type": "production", + "com.example.corp.department": "engineering" + } + }, + "Orchestration": { + "type": "object", + "properties": { + "TaskHistoryRetentionLimit": { + "type": "integer", + "description": "The number of historic tasks to keep per instance or node. If\nnegative, never remove completed or failed tasks.\n", + "format": "int64", + "example": 10 + } + }, + "description": "Orchestration configuration.", + "nullable": true + }, + "Raft": { + "type": "object", + "properties": { + "SnapshotInterval": { + "type": "integer", + "description": "The number of log entries between snapshots.", + "format": "uint64", + "example": 10000 + }, + "KeepOldSnapshots": { + "type": "integer", + "description": "The number of snapshots to keep beyond the current snapshot.\n", + "format": "uint64" + }, + "LogEntriesForSlowFollowers": { + "type": "integer", + "description": "The number of log entries to keep around to sync up slow followers\nafter a snapshot is created.\n", + "format": "uint64", + "example": 500 + }, + "ElectionTick": { + "type": "integer", + "description": "The number of ticks that a follower will wait for a message from\nthe leader before becoming a candidate and starting an election.\n`ElectionTick` must be greater than `HeartbeatTick`.\n\nA tick currently defaults to one second, so these translate\ndirectly to seconds currently, but this is NOT guaranteed.\n", + "example": 3 + }, + "HeartbeatTick": { + "type": "integer", + "description": "The number of ticks between heartbeats. Every HeartbeatTick ticks,\nthe leader will send a heartbeat to the followers.\n\nA tick currently defaults to one second, so these translate\ndirectly to seconds currently, but this is NOT guaranteed.\n", + "example": 1 + } + }, + "description": "Raft configuration." + }, + "Dispatcher": { + "type": "object", + "properties": { + "HeartbeatPeriod": { + "type": "integer", + "description": "The delay for an agent to send a heartbeat to the dispatcher.\n", + "format": "int64", + "example": 5000000000 + } + }, + "description": "Dispatcher configuration.", + "nullable": true + }, + "CAConfig": { + "type": "object", + "properties": { + "NodeCertExpiry": { + "type": "integer", + "description": "The duration node certificates are issued for.", + "format": "int64", + "example": 7776000000000000 + }, + "ExternalCAs": { + "type": "array", + "description": "Configuration for forwarding signing requests to an external\ncertificate authority.\n", + "items": { + "type": "object", + "properties": { + "Protocol": { + "type": "string", + "description": "Protocol for communication with the external CA (currently\nonly `cfssl` is supported).\n", + "default": "cfssl", + "enum": [ + "cfssl" + ] + }, + "URL": { + "type": "string", + "description": "URL where certificate signing requests should be sent.\n" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "An object with key/value pairs that are interpreted as\nprotocol-specific options for the external CA driver.\n" + }, + "CACert": { + "type": "string", + "description": "The root CA certificate (in PEM format) this external CA uses\nto issue TLS certificates (assumed to be to the current swarm\nroot CA certificate if not provided).\n" + } + } + } + }, + "SigningCACert": { + "type": "string", + "description": "The desired signing CA certificate for all swarm node TLS leaf\ncertificates, in PEM format.\n" + }, + "SigningCAKey": { + "type": "string", + "description": "The desired signing CA key for all swarm node TLS leaf certificates,\nin PEM format.\n" + }, + "ForceRotate": { + "type": "integer", + "description": "An integer whose purpose is to force swarm to generate a new\nsigning CA certificate and key, if none have been specified in\n`SigningCACert` and `SigningCAKey`\n", + "format": "uint64" + } + }, + "description": "CA configuration.", + "nullable": true + }, + "EncryptionConfig": { + "type": "object", + "properties": { + "AutoLockManagers": { + "type": "boolean", + "description": "If set, generate a key and use it to lock data stored on the\nmanagers.\n", + "example": false + } + }, + "description": "Parameters related to encryption-at-rest." + }, + "TaskDefaults": { + "type": "object", + "properties": { + "LogDriver": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The log driver to use as a default for new tasks.\n", + "example": "json-file" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver-specific options for the selectd log driver, specified\nas key/value pairs.\n", + "example": { + "max-file": "10", + "max-size": "100m" + } + } + }, + "description": "The log driver to use for tasks created in the orchestrator if\nunspecified by a service.\n\nUpdating this value only affects new tasks. Existing tasks continue\nto use their previously configured log driver until recreated.\n" + } + }, + "description": "Defaults for creating tasks in this cluster." + } + }, + "description": "User modifiable swarm configuration." + }, + "ClusterInfo": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the swarm.", + "example": "abajmipo7b4xz5ip2nrla6b11" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the swarm was initialised in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "UpdatedAt": { + "type": "string", + "description": "Date and time at which the swarm was last updated in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2017-08-09T07:09:37.632105588Z" + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + }, + "TLSInfo": { + "$ref": "#/components/schemas/TLSInfo" + }, + "RootRotationInProgress": { + "type": "boolean", + "description": "Whether there is currently a root CA rotation in progress for the swarm\n", + "example": false + }, + "DataPathPort": { + "type": "integer", + "description": "DataPathPort specifies the data path port number for data traffic.\nAcceptable port range is 1024 to 49151.\nIf no port is set or is set to 0, the default port (4789) is used.\n", + "format": "uint32", + "example": 4789 + }, + "DefaultAddrPool": { + "type": "array", + "description": "Default Address Pool specifies default subnet pools for global scope\nnetworks.\n", + "items": { + "type": "string", + "format": "CIDR", + "example": "" + } + }, + "SubnetSize": { + "maximum": 29, + "type": "integer", + "description": "SubnetSize specifies the subnet size of the networks created from the\ndefault subnet pool.\n", + "format": "uint32", + "example": 24 + } + }, + "description": "ClusterInfo represents information about the swarm as is returned by the\n\"/info\" endpoint. Join-tokens are not included.\n", + "nullable": true, + "x-nullable": true + }, + "JoinTokens": { + "type": "object", + "properties": { + "Worker": { + "type": "string", + "description": "The token workers can use to join the swarm.\n", + "example": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx" + }, + "Manager": { + "type": "string", + "description": "The token managers can use to join the swarm.\n", + "example": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + }, + "description": "JoinTokens contains the tokens workers and managers need to join the swarm.\n" + }, + "Swarm": { + "allOf": [ + { + "$ref": "#/components/schemas/ClusterInfo" + }, + { + "type": "object", + "properties": { + "JoinTokens": { + "$ref": "#/components/schemas/JoinTokens" + } + } + } + ] + }, + "TaskSpec": { + "type": "object", + "properties": { + "PluginSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The name or 'alias' to use for the plugin." + }, + "Remote": { + "type": "string", + "description": "The plugin image reference to use." + }, + "Disabled": { + "type": "boolean", + "description": "Disable the plugin once scheduled." + }, + "PluginPrivilege": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + }, + "description": "Plugin spec for the service. *(Experimental release only.)*\n\n


\n\n> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n> mutually exclusive. PluginSpec is only used when the Runtime field\n> is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n> field is set to `attachment`.\n" + }, + "ContainerSpec": { + "type": "object", + "properties": { + "Image": { + "type": "string", + "description": "The image name to use for the container" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value data." + }, + "Command": { + "type": "array", + "description": "The command to be run in the image.", + "items": { + "type": "string" + } + }, + "Args": { + "type": "array", + "description": "Arguments to the command.", + "items": { + "type": "string" + } + }, + "Hostname": { + "type": "string", + "description": "The hostname to use for the container, as a valid\n[RFC 1123](https://tools.ietf.org/html/rfc1123) hostname.\n" + }, + "Env": { + "type": "array", + "description": "A list of environment variables in the form `VAR=value`.\n", + "items": { + "type": "string" + } + }, + "Dir": { + "type": "string", + "description": "The working directory for commands to run in." + }, + "User": { + "type": "string", + "description": "The user inside the container." + }, + "Groups": { + "type": "array", + "description": "A list of additional groups that the container process will run as.\n", + "items": { + "type": "string" + } + }, + "Privileges": { + "type": "object", + "properties": { + "CredentialSpec": { + "type": "object", + "properties": { + "Config": { + "type": "string", + "description": "Load credential spec from a Swarm Config with the given ID.\nThe specified config must also be present in the Configs\nfield with the Runtime property set.\n\n


\n\n\n> **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n> and `CredentialSpec.Config` are mutually exclusive.\n", + "example": "0bt9dmxjvjiqermk6xrop3ekq" + }, + "File": { + "type": "string", + "description": "Load credential spec from this file. The file is read by\nthe daemon, and must be present in the `CredentialSpecs`\nsubdirectory in the docker data directory, which defaults\nto `C:\\ProgramData\\Docker\\` on Windows.\n\nFor example, specifying `spec.json` loads\n`C:\\ProgramData\\Docker\\CredentialSpecs\\spec.json`.\n\n


\n\n> **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n> and `CredentialSpec.Config` are mutually exclusive.\n", + "example": "spec.json" + }, + "Registry": { + "type": "string", + "description": "Load credential spec from this value in the Windows\nregistry. The specified registry value must be located in:\n\n`HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Virtualization\\Containers\\CredentialSpecs`\n\n


\n\n\n> **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n> and `CredentialSpec.Config` are mutually exclusive.\n" + } + }, + "description": "CredentialSpec for managed service account (Windows only)" + }, + "SELinuxContext": { + "type": "object", + "properties": { + "Disable": { + "type": "boolean", + "description": "Disable SELinux" + }, + "User": { + "type": "string", + "description": "SELinux user label" + }, + "Role": { + "type": "string", + "description": "SELinux role label" + }, + "Type": { + "type": "string", + "description": "SELinux type label" + }, + "Level": { + "type": "string", + "description": "SELinux level label" + } + }, + "description": "SELinux labels of the container" + } + }, + "description": "Security options for the container" + }, + "TTY": { + "type": "boolean", + "description": "Whether a pseudo-TTY should be allocated." + }, + "OpenStdin": { + "type": "boolean", + "description": "Open `stdin`" + }, + "ReadOnly": { + "type": "boolean", + "description": "Mount the container's root filesystem as read only." + }, + "Mounts": { + "type": "array", + "description": "Specification for mounts to be added to containers created as part\nof the service.\n", + "items": { + "$ref": "#/components/schemas/Mount" + } + }, + "StopSignal": { + "type": "string", + "description": "Signal to stop the container." + }, + "StopGracePeriod": { + "type": "integer", + "description": "Amount of time to wait for the container to terminate before\nforcefully killing it.\n", + "format": "int64" + }, + "HealthCheck": { + "$ref": "#/components/schemas/HealthConfig" + }, + "Hosts": { + "type": "array", + "description": "A list of hostname/IP mappings to add to the container's `hosts`\nfile. The format of extra hosts is specified in the\n[hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html)\nman page:\n\n IP_address canonical_hostname [aliases...]\n", + "items": { + "type": "string" + } + }, + "DNSConfig": { + "type": "object", + "properties": { + "Nameservers": { + "type": "array", + "description": "The IP addresses of the name servers.", + "items": { + "type": "string" + } + }, + "Search": { + "type": "array", + "description": "A search list for host-name lookup.", + "items": { + "type": "string" + } + }, + "Options": { + "type": "array", + "description": "A list of internal resolver variables to be modified (e.g.,\n`debug`, `ndots:3`, etc.).\n", + "items": { + "type": "string" + } + } + }, + "description": "Specification for DNS related configurations in resolver configuration\nfile (`resolv.conf`).\n" + }, + "Secrets": { + "type": "array", + "description": "Secrets contains references to zero or more secrets that will be\nexposed to the service.\n", + "items": { + "type": "object", + "properties": { + "File": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name represents the final filename in the filesystem.\n" + }, + "UID": { + "type": "string", + "description": "UID represents the file UID." + }, + "GID": { + "type": "string", + "description": "GID represents the file GID." + }, + "Mode": { + "type": "integer", + "description": "Mode represents the FileMode of the file.", + "format": "uint32" + } + }, + "description": "File represents a specific target that is backed by a file.\n" + }, + "SecretID": { + "type": "string", + "description": "SecretID represents the ID of the specific secret that we're\nreferencing.\n" + }, + "SecretName": { + "type": "string", + "description": "SecretName is the name of the secret that this references,\nbut this is just provided for lookup/display purposes. The\nsecret in the reference will be identified by its ID.\n" + } + } + } + }, + "Configs": { + "type": "array", + "description": "Configs contains references to zero or more configs that will be\nexposed to the service.\n", + "items": { + "type": "object", + "properties": { + "File": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name represents the final filename in the filesystem.\n" + }, + "UID": { + "type": "string", + "description": "UID represents the file UID." + }, + "GID": { + "type": "string", + "description": "GID represents the file GID." + }, + "Mode": { + "type": "integer", + "description": "Mode represents the FileMode of the file.", + "format": "uint32" + } + }, + "description": "File represents a specific target that is backed by a file.\n\n


\n\n> **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive\n" + }, + "Runtime": { + "type": "object", + "properties": {}, + "description": "Runtime represents a target that is not mounted into the\ncontainer but is used by the task\n\n


\n\n> **Note**: `Configs.File` and `Configs.Runtime` are mutually\n> exclusive\n" + }, + "ConfigID": { + "type": "string", + "description": "ConfigID represents the ID of the specific config that we're\nreferencing.\n" + }, + "ConfigName": { + "type": "string", + "description": "ConfigName is the name of the config that this references,\nbut this is just provided for lookup/display purposes. The\nconfig in the reference will be identified by its ID.\n" + } + } + } + }, + "Isolation": { + "type": "string", + "description": "Isolation technology of the containers running the service.\n(Windows only)\n", + "enum": [ + "default", + "process", + "hyperv" + ] + }, + "Init": { + "type": "boolean", + "description": "Run an init inside the container that forwards signals and reaps\nprocesses. This field is omitted if empty, and the default (as\nconfigured on the daemon) is used.\n", + "nullable": true + }, + "Sysctls": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Set kernel namedspaced parameters (sysctls) in the container.\nThe Sysctls option on services accepts the same sysctls as the\nare supported on containers. Note that while the same sysctls are\nsupported, no guarantees or checks are made about their\nsuitability for a clustered environment, and it's up to the user\nto determine whether a given sysctl will work properly in a\nService.\n" + }, + "CapabilityAdd": { + "type": "array", + "description": "A list of kernel capabilities to add to the default set\nfor the container.\n", + "example": [ + "CAP_NET_RAW", + "CAP_SYS_ADMIN", + "CAP_SYS_CHROOT", + "CAP_SYSLOG" + ], + "items": { + "type": "string" + } + }, + "CapabilityDrop": { + "type": "array", + "description": "A list of kernel capabilities to drop from the default set\nfor the container.\n", + "example": [ + "CAP_NET_RAW" + ], + "items": { + "type": "string" + } + }, + "Ulimits": { + "type": "array", + "description": "A list of resource limits to set in the container. For example: `{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}`\"\n", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of ulimit" + }, + "Soft": { + "type": "integer", + "description": "Soft limit" + }, + "Hard": { + "type": "integer", + "description": "Hard limit" + } + } + } + } + }, + "description": "Container spec for the service.\n\n


\n\n> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n> mutually exclusive. PluginSpec is only used when the Runtime field\n> is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n> field is set to `attachment`.\n" + }, + "NetworkAttachmentSpec": { + "type": "object", + "properties": { + "ContainerID": { + "type": "string", + "description": "ID of the container represented by this task" + } + }, + "description": "Read-only spec type for non-swarm containers attached to swarm overlay\nnetworks.\n\n


\n\n> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n> mutually exclusive. PluginSpec is only used when the Runtime field\n> is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n> field is set to `attachment`.\n" + }, + "Resources": { + "type": "object", + "properties": { + "Limits": { + "$ref": "#/components/schemas/Limit" + }, + "Reservations": { + "$ref": "#/components/schemas/ResourceObject" + } + }, + "description": "Resource requirements which apply to each individual container created\nas part of the service.\n" + }, + "RestartPolicy": { + "type": "object", + "properties": { + "Condition": { + "type": "string", + "description": "Condition for restart.", + "enum": [ + "none", + "on-failure", + "any" + ] + }, + "Delay": { + "type": "integer", + "description": "Delay between restart attempts.", + "format": "int64" + }, + "MaxAttempts": { + "type": "integer", + "description": "Maximum attempts to restart a given container before giving up\n(default value is 0, which is ignored).\n", + "format": "int64", + "default": 0 + }, + "Window": { + "type": "integer", + "description": "Windows is the time window used to evaluate the restart policy\n(default value is 0, which is unbounded).\n", + "format": "int64", + "default": 0 + } + }, + "description": "Specification for the restart policy which applies to containers\ncreated as part of this service.\n" + }, + "Placement": { + "type": "object", + "properties": { + "Constraints": { + "type": "array", + "description": "An array of constraint expressions to limit the set of nodes where\na task can be scheduled. Constraint expressions can either use a\n_match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find\nnodes that satisfy every expression (AND match). Constraints can\nmatch node or Docker Engine labels as follows:\n\nnode attribute | matches | example\n---------------------|--------------------------------|-----------------------------------------------\n`node.id` | Node ID | `node.id==2ivku8v2gvtg4`\n`node.hostname` | Node hostname | `node.hostname!=node-2`\n`node.role` | Node role (`manager`/`worker`) | `node.role==manager`\n`node.platform.os` | Node operating system | `node.platform.os==windows`\n`node.platform.arch` | Node architecture | `node.platform.arch==x86_64`\n`node.labels` | User-defined node labels | `node.labels.security==high`\n`engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-14.04`\n\n`engine.labels` apply to Docker Engine labels like operating system,\ndrivers, etc. Swarm administrators add `node.labels` for operational\npurposes by using the [`node update endpoint`](#operation/NodeUpdate).\n", + "example": [ + "node.hostname!=node3.corp.example.com", + "node.role!=manager", + "node.labels.type==production", + "node.platform.os==linux", + "node.platform.arch==x86_64" + ], + "items": { + "type": "string" + } + }, + "Preferences": { + "type": "array", + "description": "Preferences provide a way to make the scheduler aware of factors\nsuch as topology. They are provided in order from highest to\nlowest precedence.\n", + "example": [ + { + "Spread": { + "SpreadDescriptor": "node.labels.datacenter" + } + }, + { + "Spread": { + "SpreadDescriptor": "node.labels.rack" + } + } + ], + "items": { + "type": "object", + "properties": { + "Spread": { + "type": "object", + "properties": { + "SpreadDescriptor": { + "type": "string", + "description": "label descriptor, such as `engine.labels.az`.\n" + } + } + } + } + } + }, + "MaxReplicas": { + "type": "integer", + "description": "Maximum number of replicas for per node (default value is 0, which\nis unlimited)\n", + "format": "int64", + "default": 0 + }, + "Platforms": { + "type": "array", + "description": "Platforms stores all the platforms that the service's image can\nrun on. This field is used in the platform filter for scheduling.\nIf empty, then the platform filter is off, meaning there are no\nscheduling restrictions.\n", + "items": { + "$ref": "#/components/schemas/Platform" + } + } + } + }, + "ForceUpdate": { + "type": "integer", + "description": "A counter that triggers an update even if no relevant parameters have\nbeen changed.\n" + }, + "Runtime": { + "type": "string", + "description": "Runtime is the type of runtime specified for the task executor.\n" + }, + "Networks": { + "type": "array", + "description": "Specifies which networks the service should attach to.", + "items": { + "$ref": "#/components/schemas/NetworkAttachmentConfig" + } + }, + "LogDriver": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "Specifies the log driver to use for tasks created from this spec. If\nnot present, the default one for the swarm will be used, finally\nfalling back to the engine default if not specified.\n" + } + }, + "description": "User modifiable task configuration." + }, + "TaskState": { + "type": "string", + "enum": [ + "new", + "allocated", + "pending", + "assigned", + "accepted", + "preparing", + "ready", + "starting", + "running", + "complete", + "shutdown", + "failed", + "rejected", + "remove", + "orphaned" + ] + }, + "Task": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the task." + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Name": { + "type": "string", + "description": "Name of the task." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Spec": { + "$ref": "#/components/schemas/TaskSpec" + }, + "ServiceID": { + "type": "string", + "description": "The ID of the service this task is part of." + }, + "Slot": { + "type": "integer" + }, + "NodeID": { + "type": "string", + "description": "The ID of the node that this task is on." + }, + "AssignedGenericResources": { + "$ref": "#/components/schemas/GenericResources" + }, + "Status": { + "type": "object", + "properties": { + "Timestamp": { + "type": "string", + "format": "dateTime" + }, + "State": { + "$ref": "#/components/schemas/TaskState" + }, + "Message": { + "type": "string" + }, + "Err": { + "type": "string" + }, + "ContainerStatus": { + "type": "object", + "properties": { + "ContainerID": { + "type": "string" + }, + "PID": { + "type": "integer" + }, + "ExitCode": { + "type": "integer" + } + } + } + } + }, + "DesiredState": { + "$ref": "#/components/schemas/TaskState" + }, + "JobIteration": { + "$ref": "#/components/schemas/ObjectVersion" + } + }, + "example": { + "ID": "0kzzo1i0y4jz6027t0k7aezc7", + "Version": { + "Index": 71 + }, + "CreatedAt": "2016-06-07T21:07:31.171892745Z", + "UpdatedAt": "2016-06-07T21:07:31.376370513Z", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:31.290032978Z", + "State": "running", + "Message": "started", + "ContainerStatus": { + "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035", + "PID": 677 + } + }, + "DesiredState": "running", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.10/16" + ] + } + ], + "AssignedGenericResources": [ + { + "DiscreteResourceSpec": { + "Kind": "SSD", + "Value": 3 + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID1" + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID2" + } + } + ] + } + }, + "ServiceSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the service." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "TaskTemplate": { + "$ref": "#/components/schemas/TaskSpec" + }, + "Mode": { + "type": "object", + "properties": { + "Replicated": { + "type": "object", + "properties": { + "Replicas": { + "type": "integer", + "format": "int64" + } + } + }, + "Global": { + "type": "object", + "properties": {} + }, + "ReplicatedJob": { + "type": "object", + "properties": { + "MaxConcurrent": { + "type": "integer", + "description": "The maximum number of replicas to run simultaneously.\n", + "format": "int64", + "default": 1 + }, + "TotalCompletions": { + "type": "integer", + "description": "The total number of replicas desired to reach the Completed\nstate. If unset, will default to the value of `MaxConcurrent`\n", + "format": "int64" + } + }, + "description": "The mode used for services with a finite number of tasks that run\nto a completed state.\n" + }, + "GlobalJob": { + "type": "object", + "properties": {}, + "description": "The mode used for services which run a task to the completed state\non each valid node.\n" + } + }, + "description": "Scheduling mode for the service." + }, + "UpdateConfig": { + "type": "object", + "properties": { + "Parallelism": { + "type": "integer", + "description": "Maximum number of tasks to be updated in one iteration (0 means\nunlimited parallelism).\n", + "format": "int64" + }, + "Delay": { + "type": "integer", + "description": "Amount of time between updates, in nanoseconds.", + "format": "int64" + }, + "FailureAction": { + "type": "string", + "description": "Action to take if an updated task fails to run, or stops running\nduring the update.\n", + "enum": [ + "continue", + "pause", + "rollback" + ] + }, + "Monitor": { + "type": "integer", + "description": "Amount of time to monitor each updated task for failures, in\nnanoseconds.\n", + "format": "int64" + }, + "MaxFailureRatio": { + "type": "number", + "description": "The fraction of tasks that may fail during an update before the\nfailure action is invoked, specified as a floating point number\nbetween 0 and 1.\n" + }, + "Order": { + "type": "string", + "description": "The order of operations when rolling out an updated task. Either\nthe old task is shut down before the new task is started, or the\nnew task is started before the old task is shut down.\n", + "enum": [ + "stop-first", + "start-first" + ] + } + }, + "description": "Specification for the update strategy of the service." + }, + "RollbackConfig": { + "type": "object", + "properties": { + "Parallelism": { + "type": "integer", + "description": "Maximum number of tasks to be rolled back in one iteration (0 means\nunlimited parallelism).\n", + "format": "int64" + }, + "Delay": { + "type": "integer", + "description": "Amount of time between rollback iterations, in nanoseconds.\n", + "format": "int64" + }, + "FailureAction": { + "type": "string", + "description": "Action to take if an rolled back task fails to run, or stops\nrunning during the rollback.\n", + "enum": [ + "continue", + "pause" + ] + }, + "Monitor": { + "type": "integer", + "description": "Amount of time to monitor each rolled back task for failures, in\nnanoseconds.\n", + "format": "int64" + }, + "MaxFailureRatio": { + "type": "number", + "description": "The fraction of tasks that may fail during a rollback before the\nfailure action is invoked, specified as a floating point number\nbetween 0 and 1.\n" + }, + "Order": { + "type": "string", + "description": "The order of operations when rolling back a task. Either the old\ntask is shut down before the new task is started, or the new task\nis started before the old task is shut down.\n", + "enum": [ + "stop-first", + "start-first" + ] + } + }, + "description": "Specification for the rollback strategy of the service." + }, + "Networks": { + "type": "array", + "description": "Specifies which networks the service should attach to.", + "items": { + "$ref": "#/components/schemas/NetworkAttachmentConfig" + } + }, + "EndpointSpec": { + "$ref": "#/components/schemas/EndpointSpec" + } + }, + "description": "User modifiable configuration for a service." + }, + "EndpointPortConfig": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Protocol": { + "type": "string", + "enum": [ + "tcp", + "udp", + "sctp" + ] + }, + "TargetPort": { + "type": "integer", + "description": "The port inside the container." + }, + "PublishedPort": { + "type": "integer", + "description": "The port on the swarm hosts." + }, + "PublishMode": { + "type": "string", + "description": "The mode in which port is published.\n\n


\n\n- \"ingress\" makes the target port accessible on every node,\n regardless of whether there is a task for the service running on\n that node or not.\n- \"host\" bypasses the routing mesh and publish the port directly on\n the swarm node where that service is running.\n", + "example": "ingress", + "default": "ingress", + "enum": [ + "ingress", + "host" + ] + } + } + }, + "EndpointSpec": { + "type": "object", + "properties": { + "Mode": { + "type": "string", + "description": "The mode of resolution to use for internal load balancing between tasks.\n", + "default": "vip", + "enum": [ + "vip", + "dnsrr" + ] + }, + "Ports": { + "type": "array", + "description": "List of exposed ports that this service is accessible on from the\noutside. Ports can only be provided if `vip` resolution mode is used.\n", + "items": { + "$ref": "#/components/schemas/EndpointPortConfig" + } + } + }, + "description": "Properties that can be configured to access and load balance a service." + }, + "Service": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Spec": { + "$ref": "#/components/schemas/ServiceSpec" + }, + "Endpoint": { + "type": "object", + "properties": { + "Spec": { + "$ref": "#/components/schemas/EndpointSpec" + }, + "Ports": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EndpointPortConfig" + } + }, + "VirtualIPs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "NetworkID": { + "type": "string" + }, + "Addr": { + "type": "string" + } + } + } + } + } + }, + "UpdateStatus": { + "type": "object", + "properties": { + "State": { + "type": "string", + "enum": [ + "updating", + "paused", + "completed" + ] + }, + "StartedAt": { + "type": "string", + "format": "dateTime" + }, + "CompletedAt": { + "type": "string", + "format": "dateTime" + }, + "Message": { + "type": "string" + } + }, + "description": "The status of a service update." + }, + "ServiceStatus": { + "type": "object", + "properties": { + "RunningTasks": { + "type": "integer", + "description": "The number of tasks for the service currently in the Running state.\n", + "format": "uint64", + "example": 7 + }, + "DesiredTasks": { + "type": "integer", + "description": "The number of tasks for the service desired to be running.\nFor replicated services, this is the replica count from the\nservice spec. For global services, this is computed by taking\ncount of all tasks for the service with a Desired State other\nthan Shutdown.\n", + "format": "uint64", + "example": 10 + }, + "CompletedTasks": { + "type": "integer", + "description": "The number of tasks for a job that are in the Completed state.\nThis field must be cross-referenced with the service type, as the\nvalue of 0 may mean the service is not in a job mode, or it may\nmean the job-mode service has no tasks yet Completed.\n", + "format": "uint64" + } + }, + "description": "The status of the service's tasks. Provided only when requested as\npart of a ServiceList operation.\n" + }, + "JobStatus": { + "type": "object", + "properties": { + "JobIteration": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "LastExecution": { + "type": "string", + "description": "The last time, as observed by the server, that this job was\nstarted.\n", + "format": "dateTime" + } + }, + "description": "The status of the service when it is in one of ReplicatedJob or\nGlobalJob modes. Absent on Replicated and Global mode services. The\nJobIteration is an ObjectVersion, but unlike the Service's version,\ndoes not need to be sent with an update request.\n" + } + }, + "example": { + "ID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Version": { + "Index": 19 + }, + "CreatedAt": "2016-06-07T21:05:51.880065305Z", + "UpdatedAt": "2016-06-07T21:07:29.962229872Z", + "Spec": { + "Name": "hopeful_cori", + "TaskTemplate": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {}, + "ForceUpdate": 0 + }, + "Mode": { + "Replicated": { + "Replicas": 1 + } + }, + "UpdateConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Mode": "vip", + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ] + } + }, + "Endpoint": { + "Spec": { + "Mode": "vip", + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ] + }, + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ], + "VirtualIPs": [ + { + "NetworkID": "4qvuz4ko70xaltuqbt8956gd1", + "Addr": "10.255.0.2/16" + }, + { + "NetworkID": "4qvuz4ko70xaltuqbt8956gd1", + "Addr": "10.255.0.3/16" + } + ] + } + } + }, + "ImageDeleteResponseItem": { + "type": "object", + "properties": { + "Untagged": { + "type": "string", + "description": "The image ID of an image that was untagged" + }, + "Deleted": { + "type": "string", + "description": "The image ID of an image that was deleted" + } + } + }, + "ServiceUpdateResponse": { + "type": "object", + "properties": { + "Warnings": { + "type": "array", + "description": "Optional warning messages", + "items": { + "type": "string" + } + } + }, + "example": { + "Warning": "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + } + }, + "ContainerSummary": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of this container", + "x-go-name": "ID" + }, + "Names": { + "type": "array", + "description": "The names that this container has been given", + "items": { + "type": "string" + } + }, + "Image": { + "type": "string", + "description": "The name of the image used when creating this container" + }, + "ImageID": { + "type": "string", + "description": "The ID of the image that this container was created from" + }, + "Command": { + "type": "string", + "description": "Command to run when starting the container" + }, + "Created": { + "type": "integer", + "description": "When the container was created", + "format": "int64" + }, + "Ports": { + "type": "array", + "description": "The ports exposed by this container", + "items": { + "$ref": "#/components/schemas/Port" + } + }, + "SizeRw": { + "type": "integer", + "description": "The size of files that have been created or changed by this container", + "format": "int64" + }, + "SizeRootFs": { + "type": "integer", + "description": "The total size of all the files in this container", + "format": "int64" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "State": { + "type": "string", + "description": "The state of this container (e.g. `Exited`)" + }, + "Status": { + "type": "string", + "description": "Additional human-readable status of this container (e.g. `Exit 0`)" + }, + "HostConfig": { + "type": "object", + "properties": { + "NetworkMode": { + "type": "string" + } + } + }, + "NetworkSettings": { + "type": "object", + "properties": { + "Networks": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + } + } + }, + "description": "A summary of the container's network settings" + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MountPoint" + } + } + } + }, + "Driver": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the driver.", + "nullable": false, + "example": "some-driver" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Key/value map of driver-specific options.", + "nullable": false, + "example": { + "OptionA": "value for driver-specific option A", + "OptionB": "value for driver-specific option B" + } + } + }, + "description": "Driver represents a driver (network, logging, secrets)." + }, + "SecretSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "User-defined name of the secret." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "Data": { + "type": "string", + "description": "Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5))\ndata to store as secret.\n\nThis field is only used to _create_ a secret, and is not returned by\nother endpoints.\n", + "example": "" + }, + "Driver": { + "$ref": "#/components/schemas/Driver" + }, + "Templating": { + "$ref": "#/components/schemas/Driver" + } + } + }, + "Secret": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "example": "blt1owaxmitz71s9v5zh81zun" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime", + "example": "2017-07-20T13:55:28.678958722Z" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime", + "example": "2017-07-20T13:55:28.678958722Z" + }, + "Spec": { + "$ref": "#/components/schemas/SecretSpec" + } + } + }, + "ConfigSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "User-defined name of the config." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Data": { + "type": "string", + "description": "Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5))\nconfig data.\n" + }, + "Templating": { + "$ref": "#/components/schemas/Driver" + } + } + }, + "Config": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Spec": { + "$ref": "#/components/schemas/ConfigSpec" + } + } + }, + "ContainerState": { + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "String representation of the container state. Can be one of \"created\",\n\"running\", \"paused\", \"restarting\", \"removing\", \"exited\", or \"dead\".\n", + "example": "running", + "enum": [ + "created", + "running", + "paused", + "restarting", + "removing", + "exited", + "dead" + ] + }, + "Running": { + "type": "boolean", + "description": "Whether this container is running.\n\nNote that a running container can be _paused_. The `Running` and `Paused`\nbooleans are not mutually exclusive:\n\nWhen pausing a container (on Linux), the freezer cgroup is used to suspend\nall processes in the container. Freezing the process requires the process to\nbe running. As a result, paused containers are both `Running` _and_ `Paused`.\n\nUse the `Status` field instead to determine if a container's state is \"running\".\n", + "example": true + }, + "Paused": { + "type": "boolean", + "description": "Whether this container is paused.", + "example": false + }, + "Restarting": { + "type": "boolean", + "description": "Whether this container is restarting.", + "example": false + }, + "OOMKilled": { + "type": "boolean", + "description": "Whether a process within this container has been killed because it ran\nout of memory since the container was last started.\n", + "example": false + }, + "Dead": { + "type": "boolean", + "example": false + }, + "Pid": { + "type": "integer", + "description": "The process ID of this container", + "example": 1234 + }, + "ExitCode": { + "type": "integer", + "description": "The last exit code of this container", + "example": 0 + }, + "Error": { + "type": "string" + }, + "StartedAt": { + "type": "string", + "description": "The time when this container was last started.", + "example": "2020-01-06T09:06:59.461876391Z" + }, + "FinishedAt": { + "type": "string", + "description": "The time when this container last exited.", + "example": "2020-01-06T09:07:59.461876391Z" + }, + "Health": { + "$ref": "#/components/schemas/Health" + } + }, + "description": "ContainerState stores container's running state. It's part of ContainerJSONBase\nand will be returned by the \"inspect\" command.\n", + "nullable": true, + "x-nullable": true + }, + "ContainerCreateResponse": { + "title": "ContainerCreateResponse", + "required": [ + "Id", + "Warnings" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the created container", + "nullable": false, + "example": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + }, + "Warnings": { + "type": "array", + "description": "Warnings encountered when creating the container", + "nullable": false, + "example": [], + "items": { + "type": "string" + } + } + }, + "description": "OK response to ContainerCreate operation", + "x-go-name": "CreateResponse" + }, + "ContainerWaitResponse": { + "title": "ContainerWaitResponse", + "required": [ + "StatusCode" + ], + "type": "object", + "properties": { + "StatusCode": { + "type": "integer", + "description": "Exit code of the container", + "format": "int64", + "nullable": false + }, + "Error": { + "$ref": "#/components/schemas/ContainerWaitExitError" + } + }, + "description": "OK response to ContainerWait operation", + "x-go-name": "WaitResponse" + }, + "ContainerWaitExitError": { + "type": "object", + "properties": { + "Message": { + "type": "string", + "description": "Details of an error" + } + }, + "description": "container waiting error, if any", + "x-go-name": "WaitExitError" + }, + "SystemVersion": { + "type": "object", + "properties": { + "Platform": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string" + } + } + }, + "Components": { + "type": "array", + "description": "Information about system components\n", + "items": { + "required": [ + "Name", + "Version" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the component\n", + "example": "Engine" + }, + "Version": { + "type": "string", + "description": "Version of the component\n", + "nullable": false, + "example": "19.03.12" + }, + "Details": { + "type": "object", + "properties": {}, + "description": "Key/value pairs of strings with additional information about the\ncomponent. These values are intended for informational purposes\nonly, and their content is not defined, and not part of the API\nspecification.\n\nThese messages can be printed by the client as information to the user.\n", + "nullable": true + } + }, + "x-go-name": "ComponentVersion" + } + }, + "Version": { + "type": "string", + "description": "The version of the daemon", + "example": "19.03.12" + }, + "ApiVersion": { + "type": "string", + "description": "The default (and highest) API version that is supported by the daemon\n", + "example": "1.40" + }, + "MinAPIVersion": { + "type": "string", + "description": "The minimum API version that is supported by the daemon\n", + "example": "1.12" + }, + "GitCommit": { + "type": "string", + "description": "The Git commit of the source code that was used to build the daemon\n", + "example": "48a66213fe" + }, + "GoVersion": { + "type": "string", + "description": "The version Go used to compile the daemon, and the version of the Go\nruntime in use.\n", + "example": "go1.13.14" + }, + "Os": { + "type": "string", + "description": "The operating system that the daemon is running on (\"linux\" or \"windows\")\n", + "example": "linux" + }, + "Arch": { + "type": "string", + "description": "The architecture that the daemon is running on\n", + "example": "amd64" + }, + "KernelVersion": { + "type": "string", + "description": "The kernel version (`uname -r`) that the daemon is running on.\n\nThis field is omitted when empty.\n", + "example": "4.19.76-linuxkit" + }, + "Experimental": { + "type": "boolean", + "description": "Indicates if the daemon is started with experimental features enabled.\n\nThis field is omitted when empty / false.\n", + "example": true + }, + "BuildTime": { + "type": "string", + "description": "The date and time that the daemon was compiled.\n", + "example": "2020-06-22T15:49:27.000000000+00:00" + } + }, + "description": "Response of Engine API: GET \"/version\"\n" + }, + "SystemInfo": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Unique identifier of the daemon.\n\n


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


\n\n> **Note**: The information returned in this field, including the\n> formatting of values and labels, should not be considered stable,\n> and may change without notice.\n", + "example": [ + [ + "Backing Filesystem", + "extfs" + ], + [ + "Supports d_type", + "true" + ], + [ + "Native Overlay Diff", + "true" + ] + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "DockerRootDir": { + "type": "string", + "description": "Root directory of persistent Docker state.\n\nDefaults to `/var/lib/docker` on Linux, and `C:\\ProgramData\\docker`\non Windows.\n", + "example": "/var/lib/docker" + }, + "Plugins": { + "$ref": "#/components/schemas/PluginsInfo" + }, + "MemoryLimit": { + "type": "boolean", + "description": "Indicates if the host has memory limit support enabled.", + "example": true + }, + "SwapLimit": { + "type": "boolean", + "description": "Indicates if the host has memory swap limit support enabled.", + "example": true + }, + "KernelMemoryTCP": { + "type": "boolean", + "description": "Indicates if the host has kernel memory TCP limit support enabled. This\nfield is omitted if not supported.\n\nKernel memory TCP limits are not supported when using cgroups v2, which\ndoes not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup.\n", + "example": true + }, + "CpuCfsPeriod": { + "type": "boolean", + "description": "Indicates if CPU CFS(Completely Fair Scheduler) period is supported by\nthe host.\n", + "example": true + }, + "CpuCfsQuota": { + "type": "boolean", + "description": "Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by\nthe host.\n", + "example": true + }, + "CPUShares": { + "type": "boolean", + "description": "Indicates if CPU Shares limiting is supported by the host.\n", + "example": true + }, + "CPUSet": { + "type": "boolean", + "description": "Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host.\n\nSee [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt)\n", + "example": true + }, + "PidsLimit": { + "type": "boolean", + "description": "Indicates if the host kernel has PID limit support enabled.", + "example": true + }, + "OomKillDisable": { + "type": "boolean", + "description": "Indicates if OOM killer disable is supported on the host." + }, + "IPv4Forwarding": { + "type": "boolean", + "description": "Indicates IPv4 forwarding is enabled.", + "example": true + }, + "BridgeNfIptables": { + "type": "boolean", + "description": "Indicates if `bridge-nf-call-iptables` is available on the host.", + "example": true + }, + "BridgeNfIp6tables": { + "type": "boolean", + "description": "Indicates if `bridge-nf-call-ip6tables` is available on the host.", + "example": true + }, + "Debug": { + "type": "boolean", + "description": "Indicates if the daemon is running in debug-mode / with debug-level\nlogging enabled.\n", + "example": true + }, + "NFd": { + "type": "integer", + "description": "The total number of file Descriptors in use by the daemon process.\n\nThis information is only returned if debug-mode is enabled.\n", + "example": 64 + }, + "NGoroutines": { + "type": "integer", + "description": "The number of goroutines that currently exist.\n\nThis information is only returned if debug-mode is enabled.\n", + "example": 174 + }, + "SystemTime": { + "type": "string", + "description": "Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt)\nformat with nano-seconds.\n", + "example": "2017-08-08T20:28:29.06202363Z" + }, + "LoggingDriver": { + "type": "string", + "description": "The logging driver to use as a default for new containers.\n" + }, + "CgroupDriver": { + "type": "string", + "description": "The driver to use for managing cgroups.\n", + "example": "cgroupfs", + "default": "cgroupfs", + "enum": [ + "cgroupfs", + "systemd", + "none" + ] + }, + "CgroupVersion": { + "type": "string", + "description": "The version of the cgroup.\n", + "example": "1", + "default": "1", + "enum": [ + "1", + "2" + ] + }, + "NEventsListener": { + "type": "integer", + "description": "Number of event listeners subscribed.", + "example": 30 + }, + "KernelVersion": { + "type": "string", + "description": "Kernel version of the host.\n\nOn Linux, this information obtained from `uname`. On Windows this\ninformation is queried from the HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\\nregistry value, for example _\"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)\"_.\n", + "example": "4.9.38-moby" + }, + "OperatingSystem": { + "type": "string", + "description": "Name of the host's operating system, for example: \"Ubuntu 16.04.2 LTS\"\nor \"Windows Server 2016 Datacenter\"\n", + "example": "Alpine Linux v3.5" + }, + "OSVersion": { + "type": "string", + "description": "Version of the host's operating system\n\n


\n\n> **Note**: The information returned in this field, including its\n> very existence, and the formatting of values, should not be considered\n> stable, and may change without notice.\n", + "example": "16.04" + }, + "OSType": { + "type": "string", + "description": "Generic type of the operating system of the host, as returned by the\nGo runtime (`GOOS`).\n\nCurrently returned values are \"linux\" and \"windows\". A full list of\npossible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment).\n", + "example": "linux" + }, + "Architecture": { + "type": "string", + "description": "Hardware architecture of the host, as returned by the Go runtime\n(`GOARCH`).\n\nA full list of possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment).\n", + "example": "x86_64" + }, + "NCPU": { + "type": "integer", + "description": "The number of logical CPUs usable by the daemon.\n\nThe number of available CPUs is checked by querying the operating\nsystem when the daemon starts. Changes to operating system CPU\nallocation after the daemon is started are not reflected.\n", + "example": 4 + }, + "MemTotal": { + "type": "integer", + "description": "Total amount of physical memory available on the host, in bytes.\n", + "format": "int64", + "example": 2095882240 + }, + "IndexServerAddress": { + "type": "string", + "description": "Address / URL of the index server that is used for image search,\nand as a default for user authentication for Docker Hub and Docker Cloud.\n", + "example": "https://index.docker.io/v1/", + "default": "https://index.docker.io/v1/" + }, + "RegistryConfig": { + "$ref": "#/components/schemas/RegistryServiceConfig" + }, + "GenericResources": { + "$ref": "#/components/schemas/GenericResources" + }, + "HttpProxy": { + "type": "string", + "description": "HTTP-proxy configured for the daemon. This value is obtained from the\n[`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable.\nCredentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL\nare masked in the API response.\n\nContainers do not automatically inherit this configuration.\n", + "example": "http://xxxxx:xxxxx@proxy.corp.example.com:8080" + }, + "HttpsProxy": { + "type": "string", + "description": "HTTPS-proxy configured for the daemon. This value is obtained from the\n[`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable.\nCredentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL\nare masked in the API response.\n\nContainers do not automatically inherit this configuration.\n", + "example": "https://xxxxx:xxxxx@proxy.corp.example.com:4443" + }, + "NoProxy": { + "type": "string", + "description": "Comma-separated list of domain extensions for which no proxy should be\nused. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html)\nenvironment variable.\n\nContainers do not automatically inherit this configuration.\n", + "example": "*.local, 169.254/16" + }, + "Name": { + "type": "string", + "description": "Hostname of the host.", + "example": "node5.corp.example.com" + }, + "Labels": { + "type": "array", + "description": "User-defined labels (key/value metadata) as set on the daemon.\n\n


\n\n> **Note**: When part of a Swarm, nodes can both have _daemon_ labels,\n> set through the daemon configuration, and _node_ labels, set from a\n> manager node in the Swarm. Node labels are not included in this\n> field. Node labels can be retrieved using the `/nodes/(id)` endpoint\n> on a manager node in the Swarm.\n", + "example": [ + "storage=ssd", + "production" + ], + "items": { + "type": "string" + } + }, + "ExperimentalBuild": { + "type": "boolean", + "description": "Indicates if experimental features are enabled on the daemon.\n", + "example": true + }, + "ServerVersion": { + "type": "string", + "description": "Version string of the daemon.\n", + "example": "24.0.2" + }, + "Runtimes": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Runtime" + }, + "description": "List of [OCI compliant](https://github.com/opencontainers/runtime-spec)\nruntimes configured on the daemon. Keys hold the \"name\" used to\nreference the runtime.\n\nThe Docker daemon relies on an OCI compliant runtime (invoked via the\n`containerd` daemon) as its interface to the Linux kernel namespaces,\ncgroups, and SELinux.\n\nThe default runtime is `runc`, and automatically configured. Additional\nruntimes can be configured by the user and will be listed here.\n", + "example": { + "runc": { + "path": "runc" + }, + "runc-master": { + "path": "/go/bin/runc" + }, + "custom": { + "path": "/usr/local/bin/my-oci-runtime", + "runtimeArgs": [ + "--debug", + "--systemd-cgroup=false" + ] + } + } + }, + "DefaultRuntime": { + "type": "string", + "description": "Name of the default OCI runtime that is used when starting containers.\n\nThe default can be overridden per-container at create time.\n", + "example": "runc", + "default": "runc" + }, + "Swarm": { + "$ref": "#/components/schemas/SwarmInfo" + }, + "LiveRestoreEnabled": { + "type": "boolean", + "description": "Indicates if live restore is enabled.\n\nIf enabled, containers are kept running when the daemon is shutdown\nor upon daemon start if running containers are detected.\n", + "example": false, + "default": false + }, + "Isolation": { + "type": "string", + "description": "Represents the isolation technology to use as a default for containers.\nThe supported values are platform-specific.\n\nIf no isolation value is specified on daemon start, on Windows client,\nthe default is `hyperv`, and on Windows server, the default is `process`.\n\nThis option is currently not used on other platforms.\n", + "default": "default", + "enum": [ + "default", + "hyperv", + "process" + ] + }, + "InitBinary": { + "type": "string", + "description": "Name and, optional, path of the `docker-init` binary.\n\nIf the path is omitted, the daemon searches the host's `$PATH` for the\nbinary and uses the first result.\n", + "example": "docker-init" + }, + "ContainerdCommit": { + "$ref": "#/components/schemas/Commit" + }, + "RuncCommit": { + "$ref": "#/components/schemas/Commit" + }, + "InitCommit": { + "$ref": "#/components/schemas/Commit" + }, + "SecurityOptions": { + "type": "array", + "description": "List of security features that are enabled on the daemon, such as\napparmor, seccomp, SELinux, user-namespaces (userns), rootless and\nno-new-privileges.\n\nAdditional configuration options for each security feature may\nbe present, and are included as a comma-separated list of key/value\npairs.\n", + "example": [ + "name=apparmor", + "name=seccomp,profile=default", + "name=selinux", + "name=userns", + "name=rootless" + ], + "items": { + "type": "string" + } + }, + "ProductLicense": { + "type": "string", + "description": "Reports a summary of the product license on the daemon.\n\nIf a commercial license has been applied to the daemon, information\nsuch as number of nodes, and expiration are included.\n", + "example": "Community Engine" + }, + "DefaultAddressPools": { + "type": "array", + "description": "List of custom default address pools for local networks, which can be\nspecified in the daemon.json file or dockerd option.\n\nExample: a Base \"10.10.0.0/16\" with Size 24 will define the set of 256\n10.10.[0-255].0/24 address pools.\n", + "items": { + "type": "object", + "properties": { + "Base": { + "type": "string", + "description": "The network address in CIDR format", + "example": "10.10.0.0/16" + }, + "Size": { + "type": "integer", + "description": "The network pool size", + "example": 24 + } + } + } + }, + "Warnings": { + "type": "array", + "description": "List of warnings / informational messages about missing features, or\nissues related to the daemon configuration.\n\nThese messages can be printed by the client as information to the user.\n", + "example": [ + "WARNING: No memory limit support", + "WARNING: bridge-nf-call-iptables is disabled", + "WARNING: bridge-nf-call-ip6tables is disabled" + ], + "items": { + "type": "string" + } + } + } + }, + "PluginsInfo": { + "type": "object", + "properties": { + "Volume": { + "type": "array", + "description": "Names of available volume-drivers, and network-driver plugins.", + "example": [ + "local" + ], + "items": { + "type": "string" + } + }, + "Network": { + "type": "array", + "description": "Names of available network-drivers, and network-driver plugins.", + "example": [ + "bridge", + "host", + "ipvlan", + "macvlan", + "null", + "overlay" + ], + "items": { + "type": "string" + } + }, + "Authorization": { + "type": "array", + "description": "Names of available authorization plugins.", + "example": [ + "img-authz-plugin", + "hbm" + ], + "items": { + "type": "string" + } + }, + "Log": { + "type": "array", + "description": "Names of available logging-drivers, and logging-driver plugins.", + "example": [ + "awslogs", + "fluentd", + "gcplogs", + "gelf", + "journald", + "json-file", + "logentries", + "splunk", + "syslog" + ], + "items": { + "type": "string" + } + } + }, + "description": "Available plugins per type.\n\n


\n\n> **Note**: Only unmanaged (V1) plugins are included in this list.\n> V1 plugins are \"lazily\" loaded, and are not returned in this list\n> if there is no resource using the plugin.\n" + }, + "RegistryServiceConfig": { + "type": "object", + "properties": { + "AllowNondistributableArtifactsCIDRs": { + "type": "array", + "description": "List of IP ranges to which nondistributable artifacts can be pushed,\nusing the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632).\n\nSome images (for example, Windows base images) contain artifacts\nwhose distribution is restricted by license. When these images are\npushed to a registry, restricted artifacts are not included.\n\nThis configuration override this behavior, and enables the daemon to\npush nondistributable artifacts to all registries whose resolved IP\naddress is within the subnet described by the CIDR syntax.\n\nThis option is useful when pushing images containing\nnondistributable artifacts to a registry on an air-gapped network so\nhosts on that network can pull the images without connecting to\nanother server.\n\n> **Warning**: Nondistributable artifacts typically have restrictions\n> on how and where they can be distributed and shared. Only use this\n> feature to push artifacts to private registries and ensure that you\n> are in compliance with any terms that cover redistributing\n> nondistributable artifacts.\n", + "example": [ + "::1/128", + "127.0.0.0/8" + ], + "items": { + "type": "string" + } + }, + "AllowNondistributableArtifactsHostnames": { + "type": "array", + "description": "List of registry hostnames to which nondistributable artifacts can be\npushed, using the format `[:]` or `[:]`.\n\nSome images (for example, Windows base images) contain artifacts\nwhose distribution is restricted by license. When these images are\npushed to a registry, restricted artifacts are not included.\n\nThis configuration override this behavior for the specified\nregistries.\n\nThis option is useful when pushing images containing\nnondistributable artifacts to a registry on an air-gapped network so\nhosts on that network can pull the images without connecting to\nanother server.\n\n> **Warning**: Nondistributable artifacts typically have restrictions\n> on how and where they can be distributed and shared. Only use this\n> feature to push artifacts to private registries and ensure that you\n> are in compliance with any terms that cover redistributing\n> nondistributable artifacts.\n", + "example": [ + "registry.internal.corp.example.com:3000", + "[2001:db8:a0b:12f0::1]:443" + ], + "items": { + "type": "string" + } + }, + "InsecureRegistryCIDRs": { + "type": "array", + "description": "List of IP ranges of insecure registries, using the CIDR syntax\n([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries\naccept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates\nfrom unknown CAs) communication.\n\nBy default, local registries (`127.0.0.0/8`) are configured as\ninsecure. All other registries are secure. Communicating with an\ninsecure registry is not possible if the daemon assumes that registry\nis secure.\n\nThis configuration override this behavior, insecure communication with\nregistries whose resolved IP address is within the subnet described by\nthe CIDR syntax.\n\nRegistries can also be marked insecure by hostname. Those registries\nare listed under `IndexConfigs` and have their `Secure` field set to\n`false`.\n\n> **Warning**: Using this option can be useful when running a local\n> registry, but introduces security vulnerabilities. This option\n> should therefore ONLY be used for testing purposes. For increased\n> security, users should add their CA to their system's list of trusted\n> CAs instead of enabling this option.\n", + "example": [ + "::1/128", + "127.0.0.0/8" + ], + "items": { + "type": "string" + } + }, + "IndexConfigs": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/IndexInfo" + }, + "example": { + "127.0.0.1:5000": { + "Name": "127.0.0.1:5000", + "Mirrors": [], + "Secure": false, + "Official": false + }, + "[2001:db8:a0b:12f0::1]:80": { + "Name": "[2001:db8:a0b:12f0::1]:80", + "Mirrors": [], + "Secure": false, + "Official": false + }, + "docker.io": { + "Name": "docker.io", + "Mirrors": [ + "https://hub-mirror.corp.example.com:5000/" + ], + "Secure": true, + "Official": true + }, + "registry.internal.corp.example.com:3000": { + "Name": "registry.internal.corp.example.com:3000", + "Mirrors": [], + "Secure": false, + "Official": false + } + } + }, + "Mirrors": { + "type": "array", + "description": "List of registry URLs that act as a mirror for the official\n(`docker.io`) registry.\n", + "example": [ + "https://hub-mirror.corp.example.com:5000/", + "https://[2001:db8:a0b:12f0::1]/" + ], + "items": { + "type": "string" + } + } + }, + "description": "RegistryServiceConfig stores daemon registry services configuration.\n", + "nullable": true, + "x-nullable": true + }, + "IndexInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the registry, such as \"docker.io\".\n", + "example": "docker.io" + }, + "Mirrors": { + "type": "array", + "description": "List of mirrors, expressed as URIs.\n", + "example": [ + "https://hub-mirror.corp.example.com:5000/", + "https://registry-2.docker.io/", + "https://registry-3.docker.io/" + ], + "items": { + "type": "string" + } + }, + "Secure": { + "type": "boolean", + "description": "Indicates if the registry is part of the list of insecure\nregistries.\n\nIf `false`, the registry is insecure. Insecure registries accept\nun-encrypted (HTTP) and/or untrusted (HTTPS with certificates from\nunknown CAs) communication.\n\n> **Warning**: Insecure registries can be useful when running a local\n> registry. However, because its use creates security vulnerabilities\n> it should ONLY be enabled for testing purposes. For increased\n> security, users should add their CA to their system's list of\n> trusted CAs instead of enabling this option.\n", + "example": true + }, + "Official": { + "type": "boolean", + "description": "Indicates whether this is an official registry (i.e., Docker Hub / docker.io)\n", + "example": true + } + }, + "description": "IndexInfo contains information about a registry.", + "nullable": true, + "x-nullable": true + }, + "Runtime": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "Name and, optional, path, of the OCI executable binary.\n\nIf the path is omitted, the daemon searches the host's `$PATH` for the\nbinary and uses the first result.\n", + "example": "/usr/local/bin/my-oci-runtime" + }, + "runtimeArgs": { + "type": "array", + "description": "List of command-line arguments to pass to the runtime when invoked.\n", + "nullable": true, + "example": [ + "--debug", + "--systemd-cgroup=false" + ], + "items": { + "type": "string" + } + } + }, + "description": "Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec)\nruntime.\n\nThe runtime is invoked by the daemon via the `containerd` daemon. OCI\nruntimes act as an interface to the Linux kernel namespaces, cgroups,\nand SELinux.\n" + }, + "Commit": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Actual commit ID of external tool.", + "example": "cfb82a876ecc11b5ca0977d1733adbe58599088a" + }, + "Expected": { + "type": "string", + "description": "Commit ID of external tool expected by dockerd as set at build time.\n", + "example": "2d41c047c83e09a6d61d464906feb2a2f3c52aa4" + } + }, + "description": "Commit holds the Git-commit (SHA1) that a binary was built from, as\nreported in the version-string of external tools, such as `containerd`,\nor `runC`.\n" + }, + "SwarmInfo": { + "type": "object", + "properties": { + "NodeID": { + "type": "string", + "description": "Unique identifier of for this node in the swarm.", + "example": "k67qz4598weg5unwwffg6z1m1", + "default": "" + }, + "NodeAddr": { + "type": "string", + "description": "IP address at which this node can be reached by other nodes in the\nswarm.\n", + "example": "10.0.0.46", + "default": "" + }, + "LocalNodeState": { + "$ref": "#/components/schemas/LocalNodeState" + }, + "ControlAvailable": { + "type": "boolean", + "example": true, + "default": false + }, + "Error": { + "type": "string", + "default": "" + }, + "RemoteManagers": { + "type": "array", + "description": "List of ID's and addresses of other managers in the swarm.\n", + "nullable": true, + "example": [ + { + "NodeID": "71izy0goik036k48jg985xnds", + "Addr": "10.0.0.158:2377" + }, + { + "NodeID": "79y6h1o4gv8n120drcprv5nmc", + "Addr": "10.0.0.159:2377" + }, + { + "NodeID": "k67qz4598weg5unwwffg6z1m1", + "Addr": "10.0.0.46:2377" + } + ], + "items": { + "$ref": "#/components/schemas/PeerNode" + } + }, + "Nodes": { + "type": "integer", + "description": "Total number of nodes in the swarm.", + "nullable": true, + "example": 4 + }, + "Managers": { + "type": "integer", + "description": "Total number of managers in the swarm.", + "nullable": true, + "example": 3 + }, + "Cluster": { + "$ref": "#/components/schemas/ClusterInfo" + } + }, + "description": "Represents generic information about swarm.\n" + }, + "LocalNodeState": { + "type": "string", + "description": "Current local status of this node.", + "example": "active", + "default": "", + "enum": [ + "", + "inactive", + "pending", + "active", + "error", + "locked" + ] + }, + "PeerNode": { + "type": "object", + "properties": { + "NodeID": { + "type": "string", + "description": "Unique identifier of for this node in the swarm." + }, + "Addr": { + "type": "string", + "description": "IP address and ports at which this node can be reached.\n" + } + }, + "description": "Represents a peer-node in the swarm" + }, + "NetworkAttachmentConfig": { + "type": "object", + "properties": { + "Target": { + "type": "string", + "description": "The target network for attachment. Must be a network name or ID.\n" + }, + "Aliases": { + "type": "array", + "description": "Discoverable alternate names for the service on this network.\n", + "items": { + "type": "string" + } + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver attachment options for the network target.\n" + } + }, + "description": "Specifies how a service should be attached to a particular network.\n" + }, + "EventActor": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the object emitting the event", + "example": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + }, + "Attributes": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Various key/value attributes of the object, depending on its type.\n", + "example": { + "com.example.some-label": "some-label-value", + "image": "alpine:latest", + "name": "my-container" + } + } + }, + "description": "Actor describes something that generates events, like a container, network,\nor a volume.\n" + }, + "EventMessage": { + "title": "SystemEventsResponse", + "type": "object", + "properties": { + "Type": { + "type": "string", + "description": "The type of object emitting the event", + "example": "container", + "enum": [ + "builder", + "config", + "container", + "daemon", + "image", + "network", + "node", + "plugin", + "secret", + "service", + "volume" + ] + }, + "Action": { + "type": "string", + "description": "The type of event", + "example": "create" + }, + "Actor": { + "$ref": "#/components/schemas/EventActor" + }, + "scope": { + "type": "string", + "description": "Scope of the event. Engine events are `local` scope. Cluster (Swarm)\nevents are `swarm` scope.\n", + "enum": [ + "local", + "swarm" + ] + }, + "time": { + "type": "integer", + "description": "Timestamp of event", + "format": "int64", + "example": 1629574695 + }, + "timeNano": { + "type": "integer", + "description": "Timestamp of event, with nanosecond accuracy", + "format": "int64", + "example": 1629574695515050000 + } + }, + "description": "EventMessage represents the information an event contains.\n" + }, + "OCIDescriptor": { + "type": "object", + "properties": { + "mediaType": { + "type": "string", + "description": "The media type of the object this schema refers to.\n", + "example": "application/vnd.docker.distribution.manifest.v2+json" + }, + "digest": { + "type": "string", + "description": "The digest of the targeted content.\n", + "example": "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96" + }, + "size": { + "type": "integer", + "description": "The size in bytes of the blob.\n", + "format": "int64", + "example": 3987495 + } + }, + "description": "A descriptor struct containing digest, media type, and size, as defined in\nthe [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md).\n", + "x-go-name": "Descriptor" + }, + "OCIPlatform": { + "type": "object", + "properties": { + "architecture": { + "type": "string", + "description": "The CPU architecture, for example `amd64` or `ppc64`.\n", + "example": "arm" + }, + "os": { + "type": "string", + "description": "The operating system, for example `linux` or `windows`.\n", + "example": "windows" + }, + "os.version": { + "type": "string", + "description": "Optional field specifying the operating system version, for example on\nWindows `10.0.19041.1165`.\n", + "example": "10.0.19041.1165" + }, + "os.features": { + "type": "array", + "description": "Optional field specifying an array of strings, each listing a required\nOS feature (for example on Windows `win32k`).\n", + "example": [ + "win32k" + ], + "items": { + "type": "string" + } + }, + "variant": { + "type": "string", + "description": "Optional field specifying a variant of the CPU, for example `v7` to\nspecify ARMv7 when architecture is `arm`.\n", + "example": "v7" + } + }, + "description": "Describes the platform which the image in the manifest runs on, as defined\nin the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md).\n", + "x-go-name": "Platform" + }, + "DistributionInspect": { + "title": "DistributionInspectResponse", + "required": [ + "Descriptor", + "Platforms" + ], + "type": "object", + "properties": { + "Descriptor": { + "$ref": "#/components/schemas/OCIDescriptor" + }, + "Platforms": { + "type": "array", + "description": "An array containing all platforms supported by the image.\n", + "items": { + "$ref": "#/components/schemas/OCIPlatform" + } + } + }, + "description": "Describes the result obtained from contacting the registry to retrieve\nimage metadata.\n", + "x-go-name": "DistributionInspect" + }, + "ClusterVolume": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The Swarm ID of this volume. Because cluster volumes are Swarm\nobjects, they have an ID, unlike non-cluster volumes. This ID can\nbe used to refer to the Volume instead of the name.\n" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Spec": { + "$ref": "#/components/schemas/ClusterVolumeSpec" + }, + "Info": { + "type": "object", + "properties": { + "CapacityBytes": { + "type": "integer", + "description": "The capacity of the volume in bytes. A value of 0 indicates that\nthe capacity is unknown.\n", + "format": "int64" + }, + "VolumeContext": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of strings to strings returned from the storage plugin when\nthe volume is created.\n" + }, + "VolumeID": { + "type": "string", + "description": "The ID of the volume as returned by the CSI storage plugin. This\nis distinct from the volume's ID as provided by Docker. This ID\nis never used by the user when communicating with Docker to refer\nto this volume. If the ID is blank, then the Volume has not been\nsuccessfully created in the plugin yet.\n" + }, + "AccessibleTopology": { + "type": "array", + "description": "The topology this volume is actually accessible from.\n", + "items": { + "$ref": "#/components/schemas/Topology" + } + } + }, + "description": "Information about the global status of the volume.\n" + }, + "PublishStatus": { + "type": "array", + "description": "The status of the volume as it pertains to its publishing and use on\nspecific nodes\n", + "items": { + "type": "object", + "properties": { + "NodeID": { + "type": "string", + "description": "The ID of the Swarm node the volume is published on.\n" + }, + "State": { + "type": "string", + "description": "The published state of the volume.\n* `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed.\n* `published` The volume is published successfully to the node.\n* `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so.\n* `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller.\n", + "enum": [ + "pending-publish", + "published", + "pending-node-unpublish", + "pending-controller-unpublish" + ] + }, + "PublishContext": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of strings to strings returned by the CSI controller\nplugin when a volume is published.\n" + } + } + } + } + }, + "description": "Options and information specific to, and only present on, Swarm CSI\ncluster volumes.\n" + }, + "ClusterVolumeSpec": { + "type": "object", + "properties": { + "Group": { + "type": "string", + "description": "Group defines the volume group of this volume. Volumes belonging to\nthe same group can be referred to by group name when creating\nServices. Referring to a volume by group instructs Swarm to treat\nvolumes in that group interchangeably for the purpose of scheduling.\nVolumes with an empty string for a group technically all belong to\nthe same, emptystring group.\n" + }, + "AccessMode": { + "type": "object", + "properties": { + "Scope": { + "type": "string", + "description": "The set of nodes this volume can be used on at one time.\n- `single` The volume may only be scheduled to one node at a time.\n- `multi` the volume may be scheduled to any supported number of nodes at a time.\n", + "nullable": false, + "default": "single", + "enum": [ + "single", + "multi" + ] + }, + "Sharing": { + "type": "string", + "description": "The number and way that different tasks can use this volume\nat one time.\n- `none` The volume may only be used by one task at a time.\n- `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly\n- `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write.\n- `all` The volume may have any number of readers and writers.\n", + "nullable": false, + "default": "none", + "enum": [ + "none", + "readonly", + "onewriter", + "all" + ] + }, + "MountVolume": { + "type": "object", + "properties": {}, + "description": "Options for using this volume as a Mount-type volume.\n\n Either MountVolume or BlockVolume, but not both, must be\n present.\n properties:\n FsType:\n type: \"string\"\n description: |\n Specifies the filesystem type for the mount volume.\n Optional.\n MountFlags:\n type: \"array\"\n description: |\n Flags to pass when mounting the volume. Optional.\n items:\n type: \"string\"\nBlockVolume:\n type: \"object\"\n description: |\n Options for using this volume as a Block-type volume.\n Intentionally empty.\n" + }, + "Secrets": { + "type": "array", + "description": "Swarm Secrets that are passed to the CSI storage plugin when\noperating on this volume.\n", + "items": { + "type": "object", + "properties": { + "Key": { + "type": "string", + "description": "Key is the name of the key of the key-value pair passed to\nthe plugin.\n" + }, + "Secret": { + "type": "string", + "description": "Secret is the swarm Secret object from which to read data.\nThis can be a Secret name or ID. The Secret data is\nretrieved by swarm and used as the value of the key-value\npair passed to the plugin.\n" + } + }, + "description": "One cluster volume secret entry. Defines a key-value pair that\nis passed to the plugin.\n" + } + }, + "AccessibilityRequirements": { + "type": "object", + "properties": { + "Requisite": { + "type": "array", + "description": "A list of required topologies, at least one of which the\nvolume must be accessible from.\n", + "items": { + "$ref": "#/components/schemas/Topology" + } + }, + "Preferred": { + "type": "array", + "description": "A list of topologies that the volume should attempt to be\nprovisioned in.\n", + "items": { + "$ref": "#/components/schemas/Topology" + } + } + }, + "description": "Requirements for the accessible topology of the volume. These\nfields are optional. For an in-depth description of what these\nfields mean, see the CSI specification.\n" + }, + "CapacityRange": { + "type": "object", + "properties": { + "RequiredBytes": { + "type": "integer", + "description": "The volume must be at least this big. The value of 0\nindicates an unspecified minimum\n", + "format": "int64" + }, + "LimitBytes": { + "type": "integer", + "description": "The volume must not be bigger than this. The value of 0\nindicates an unspecified maximum.\n", + "format": "int64" + } + }, + "description": "The desired capacity that the volume should be created with. If\nempty, the plugin will decide the capacity.\n" + }, + "Availability": { + "type": "string", + "description": "The availability of the volume for use in tasks.\n- `active` The volume is fully available for scheduling on the cluster\n- `pause` No new workloads should use the volume, but existing workloads are not stopped.\n- `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started.\n", + "nullable": false, + "default": "active", + "enum": [ + "active", + "pause", + "drain" + ] + } + }, + "description": "Defines how the volume is used by tasks.\n" + } + }, + "description": "Cluster-specific options used to create the volume.\n" + }, + "Topology": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of topological domains to topological segments. For in depth\ndetails, see documentation for the Topology object in the CSI\nspecification.\n" + } + } + } +} \ No newline at end of file diff --git a/spec/v1.44.json b/spec/v1.44.json new file mode 100644 index 00000000..5165ccaa --- /dev/null +++ b/spec/v1.44.json @@ -0,0 +1,16801 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Docker Engine API", + "description": "The Engine API is an HTTP API served by Docker Engine. It is the API the\nDocker client uses to communicate with the Engine, so everything the Docker\nclient can do can be done with the API.\n\nMost of the client's commands map directly to API endpoints (e.g. `docker ps`\nis `GET /containers/json`). The notable exception is running containers,\nwhich consists of several API calls.\n\n# Errors\n\nThe API uses standard HTTP status codes to indicate the success or failure\nof the API call. The body of the response will be JSON in the following\nformat:\n\n```\n{\n \"message\": \"page not found\"\n}\n```\n\n# Versioning\n\nThe API is usually changed in each release, so API calls are versioned to\nensure that clients don't break. To lock to a specific version of the API,\nyou prefix the URL with its version, for example, call `/v1.30/info` to use\nthe v1.30 version of the `/info` endpoint. If the API version specified in\nthe URL is not supported by the daemon, a HTTP `400 Bad Request` error message\nis returned.\n\nIf you omit the version-prefix, the current version of the API (v1.44) is used.\nFor example, calling `/info` is the same as calling `/v1.44/info`. Using the\nAPI without a version-prefix is deprecated and will be removed in a future release.\n\nEngine releases in the near future should support this version of the API,\nso your client will continue to work even if it is talking to a newer Engine.\n\nThe API uses an open schema model, which means server may add extra properties\nto responses. Likewise, the server will ignore any extra query parameters and\nrequest body properties. When you write clients, you need to ignore additional\nproperties in responses to ensure they do not break when talking to newer\ndaemons.\n\n\n# Authentication\n\nAuthentication for registries is handled client side. The client has to send\nauthentication details to various endpoints that need to communicate with\nregistries, such as `POST /images/(name)/push`. These are sent as\n`X-Registry-Auth` header as a [base64url encoded](https://tools.ietf.org/html/rfc4648#section-5)\n(JSON) string with the following structure:\n\n```\n{\n \"username\": \"string\",\n \"password\": \"string\",\n \"email\": \"string\",\n \"serveraddress\": \"string\"\n}\n```\n\nThe `serveraddress` is a domain/IP without a protocol. Throughout this\nstructure, double quotes are required.\n\nIf you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth),\nyou can just pass this instead of credentials:\n\n```\n{\n \"identitytoken\": \"9cbaf023786cd7...\"\n}\n```\n", + "version": "1.44", + "x-logo": { + "url": "https://docs.docker.com/assets/images/logo-docker-main.png" + } + }, + "servers": [ + { + "url": "/v1.44" + } + ], + "tags": [ + { + "name": "Container", + "description": "Create and manage containers.\n", + "x-displayName": "Containers" + }, + { + "name": "Image", + "x-displayName": "Images" + }, + { + "name": "Network", + "description": "Networks are user-defined networks that containers can be attached to.\nSee the [networking documentation](https://docs.docker.com/network/)\nfor more information.\n", + "x-displayName": "Networks" + }, + { + "name": "Volume", + "description": "Create and manage persistent storage that can be attached to containers.\n", + "x-displayName": "Volumes" + }, + { + "name": "Exec", + "description": "Run new commands inside running containers. Refer to the\n[command-line reference](https://docs.docker.com/engine/reference/commandline/exec/)\nfor more information.\n\nTo exec a command in a container, you first need to create an exec instance,\nthen start it. These two API endpoints are wrapped up in a single command-line\ncommand, `docker exec`.\n", + "x-displayName": "Exec" + }, + { + "name": "Swarm", + "description": "Engines can be clustered together in a swarm. Refer to the\n[swarm mode documentation](https://docs.docker.com/engine/swarm/)\nfor more information.\n", + "x-displayName": "Swarm" + }, + { + "name": "Node", + "description": "Nodes are instances of the Engine participating in a swarm. Swarm mode\nmust be enabled for these endpoints to work.\n", + "x-displayName": "Nodes" + }, + { + "name": "Service", + "description": "Services are the definitions of tasks to run on a swarm. Swarm mode must\nbe enabled for these endpoints to work.\n", + "x-displayName": "Services" + }, + { + "name": "Task", + "description": "A task is a container running on a swarm. It is the atomic scheduling unit\nof swarm. Swarm mode must be enabled for these endpoints to work.\n", + "x-displayName": "Tasks" + }, + { + "name": "Secret", + "description": "Secrets are sensitive data that can be used by services. Swarm mode must\nbe enabled for these endpoints to work.\n", + "x-displayName": "Secrets" + }, + { + "name": "Config", + "description": "Configs are application configurations that can be used by services. Swarm\nmode must be enabled for these endpoints to work.\n", + "x-displayName": "Configs" + }, + { + "name": "Plugin", + "x-displayName": "Plugins" + }, + { + "name": "System", + "x-displayName": "System" + } + ], + "paths": { + "/containers/json": { + "get": { + "tags": [ + "Container" + ], + "summary": "List containers", + "description": "Returns a list of containers. For details on the format, see the\n[inspect endpoint](#operation/ContainerInspect).\n\nNote that it uses a different, smaller representation of a container\nthan inspecting a single container. For example, the list of linked\ncontainers is not propagated .\n", + "operationId": "ContainerList", + "parameters": [ + { + "name": "all", + "in": "query", + "description": "Return all containers. By default, only running containers are shown.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "limit", + "in": "query", + "description": "Return this number of most recently created containers, including\nnon-running ones.\n", + "schema": { + "type": "integer" + } + }, + { + "name": "size", + "in": "query", + "description": "Return the size of container as fields `SizeRw` and `SizeRootFs`.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "filters", + "in": "query", + "description": "Filters to process on the container list, encoded as JSON (a\n`map[string][]string`). For example, `{\"status\": [\"paused\"]}` will\nonly return paused containers.\n\nAvailable filters:\n\n- `ancestor`=(`[:]`, ``, or ``)\n- `before`=(`` or ``)\n- `expose`=(`[/]`|`/[]`)\n- `exited=` containers with exit code of ``\n- `health`=(`starting`|`healthy`|`unhealthy`|`none`)\n- `id=` a container's ID\n- `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only)\n- `is-task=`(`true`|`false`)\n- `label=key` or `label=\"key=value\"` of a container label\n- `name=` a container's name\n- `network`=(`` or ``)\n- `publish`=(`[/]`|`/[]`)\n- `since`=(`` or ``)\n- `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`)\n- `volume`=(`` or ``)\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerSummary" + } + }, + "example": [ + { + "Id": "8dfafdbc3a40", + "Names": [ + "/boring_feynman" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 1", + "Created": 1367854155, + "State": "Exited", + "Status": "Exit 0", + "Ports": [ + { + "PrivatePort": 2222, + "PublicPort": 3333, + "Type": "tcp" + } + ], + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "2cdc4edb1ded3631c81f57966563e5c8525b81121bb3706a9a9a3ae102711f3f", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:02" + } + } + }, + "Mounts": [ + { + "Name": "fac362...80535", + "Source": "/data", + "Destination": "/data", + "Driver": "local", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" + } + ] + }, + { + "Id": "9cd87474be90", + "Names": [ + "/coolName" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 222222", + "Created": 1367854155, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "88eaed7b37b38c2a3f0c4bc796494fdf51b270c2d22656412a2ca5d559a64d7a", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.8", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:08" + } + } + }, + "Mounts": [] + }, + { + "Id": "3176a2479c92", + "Names": [ + "/sleepy_dog" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "8b27c041c30326d59cd6e6f510d4f8d1d570a228466f956edf7815508f78e30d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.6", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:06" + } + } + }, + "Mounts": [] + }, + { + "Id": "4cb07b47f9fb", + "Names": [ + "/running_cat" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "d91c7b2f0644403d7ef3095985ea0e2370325cd2332ff3a3225c4247328e66e9", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.5", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:05" + } + } + }, + "Mounts": [] + } + ] + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/create": { + "post": { + "tags": [ + "Container" + ], + "summary": "Create a container", + "operationId": "ContainerCreate", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Assign the specified name to the container. Must match\n`/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`.\n", + "schema": { + "pattern": "^/?[a-zA-Z0-9][a-zA-Z0-9_.-]+$", + "type": "string" + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform in the format `os[/arch[/variant]]` used for image lookup.\n\nWhen specified, the daemon checks if the requested image is present\nin the local image cache with the given OS and Architecture, and\notherwise returns a `404` status.\n\nIf the option is not set, the host's native OS and Architecture are\nused to look up the image in the image cache. However, if no platform\nis passed and the given image does exist in the local image cache,\nbut its OS or architecture does not match, the container is created\nwith the available image, and a warning is added to the `Warnings`\nfield in the response, for example;\n\n WARNING: The requested image's platform (linux/arm64/v8) does not\n match the detected host platform (linux/amd64) and no\n specific platform was requested\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Container to create", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ContainerConfig" + }, + { + "type": "object", + "properties": { + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "NetworkingConfig": { + "$ref": "#/components/schemas/NetworkingConfig" + } + } + } + ] + } + }, + "application/octet-stream": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ContainerConfig" + }, + { + "type": "object", + "properties": { + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "NetworkingConfig": { + "$ref": "#/components/schemas/NetworkingConfig" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Container created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContainerCreateResponse" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such image: c2ada9df5af8" + } + } + } + }, + "409": { + "description": "conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/containers/{id}/json": { + "get": { + "tags": [ + "Container" + ], + "summary": "Inspect a container", + "description": "Return low-level information about a container.", + "operationId": "ContainerInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "size", + "in": "query", + "description": "Return the size of container as fields `SizeRw` and `SizeRootFs`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "ContainerInspectResponse", + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the container" + }, + "Created": { + "type": "string", + "description": "The time the container was created" + }, + "Path": { + "type": "string", + "description": "The path to the command being run" + }, + "Args": { + "type": "array", + "description": "The arguments to the command being run", + "items": { + "type": "string" + } + }, + "State": { + "$ref": "#/components/schemas/ContainerState" + }, + "Image": { + "type": "string", + "description": "The container's image ID" + }, + "ResolvConfPath": { + "type": "string" + }, + "HostnamePath": { + "type": "string" + }, + "HostsPath": { + "type": "string" + }, + "LogPath": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "RestartCount": { + "type": "integer" + }, + "Driver": { + "type": "string" + }, + "Platform": { + "type": "string" + }, + "MountLabel": { + "type": "string" + }, + "ProcessLabel": { + "type": "string" + }, + "AppArmorProfile": { + "type": "string" + }, + "ExecIDs": { + "type": "array", + "description": "IDs of exec instances that are running in the container.", + "nullable": true, + "items": { + "type": "string" + } + }, + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "GraphDriver": { + "$ref": "#/components/schemas/GraphDriverData" + }, + "SizeRw": { + "type": "integer", + "description": "The size of files that have been created or changed by this\ncontainer.\n", + "format": "int64" + }, + "SizeRootFs": { + "type": "integer", + "description": "The total size of all the files in this container.", + "format": "int64" + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MountPoint" + } + }, + "Config": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "NetworkSettings": { + "$ref": "#/components/schemas/NetworkSettings" + } + } + }, + "example": { + "AppArmorProfile": "", + "Args": [ + "-c", + "exit 9" + ], + "Config": { + "AttachStderr": true, + "AttachStdin": false, + "AttachStdout": true, + "Cmd": [ + "/bin/sh", + "-c", + "exit 9" + ], + "Domainname": "", + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Healthcheck": { + "Test": [ + "CMD-SHELL", + "exit 0" + ] + }, + "Hostname": "ba033ac44011", + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "MacAddress": "", + "NetworkDisabled": false, + "OpenStdin": false, + "StdinOnce": false, + "Tty": false, + "User": "", + "Volumes": { + "/volumes/data": {} + }, + "WorkingDir": "", + "StopSignal": "SIGTERM", + "StopTimeout": 10 + }, + "Created": "2015-01-06T15:47:31.485331387Z", + "Driver": "overlay2", + "ExecIDs": [ + "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca", + "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4" + ], + "HostConfig": { + "MaximumIOps": 0, + "MaximumIOBps": 0, + "BlkioWeight": 0, + "BlkioWeightDevice": [ + {} + ], + "BlkioDeviceReadBps": [ + {} + ], + "BlkioDeviceWriteBps": [ + {} + ], + "BlkioDeviceReadIOps": [ + {} + ], + "BlkioDeviceWriteIOps": [ + {} + ], + "ContainerIDFile": "", + "CpusetCpus": "", + "CpusetMems": "", + "CpuPercent": 80, + "CpuShares": 0, + "CpuPeriod": 100000, + "CpuRealtimePeriod": 1000000, + "CpuRealtimeRuntime": 10000, + "Devices": [], + "DeviceRequests": [ + { + "Driver": "nvidia", + "Count": -1, + "DeviceIDs\"": [ + "0", + "1", + "GPU-fef8089b-4820-abfc-e83e-94318197576e" + ], + "Capabilities": [ + [ + "gpu", + "nvidia", + "compute" + ] + ], + "Options": { + "property1": "string", + "property2": "string" + } + } + ], + "IpcMode": "", + "Memory": 0, + "MemorySwap": 0, + "MemoryReservation": 0, + "OomKillDisable": false, + "OomScoreAdj": 500, + "NetworkMode": "bridge", + "PidMode": "", + "PortBindings": {}, + "Privileged": false, + "ReadonlyRootfs": false, + "PublishAllPorts": false, + "RestartPolicy": { + "MaximumRetryCount": 2, + "Name": "on-failure" + }, + "LogConfig": { + "Type": "json-file" + }, + "Sysctls": { + "net.ipv4.ip_forward": "1" + }, + "Ulimits": [ + {} + ], + "VolumeDriver": "", + "ShmSize": 67108864 + }, + "HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname", + "HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts", + "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log", + "Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39", + "Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2", + "MountLabel": "", + "Name": "/boring_euclid", + "NetworkSettings": { + "Bridge": "", + "SandboxID": "", + "HairpinMode": false, + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + "SandboxKey": "", + "EndpointID": "", + "Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "IPAddress": "", + "IPPrefixLen": 0, + "IPv6Gateway": "", + "MacAddress": "", + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Path": "/bin/sh", + "ProcessLabel": "", + "ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf", + "RestartCount": 1, + "State": { + "Error": "", + "ExitCode": 9, + "FinishedAt": "2015-01-06T15:47:32.080254511Z", + "Health": { + "Status": "healthy", + "FailingStreak": 0, + "Log": [ + { + "Start": "2019-12-22T10:59:05.6385933Z", + "End": "2019-12-22T10:59:05.8078452Z", + "ExitCode": 0, + "Output": "" + } + ] + }, + "OOMKilled": false, + "Dead": false, + "Paused": false, + "Pid": 0, + "Restarting": false, + "Running": true, + "StartedAt": "2015-01-06T15:47:32.072697474Z", + "Status": "running" + }, + "Mounts": [ + { + "Name": "fac362...80535", + "Source": "/data", + "Destination": "/data", + "Driver": "local", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" + } + ] + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/top": { + "get": { + "tags": [ + "Container" + ], + "summary": "List processes running inside a container", + "description": "On Unix systems, this is done by running the `ps` command. This endpoint\nis not supported on Windows.\n", + "operationId": "ContainerTop", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "ps_args", + "in": "query", + "description": "The arguments to pass to `ps`. For example, `aux`", + "schema": { + "type": "string", + "default": "-ef" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "ContainerTopResponse", + "type": "object", + "properties": { + "Titles": { + "type": "array", + "description": "The ps column titles", + "items": { + "type": "string" + } + }, + "Processes": { + "type": "array", + "description": "Each process running in the container, where each is process\nis an array of values corresponding to the titles.\n", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "description": "OK response to ContainerTop operation" + }, + "example": { + "Titles": [ + "UID", + "PID", + "PPID", + "C", + "STIME", + "TTY", + "TIME", + "CMD" + ], + "Processes": [ + [ + "root", + "13642", + "882", + "0", + "17:03", + "pts/0", + "00:00:00", + "/bin/bash" + ], + [ + "root", + "13735", + "13642", + "0", + "17:06", + "pts/0", + "00:00:00", + "sleep 10" + ] + ] + } + }, + "text/plain": { + "schema": { + "title": "ContainerTopResponse", + "type": "object", + "properties": { + "Titles": { + "type": "array", + "description": "The ps column titles", + "items": { + "type": "string" + } + }, + "Processes": { + "type": "array", + "description": "Each process running in the container, where each is process\nis an array of values corresponding to the titles.\n", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "description": "OK response to ContainerTop operation" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/logs": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get container logs", + "description": "Get `stdout` and `stderr` logs from a container.\n\nNote: This endpoint works only for containers with the `json-file` or\n`journald` logging driver.\n", + "operationId": "ContainerLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "follow", + "in": "query", + "description": "Keep connection after returning logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "until", + "in": "query", + "description": "Only return logs before this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs.\nSpecify as an integer or `all` to output all log lines.\n", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "200": { + "description": "logs returned as a stream in response body.\nFor the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach).\nNote that unlike the attach endpoint, the logs endpoint does not\nupgrade the connection and does not set Content-Type.\n", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/changes": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get changes on a container’s filesystem", + "description": "Returns which files in a container's filesystem have been added, deleted,\nor modified. The `Kind` of modification can be one of:\n\n- `0`: Modified (\"C\")\n- `1`: Added (\"A\")\n- `2`: Deleted (\"D\")\n", + "operationId": "ContainerChanges", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The list of changes", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FilesystemChange" + } + }, + "example": [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/export": { + "get": { + "tags": [ + "Container" + ], + "summary": "Export a container", + "description": "Export the contents of a container as a tarball.", + "operationId": "ContainerExport", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/stats": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get container stats based on resource usage", + "description": "This endpoint returns a live stream of a container’s resource usage\nstatistics.\n\nThe `precpu_stats` is the CPU statistic of the *previous* read, and is\nused to calculate the CPU usage percentage. It is not an exact copy\nof the `cpu_stats` field.\n\nIf either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is\nnil then for compatibility with older daemons the length of the\ncorresponding `cpu_usage.percpu_usage` array should be used.\n\nOn a cgroup v2 host, the following fields are not set\n* `blkio_stats`: all fields other than `io_service_bytes_recursive`\n* `cpu_stats`: `cpu_usage.percpu_usage`\n* `memory_stats`: `max_usage` and `failcnt`\nAlso, `memory_stats.stats` fields are incompatible with cgroup v1.\n\nTo calculate the values shown by the `stats` command of the docker cli tool\nthe following formulas can be used:\n* used_memory = `memory_stats.usage - memory_stats.stats.cache`\n* available_memory = `memory_stats.limit`\n* Memory usage % = `(used_memory / available_memory) * 100.0`\n* cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage`\n* system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage`\n* number_cpus = `lenght(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus`\n* CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0`\n", + "operationId": "ContainerStats", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "stream", + "in": "query", + "description": "Stream the output. If false, the stats will be output once and then\nit will disconnect.\n", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "one-shot", + "in": "query", + "description": "Only get a single stat instead of waiting for 2 cycles. Must be used\nwith `stream=false`.\n", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "read": "2015-01-08T22:57:31.547920715Z", + "pids_stats": { + "current": 3 + }, + "networks": { + "eth0": { + "rx_bytes": 5338, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 36, + "tx_bytes": 648, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 8 + }, + "eth5": { + "rx_bytes": 4641, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 26, + "tx_bytes": 690, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 9 + } + }, + "memory_stats": { + "stats": { + "total_pgmajfault": 0, + "cache": 0, + "mapped_file": 0, + "total_inactive_file": 0, + "pgpgout": 414, + "rss": 6537216, + "total_mapped_file": 0, + "writeback": 0, + "unevictable": 0, + "pgpgin": 477, + "total_unevictable": 0, + "pgmajfault": 0, + "total_rss": 6537216, + "total_rss_huge": 6291456, + "total_writeback": 0, + "total_inactive_anon": 0, + "rss_huge": 6291456, + "hierarchical_memory_limit": 67108864, + "total_pgfault": 964, + "total_active_file": 0, + "active_anon": 6537216, + "total_active_anon": 6537216, + "total_pgpgout": 414, + "total_cache": 0, + "inactive_anon": 0, + "active_file": 0, + "pgfault": 964, + "inactive_file": 0, + "total_pgpgin": 477 + }, + "max_usage": 6651904, + "usage": 6537216, + "failcnt": 0, + "limit": 67108864 + }, + "blkio_stats": {}, + "cpu_stats": { + "cpu_usage": { + "percpu_usage": [ + 8646879, + 24472255, + 36438778, + 30657443 + ], + "usage_in_usermode": 50000000, + "total_usage": 100215355, + "usage_in_kernelmode": 30000000 + }, + "system_cpu_usage": 739306590000000, + "online_cpus": 4, + "throttling_data": { + "periods": 0, + "throttled_periods": 0, + "throttled_time": 0 + } + }, + "precpu_stats": { + "cpu_usage": { + "percpu_usage": [ + 8646879, + 24350896, + 36438778, + 30657443 + ], + "usage_in_usermode": 50000000, + "total_usage": 100093996, + "usage_in_kernelmode": 30000000 + }, + "system_cpu_usage": 9492140000000, + "online_cpus": 4, + "throttling_data": { + "periods": 0, + "throttled_periods": 0, + "throttled_time": 0 + } + } + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/resize": { + "post": { + "tags": [ + "Container" + ], + "summary": "Resize a container TTY", + "description": "Resize the TTY for a container.", + "operationId": "ContainerResize", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "h", + "in": "query", + "description": "Height of the TTY session in characters", + "schema": { + "type": "integer" + } + }, + { + "name": "w", + "in": "query", + "description": "Width of the TTY session in characters", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "cannot resize container", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/start": { + "post": { + "tags": [ + "Container" + ], + "summary": "Start a container", + "operationId": "ContainerStart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container. Format is a\nsingle character `[a-Z]` or `ctrl-` where `` is one\nof: `a-z`, `@`, `^`, `[`, `,` or `_`.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "304": { + "description": "container already started", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/stop": { + "post": { + "tags": [ + "Container" + ], + "summary": "Stop a container", + "operationId": "ContainerStop", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "signal", + "in": "query", + "description": "Signal to send to the container as an integer or string (e.g. `SIGINT`).\n", + "schema": { + "type": "string" + } + }, + { + "name": "t", + "in": "query", + "description": "Number of seconds to wait before killing the container", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "304": { + "description": "container already stopped", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/restart": { + "post": { + "tags": [ + "Container" + ], + "summary": "Restart a container", + "operationId": "ContainerRestart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "signal", + "in": "query", + "description": "Signal to send to the container as an integer or string (e.g. `SIGINT`).\n", + "schema": { + "type": "string" + } + }, + { + "name": "t", + "in": "query", + "description": "Number of seconds to wait before killing the container", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/kill": { + "post": { + "tags": [ + "Container" + ], + "summary": "Kill a container", + "description": "Send a POSIX signal to a container, defaulting to killing to the\ncontainer.\n", + "operationId": "ContainerKill", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "signal", + "in": "query", + "description": "Signal to send to the container as an integer or string (e.g. `SIGINT`).\n", + "schema": { + "type": "string", + "default": "SIGKILL" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "container is not running", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "Container d37cde0fe4ad63c3a7252023b2f9800282894247d145cb5933ddf6e52cc03a28 is not running" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/update": { + "post": { + "tags": [ + "Container" + ], + "summary": "Update a container", + "description": "Change various configuration options of a container without having to\nrecreate it.\n", + "operationId": "ContainerUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Resources" + }, + { + "type": "object", + "properties": { + "RestartPolicy": { + "$ref": "#/components/schemas/RestartPolicy" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The container has been updated.", + "content": { + "application/json": { + "schema": { + "title": "ContainerUpdateResponse", + "type": "object", + "properties": { + "Warnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "OK response to ContainerUpdate operation" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "update" + } + }, + "/containers/{id}/rename": { + "post": { + "tags": [ + "Container" + ], + "summary": "Rename a container", + "operationId": "ContainerRename", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "description": "New name for the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "name already in use", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/pause": { + "post": { + "tags": [ + "Container" + ], + "summary": "Pause a container", + "description": "Use the freezer cgroup to suspend all processes in a container.\n\nTraditionally, when suspending a process the `SIGSTOP` signal is used,\nwhich is observable by the process being suspended. With the freezer\ncgroup the process is unaware, and unable to capture, that it is being\nsuspended, and subsequently resumed.\n", + "operationId": "ContainerPause", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/unpause": { + "post": { + "tags": [ + "Container" + ], + "summary": "Unpause a container", + "description": "Resume a container which has been paused.", + "operationId": "ContainerUnpause", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/attach": { + "post": { + "tags": [ + "Container" + ], + "summary": "Attach to a container", + "description": "Attach to a container to read its output or send it input. You can attach\nto the same container multiple times and you can reattach to containers\nthat have been detached.\n\nEither the `stream` or `logs` parameter must be `true` for this endpoint\nto do anything.\n\nSee the [documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/)\nfor more details.\n\n### Hijacking\n\nThis endpoint hijacks the HTTP connection to transport `stdin`, `stdout`,\nand `stderr` on the same socket.\n\nThis is the response from the daemon for an attach request:\n\n```\nHTTP/1.1 200 OK\nContent-Type: application/vnd.docker.raw-stream\n\n[STREAM]\n```\n\nAfter the headers and two new lines, the TCP connection can now be used\nfor raw, bidirectional communication between the client and server.\n\nTo hint potential proxies about connection hijacking, the Docker client\ncan also optionally send connection upgrade headers.\n\nFor example, the client sends this request to upgrade the connection:\n\n```\nPOST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1\nUpgrade: tcp\nConnection: Upgrade\n```\n\nThe Docker daemon will respond with a `101 UPGRADED` response, and will\nsimilarly follow with the raw stream:\n\n```\nHTTP/1.1 101 UPGRADED\nContent-Type: application/vnd.docker.raw-stream\nConnection: Upgrade\nUpgrade: tcp\n\n[STREAM]\n```\n\n### Stream format\n\nWhen the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate),\nthe HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream\nand the stream over the hijacked connected is multiplexed to separate out\n`stdout` and `stderr`. The stream consists of a series of frames, each\ncontaining a header and a payload.\n\nThe header contains the information which the stream writes (`stdout` or\n`stderr`). It also contains the size of the associated frame encoded in\nthe last four bytes (`uint32`).\n\nIt is encoded on the first eight bytes like this:\n\n```go\nheader := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n```\n\n`STREAM_TYPE` can be:\n\n- 0: `stdin` (is written on `stdout`)\n- 1: `stdout`\n- 2: `stderr`\n\n`SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size\nencoded as big endian.\n\nFollowing the header is the payload, which is the specified number of\nbytes of `STREAM_TYPE`.\n\nThe simplest way to implement this protocol is the following:\n\n1. Read 8 bytes.\n2. Choose `stdout` or `stderr` depending on the first byte.\n3. Extract the frame size from the last four bytes.\n4. Read the extracted size and output it on the correct output.\n5. Goto 1.\n\n### Stream format when using a TTY\n\nWhen the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate),\nthe stream is not multiplexed. The data exchanged over the hijacked\nconnection is simply the raw data from the process PTY and client's\n`stdin`.\n", + "operationId": "ContainerAttach", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container.Format is a single\ncharacter `[a-Z]` or `ctrl-` where `` is one of: `a-z`,\n`@`, `^`, `[`, `,` or `_`.\n", + "schema": { + "type": "string" + } + }, + { + "name": "logs", + "in": "query", + "description": "Replay previous logs from the container.\n\nThis is useful for attaching to a container that has started and you\nwant to output everything since the container started.\n\nIf `stream` is also enabled, once all the previous output has been\nreturned, it will seamlessly transition into streaming current\noutput.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stream", + "in": "query", + "description": "Stream attached streams from the time the request was made onwards.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdin", + "in": "query", + "description": "Attach to `stdin`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Attach to `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Attach to `stderr`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "101": { + "description": "no error, hints proxy about hijacking", + "content": {} + }, + "200": { + "description": "no error, no upgrade header found", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/attach/ws": { + "get": { + "tags": [ + "Container" + ], + "summary": "Attach to a container via a websocket", + "operationId": "ContainerAttachWebsocket", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container.Format is a single\ncharacter `[a-Z]` or `ctrl-` where `` is one of: `a-z`,\n`@`, `^`, `[`, `,`, or `_`.\n", + "schema": { + "type": "string" + } + }, + { + "name": "logs", + "in": "query", + "description": "Return logs", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stream", + "in": "query", + "description": "Return stream", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdin", + "in": "query", + "description": "Attach to `stdin`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Attach to `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Attach to `stderr`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "101": { + "description": "no error, hints proxy about hijacking", + "content": {} + }, + "200": { + "description": "no error, no upgrade header found", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/wait": { + "post": { + "tags": [ + "Container" + ], + "summary": "Wait for a container", + "description": "Block until a container stops, then returns the exit code.", + "operationId": "ContainerWait", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "condition", + "in": "query", + "description": "Wait until a container state reaches the given condition.\n\nDefaults to `not-running` if omitted or empty.\n", + "schema": { + "type": "string", + "default": "not-running", + "enum": [ + "not-running", + "next-exit", + "removed" + ] + } + } + ], + "responses": { + "200": { + "description": "The container has exit.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContainerWaitResponse" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}": { + "delete": { + "tags": [ + "Container" + ], + "summary": "Remove a container", + "operationId": "ContainerDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "v", + "in": "query", + "description": "Remove anonymous volumes associated with the container.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "force", + "in": "query", + "description": "If the container is running, kill it before removing it.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "link", + "in": "query", + "description": "Remove the specified link associated with the container.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "You cannot remove a running container: c2ada9df5af8. Stop the\ncontainer before attempting removal or force remove\n" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/archive": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get an archive of a filesystem resource in a container", + "description": "Get a tar archive of a resource in the filesystem of container id.", + "operationId": "ContainerArchive", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Resource in the container’s filesystem to archive.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Container or path does not exist", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Container" + ], + "summary": "Extract an archive of files or folders to a directory in a container", + "description": "Upload a tar archive to be extracted to a path in the filesystem of container id.\n`path` parameter is asserted to be a directory. If it exists as a file, 400 error\nwill be returned with message \"not a directory\".\n", + "operationId": "PutContainerArchive", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Path to a directory in the container to extract the archive’s contents into. ", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "noOverwriteDirNonDir", + "in": "query", + "description": "If `1`, `true`, or `True` then it will be an error if unpacking the\ngiven content would cause an existing directory to be replaced with\na non-directory and vice versa.\n", + "schema": { + "type": "string" + } + }, + { + "name": "copyUIDGID", + "in": "query", + "description": "If `1`, `true`, then it will copy UID/GID maps to the dest file or\ndir\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The input stream must be a tar archive compressed with one of the\nfollowing algorithms: `identity` (no compression), `gzip`, `bzip2`,\nor `xz`.\n", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The content was extracted successfully", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "not a directory" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "Permission denied, the volume or container rootfs is marked as read-only.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "No such container or path does not exist inside the container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputStream" + }, + "head": { + "tags": [ + "Container" + ], + "summary": "Get information about files in a container", + "description": "A response header `X-Docker-Container-Path-Stat` is returned, containing\na base64 - encoded JSON object with some filesystem header information\nabout the path.\n", + "operationId": "ContainerArchiveInfo", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Resource in the container’s filesystem to archive.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "headers": { + "X-Docker-Container-Path-Stat": { + "description": "A base64 - encoded JSON object with some filesystem header\ninformation about the path\n", + "schema": { + "type": "string" + } + } + }, + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Container or path does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/prune": { + "post": { + "tags": [ + "Container" + ], + "summary": "Delete stopped containers", + "operationId": "ContainerPrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `until=` Prune containers created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune containers with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ContainerPruneResponse", + "type": "object", + "properties": { + "ContainersDeleted": { + "type": "array", + "description": "Container IDs that were deleted", + "items": { + "type": "string" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/json": { + "get": { + "tags": [ + "Image" + ], + "summary": "List Images", + "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.", + "operationId": "ImageList", + "parameters": [ + { + "name": "all", + "in": "query", + "description": "Show all images. Only images from a final layer (no children) are shown by default.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the images list.\n\nAvailable filters:\n\n- `before`=(`[:]`, `` or ``)\n- `dangling=true`\n- `label=key` or `label=\"key=value\"` of an image label\n- `reference`=(`[:]`)\n- `since`=(`[:]`, `` or ``)\n- `until=`\n", + "schema": { + "type": "string" + } + }, + { + "name": "shared-size", + "in": "query", + "description": "Compute and show shared size as a `SharedSize` field on each image.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "digests", + "in": "query", + "description": "Show digest information as a `RepoDigests` field on each image.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Summary image data for the images matching the query", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/build": { + "post": { + "tags": [ + "Image" + ], + "summary": "Build an image", + "description": "Build an image from a tar archive with a `Dockerfile` in it.\n\nThe `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/).\n\nThe 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.\n\nThe build is canceled if the client drops the connection by quitting or being killed.\n", + "operationId": "ImageBuild", + "parameters": [ + { + "name": "dockerfile", + "in": "query", + "description": "Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`.", + "schema": { + "type": "string", + "default": "Dockerfile" + } + }, + { + "name": "t", + "in": "query", + "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.", + "schema": { + "type": "string" + } + }, + { + "name": "extrahosts", + "in": "query", + "description": "Extra hosts to add to /etc/hosts", + "schema": { + "type": "string" + } + }, + { + "name": "remote", + "in": "query", + "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.", + "schema": { + "type": "string" + } + }, + { + "name": "q", + "in": "query", + "description": "Suppress verbose build output.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "nocache", + "in": "query", + "description": "Do not use the cache when building the image.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "cachefrom", + "in": "query", + "description": "JSON array of images used for build cache resolution.", + "schema": { + "type": "string" + } + }, + { + "name": "pull", + "in": "query", + "description": "Attempt to pull the image even if an older image exists locally.", + "schema": { + "type": "string" + } + }, + { + "name": "rm", + "in": "query", + "description": "Remove intermediate containers after a successful build.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "forcerm", + "in": "query", + "description": "Always remove intermediate containers, even upon failure.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "memory", + "in": "query", + "description": "Set memory limit for build.", + "schema": { + "type": "integer" + } + }, + { + "name": "memswap", + "in": "query", + "description": "Total memory (memory + swap). Set as `-1` to disable swap.", + "schema": { + "type": "integer" + } + }, + { + "name": "cpushares", + "in": "query", + "description": "CPU shares (relative weight).", + "schema": { + "type": "integer" + } + }, + { + "name": "cpusetcpus", + "in": "query", + "description": "CPUs in which to allow execution (e.g., `0-3`, `0,1`).", + "schema": { + "type": "string" + } + }, + { + "name": "cpuperiod", + "in": "query", + "description": "The length of a CPU period in microseconds.", + "schema": { + "type": "integer" + } + }, + { + "name": "cpuquota", + "in": "query", + "description": "Microseconds of CPU time that the container can get in a CPU period.", + "schema": { + "type": "integer" + } + }, + { + "name": "buildargs", + "in": "query", + "description": "JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values.\n\nFor example, the build arg `FOO=bar` would become `{\"FOO\":\"bar\"}` in JSON. This would result in the query parameter `buildargs={\"FOO\":\"bar\"}`. Note that `{\"FOO\":\"bar\"}` should be URI component encoded.\n\n[Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg)\n", + "schema": { + "type": "string" + } + }, + { + "name": "shmsize", + "in": "query", + "description": "Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB.", + "schema": { + "type": "integer" + } + }, + { + "name": "squash", + "in": "query", + "description": "Squash the resulting images layers into a single layer. *(Experimental release only.)*", + "schema": { + "type": "boolean" + } + }, + { + "name": "labels", + "in": "query", + "description": "Arbitrary key/value labels to set on the image, as a JSON map of string pairs.", + "schema": { + "type": "string" + } + }, + { + "name": "networkmode", + "in": "query", + "description": "Sets the networking mode for the run commands during build. Supported\nstandard values are: `bridge`, `host`, `none`, and `container:`.\nAny other value is taken as a custom network's name or ID to which this\ncontainer should connect to.\n", + "schema": { + "type": "string" + } + }, + { + "name": "Content-type", + "in": "header", + "schema": { + "type": "string", + "default": "application/x-tar", + "enum": [ + "application/x-tar" + ] + } + }, + { + "name": "X-Registry-Config", + "in": "header", + "description": "This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to.\n\nThe key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example:\n\n```\n{\n \"docker.example.com\": {\n \"username\": \"janedoe\",\n \"password\": \"hunter2\"\n },\n \"https://index.docker.io/v1/\": {\n \"username\": \"mobydock\",\n \"password\": \"conta1n3rize14\"\n }\n}\n```\n\nOnly 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.\n", + "schema": { + "type": "string" + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform in the format os[/arch[/variant]]", + "schema": { + "type": "string" + } + }, + { + "name": "target", + "in": "query", + "description": "Target build stage", + "schema": { + "type": "string" + } + }, + { + "name": "outputs", + "in": "query", + "description": "BuildKit output configuration", + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "Version of the builder backend to use.\n\n- `1` is the first generation classic (deprecated) builder in the Docker daemon (default)\n- `2` is [BuildKit](https://github.com/moby/buildkit)\n", + "schema": { + "type": "string", + "default": "1", + "enum": [ + "1", + "2" + ] + } + } + ], + "requestBody": { + "description": "A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz.", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputStream" + } + }, + "/build/prune": { + "post": { + "tags": [ + "Image" + ], + "summary": "Delete builder cache", + "operationId": "BuildPrune", + "parameters": [ + { + "name": "keep-storage", + "in": "query", + "description": "Amount of disk space in bytes to keep for cache", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "all", + "in": "query", + "description": "Remove all types of build cache", + "schema": { + "type": "boolean" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the list of build cache objects.\n\nAvailable filters:\n\n- `until=` remove cache older than ``. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time.\n- `id=`\n- `parent=`\n- `type=`\n- `description=`\n- `inuse`\n- `shared`\n- `private`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "BuildPruneResponse", + "type": "object", + "properties": { + "CachesDeleted": { + "type": "array", + "items": { + "type": "string", + "description": "ID of build cache object" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/create": { + "post": { + "tags": [ + "Image" + ], + "summary": "Create an image", + "description": "Pull or import an image.", + "operationId": "ImageCreate", + "parameters": [ + { + "name": "fromImage", + "in": "query", + "description": "Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed.", + "schema": { + "type": "string" + } + }, + { + "name": "fromSrc", + "in": "query", + "description": "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image.", + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled.", + "schema": { + "type": "string" + } + }, + { + "name": "message", + "in": "query", + "description": "Set commit message for imported image.", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + }, + { + "name": "changes", + "in": "query", + "description": "Apply `Dockerfile` instructions to the image that is created,\nfor example: `changes=ENV DEBUG=true`.\nNote that `ENV DEBUG=true` should be URI component encoded.\n\nSupported `Dockerfile` instructions:\n`CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR`\n", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform in the format os[/arch[/variant]].\n\nWhen used in combination with the `fromImage` option, the daemon checks\nif the given image is present in the local image cache with the given\nOS and Architecture, and otherwise attempts to pull the image. If the\noption is not set, the host's native OS and Architecture are used.\nIf the given image does not exist in the local image cache, the daemon\nattempts to pull the image with the host's native OS and Architecture.\nIf the given image does exists in the local image cache, but its OS or\narchitecture does not match, a warning is produced.\n\nWhen used with the `fromSrc` option to import an image from an archive,\nthis option sets the platform information for the imported image. If\nthe option is not set, the host's native OS and Architecture are used\nfor the imported image.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Image content if the value `-` has been specified in fromSrc query parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/octet-stream": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "repository does not exist or no read access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputImage" + } + }, + "/images/{name}/json": { + "get": { + "tags": [ + "Image" + ], + "summary": "Inspect an image", + "description": "Return low-level information about an image.", + "operationId": "ImageInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ImageInspect" + } + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such image: someimage (tag: latest)" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/history": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get the history of an image", + "description": "Return parent layers of an image.", + "operationId": "ImageHistory", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "List of image layers", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "HistoryResponseItem", + "required": [ + "Comment", + "Created", + "CreatedBy", + "Id", + "Size", + "Tags" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": false + }, + "Created": { + "type": "integer", + "format": "int64", + "nullable": false + }, + "CreatedBy": { + "type": "string", + "nullable": false + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "Size": { + "type": "integer", + "format": "int64", + "nullable": false + }, + "Comment": { + "type": "string", + "nullable": false + } + }, + "description": "individual image layer information in response to ImageHistory operation", + "x-go-name": "HistoryResponseItem" + } + }, + "example": [ + { + "Id": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710", + "Created": 1398108230, + "CreatedBy": "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /", + "Tags": [ + "ubuntu:lucid", + "ubuntu:10.04" + ], + "Size": 182964289, + "Comment": "" + }, + { + "Id": "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8", + "Created": 1398108222, + "CreatedBy": "/bin/sh -c #(nop) MAINTAINER Tianon Gravi - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/", + "Tags": [], + "Size": 0, + "Comment": "" + }, + { + "Id": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158", + "Created": 1371157430, + "CreatedBy": "", + "Tags": [ + "scratch12:latest", + "scratch:latest" + ], + "Size": 0, + "Comment": "Imported from -" + } + ] + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/push": { + "post": { + "tags": [ + "Image" + ], + "summary": "Push an image", + "description": "Push an image to a registry.\n\nIf you wish to push an image on to a private registry, that image must\nalready have a tag which references the registry. For example,\n`registry.example.com/myimage:latest`.\n\nThe push is cancelled if the HTTP connection is closed.\n", + "operationId": "ImagePush", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag to associate with the image on the registry.", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/tag": { + "post": { + "tags": [ + "Image" + ], + "summary": "Tag an image", + "description": "Tag an image so that it becomes part of a repository.", + "operationId": "ImageTag", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID to tag.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "The repository to tag in. For example, `someuser/someimage`.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The name of the new tag.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "No error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}": { + "delete": { + "tags": [ + "Image" + ], + "summary": "Remove an image", + "description": "Remove an image, along with any untagged parent images that were\nreferenced by that image.\n\nImages can't be removed if they have descendant images, are being\nused by a running container or are being used by a build.\n", + "operationId": "ImageDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Remove the image even if it is being used by stopped containers or has other tags", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "noprune", + "in": "query", + "description": "Do not delete untagged parent images", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "The image was deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageDeleteResponseItem" + } + }, + "example": [ + { + "Untagged": "3e2f21a89f" + }, + { + "Deleted": "3e2f21a89f" + }, + { + "Deleted": "53b4f83ac9" + } + ] + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/search": { + "get": { + "tags": [ + "Image" + ], + "summary": "Search images", + "description": "Search for an image on Docker Hub.", + "operationId": "ImageSearch", + "parameters": [ + { + "name": "term", + "in": "query", + "description": "Term to search", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "schema": { + "type": "integer" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:\n\n- `is-automated=(true|false)` (deprecated, see below)\n- `is-official=(true|false)`\n- `stars=` Matches images that has at least 'number' stars.\n\nThe `is-automated` filter is deprecated. The `is_automated` field has\nbeen deprecated by Docker Hub's search API. Consequently, searching\nfor `is-automated=true` will yield no results.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "ImageSearchResponseItem", + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "is_official": { + "type": "boolean" + }, + "is_automated": { + "type": "boolean", + "description": "Whether this repository has automated builds enabled.\n\n


\n\n> **Deprecated**: This field is deprecated and will always\n> be \"false\" in future.\n", + "example": false + }, + "name": { + "type": "string" + }, + "star_count": { + "type": "integer" + } + } + } + }, + "example": [ + { + "description": "A minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size!", + "is_official": true, + "is_automated": false, + "name": "alpine", + "star_count": 10093 + }, + { + "description": "Busybox base image.", + "is_official": true, + "is_automated": false, + "name": "Busybox base image.", + "star_count": 3037 + }, + { + "description": "The PostgreSQL object-relational database system provides reliability and data integrity.", + "is_official": true, + "is_automated": false, + "name": "postgres", + "star_count": 12408 + } + ] + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/prune": { + "post": { + "tags": [ + "Image" + ], + "summary": "Delete unused images", + "operationId": "ImagePrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters:\n\n- `dangling=` When set to `true` (or `1`), prune only\n unused *and* untagged images. When set to `false`\n (or `0`), all unused images are pruned.\n- `until=` Prune images created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune images with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ImagePruneResponse", + "type": "object", + "properties": { + "ImagesDeleted": { + "type": "array", + "description": "Images that were deleted", + "items": { + "$ref": "#/components/schemas/ImageDeleteResponseItem" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/auth": { + "post": { + "tags": [ + "System" + ], + "summary": "Check auth configuration", + "description": "Validate credentials for a registry and, if available, get an identity\ntoken for accessing the registry without password.\n", + "operationId": "SystemAuth", + "requestBody": { + "description": "Authentication to check", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthConfig" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "An identity token was generated successfully.", + "content": { + "application/json": { + "schema": { + "title": "SystemAuthResponse", + "required": [ + "Status" + ], + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "The status of the authentication", + "nullable": false + }, + "IdentityToken": { + "type": "string", + "description": "An opaque token used to authenticate a user after a successful login", + "nullable": false + } + } + }, + "example": { + "Status": "Login Succeeded", + "IdentityToken": "9cbaf023786cd7..." + } + } + } + }, + "204": { + "description": "No error", + "content": {} + }, + "401": { + "description": "Auth error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "authConfig" + } + }, + "/info": { + "get": { + "tags": [ + "System" + ], + "summary": "Get system information", + "operationId": "SystemInfo", + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/version": { + "get": { + "tags": [ + "System" + ], + "summary": "Get version", + "description": "Returns the version of Docker that is running and various information about the system that Docker is running on.", + "operationId": "SystemVersion", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemVersion" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/_ping": { + "get": { + "tags": [ + "System" + ], + "summary": "Ping", + "description": "This is a dummy endpoint you can use to test if the server is accessible.", + "operationId": "SystemPing", + "responses": { + "200": { + "description": "no error", + "headers": { + "Swarm": { + "description": "Contains information about Swarm status of the daemon,\nand if the daemon is acting as a manager or worker node.\n", + "schema": { + "type": "string", + "default": "inactive", + "enum": [ + "inactive", + "pending", + "error", + "locked", + "active/worker", + "active/manager" + ] + } + }, + "Docker-Experimental": { + "description": "If the server is running with experimental mode enabled", + "schema": { + "type": "boolean" + } + }, + "Cache-Control": { + "schema": { + "type": "string", + "default": "no-cache, no-store, must-revalidate" + } + }, + "Pragma": { + "schema": { + "type": "string", + "default": "no-cache" + } + }, + "API-Version": { + "description": "Max API Version the server supports", + "schema": { + "type": "string" + } + }, + "Builder-Version": { + "description": "Default version of docker image builder\n\nThe default on Linux is version \"2\" (BuildKit), but the daemon\ncan be configured to recommend version \"1\" (classic Builder).\nWindows does not yet support BuildKit for native Windows images,\nand uses \"1\" (classic builder) as a default.\n\nThis value is a recommendation as advertised by the daemon, and\nit is up to the client to choose which builder to use.\n", + "schema": { + "type": "string", + "default": "2" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string", + "example": "OK" + } + } + } + }, + "500": { + "description": "server error", + "headers": { + "Cache-Control": { + "schema": { + "type": "string", + "default": "no-cache, no-store, must-revalidate" + } + }, + "Pragma": { + "schema": { + "type": "string", + "default": "no-cache" + } + } + }, + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "head": { + "tags": [ + "System" + ], + "summary": "Ping", + "description": "This is a dummy endpoint you can use to test if the server is accessible.", + "operationId": "SystemPingHead", + "responses": { + "200": { + "description": "no error", + "headers": { + "Swarm": { + "description": "Contains information about Swarm status of the daemon,\nand if the daemon is acting as a manager or worker node.\n", + "schema": { + "type": "string", + "default": "inactive", + "enum": [ + "inactive", + "pending", + "error", + "locked", + "active/worker", + "active/manager" + ] + } + }, + "Docker-Experimental": { + "description": "If the server is running with experimental mode enabled", + "schema": { + "type": "boolean" + } + }, + "Cache-Control": { + "schema": { + "type": "string", + "default": "no-cache, no-store, must-revalidate" + } + }, + "Pragma": { + "schema": { + "type": "string", + "default": "no-cache" + } + }, + "API-Version": { + "description": "Max API Version the server supports", + "schema": { + "type": "string" + } + }, + "Builder-Version": { + "description": "Default version of docker image builder", + "schema": { + "type": "string" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string", + "example": "(empty)" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/commit": { + "post": { + "tags": [ + "Image" + ], + "summary": "Create a new image from a container", + "operationId": "ImageCommit", + "parameters": [ + { + "name": "container", + "in": "query", + "description": "The ID or name of the container to commit", + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "Repository name for the created image", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "Tag name for the create image", + "schema": { + "type": "string" + } + }, + { + "name": "comment", + "in": "query", + "description": "Commit message", + "schema": { + "type": "string" + } + }, + { + "name": "author", + "in": "query", + "description": "Author of the image (e.g., `John Hannibal Smith `)", + "schema": { + "type": "string" + } + }, + { + "name": "pause", + "in": "query", + "description": "Whether to pause the container before committing", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "changes", + "in": "query", + "description": "`Dockerfile` instructions to apply while committing", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The container configuration", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContainerConfig" + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "containerConfig" + } + }, + "/events": { + "get": { + "tags": [ + "System" + ], + "summary": "Monitor events", + "description": "Stream real-time events from the server.\n\nVarious objects within Docker report events when something happens to them.\n\nContainers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune`\n\nImages report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune`\n\nVolumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune`\n\nNetworks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune`\n\nThe Docker daemon reports these events: `reload`\n\nServices report these events: `create`, `update`, and `remove`\n\nNodes report these events: `create`, `update`, and `remove`\n\nSecrets report these events: `create`, `update`, and `remove`\n\nConfigs report these events: `create`, `update`, and `remove`\n\nThe Builder reports `prune` events\n", + "operationId": "SystemEvents", + "parameters": [ + { + "name": "since", + "in": "query", + "description": "Show events created since this timestamp then stream new events.", + "schema": { + "type": "string" + } + }, + { + "name": "until", + "in": "query", + "description": "Show events created until this timestamp then stop streaming.", + "schema": { + "type": "string" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters:\n\n- `config=` config name or ID\n- `container=` container name or ID\n- `daemon=` daemon name or ID\n- `event=` event type\n- `image=` image name or ID\n- `label=` image or container label\n- `network=` network name or ID\n- `node=` node ID\n- `plugin`= plugin name or ID\n- `scope`= local or swarm\n- `secret=` secret name or ID\n- `service=` service name or ID\n- `type=` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config`\n- `volume=` volume name\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventMessage" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/system/df": { + "get": { + "tags": [ + "System" + ], + "summary": "Get data usage information", + "operationId": "SystemDataUsage", + "parameters": [ + { + "name": "type", + "in": "query", + "description": "Object types, for which to compute and return data.\n", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "container", + "image", + "volume", + "build-cache" + ] + } + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "SystemDataUsageResponse", + "type": "object", + "properties": { + "LayersSize": { + "type": "integer", + "format": "int64" + }, + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + }, + "Containers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerSummary" + } + }, + "Volumes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Volume" + } + }, + "BuildCache": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BuildCache" + } + } + }, + "example": { + "LayersSize": 1092588, + "Images": [ + { + "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "ParentId": "", + "RepoTags": [ + "busybox:latest" + ], + "RepoDigests": [ + "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + ], + "Created": 1466724217, + "Size": 1092588, + "SharedSize": 0, + "Labels": {}, + "Containers": 1 + } + ], + "Containers": [ + { + "Id": "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148", + "Names": [ + "/top" + ], + "Image": "busybox", + "ImageID": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "Command": "top", + "Created": 1472592424, + "Ports": [], + "SizeRootFs": 1092588, + "Labels": {}, + "State": "exited", + "Status": "Exited (0) 56 minutes ago", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92", + "EndpointID": "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a", + "Gateway": "172.18.0.1", + "IPAddress": "172.18.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Mounts": [] + } + ], + "Volumes": [ + { + "Name": "my-volume", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/my-volume/_data", + "Scope": "local", + "UsageData": { + "Size": 10920104, + "RefCount": 2 + } + } + ], + "BuildCache": [ + { + "ID": "hw53o5aio51xtltp5xjp8v7fx", + "Parents": [], + "Type": "regular", + "Description": "pulled from docker.io/library/debian@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0", + "InUse": false, + "Shared": true, + "Size": 0, + "CreatedAt": "2021-06-28T13:31:01.474619385Z", + "LastUsedAt": "2021-07-07T22:02:32.738075951Z", + "UsageCount": 26 + }, + { + "ID": "ndlpt0hhvkqcdfkputsk4cq9c", + "Parents": [ + "ndlpt0hhvkqcdfkputsk4cq9c" + ], + "Type": "regular", + "Description": "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache", + "InUse": false, + "Shared": true, + "Size": 51, + "CreatedAt": "2021-06-28T13:31:03.002625487Z", + "LastUsedAt": "2021-07-07T22:02:32.773909517Z", + "UsageCount": 26 + } + ] + } + } + }, + "text/plain": { + "schema": { + "title": "SystemDataUsageResponse", + "type": "object", + "properties": { + "LayersSize": { + "type": "integer", + "format": "int64" + }, + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + }, + "Containers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerSummary" + } + }, + "Volumes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Volume" + } + }, + "BuildCache": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BuildCache" + } + } + }, + "example": { + "LayersSize": 1092588, + "Images": [ + { + "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "ParentId": "", + "RepoTags": [ + "busybox:latest" + ], + "RepoDigests": [ + "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + ], + "Created": 1466724217, + "Size": 1092588, + "SharedSize": 0, + "Labels": {}, + "Containers": 1 + } + ], + "Containers": [ + { + "Id": "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148", + "Names": [ + "/top" + ], + "Image": "busybox", + "ImageID": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "Command": "top", + "Created": 1472592424, + "Ports": [], + "SizeRootFs": 1092588, + "Labels": {}, + "State": "exited", + "Status": "Exited (0) 56 minutes ago", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92", + "EndpointID": "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a", + "Gateway": "172.18.0.1", + "IPAddress": "172.18.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Mounts": [] + } + ], + "Volumes": [ + { + "Name": "my-volume", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/my-volume/_data", + "Scope": "local", + "UsageData": { + "Size": 10920104, + "RefCount": 2 + } + } + ], + "BuildCache": [ + { + "ID": "hw53o5aio51xtltp5xjp8v7fx", + "Parents": [], + "Type": "regular", + "Description": "pulled from docker.io/library/debian@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0", + "InUse": false, + "Shared": true, + "Size": 0, + "CreatedAt": "2021-06-28T13:31:01.474619385Z", + "LastUsedAt": "2021-07-07T22:02:32.738075951Z", + "UsageCount": 26 + }, + { + "ID": "ndlpt0hhvkqcdfkputsk4cq9c", + "Parents": [ + "ndlpt0hhvkqcdfkputsk4cq9c" + ], + "Type": "regular", + "Description": "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache", + "InUse": false, + "Shared": true, + "Size": 51, + "CreatedAt": "2021-06-28T13:31:03.002625487Z", + "LastUsedAt": "2021-07-07T22:02:32.773909517Z", + "UsageCount": 26 + } + ] + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/get": { + "get": { + "tags": [ + "Image" + ], + "summary": "Export an image", + "description": "Get a tarball containing all images and metadata for a repository.\n\nIf `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.\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID), each containing these files:\n\n- `VERSION`: currently `1.0` - the file format version\n- `json`: detailed layer information, similar to `docker inspect layer_id`\n- `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions.\n\nIf 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.\n\n```json\n{\n \"hello-world\": {\n \"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"\n }\n}\n```\n", + "operationId": "ImageGet", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/get": { + "get": { + "tags": [ + "Image" + ], + "summary": "Export several images", + "description": "Get a tarball containing all images and metadata for several image\nrepositories.\n\nFor each value of the `names` parameter: if it is a specific name and\ntag (e.g. `ubuntu:latest`), then only that image (and its parents) are\nreturned; if it is an image ID, similarly only that image (and its parents)\nare returned and there would be no names referenced in the 'repositories'\nfile for this image ID.\n\nFor details on the format, see the [export image endpoint](#operation/ImageGet).\n", + "operationId": "ImageGetAll", + "parameters": [ + { + "name": "names", + "in": "query", + "description": "Image names to filter by", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/load": { + "post": { + "tags": [ + "Image" + ], + "summary": "Import images", + "description": "Load a set of images and tags into a repository.\n\nFor details on the format, see the [export image endpoint](#operation/ImageGet).\n", + "operationId": "ImageLoad", + "parameters": [ + { + "name": "quiet", + "in": "query", + "description": "Suppress progress details during load.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "Tar archive containing images", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "imagesTarball" + } + }, + "/containers/{id}/exec": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Create an exec instance", + "description": "Run a command inside a running container.", + "operationId": "ContainerExec", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Exec configuration", + "content": { + "application/json": { + "schema": { + "title": "ExecConfig", + "type": "object", + "properties": { + "AttachStdin": { + "type": "boolean", + "description": "Attach to `stdin` of the exec command." + }, + "AttachStdout": { + "type": "boolean", + "description": "Attach to `stdout` of the exec command." + }, + "AttachStderr": { + "type": "boolean", + "description": "Attach to `stderr` of the exec command." + }, + "ConsoleSize": { + "maxItems": 2, + "minItems": 2, + "type": "array", + "description": "Initial console size, as an `[height, width]` array.", + "nullable": true, + "items": { + "minimum": 0, + "type": "integer" + } + }, + "DetachKeys": { + "type": "string", + "description": "Override the key sequence for detaching a container. Format is\na single character `[a-Z]` or `ctrl-` where ``\nis one of: `a-z`, `@`, `^`, `[`, `,` or `_`.\n" + }, + "Tty": { + "type": "boolean", + "description": "Allocate a pseudo-TTY." + }, + "Env": { + "type": "array", + "description": "A list of environment variables in the form `[\"VAR=value\", ...]`.\n", + "items": { + "type": "string" + } + }, + "Cmd": { + "type": "array", + "description": "Command to run, as a string or array of strings.", + "items": { + "type": "string" + } + }, + "Privileged": { + "type": "boolean", + "description": "Runs the exec process with extended privileges.", + "default": false + }, + "User": { + "type": "string", + "description": "The user, and optionally, group to run the exec process inside\nthe container. Format is one of: `user`, `user:group`, `uid`,\nor `uid:gid`.\n" + }, + "WorkingDir": { + "type": "string", + "description": "The working directory for the exec process inside the container.\n" + } + }, + "example": { + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "DetachKeys": "ctrl-p,ctrl-q", + "Tty": false, + "Cmd": [ + "date" + ], + "Env": [ + "FOO=bar", + "BAZ=quux" + ] + } + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "409": { + "description": "container is paused", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "execConfig" + } + }, + "/exec/{id}/start": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Start an exec instance", + "description": "Starts a previously set up exec instance. If detach is true, this endpoint\nreturns immediately after starting the command. Otherwise, it sets up an\ninteractive session with the command.\n", + "operationId": "ExecStart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "ExecStartConfig", + "type": "object", + "properties": { + "Detach": { + "type": "boolean", + "description": "Detach from the command." + }, + "Tty": { + "type": "boolean", + "description": "Allocate a pseudo-TTY." + }, + "ConsoleSize": { + "maxItems": 2, + "minItems": 2, + "type": "array", + "description": "Initial console size, as an `[height, width]` array.", + "nullable": true, + "items": { + "minimum": 0, + "type": "integer" + } + } + }, + "example": { + "Detach": false, + "Tty": true, + "ConsoleSize": [ + 80, + 64 + ] + } + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "404": { + "description": "No such exec instance", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Container is stopped or paused", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "execStartConfig" + } + }, + "/exec/{id}/resize": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Resize an exec instance", + "description": "Resize the TTY session used by an exec instance. This endpoint only works\nif `tty` was specified as part of creating and starting the exec instance.\n", + "operationId": "ExecResize", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "h", + "in": "query", + "description": "Height of the TTY session in characters", + "schema": { + "type": "integer" + } + }, + { + "name": "w", + "in": "query", + "description": "Width of the TTY session in characters", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "No such exec instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/exec/{id}/json": { + "get": { + "tags": [ + "Exec" + ], + "summary": "Inspect an exec instance", + "description": "Return low-level information about an exec instance.", + "operationId": "ExecInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ExecInspectResponse", + "type": "object", + "properties": { + "CanRemove": { + "type": "boolean" + }, + "DetachKeys": { + "type": "string" + }, + "ID": { + "type": "string" + }, + "Running": { + "type": "boolean" + }, + "ExitCode": { + "type": "integer" + }, + "ProcessConfig": { + "$ref": "#/components/schemas/ProcessConfig" + }, + "OpenStdin": { + "type": "boolean" + }, + "OpenStderr": { + "type": "boolean" + }, + "OpenStdout": { + "type": "boolean" + }, + "ContainerID": { + "type": "string" + }, + "Pid": { + "type": "integer", + "description": "The system process ID for the exec process." + } + } + }, + "example": { + "CanRemove": false, + "ContainerID": "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126", + "DetachKeys": "", + "ExitCode": 2, + "ID": "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b", + "OpenStderr": true, + "OpenStdin": true, + "OpenStdout": true, + "ProcessConfig": { + "arguments": [ + "-c", + "exit 2" + ], + "entrypoint": "sh", + "privileged": false, + "tty": true, + "user": "1000" + }, + "Running": false, + "Pid": 42000 + } + } + } + }, + "404": { + "description": "No such exec instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes": { + "get": { + "tags": [ + "Volume" + ], + "summary": "List volumes", + "operationId": "VolumeList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the volumes list. Available filters:\n\n- `dangling=` When set to `true` (or `1`), returns all\n volumes that are not in use by a container. When set to `false`\n (or `0`), only volumes that are in use by one or more\n containers are returned.\n- `driver=` Matches volumes based on their driver.\n- `label=` or `label=:` Matches volumes based on\n the presence of a `label` alone or a `label` and a value.\n- `name=` Matches all or part of a volume name.\n", + "schema": { + "type": "string", + "format": "json" + } + } + ], + "responses": { + "200": { + "description": "Summary volume data that matches the query", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VolumeListResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes/create": { + "post": { + "tags": [ + "Volume" + ], + "summary": "Create a volume", + "operationId": "VolumeCreate", + "requestBody": { + "description": "Volume configuration", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VolumeCreateOptions" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "The volume was created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Volume" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "volumeConfig" + } + }, + "/volumes/{name}": { + "get": { + "tags": [ + "Volume" + ], + "summary": "Inspect a volume", + "operationId": "VolumeInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Volume name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Volume" + } + } + } + }, + "404": { + "description": "No such volume", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Volume" + ], + "summary": "\"Update a volume. Valid only for Swarm cluster volumes\"\n", + "operationId": "VolumeUpdate", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name or ID of the volume", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the volume being updated. This is required to\navoid conflicting writes. Found in the volume's `ClusterVolume`\nfield.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "The spec of the volume to update. Currently, only Availability may\nchange. All other fields must remain unchanged.\n", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "Spec": { + "$ref": "#/components/schemas/ClusterVolumeSpec" + } + }, + "description": "Volume configuration" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such volume", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + }, + "delete": { + "tags": [ + "Volume" + ], + "summary": "Remove a volume", + "description": "Instruct the driver to remove the volume.", + "operationId": "VolumeDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Volume name or ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force the removal of the volume", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "The volume was removed", + "content": {} + }, + "404": { + "description": "No such volume or volume driver", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Volume is in use and cannot be removed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes/prune": { + "post": { + "tags": [ + "Volume" + ], + "summary": "Delete unused volumes", + "operationId": "VolumePrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels.\n- `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "VolumePruneResponse", + "type": "object", + "properties": { + "VolumesDeleted": { + "type": "array", + "description": "Volumes that were deleted", + "items": { + "type": "string" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks": { + "get": { + "tags": [ + "Network" + ], + "summary": "List networks", + "description": "Returns a list of networks. For details on the format, see the\n[network inspect endpoint](#operation/NetworkInspect).\n\nNote that it uses a different, smaller representation of a network than\ninspecting a single network. For example, the list of containers attached\nto the network is not propagated in API versions 1.28 and up.\n", + "operationId": "NetworkList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "JSON encoded value of the filters (a `map[string][]string`) to process\non the networks list.\n\nAvailable filters:\n\n- `dangling=` When set to `true` (or `1`), returns all\n networks that are not in use by a container. When set to `false`\n (or `0`), only networks that are in use by one or more\n containers are returned.\n- `driver=` Matches a network's driver.\n- `id=` Matches all or part of a network ID.\n- `label=` or `label==` of a network label.\n- `name=` Matches all or part of a network name.\n- `scope=[\"swarm\"|\"global\"|\"local\"]` Filters networks by scope (`swarm`, `global`, or `local`).\n- `type=[\"custom\"|\"builtin\"]` Filters networks by type. The `custom` keyword returns all user-defined networks.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Network" + } + }, + "example": [ + { + "Name": "bridge", + "Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566", + "Created": "2016-10-19T06:21:00.416543526Z", + "Scope": "local", + "Driver": "bridge", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.17.0.0/16" + } + ] + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + } + }, + { + "Name": "none", + "Id": "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794", + "Created": "0001-01-01T00:00:00Z", + "Scope": "local", + "Driver": "null", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + }, + { + "Name": "host", + "Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e", + "Created": "0001-01-01T00:00:00Z", + "Scope": "local", + "Driver": "host", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + } + ] + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks/{id}": { + "get": { + "tags": [ + "Network" + ], + "summary": "Inspect a network", + "operationId": "NetworkInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "verbose", + "in": "query", + "description": "Detailed inspect output for troubleshooting", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "scope", + "in": "query", + "description": "Filter the network by scope (swarm, global, or local)", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Network" + } + } + } + }, + "404": { + "description": "Network not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Network" + ], + "summary": "Remove a network", + "operationId": "NetworkDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No error", + "content": {} + }, + "403": { + "description": "operation not supported for pre-defined networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such network", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks/create": { + "post": { + "tags": [ + "Network" + ], + "summary": "Create a network", + "operationId": "NetworkCreate", + "requestBody": { + "description": "Network configuration", + "content": { + "application/json": { + "schema": { + "title": "NetworkCreateRequest", + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The network's name." + }, + "CheckDuplicate": { + "type": "boolean", + "description": "Deprecated: CheckDuplicate is now always enabled.\n" + }, + "Driver": { + "type": "string", + "description": "Name of the network driver plugin to use.", + "default": "bridge" + }, + "Internal": { + "type": "boolean", + "description": "Restrict external access to the network." + }, + "Attachable": { + "type": "boolean", + "description": "Globally scoped network is manually attachable by regular\ncontainers from workers in swarm mode.\n" + }, + "Ingress": { + "type": "boolean", + "description": "Ingress network is the network which provides the routing-mesh\nin swarm mode.\n" + }, + "IPAM": { + "$ref": "#/components/schemas/IPAM" + }, + "EnableIPv6": { + "type": "boolean", + "description": "Enable IPv6 on the network." + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Network specific options to be used by the drivers." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + } + }, + "example": { + "Name": "isolated_nw", + "CheckDuplicate": false, + "Driver": "bridge", + "EnableIPv6": true, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.20.0.0/16", + "IPRange": "172.20.10.0/24", + "Gateway": "172.20.10.11" + }, + { + "Subnet": "2001:db8:abcd::/64", + "Gateway": "2001:db8:abcd::1011" + } + ], + "Options": { + "foo": "bar" + } + }, + "Internal": true, + "Attachable": false, + "Ingress": false, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "NetworkCreateResponse", + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the created network." + }, + "Warning": { + "type": "string" + } + }, + "example": { + "Id": "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30", + "Warning": "" + } + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "Forbidden operation. This happens when trying to create a network named after a pre-defined network,\nor when trying to create an overlay network on a daemon which is not part of a Swarm cluster.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "plugin not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "networkConfig" + } + }, + "/networks/{id}/connect": { + "post": { + "tags": [ + "Network" + ], + "summary": "Connect a container to a network", + "description": "The network must be either a local-scoped network or a swarm-scoped network with the `attachable` option set. A network cannot be re-attached to a running container", + "operationId": "NetworkConnect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "NetworkConnectRequest", + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "The ID or name of the container to connect to the network." + }, + "EndpointConfig": { + "$ref": "#/components/schemas/EndpointSettings" + } + }, + "example": { + "Container": "3613f73ba0e4", + "EndpointConfig": { + "IPAMConfig": { + "IPv4Address": "172.24.56.89", + "IPv6Address": "2001:db8::5689" + }, + "MacAddress": "02:42:ac:12:05:02" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "Operation forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Network or container not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "container" + } + }, + "/networks/{id}/disconnect": { + "post": { + "tags": [ + "Network" + ], + "summary": "Disconnect a container from a network", + "operationId": "NetworkDisconnect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "NetworkDisconnectRequest", + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "The ID or name of the container to disconnect from the network.\n" + }, + "Force": { + "type": "boolean", + "description": "Force the container to disconnect from the network.\n" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "403": { + "description": "Operation not supported for swarm scoped networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Network or container not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "container" + } + }, + "/networks/prune": { + "post": { + "tags": [ + "Network" + ], + "summary": "Delete unused networks", + "operationId": "NetworkPrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `until=` Prune networks created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune networks with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "NetworkPruneResponse", + "type": "object", + "properties": { + "NetworksDeleted": { + "type": "array", + "description": "Networks that were deleted", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "List plugins", + "description": "Returns information about installed plugins.", + "operationId": "PluginList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the plugin list.\n\nAvailable filters:\n\n- `capability=`\n- `enable=|`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Plugin" + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/privileges": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "Get plugin privileges", + "operationId": "GetPluginPrivileges", + "parameters": [ + { + "name": "remote", + "in": "query", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/pull": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Install a plugin", + "description": "Pulls and installs a plugin. After the plugin is installed, it can be\nenabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable).\n", + "operationId": "PluginPull", + "parameters": [ + { + "name": "remote", + "in": "query", + "description": "Remote reference for plugin to install.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "description": "Local name for the pulled plugin.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration to use when pulling a plugin\nfrom a registry.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/plugins/{name}/json": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "Inspect a plugin", + "operationId": "PluginInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + } + } + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}": { + "delete": { + "tags": [ + "Plugin" + ], + "summary": "Remove a plugin", + "operationId": "PluginDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Disable the plugin before removing. This may result in issues if the\nplugin is in use by a container.\n", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + } + } + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/enable": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Enable a plugin", + "operationId": "PluginEnable", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Set the HTTP client timeout (in seconds)", + "schema": { + "type": "integer", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/disable": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Disable a plugin", + "operationId": "PluginDisable", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force disable a plugin even if still in use.\n", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/upgrade": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Upgrade a plugin", + "operationId": "PluginUpgrade", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "remote", + "in": "query", + "description": "Remote reference to upgrade to.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration to use when pulling a plugin\nfrom a registry.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/plugins/create": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Create a plugin", + "operationId": "PluginCreate", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Path to tar containing plugin rootfs and manifest", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "tarContext" + } + }, + "/plugins/{name}/push": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Push a plugin", + "description": "Push a plugin to the registry.\n", + "operationId": "PluginPush", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/set": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Configure a plugin", + "operationId": "PluginSet", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + "DEBUG=1" + ], + "items": { + "type": "string" + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "No error", + "content": {} + }, + "404": { + "description": "Plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/nodes": { + "get": { + "tags": [ + "Node" + ], + "summary": "List nodes", + "operationId": "NodeList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the nodes list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `id=`\n- `label=`\n- `membership=`(`accepted`|`pending`)`\n- `name=`\n- `node.label=`\n- `role=`(`manager`|`worker`)`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Node" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Node" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/nodes/{id}": { + "get": { + "tags": [ + "Node" + ], + "summary": "Inspect a node", + "operationId": "NodeInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the node", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Node" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Node" + } + } + } + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Node" + ], + "summary": "Delete a node", + "operationId": "NodeDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the node", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force remove a node from the swarm", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/nodes/{id}/update": { + "post": { + "tags": [ + "Node" + ], + "summary": "Update a node", + "operationId": "NodeUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the node", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the node object being updated. This is required\nto avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NodeSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/NodeSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm": { + "get": { + "tags": [ + "Swarm" + ], + "summary": "Inspect swarm", + "operationId": "SwarmInspect", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Swarm" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Swarm" + } + } + } + }, + "404": { + "description": "no such swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/init": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Initialize a new swarm", + "operationId": "SwarmInit", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "SwarmInitRequest", + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication, as well\nas determining the networking interface used for the VXLAN\nTunnel Endpoint (VTEP). This can either be an address/port\ncombination in the form `192.168.1.1:4567`, or an interface\nfollowed by a port number, like `eth0:4567`. If the port number\nis omitted, the default swarm listening port is used.\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "DataPathPort": { + "type": "integer", + "description": "DataPathPort specifies the data path port number for data traffic.\nAcceptable port range is 1024 to 49151.\nif no port is set or is set to 0, default port 4789 will be used.\n", + "format": "uint32" + }, + "DefaultAddrPool": { + "type": "array", + "description": "Default Address Pool specifies default subnet pools for global\nscope networks.\n", + "items": { + "type": "string", + "example": "" + } + }, + "ForceNewCluster": { + "type": "boolean", + "description": "Force creation of a new swarm." + }, + "SubnetSize": { + "type": "integer", + "description": "SubnetSize specifies the subnet size of the networks created\nfrom the default subnet pool.\n", + "format": "uint32" + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "DataPathPort": 4789, + "DefaultAddrPool": [ + "10.10.0.0/8", + "20.20.0.0/8" + ], + "SubnetSize": 24, + "ForceNewCluster": false, + "Spec": { + "Orchestration": {}, + "Raft": {}, + "Dispatcher": {}, + "CAConfig": {}, + "EncryptionConfig": { + "AutoLockManagers": false + } + } + } + } + }, + "text/plain": { + "schema": { + "title": "SwarmInitRequest", + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication, as well\nas determining the networking interface used for the VXLAN\nTunnel Endpoint (VTEP). This can either be an address/port\ncombination in the form `192.168.1.1:4567`, or an interface\nfollowed by a port number, like `eth0:4567`. If the port number\nis omitted, the default swarm listening port is used.\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "DataPathPort": { + "type": "integer", + "description": "DataPathPort specifies the data path port number for data traffic.\nAcceptable port range is 1024 to 49151.\nif no port is set or is set to 0, default port 4789 will be used.\n", + "format": "uint32" + }, + "DefaultAddrPool": { + "type": "array", + "description": "Default Address Pool specifies default subnet pools for global\nscope networks.\n", + "items": { + "type": "string", + "example": "" + } + }, + "ForceNewCluster": { + "type": "boolean", + "description": "Force creation of a new swarm." + }, + "SubnetSize": { + "type": "integer", + "description": "SubnetSize specifies the subnet size of the networks created\nfrom the default subnet pool.\n", + "format": "uint32" + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "DataPathPort": 4789, + "DefaultAddrPool": [ + "10.10.0.0/8", + "20.20.0.0/8" + ], + "SubnetSize": 24, + "ForceNewCluster": false, + "Spec": { + "Orchestration": {}, + "Raft": {}, + "Dispatcher": {}, + "CAConfig": {}, + "EncryptionConfig": { + "AutoLockManagers": false + } + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "string", + "description": "The node ID", + "example": "7v2t30z9blmxuhnyo6s4cpenp" + } + }, + "text/plain": { + "schema": { + "type": "string", + "description": "The node ID", + "example": "7v2t30z9blmxuhnyo6s4cpenp" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is already part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/join": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Join an existing swarm", + "operationId": "SwarmJoin", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "SwarmJoinRequest", + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication if the node\ngets promoted to manager, as well as determining the networking\ninterface used for the VXLAN Tunnel Endpoint (VTEP).\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "RemoteAddrs": { + "type": "array", + "description": "Addresses of manager nodes already participating in the swarm.\n", + "items": { + "type": "string" + } + }, + "JoinToken": { + "type": "string", + "description": "Secret token for joining this swarm." + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "RemoteAddrs": [ + "node1:2377" + ], + "JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + } + }, + "text/plain": { + "schema": { + "title": "SwarmJoinRequest", + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication if the node\ngets promoted to manager, as well as determining the networking\ninterface used for the VXLAN Tunnel Endpoint (VTEP).\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "RemoteAddrs": { + "type": "array", + "description": "Addresses of manager nodes already participating in the swarm.\n", + "items": { + "type": "string" + } + }, + "JoinToken": { + "type": "string", + "description": "Secret token for joining this swarm." + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "RemoteAddrs": [ + "node1:2377" + ], + "JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is already part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/leave": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Leave a swarm", + "operationId": "SwarmLeave", + "parameters": [ + { + "name": "force", + "in": "query", + "description": "Force leave swarm, even if this is the last manager or that it will\nbreak the cluster.\n", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/update": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Update a swarm", + "operationId": "SwarmUpdate", + "parameters": [ + { + "name": "version", + "in": "query", + "description": "The version number of the swarm object being updated. This is\nrequired to avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "rotateWorkerToken", + "in": "query", + "description": "Rotate the worker join token.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "rotateManagerToken", + "in": "query", + "description": "Rotate the manager join token.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "rotateManagerUnlockKey", + "in": "query", + "description": "Rotate the manager unlock key.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/SwarmSpec" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/unlockkey": { + "get": { + "tags": [ + "Swarm" + ], + "summary": "Get the unlock key", + "operationId": "SwarmUnlockkey", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "UnlockKeyResponse", + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + }, + "text/plain": { + "schema": { + "title": "UnlockKeyResponse", + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/unlock": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Unlock a locked manager", + "operationId": "SwarmUnlock", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "SwarmUnlockRequest", + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services": { + "get": { + "tags": [ + "Service" + ], + "summary": "List services", + "operationId": "ServiceList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the services list.\n\nAvailable filters:\n\n- `id=`\n- `label=`\n- `mode=[\"replicated\"|\"global\"]`\n- `name=`\n", + "schema": { + "type": "string" + } + }, + { + "name": "status", + "in": "query", + "description": "Include service status, with count of running and desired tasks.\n", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/services/create": { + "post": { + "tags": [ + "Service" + ], + "summary": "Create a service", + "operationId": "ServiceCreate", + "parameters": [ + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration for pulling from private\nregistries.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServiceSpec" + }, + { + "type": "object", + "example": { + "Name": "web", + "TaskTemplate": { + "ContainerSpec": { + "Image": "nginx:alpine", + "Mounts": [ + { + "ReadOnly": true, + "Source": "web-data", + "Target": "/usr/share/nginx/html", + "Type": "volume", + "VolumeOptions": { + "DriverConfig": {}, + "Labels": { + "com.example.something": "something-value" + } + } + } + ], + "Hosts": [ + "10.10.10.10 host1", + "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 host2" + ], + "User": "33", + "DNSConfig": { + "Nameservers": [ + "8.8.8.8" + ], + "Search": [ + "example.org" + ], + "Options": [ + "timeout:3" + ] + }, + "Secrets": [ + { + "File": { + "Name": "www.example.org.key", + "UID": "33", + "GID": "33", + "Mode": 384 + }, + "SecretID": "fpjqlhnwb19zds35k8wn80lq9", + "SecretName": "example_org_domain_key" + } + ] + }, + "LogDriver": { + "Name": "json-file", + "Options": { + "max-file": "3", + "max-size": "10M" + } + }, + "Placement": {}, + "Resources": { + "Limits": { + "MemoryBytes": 104857600 + }, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "on-failure", + "Delay": 10000000000, + "MaxAttempts": 10 + } + }, + "Mode": { + "Replicated": { + "Replicas": 4 + } + }, + "UpdateConfig": { + "Parallelism": 2, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Ports": [ + { + "Protocol": "tcp", + "PublishedPort": 8080, + "TargetPort": 80 + } + ] + }, + "Labels": { + "foo": "bar" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceCreateResponse" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "network is not eligible for services", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services/{id}": { + "get": { + "tags": [ + "Service" + ], + "summary": "Inspect a service", + "operationId": "ServiceInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "insertDefaults", + "in": "query", + "description": "Fill empty fields with default values.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Service" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Service" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Service" + ], + "summary": "Delete a service", + "operationId": "ServiceDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/services/{id}/update": { + "post": { + "tags": [ + "Service" + ], + "summary": "Update a service", + "operationId": "ServiceUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the service object being updated. This is\nrequired to avoid conflicting writes.\nThis version number should be the value as currently set on the\nservice *before* the update. You can find the current version by\ncalling `GET /services/{id}`\n", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "registryAuthFrom", + "in": "query", + "description": "If the `X-Registry-Auth` header is not specified, this parameter\nindicates where to find registry authorization credentials.\n", + "schema": { + "type": "string", + "default": "spec", + "enum": [ + "spec", + "previous-spec" + ] + } + }, + { + "name": "rollback", + "in": "query", + "description": "Set to this parameter to `previous` to cause a server-side rollback\nto the previous service spec. The supplied spec will be ignored in\nthis case.\n", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration for pulling from private\nregistries.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServiceSpec" + }, + { + "type": "object", + "example": { + "Name": "top", + "TaskTemplate": { + "ContainerSpec": { + "Image": "busybox", + "Args": [ + "top" + ] + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {}, + "ForceUpdate": 0 + }, + "Mode": { + "Replicated": { + "Replicas": 1 + } + }, + "UpdateConfig": { + "Parallelism": 2, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Mode": "vip" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUpdateResponse" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services/{id}/logs": { + "get": { + "tags": [ + "Service" + ], + "summary": "Get service logs", + "description": "Get `stdout` and `stderr` logs from a service. See also\n[`/containers/{id}/logs`](#operation/ContainerLogs).\n\n**Note**: This endpoint works only for services with the `local`,\n`json-file` or `journald` logging drivers.\n", + "operationId": "ServiceLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the service", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "details", + "in": "query", + "description": "Show service context and extra details provided to logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "follow", + "in": "query", + "description": "Keep connection after returning logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs.\nSpecify as an integer or `all` to output all log lines.\n", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "200": { + "description": "logs returned as a stream in response body", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such service: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks": { + "get": { + "tags": [ + "Task" + ], + "summary": "List tasks", + "operationId": "TaskList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the tasks list.\n\nAvailable filters:\n\n- `desired-state=(running | shutdown | accepted)`\n- `id=`\n- `label=key` or `label=\"key=value\"`\n- `name=`\n- `node=`\n- `service=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "0kzzo1i0y4jz6027t0k7aezc7", + "Version": { + "Index": 71 + }, + "CreatedAt": "2016-06-07T21:07:31.171892745Z", + "UpdatedAt": "2016-06-07T21:07:31.376370513Z", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:31.290032978Z", + "State": "running", + "Message": "started", + "ContainerStatus": { + "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035", + "PID": 677 + } + }, + "DesiredState": "running", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.10/16" + ] + } + ] + }, + { + "ID": "1yljwbmlr8er2waf8orvqpwms", + "Version": { + "Index": 30 + }, + "CreatedAt": "2016-06-07T21:07:30.019104782Z", + "UpdatedAt": "2016-06-07T21:07:30.231958098Z", + "Name": "hopeful_cori", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:30.202183143Z", + "State": "shutdown", + "Message": "shutdown", + "ContainerStatus": { + "ContainerID": "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213" + } + }, + "DesiredState": "shutdown", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.5/16" + ] + } + ] + } + ], + "items": { + "$ref": "#/components/schemas/Task" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks/{id}": { + "get": { + "tags": [ + "Task" + ], + "summary": "Inspect a task", + "operationId": "TaskInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the task", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Task" + } + } + } + }, + "404": { + "description": "no such task", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks/{id}/logs": { + "get": { + "tags": [ + "Task" + ], + "summary": "Get task logs", + "description": "Get `stdout` and `stderr` logs from a task.\nSee also [`/containers/{id}/logs`](#operation/ContainerLogs).\n\n**Note**: This endpoint works only for services with the `local`,\n`json-file` or `journald` logging drivers.\n", + "operationId": "TaskLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the task", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "details", + "in": "query", + "description": "Show task context and extra details provided to logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "follow", + "in": "query", + "description": "Keep connection after returning logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs.\nSpecify as an integer or `all` to output all log lines.\n", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "200": { + "description": "logs returned as a stream in response body", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "no such task", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such task: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets": { + "get": { + "tags": [ + "Secret" + ], + "summary": "List secrets", + "operationId": "SecretList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the secrets list.\n\nAvailable filters:\n\n- `id=`\n- `label= or label==value`\n- `name=`\n- `names=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "blt1owaxmitz71s9v5zh81zun", + "Version": { + "Index": 85 + }, + "CreatedAt": "2017-07-20T13:55:28.678958722Z", + "UpdatedAt": "2017-07-20T13:55:28.678958722Z", + "Spec": { + "Name": "mysql-passwd", + "Labels": { + "some.label": "some.value" + }, + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + }, + { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt", + "Labels": { + "foo": "bar" + } + } + } + ], + "items": { + "$ref": "#/components/schemas/Secret" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets/create": { + "post": { + "tags": [ + "Secret" + ], + "summary": "Create a secret", + "operationId": "SecretCreate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SecretSpec" + }, + { + "type": "object", + "example": { + "Name": "app-key.crt", + "Labels": { + "foo": "bar" + }, + "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==", + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + } + ] + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/secrets/{id}": { + "get": { + "tags": [ + "Secret" + ], + "summary": "Inspect a secret", + "operationId": "SecretInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the secret", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Secret" + }, + "example": { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt", + "Labels": { + "foo": "bar" + }, + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + } + } + } + }, + "404": { + "description": "secret not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Secret" + ], + "summary": "Delete a secret", + "operationId": "SecretDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the secret", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "secret not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets/{id}/update": { + "post": { + "tags": [ + "Secret" + ], + "summary": "Update a Secret", + "operationId": "SecretUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the secret", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the secret object being updated. This is\nrequired to avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "The spec of the secret to update. Currently, only the Labels field\ncan be updated. All other fields must remain unchanged from the\n[SecretInspect endpoint](#operation/SecretInspect) response values.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SecretSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/SecretSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such secret", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/configs": { + "get": { + "tags": [ + "Config" + ], + "summary": "List configs", + "operationId": "ConfigList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the configs list.\n\nAvailable filters:\n\n- `id=`\n- `label= or label==value`\n- `name=`\n- `names=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "server.conf" + } + } + ], + "items": { + "$ref": "#/components/schemas/Config" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/configs/create": { + "post": { + "tags": [ + "Config" + ], + "summary": "Create a config", + "operationId": "ConfigCreate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ConfigSpec" + }, + { + "type": "object", + "example": { + "Name": "server.conf", + "Labels": { + "foo": "bar" + }, + "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + } + } + ] + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/configs/{id}": { + "get": { + "tags": [ + "Config" + ], + "summary": "Inspect a config", + "operationId": "ConfigInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the config", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Config" + }, + "example": { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt" + } + } + } + } + }, + "404": { + "description": "config not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Config" + ], + "summary": "Delete a config", + "operationId": "ConfigDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the config", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "config not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/configs/{id}/update": { + "post": { + "tags": [ + "Config" + ], + "summary": "Update a Config", + "operationId": "ConfigUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the config", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the config object being updated. This is\nrequired to avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "The spec of the config to update. Currently, only the Labels field\ncan be updated. All other fields must remain unchanged from the\n[ConfigInspect endpoint](#operation/ConfigInspect) response values.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ConfigSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such config", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/distribution/{name}/json": { + "get": { + "tags": [ + "Distribution" + ], + "summary": "Get image information from the registry", + "description": "Return image digest and platform information by contacting the registry.\n", + "operationId": "DistributionInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "descriptor and platform information", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DistributionInspect" + } + } + } + }, + "401": { + "description": "Failed authentication or no image found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such image: someimage (tag: latest)" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/session": { + "post": { + "tags": [ + "Session" + ], + "summary": "Initialize interactive session", + "description": "Start a new interactive session with a server. Session allows server to\ncall back to the client for advanced capabilities.\n\n### Hijacking\n\nThis endpoint hijacks the HTTP connection to HTTP2 transport that allows\nthe client to expose gPRC services on that connection.\n\nFor example, the client sends this request to upgrade the connection:\n\n```\nPOST /session HTTP/1.1\nUpgrade: h2c\nConnection: Upgrade\n```\n\nThe Docker daemon responds with a `101 UPGRADED` response follow with\nthe raw stream:\n\n```\nHTTP/1.1 101 UPGRADED\nConnection: Upgrade\nUpgrade: h2c\n```\n", + "operationId": "Session", + "responses": { + "101": { + "description": "no error, hijacking successful", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Port": { + "required": [ + "PrivatePort", + "Type" + ], + "type": "object", + "properties": { + "IP": { + "type": "string", + "description": "Host IP address that the container's port is mapped to", + "format": "ip-address" + }, + "PrivatePort": { + "type": "integer", + "description": "Port on the container", + "format": "uint16", + "nullable": false + }, + "PublicPort": { + "type": "integer", + "description": "Port exposed on the host", + "format": "uint16" + }, + "Type": { + "type": "string", + "nullable": false, + "enum": [ + "tcp", + "udp", + "sctp" + ] + } + }, + "description": "An open port on a container", + "example": { + "PrivatePort": 8080, + "PublicPort": 80, + "Type": "tcp" + } + }, + "MountPoint": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "description": "The mount type:\n\n- `bind` a mount of a file or directory from the host into the container.\n- `volume` a docker volume with the given `Name`.\n- `tmpfs` a `tmpfs`.\n- `npipe` a named pipe from the host into the container.\n- `cluster` a Swarm cluster volume\n", + "example": "volume", + "enum": [ + "bind", + "volume", + "tmpfs", + "npipe", + "cluster" + ] + }, + "Name": { + "type": "string", + "description": "Name is the name reference to the underlying data defined by `Source`\ne.g., the volume name.\n", + "example": "myvolume" + }, + "Source": { + "type": "string", + "description": "Source location of the mount.\n\nFor volumes, this contains the storage location of the volume (within\n`/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains\nthe source (host) part of the bind-mount. For `tmpfs` mount points, this\nfield is empty.\n", + "example": "/var/lib/docker/volumes/myvolume/_data" + }, + "Destination": { + "type": "string", + "description": "Destination is the path relative to the container root (`/`) where\nthe `Source` is mounted inside the container.\n", + "example": "/usr/share/nginx/html/" + }, + "Driver": { + "type": "string", + "description": "Driver is the volume driver used to create the volume (if it is a volume).\n", + "example": "local" + }, + "Mode": { + "type": "string", + "description": "Mode is a comma separated list of options supplied by the user when\ncreating the bind/volume mount.\n\nThe default is platform-specific (`\"z\"` on Linux, empty on Windows).\n", + "example": "z" + }, + "RW": { + "type": "boolean", + "description": "Whether the mount is mounted writable (read-write).\n", + "example": true + }, + "Propagation": { + "type": "string", + "description": "Propagation describes how mounts are propagated from the host into the\nmount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt)\nfor details. This field is not used on Windows.\n", + "example": "" + } + }, + "description": "MountPoint represents a mount point configuration inside the container.\nThis is used for reporting the mountpoints in use by a container.\n" + }, + "DeviceMapping": { + "type": "object", + "properties": { + "PathOnHost": { + "type": "string" + }, + "PathInContainer": { + "type": "string" + }, + "CgroupPermissions": { + "type": "string" + } + }, + "description": "A device mapping between the host and container", + "example": { + "PathOnHost": "/dev/deviceName", + "PathInContainer": "/dev/deviceName", + "CgroupPermissions": "mrw" + } + }, + "DeviceRequest": { + "type": "object", + "properties": { + "Driver": { + "type": "string", + "example": "nvidia" + }, + "Count": { + "type": "integer", + "example": -1 + }, + "DeviceIDs": { + "type": "array", + "example": [ + "0", + "1", + "GPU-fef8089b-4820-abfc-e83e-94318197576e" + ], + "items": { + "type": "string" + } + }, + "Capabilities": { + "type": "array", + "description": "A list of capabilities; an OR list of AND lists of capabilities.\n", + "example": [ + [ + "gpu", + "nvidia", + "compute" + ] + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver-specific options, specified as a key/value pairs. These options\nare passed directly to the driver.\n" + } + }, + "description": "A request for devices to be sent to device drivers" + }, + "ThrottleDevice": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Device path" + }, + "Rate": { + "minimum": 0, + "type": "integer", + "description": "Rate", + "format": "int64" + } + } + }, + "Mount": { + "type": "object", + "properties": { + "Target": { + "type": "string", + "description": "Container path." + }, + "Source": { + "type": "string", + "description": "Mount source (e.g. a volume name, a host path)." + }, + "Type": { + "type": "string", + "description": "The mount type. Available types:\n\n- `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container.\n- `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.\n- `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs.\n- `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container.\n- `cluster` a Swarm cluster volume\n", + "enum": [ + "bind", + "volume", + "tmpfs", + "npipe", + "cluster" + ] + }, + "ReadOnly": { + "type": "boolean", + "description": "Whether the mount should be read-only." + }, + "Consistency": { + "type": "string", + "description": "The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`." + }, + "BindOptions": { + "type": "object", + "properties": { + "Propagation": { + "type": "string", + "description": "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.", + "enum": [ + "private", + "rprivate", + "shared", + "rshared", + "slave", + "rslave" + ] + }, + "NonRecursive": { + "type": "boolean", + "description": "Disable recursive bind mount.", + "default": false + }, + "CreateMountpoint": { + "type": "boolean", + "description": "Create mount point on host if missing", + "default": false + }, + "ReadOnlyNonRecursive": { + "type": "boolean", + "description": "Make the mount non-recursively read-only, but still leave the mount recursive\n(unless NonRecursive is set to true in conjunction).\n", + "default": false + }, + "ReadOnlyForceRecursive": { + "type": "boolean", + "description": "Raise an error if the mount cannot be made recursively read-only.", + "default": false + } + }, + "description": "Optional configuration for the `bind` type." + }, + "VolumeOptions": { + "type": "object", + "properties": { + "NoCopy": { + "type": "boolean", + "description": "Populate volume with data from the target.", + "default": false + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "DriverConfig": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the driver to use to create the volume." + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "key/value map of driver specific options." + } + }, + "description": "Map of driver specific options" + } + }, + "description": "Optional configuration for the `volume` type." + }, + "TmpfsOptions": { + "type": "object", + "properties": { + "SizeBytes": { + "type": "integer", + "description": "The size for the tmpfs mount in bytes.", + "format": "int64" + }, + "Mode": { + "type": "integer", + "description": "The permission mode for the tmpfs mount in an integer." + } + }, + "description": "Optional configuration for the `tmpfs` type." + } + } + }, + "RestartPolicy": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "- Empty string means not to restart\n- `no` Do not automatically restart\n- `always` Always restart\n- `unless-stopped` Restart always except when the user has manually stopped the container\n- `on-failure` Restart only when the container exit code is non-zero\n", + "enum": [ + "", + "no", + "always", + "unless-stopped", + "on-failure" + ] + }, + "MaximumRetryCount": { + "type": "integer", + "description": "If `on-failure` is used, the number of times to retry before giving up.\n" + } + }, + "description": "The behavior to apply when the container exits. The default is not to\nrestart.\n\nAn ever increasing delay (double the previous delay, starting at 100ms) is\nadded before each restart to prevent flooding the server.\n" + }, + "Resources": { + "type": "object", + "properties": { + "CpuShares": { + "type": "integer", + "description": "An integer value representing this container's relative CPU weight\nversus other containers.\n" + }, + "Memory": { + "type": "integer", + "description": "Memory limit in bytes.", + "format": "int64", + "default": 0 + }, + "CgroupParent": { + "type": "string", + "description": "Path to `cgroups` under which the container's `cgroup` is created. If\nthe path is not absolute, the path is considered to be relative to the\n`cgroups` path of the init process. Cgroups are created if they do not\nalready exist.\n" + }, + "BlkioWeight": { + "maximum": 1000, + "minimum": 0, + "type": "integer", + "description": "Block IO weight (relative weight)." + }, + "BlkioWeightDevice": { + "type": "array", + "description": "Block IO weight (relative device weight) in the form:\n\n```\n[{\"Path\": \"device_path\", \"Weight\": weight}]\n```\n", + "items": { + "type": "object", + "properties": { + "Path": { + "type": "string" + }, + "Weight": { + "minimum": 0, + "type": "integer" + } + } + } + }, + "BlkioDeviceReadBps": { + "type": "array", + "description": "Limit read rate (bytes per second) from a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceWriteBps": { + "type": "array", + "description": "Limit write rate (bytes per second) to a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceReadIOps": { + "type": "array", + "description": "Limit read rate (IO per second) from a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceWriteIOps": { + "type": "array", + "description": "Limit write rate (IO per second) to a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "CpuPeriod": { + "type": "integer", + "description": "The length of a CPU period in microseconds.", + "format": "int64" + }, + "CpuQuota": { + "type": "integer", + "description": "Microseconds of CPU time that the container can get in a CPU period.\n", + "format": "int64" + }, + "CpuRealtimePeriod": { + "type": "integer", + "description": "The length of a CPU real-time period in microseconds. Set to 0 to\nallocate no time allocated to real-time tasks.\n", + "format": "int64" + }, + "CpuRealtimeRuntime": { + "type": "integer", + "description": "The length of a CPU real-time runtime in microseconds. Set to 0 to\nallocate no time allocated to real-time tasks.\n", + "format": "int64" + }, + "CpusetCpus": { + "type": "string", + "description": "CPUs in which to allow execution (e.g., `0-3`, `0,1`).\n", + "example": "0-3" + }, + "CpusetMems": { + "type": "string", + "description": "Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only\neffective on NUMA systems.\n" + }, + "Devices": { + "type": "array", + "description": "A list of devices to add to the container.", + "items": { + "$ref": "#/components/schemas/DeviceMapping" + } + }, + "DeviceCgroupRules": { + "type": "array", + "description": "a list of cgroup rules to apply to the container", + "items": { + "type": "string", + "example": "c 13:* rwm" + } + }, + "DeviceRequests": { + "type": "array", + "description": "A list of requests for devices to be sent to device drivers.\n", + "items": { + "$ref": "#/components/schemas/DeviceRequest" + } + }, + "KernelMemoryTCP": { + "type": "integer", + "description": "Hard limit for kernel TCP buffer memory (in bytes). Depending on the\nOCI runtime in use, this option may be ignored. It is no longer supported\nby the default (runc) runtime.\n\nThis field is omitted when empty.\n", + "format": "int64" + }, + "MemoryReservation": { + "type": "integer", + "description": "Memory soft limit in bytes.", + "format": "int64" + }, + "MemorySwap": { + "type": "integer", + "description": "Total memory limit (memory + swap). Set as `-1` to enable unlimited\nswap.\n", + "format": "int64" + }, + "MemorySwappiness": { + "maximum": 100, + "minimum": 0, + "type": "integer", + "description": "Tune a container's memory swappiness behavior. Accepts an integer\nbetween 0 and 100.\n", + "format": "int64" + }, + "NanoCpus": { + "type": "integer", + "description": "CPU quota in units of 10-9 CPUs.", + "format": "int64" + }, + "OomKillDisable": { + "type": "boolean", + "description": "Disable OOM Killer for the container." + }, + "Init": { + "type": "boolean", + "description": "Run an init inside the container that forwards signals and reaps\nprocesses. This field is omitted if empty, and the default (as\nconfigured on the daemon) is used.\n", + "nullable": true + }, + "PidsLimit": { + "type": "integer", + "description": "Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null`\nto not change.\n", + "format": "int64", + "nullable": true + }, + "Ulimits": { + "type": "array", + "description": "A list of resource limits to set in the container. For example:\n\n```\n{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}\n```\n", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of ulimit" + }, + "Soft": { + "type": "integer", + "description": "Soft limit" + }, + "Hard": { + "type": "integer", + "description": "Hard limit" + } + } + } + }, + "CpuCount": { + "type": "integer", + "description": "The number of usable CPUs (Windows only).\n\nOn Windows Server containers, the processor resource controls are\nmutually exclusive. The order of precedence is `CPUCount` first, then\n`CPUShares`, and `CPUPercent` last.\n", + "format": "int64" + }, + "CpuPercent": { + "type": "integer", + "description": "The usable percentage of the available CPUs (Windows only).\n\nOn Windows Server containers, the processor resource controls are\nmutually exclusive. The order of precedence is `CPUCount` first, then\n`CPUShares`, and `CPUPercent` last.\n", + "format": "int64" + }, + "IOMaximumIOps": { + "type": "integer", + "description": "Maximum IOps for the container system drive (Windows only)", + "format": "int64" + }, + "IOMaximumBandwidth": { + "type": "integer", + "description": "Maximum IO in bytes per second for the container system drive\n(Windows only).\n", + "format": "int64" + } + }, + "description": "A container's resources (cgroups config, ulimits, etc)" + }, + "Limit": { + "type": "object", + "properties": { + "NanoCPUs": { + "type": "integer", + "format": "int64", + "example": 4000000000 + }, + "MemoryBytes": { + "type": "integer", + "format": "int64", + "example": 8272408576 + }, + "Pids": { + "type": "integer", + "description": "Limits the maximum number of PIDs in the container. Set `0` for unlimited.\n", + "format": "int64", + "example": 100, + "default": 0 + } + }, + "description": "An object describing a limit on resources which can be requested by a task.\n" + }, + "ResourceObject": { + "type": "object", + "properties": { + "NanoCPUs": { + "type": "integer", + "format": "int64", + "example": 4000000000 + }, + "MemoryBytes": { + "type": "integer", + "format": "int64", + "example": 8272408576 + }, + "GenericResources": { + "$ref": "#/components/schemas/GenericResources" + } + }, + "description": "An object describing the resources which can be advertised by a node and\nrequested by a task.\n" + }, + "GenericResources": { + "type": "array", + "description": "User-defined resources can be either Integer resources (e.g, `SSD=3`) or\nString resources (e.g, `GPU=UUID1`).\n", + "example": [ + { + "DiscreteResourceSpec": { + "Kind": "SSD", + "Value": 3 + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID1" + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID2" + } + } + ], + "items": { + "type": "object", + "properties": { + "NamedResourceSpec": { + "type": "object", + "properties": { + "Kind": { + "type": "string" + }, + "Value": { + "type": "string" + } + } + }, + "DiscreteResourceSpec": { + "type": "object", + "properties": { + "Kind": { + "type": "string" + }, + "Value": { + "type": "integer", + "format": "int64" + } + } + } + } + } + }, + "HealthConfig": { + "type": "object", + "properties": { + "Test": { + "type": "array", + "description": "The test to perform. Possible values are:\n\n- `[]` inherit healthcheck from image or parent image\n- `[\"NONE\"]` disable healthcheck\n- `[\"CMD\", args...]` exec arguments directly\n- `[\"CMD-SHELL\", command]` run command with system's default shell\n", + "items": { + "type": "string" + } + }, + "Interval": { + "type": "integer", + "description": "The time to wait between checks in nanoseconds. It should be 0 or at\nleast 1000000 (1 ms). 0 means inherit.\n", + "format": "int64" + }, + "Timeout": { + "type": "integer", + "description": "The time to wait before considering the check to have hung. It should\nbe 0 or at least 1000000 (1 ms). 0 means inherit.\n", + "format": "int64" + }, + "Retries": { + "type": "integer", + "description": "The number of consecutive failures needed to consider a container as\nunhealthy. 0 means inherit.\n" + }, + "StartPeriod": { + "type": "integer", + "description": "Start period for the container to initialize before starting\nhealth-retries countdown in nanoseconds. It should be 0 or at least\n1000000 (1 ms). 0 means inherit.\n", + "format": "int64" + }, + "StartInterval": { + "type": "integer", + "description": "The time to wait between checks in nanoseconds during the start period.\nIt should be 0 or at least 1000000 (1 ms). 0 means inherit.\n", + "format": "int64" + } + }, + "description": "A test to perform to check that the container is healthy." + }, + "Health": { + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "Status is one of `none`, `starting`, `healthy` or `unhealthy`\n\n- \"none\" Indicates there is no healthcheck\n- \"starting\" Starting indicates that the container is not yet ready\n- \"healthy\" Healthy indicates that the container is running correctly\n- \"unhealthy\" Unhealthy indicates that the container has a problem\n", + "example": "healthy", + "enum": [ + "none", + "starting", + "healthy", + "unhealthy" + ] + }, + "FailingStreak": { + "type": "integer", + "description": "FailingStreak is the number of consecutive failures", + "example": 0 + }, + "Log": { + "type": "array", + "description": "Log contains the last few results (oldest first)\n", + "items": { + "$ref": "#/components/schemas/HealthcheckResult" + } + } + }, + "description": "Health stores information about the container's healthcheck results.\n", + "nullable": true, + "x-nullable": true + }, + "HealthcheckResult": { + "type": "object", + "properties": { + "Start": { + "type": "string", + "description": "Date and time at which this check started in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "date-time", + "example": "2020-01-04T10:44:24.496525531Z" + }, + "End": { + "type": "string", + "description": "Date and time at which this check ended in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2020-01-04T10:45:21.364524523Z" + }, + "ExitCode": { + "type": "integer", + "description": "ExitCode meanings:\n\n- `0` healthy\n- `1` unhealthy\n- `2` reserved (considered unhealthy)\n- other values: error running probe\n", + "example": 0 + }, + "Output": { + "type": "string", + "description": "Output from last check" + } + }, + "description": "HealthcheckResult stores information about a single run of a healthcheck probe\n", + "nullable": true, + "x-nullable": true + }, + "HostConfig": { + "description": "Container configuration that depends on the host we are running on", + "allOf": [ + { + "$ref": "#/components/schemas/Resources" + }, + { + "type": "object", + "properties": { + "Binds": { + "type": "array", + "description": "A list of volume bindings for this container. Each volume binding\nis a string in one of these forms:\n\n- `host-src:container-dest[:options]` to bind-mount a host path\n into the container. Both `host-src`, and `container-dest` must\n be an _absolute_ path.\n- `volume-name:container-dest[:options]` to bind-mount a volume\n managed by a volume driver into the container. `container-dest`\n must be an _absolute_ path.\n\n`options` is an optional, comma-delimited list of:\n\n- `nocopy` disables automatic copying of data from the container\n path to the volume. The `nocopy` flag only applies to named volumes.\n- `[ro|rw]` mounts a volume read-only or read-write, respectively.\n If omitted or set to `rw`, volumes are mounted read-write.\n- `[z|Z]` applies SELinux labels to allow or deny multiple containers\n to read and write to the same volume.\n - `z`: a _shared_ content label is applied to the content. This\n label indicates that multiple containers can share the volume\n content, for both reading and writing.\n - `Z`: a _private unshared_ label is applied to the content.\n This label indicates that only the current container can use\n a private volume. Labeling systems such as SELinux require\n proper labels to be placed on volume content that is mounted\n into a container. Without a label, the security system can\n prevent a container's processes from using the content. By\n default, the labels set by the host operating system are not\n modified.\n- `[[r]shared|[r]slave|[r]private]` specifies mount\n [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt).\n This only applies to bind-mounted volumes, not internal volumes\n or named volumes. Mount propagation requires the source mount\n point (the location where the source directory is mounted in the\n host operating system) to have the correct propagation properties.\n For shared volumes, the source mount point must be set to `shared`.\n For slave volumes, the mount must be set to either `shared` or\n `slave`.\n", + "items": { + "type": "string" + } + }, + "ContainerIDFile": { + "type": "string", + "description": "Path to a file where the container ID is written" + }, + "LogConfig": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "enum": [ + "json-file", + "syslog", + "journald", + "gelf", + "fluentd", + "awslogs", + "splunk", + "etwlogs", + "none" + ] + }, + "Config": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "The logging configuration for this container" + }, + "NetworkMode": { + "type": "string", + "description": "Network mode to use for this container. Supported standard values\nare: `bridge`, `host`, `none`, and `container:`. Any\nother value is taken as a custom network's name to which this\ncontainer should connect to.\n" + }, + "PortBindings": { + "$ref": "#/components/schemas/PortMap" + }, + "RestartPolicy": { + "$ref": "#/components/schemas/RestartPolicy" + }, + "AutoRemove": { + "type": "boolean", + "description": "Automatically remove the container when the container's process\nexits. This has no effect if `RestartPolicy` is set.\n" + }, + "VolumeDriver": { + "type": "string", + "description": "Driver that this container uses to mount volumes." + }, + "VolumesFrom": { + "type": "array", + "description": "A list of volumes to inherit from another container, specified in\nthe form `[:]`.\n", + "items": { + "type": "string" + } + }, + "Mounts": { + "type": "array", + "description": "Specification for mounts to be added to the container.\n", + "items": { + "$ref": "#/components/schemas/Mount" + } + }, + "ConsoleSize": { + "maxItems": 2, + "minItems": 2, + "type": "array", + "description": "Initial console size, as an `[height, width]` array.\n", + "nullable": true, + "items": { + "minimum": 0, + "type": "integer" + } + }, + "Annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Arbitrary non-identifying metadata attached to container and\nprovided to the runtime when the container is started.\n" + }, + "CapAdd": { + "type": "array", + "description": "A list of kernel capabilities to add to the container. Conflicts\nwith option 'Capabilities'.\n", + "items": { + "type": "string" + } + }, + "CapDrop": { + "type": "array", + "description": "A list of kernel capabilities to drop from the container. Conflicts\nwith option 'Capabilities'.\n", + "items": { + "type": "string" + } + }, + "CgroupnsMode": { + "type": "string", + "description": "cgroup namespace mode for the container. Possible values are:\n\n- `\"private\"`: the container runs in its own private cgroup namespace\n- `\"host\"`: use the host system's cgroup namespace\n\nIf not specified, the daemon default is used, which can either be `\"private\"`\nor `\"host\"`, depending on daemon version, kernel support and configuration.\n", + "enum": [ + "private", + "host" + ] + }, + "Dns": { + "type": "array", + "description": "A list of DNS servers for the container to use.", + "items": { + "type": "string" + } + }, + "DnsOptions": { + "type": "array", + "description": "A list of DNS options.", + "items": { + "type": "string" + } + }, + "DnsSearch": { + "type": "array", + "description": "A list of DNS search domains.", + "items": { + "type": "string" + } + }, + "ExtraHosts": { + "type": "array", + "description": "A list of hostnames/IP mappings to add to the container's `/etc/hosts`\nfile. Specified in the form `[\"hostname:IP\"]`.\n", + "items": { + "type": "string" + } + }, + "GroupAdd": { + "type": "array", + "description": "A list of additional groups that the container process will run as.\n", + "items": { + "type": "string" + } + }, + "IpcMode": { + "type": "string", + "description": "IPC sharing mode for the container. Possible values are:\n\n- `\"none\"`: own private IPC namespace, with /dev/shm not mounted\n- `\"private\"`: own private IPC namespace\n- `\"shareable\"`: own private IPC namespace, with a possibility to share it with other containers\n- `\"container:\"`: join another (shareable) container's IPC namespace\n- `\"host\"`: use the host system's IPC namespace\n\nIf not specified, daemon default is used, which can either be `\"private\"`\nor `\"shareable\"`, depending on daemon version and configuration.\n" + }, + "Cgroup": { + "type": "string", + "description": "Cgroup to use for the container." + }, + "Links": { + "type": "array", + "description": "A list of links for the container in the form `container_name:alias`.\n", + "items": { + "type": "string" + } + }, + "OomScoreAdj": { + "type": "integer", + "description": "An integer value containing the score given to the container in\norder to tune OOM killer preferences.\n", + "example": 500 + }, + "PidMode": { + "type": "string", + "description": "Set the PID (Process) Namespace mode for the container. It can be\neither:\n\n- `\"container:\"`: joins another container's PID namespace\n- `\"host\"`: use the host's PID namespace inside the container\n" + }, + "Privileged": { + "type": "boolean", + "description": "Gives the container full access to the host." + }, + "PublishAllPorts": { + "type": "boolean", + "description": "Allocates an ephemeral host port for all of a container's\nexposed ports.\n\nPorts are de-allocated when the container stops and allocated when\nthe container starts. The allocated port might be changed when\nrestarting the container.\n\nThe port is selected from the ephemeral port range that depends on\nthe kernel. For example, on Linux the range is defined by\n`/proc/sys/net/ipv4/ip_local_port_range`.\n" + }, + "ReadonlyRootfs": { + "type": "boolean", + "description": "Mount the container's root filesystem as read only." + }, + "SecurityOpt": { + "type": "array", + "description": "A list of string values to customize labels for MLS systems, such\nas SELinux.\n", + "items": { + "type": "string" + } + }, + "StorageOpt": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Storage driver options for this container, in the form `{\"size\": \"120G\"}`.\n" + }, + "Tmpfs": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of container directories which should be replaced by tmpfs\nmounts, and their corresponding mount options. For example:\n\n```\n{ \"/run\": \"rw,noexec,nosuid,size=65536k\" }\n```\n" + }, + "UTSMode": { + "type": "string", + "description": "UTS namespace to use for the container." + }, + "UsernsMode": { + "type": "string", + "description": "Sets the usernamespace mode for the container when usernamespace\nremapping option is enabled.\n" + }, + "ShmSize": { + "minimum": 0, + "type": "integer", + "description": "Size of `/dev/shm` in bytes. If omitted, the system uses 64MB.\n", + "format": "int64" + }, + "Sysctls": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A list of kernel parameters (sysctls) to set in the container.\nFor example:\n\n```\n{\"net.ipv4.ip_forward\": \"1\"}\n```\n" + }, + "Runtime": { + "type": "string", + "description": "Runtime to use with this container." + }, + "Isolation": { + "type": "string", + "description": "Isolation technology of the container. (Windows only)\n", + "enum": [ + "default", + "process", + "hyperv" + ] + }, + "MaskedPaths": { + "type": "array", + "description": "The list of paths to be masked inside the container (this overrides\nthe default set of paths).\n", + "items": { + "type": "string" + } + }, + "ReadonlyPaths": { + "type": "array", + "description": "The list of paths to be set as read-only inside the container\n(this overrides the default set of paths).\n", + "items": { + "type": "string" + } + } + } + } + ] + }, + "ContainerConfig": { + "type": "object", + "properties": { + "Hostname": { + "type": "string", + "description": "The hostname to use for the container, as a valid RFC 1123 hostname.\n", + "example": "439f4e91bd1d" + }, + "Domainname": { + "type": "string", + "description": "The domain name to use for the container.\n" + }, + "User": { + "type": "string", + "description": "The user that commands are run as inside the container." + }, + "AttachStdin": { + "type": "boolean", + "description": "Whether to attach to `stdin`.", + "default": false + }, + "AttachStdout": { + "type": "boolean", + "description": "Whether to attach to `stdout`.", + "default": true + }, + "AttachStderr": { + "type": "boolean", + "description": "Whether to attach to `stderr`.", + "default": true + }, + "ExposedPorts": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "An object mapping ports to an empty object in the form:\n\n`{\"/\": {}}`\n", + "nullable": true, + "example": { + "80/tcp": {}, + "443/tcp": {} + } + }, + "Tty": { + "type": "boolean", + "description": "Attach standard streams to a TTY, including `stdin` if it is not closed.\n", + "default": false + }, + "OpenStdin": { + "type": "boolean", + "description": "Open `stdin`", + "default": false + }, + "StdinOnce": { + "type": "boolean", + "description": "Close `stdin` after one attached client disconnects", + "default": false + }, + "Env": { + "type": "array", + "description": "A list of environment variables to set inside the container in the\nform `[\"VAR=value\", ...]`. A variable without `=` is removed from the\nenvironment, rather than to have an empty value.\n", + "example": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "items": { + "type": "string" + } + }, + "Cmd": { + "type": "array", + "description": "Command to run specified as a string or an array of strings.\n", + "example": [ + "/bin/sh" + ], + "items": { + "type": "string" + } + }, + "Healthcheck": { + "$ref": "#/components/schemas/HealthConfig" + }, + "ArgsEscaped": { + "type": "boolean", + "description": "Command is already escaped (Windows only)", + "nullable": true, + "example": false, + "default": false + }, + "Image": { + "type": "string", + "description": "The name (or reference) of the image to use when creating the container,\nor which was used when the container was created.\n", + "example": "example-image:1.0" + }, + "Volumes": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "An object mapping mount point paths inside the container to empty\nobjects.\n" + }, + "WorkingDir": { + "type": "string", + "description": "The working directory for commands to run in.", + "example": "/public/" + }, + "Entrypoint": { + "type": "array", + "description": "The entry point for the container as a string or an array of strings.\n\nIf the array consists of exactly one empty string (`[\"\"]`) then the\nentry point is reset to system default (i.e., the entry point used by\ndocker when there is no `ENTRYPOINT` instruction in the `Dockerfile`).\n", + "example": [], + "items": { + "type": "string" + } + }, + "NetworkDisabled": { + "type": "boolean", + "description": "Disable networking for the container.", + "nullable": true + }, + "MacAddress": { + "type": "string", + "description": "MAC address of the container.\n\nDeprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead.\n", + "nullable": true + }, + "OnBuild": { + "type": "array", + "description": "`ONBUILD` metadata that were defined in the image's `Dockerfile`.\n", + "nullable": true, + "example": [], + "items": { + "type": "string" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "StopSignal": { + "type": "string", + "description": "Signal to stop a container as a string or unsigned integer.\n", + "nullable": true, + "example": "SIGTERM" + }, + "StopTimeout": { + "type": "integer", + "description": "Timeout to stop a container in seconds.", + "nullable": true + }, + "Shell": { + "type": "array", + "description": "Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell.\n", + "nullable": true, + "example": [ + "/bin/sh", + "-c" + ], + "items": { + "type": "string" + } + } + }, + "description": "Configuration for a container that is portable between hosts.\n\nWhen used as `ContainerConfig` field in an image, `ContainerConfig` is an\noptional field containing the configuration of the container that was last\ncommitted when creating the image.\n\nPrevious versions of Docker builder used this field to store build cache,\nand it is not in active use anymore.\n" + }, + "NetworkingConfig": { + "type": "object", + "properties": { + "EndpointsConfig": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + }, + "description": "A mapping of network name to endpoint configuration for that network.\nThe endpoint configuration can be left empty to connect to that\nnetwork with no particular endpoint configuration.\n" + } + }, + "description": "NetworkingConfig represents the container's networking configuration for\neach of its interfaces.\nIt is used for the networking configs specified in the `docker create`\nand `docker network connect` commands.\n", + "example": { + "EndpointsConfig": { + "isolated_nw": { + "IPAMConfig": { + "IPv4Address": "172.20.30.33", + "IPv6Address": "2001:db8:abcd::3033", + "LinkLocalIPs": [ + "169.254.34.68", + "fe80::3468" + ] + }, + "MacAddress": "02:42:ac:12:05:02", + "Links": [ + "container_1", + "container_2" + ], + "Aliases": [ + "server_x", + "server_y" + ] + }, + "database_nw": {} + } + } + }, + "NetworkSettings": { + "type": "object", + "properties": { + "Bridge": { + "type": "string", + "description": "Name of the default bridge interface when dockerd's --bridge flag is set.\n", + "example": "docker0" + }, + "SandboxID": { + "type": "string", + "description": "SandboxID uniquely represents a container's network stack.", + "example": "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3" + }, + "HairpinMode": { + "type": "boolean", + "description": "Indicates if hairpin NAT should be enabled on the virtual interface.\n\nDeprecated: This field is never set and will be removed in a future release.\n", + "example": false + }, + "LinkLocalIPv6Address": { + "type": "string", + "description": "IPv6 unicast address using the link-local prefix.\n\nDeprecated: This field is never set and will be removed in a future release.\n", + "example": "" + }, + "LinkLocalIPv6PrefixLen": { + "type": "integer", + "description": "Prefix length of the IPv6 unicast address.\n\nDeprecated: This field is never set and will be removed in a future release.\n" + }, + "Ports": { + "$ref": "#/components/schemas/PortMap" + }, + "SandboxKey": { + "type": "string", + "description": "SandboxKey is the full path of the netns handle", + "example": "/var/run/docker/netns/8ab54b426c38" + }, + "SecondaryIPAddresses": { + "type": "array", + "description": "Deprecated: This field is never set and will be removed in a future release.", + "nullable": true, + "items": { + "$ref": "#/components/schemas/Address" + } + }, + "SecondaryIPv6Addresses": { + "type": "array", + "description": "Deprecated: This field is never set and will be removed in a future release.", + "nullable": true, + "items": { + "$ref": "#/components/schemas/Address" + } + }, + "EndpointID": { + "type": "string", + "description": "EndpointID uniquely represents a service endpoint in a Sandbox.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + }, + "Gateway": { + "type": "string", + "description": "Gateway address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "172.17.0.1" + }, + "GlobalIPv6Address": { + "type": "string", + "description": "Global IPv6 address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "2001:db8::5689" + }, + "GlobalIPv6PrefixLen": { + "type": "integer", + "description": "Mask length of the global IPv6 address.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": 64 + }, + "IPAddress": { + "type": "string", + "description": "IPv4 address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "172.17.0.4" + }, + "IPPrefixLen": { + "type": "integer", + "description": "Mask length of the IPv4 address.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": 16 + }, + "IPv6Gateway": { + "type": "string", + "description": "IPv6 gateway address for this network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "2001:db8:2::100" + }, + "MacAddress": { + "type": "string", + "description": "MAC address for the container on the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "02:42:ac:11:00:04" + }, + "Networks": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + }, + "description": "Information about all networks that the container is connected to.\n" + } + }, + "description": "NetworkSettings exposes the network settings in the API" + }, + "Address": { + "type": "object", + "properties": { + "Addr": { + "type": "string", + "description": "IP address." + }, + "PrefixLen": { + "type": "integer", + "description": "Mask length of the IP address." + } + }, + "description": "Address represents an IPv4 or IPv6 IP address." + }, + "PortMap": { + "type": "object", + "additionalProperties": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/PortBinding" + } + }, + "description": "PortMap describes the mapping of container ports to host ports, using the\ncontainer's port-number and protocol as key in the format `/`,\nfor example, `80/udp`.\n\nIf a container's port is mapped for multiple protocols, separate entries\nare added to the mapping table.\n", + "example": { + "443/tcp": [ + { + "HostIp": "127.0.0.1", + "HostPort": "4443" + } + ], + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "80" + }, + { + "HostIp": "0.0.0.0", + "HostPort": "8080" + } + ], + "80/udp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "80" + } + ], + "53/udp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "53" + } + ] + } + }, + "PortBinding": { + "type": "object", + "properties": { + "HostIp": { + "type": "string", + "description": "Host IP address that the container's port is mapped to.", + "example": "127.0.0.1" + }, + "HostPort": { + "type": "string", + "description": "Host port number that the container's port is mapped to.", + "example": "4443" + } + }, + "description": "PortBinding represents a binding between a host IP address and a host\nport.\n" + }, + "GraphDriverData": { + "required": [ + "Data", + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the storage driver.", + "nullable": false, + "example": "overlay2" + }, + "Data": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Low-level storage metadata, provided as key/value pairs.\n\nThis information is driver-specific, and depends on the storage-driver\nin use, and should be used for informational purposes only.\n", + "nullable": false, + "example": { + "MergedDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/merged", + "UpperDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/diff", + "WorkDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/work" + } + } + }, + "description": "Information about the storage driver used to store the container's and\nimage's filesystem.\n" + }, + "FilesystemChange": { + "required": [ + "Kind", + "Path" + ], + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Path to file or directory that has changed.\n", + "nullable": false + }, + "Kind": { + "$ref": "#/components/schemas/ChangeType" + } + }, + "description": "Change in the container's filesystem.\n" + }, + "ChangeType": { + "type": "integer", + "description": "Kind of change\n\nCan be one of:\n\n- `0`: Modified (\"C\")\n- `1`: Added (\"A\")\n- `2`: Deleted (\"D\")\n", + "format": "uint8", + "nullable": false, + "enum": [ + 0, + 1, + 2 + ], + "x-nullable": false + }, + "ImageInspect": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "ID is the content-addressable ID of an image.\n\nThis identifier is a content-addressable digest calculated from the\nimage's configuration (which includes the digests of layers used by\nthe image).\n\nNote that this digest differs from the `RepoDigests` below, which\nholds digests of image manifests that reference the image.\n", + "nullable": false, + "example": "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + }, + "RepoTags": { + "type": "array", + "description": "List of image names/tags in the local image cache that reference this\nimage.\n\nMultiple image tags can refer to the same image, and this list may be\nempty if no tags reference the image, in which case the image is\n\"untagged\", in which case it can still be referenced by its ID.\n", + "example": [ + "example:1.0", + "example:latest", + "example:stable", + "internal.registry.example.com:5000/example:1.0" + ], + "items": { + "type": "string" + } + }, + "RepoDigests": { + "type": "array", + "description": "List of content-addressable digests of locally available image manifests\nthat the image is referenced from. Multiple manifests can refer to the\nsame image.\n\nThese digests are usually only available if the image was either pulled\nfrom a registry, or if the image was pushed to a registry, which is when\nthe manifest is generated and its digest calculated.\n", + "example": [ + "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", + "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + ], + "items": { + "type": "string" + } + }, + "Parent": { + "type": "string", + "description": "ID of the parent image.\n\nDepending on how the image was created, this field may be empty and\nis only set for images that were built/created locally. This field\nis empty if the image was pulled from an image registry.\n", + "nullable": false, + "example": "" + }, + "Comment": { + "type": "string", + "description": "Optional message that was set when committing or importing the image.\n", + "nullable": false, + "example": "" + }, + "Created": { + "type": "string", + "description": "Date and time at which the image was created, formatted in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n\nThis information is only available if present in the image,\nand omitted otherwise.\n", + "format": "dateTime", + "nullable": true, + "example": "2022-02-04T21:20:12.497794809Z" + }, + "Container": { + "type": "string", + "description": "The ID of the container that was used to create the image.\n\nDepending on how the image was created, this field may be empty.\n\n**Deprecated**: this field is kept for backward compatibility, but\nwill be removed in API v1.45.\n", + "example": "65974bc86f1770ae4bff79f651ebdbce166ae9aada632ee3fa9af3a264911735" + }, + "ContainerConfig": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "DockerVersion": { + "type": "string", + "description": "The version of Docker that was used to build the image.\n\nDepending on how the image was created, this field may be empty.\n", + "nullable": false, + "example": "20.10.7" + }, + "Author": { + "type": "string", + "description": "Name of the author that was specified when committing the image, or as\nspecified through MAINTAINER (deprecated) in the Dockerfile.\n", + "nullable": false, + "example": "" + }, + "Config": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "Architecture": { + "type": "string", + "description": "Hardware CPU architecture that the image runs on.\n", + "nullable": false, + "example": "arm" + }, + "Variant": { + "type": "string", + "description": "CPU architecture variant (presently ARM-only).\n", + "nullable": true, + "example": "v7" + }, + "Os": { + "type": "string", + "description": "Operating System the image is built to run on.\n", + "nullable": false, + "example": "linux" + }, + "OsVersion": { + "type": "string", + "description": "Operating System version the image is built to run on (especially\nfor Windows).\n", + "nullable": true, + "example": "" + }, + "Size": { + "type": "integer", + "description": "Total size of the image including all layers it is composed of.\n", + "format": "int64", + "nullable": false, + "example": 1239828 + }, + "VirtualSize": { + "type": "integer", + "description": "Total size of the image including all layers it is composed of.\n\nDeprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead.\n", + "format": "int64", + "example": 1239828 + }, + "GraphDriver": { + "$ref": "#/components/schemas/GraphDriverData" + }, + "RootFS": { + "required": [ + "Type" + ], + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": false, + "example": "layers" + }, + "Layers": { + "type": "array", + "example": [ + "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6", + "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" + ], + "items": { + "type": "string" + } + } + }, + "description": "Information about the image's RootFS, including the layer IDs.\n" + }, + "Metadata": { + "type": "object", + "properties": { + "LastTagTime": { + "type": "string", + "description": "Date and time at which the image was last tagged in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n\nThis information is only available if the image was tagged locally,\nand omitted otherwise.\n", + "format": "dateTime", + "nullable": true, + "example": "2022-02-28T14:40:02.623929178Z" + } + }, + "description": "Additional metadata of the image in the local cache. This information\nis local to the daemon, and not part of the image itself.\n" + } + }, + "description": "Information about an image in the local image cache.\n" + }, + "ImageSummary": { + "required": [ + "Containers", + "Created", + "Id", + "Labels", + "ParentId", + "RepoDigests", + "RepoTags", + "SharedSize", + "Size" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "ID is the content-addressable ID of an image.\n\nThis identifier is a content-addressable digest calculated from the\nimage's configuration (which includes the digests of layers used by\nthe image).\n\nNote that this digest differs from the `RepoDigests` below, which\nholds digests of image manifests that reference the image.\n", + "nullable": false, + "example": "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + }, + "ParentId": { + "type": "string", + "description": "ID of the parent image.\n\nDepending on how the image was created, this field may be empty and\nis only set for images that were built/created locally. This field\nis empty if the image was pulled from an image registry.\n", + "nullable": false, + "example": "" + }, + "RepoTags": { + "type": "array", + "description": "List of image names/tags in the local image cache that reference this\nimage.\n\nMultiple image tags can refer to the same image, and this list may be\nempty if no tags reference the image, in which case the image is\n\"untagged\", in which case it can still be referenced by its ID.\n", + "nullable": false, + "example": [ + "example:1.0", + "example:latest", + "example:stable", + "internal.registry.example.com:5000/example:1.0" + ], + "items": { + "type": "string" + } + }, + "RepoDigests": { + "type": "array", + "description": "List of content-addressable digests of locally available image manifests\nthat the image is referenced from. Multiple manifests can refer to the\nsame image.\n\nThese digests are usually only available if the image was either pulled\nfrom a registry, or if the image was pushed to a registry, which is when\nthe manifest is generated and its digest calculated.\n", + "nullable": false, + "example": [ + "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", + "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + ], + "items": { + "type": "string" + } + }, + "Created": { + "type": "integer", + "description": "Date and time at which the image was created as a Unix timestamp\n(number of seconds sinds EPOCH).\n", + "nullable": false, + "example": 1644009612 + }, + "Size": { + "type": "integer", + "description": "Total size of the image including all layers it is composed of.\n", + "format": "int64", + "nullable": false, + "example": 172064416 + }, + "SharedSize": { + "type": "integer", + "description": "Total size of image layers that are shared between this image and other\nimages.\n\nThis size is not calculated by default. `-1` indicates that the value\nhas not been set / calculated.\n", + "format": "int64", + "nullable": false, + "example": 1239828 + }, + "VirtualSize": { + "type": "integer", + "description": "Total size of the image including all layers it is composed of.\n\nDeprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead.", + "format": "int64", + "example": 172064416 + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "nullable": false, + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "Containers": { + "type": "integer", + "description": "Number of containers using this image. Includes both stopped and running\ncontainers.\n\nThis size is not calculated by default, and depends on which API endpoint\nis used. `-1` indicates that the value has not been set / calculated.\n", + "nullable": false, + "example": 2 + } + }, + "x-go-name": "Summary" + }, + "AuthConfig": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "email": { + "type": "string" + }, + "serveraddress": { + "type": "string" + } + }, + "example": { + "username": "hannibal", + "password": "xxxx", + "serveraddress": "https://index.docker.io/v1/" + } + }, + "ProcessConfig": { + "type": "object", + "properties": { + "privileged": { + "type": "boolean" + }, + "user": { + "type": "string" + }, + "tty": { + "type": "boolean" + }, + "entrypoint": { + "type": "string" + }, + "arguments": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Volume": { + "required": [ + "Driver", + "Labels", + "Mountpoint", + "Name", + "Options", + "Scope" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the volume.", + "nullable": false, + "example": "tardis" + }, + "Driver": { + "type": "string", + "description": "Name of the volume driver used by the volume.", + "nullable": false, + "example": "custom" + }, + "Mountpoint": { + "type": "string", + "description": "Mount path of the volume on the host.", + "nullable": false, + "example": "/var/lib/docker/volumes/tardis" + }, + "CreatedAt": { + "type": "string", + "description": "Date/Time the volume was created.", + "format": "dateTime", + "example": "2016-06-07T20:31:11.853781916Z" + }, + "Status": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "Low-level details about the volume, provided by the volume driver.\nDetails are returned as a map with key/value pairs:\n`{\"key\":\"value\",\"key2\":\"value2\"}`.\n\nThe `Status` field is optional, and is omitted if the volume driver\ndoes not support this feature.\n", + "example": { + "hello": "world" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "nullable": false, + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "Scope": { + "type": "string", + "description": "The level at which the volume exists. Either `global` for cluster-wide,\nor `local` for machine level.\n", + "nullable": false, + "example": "local", + "default": "local", + "enum": [ + "local", + "global" + ] + }, + "ClusterVolume": { + "$ref": "#/components/schemas/ClusterVolume" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The driver specific options used when creating the volume.\n", + "example": { + "device": "tmpfs", + "o": "size=100m,uid=1000", + "type": "tmpfs" + } + }, + "UsageData": { + "required": [ + "RefCount", + "Size" + ], + "type": "object", + "properties": { + "Size": { + "type": "integer", + "description": "Amount of disk space used by the volume (in bytes). This information\nis only available for volumes created with the `\"local\"` volume\ndriver. For volumes created with other volume drivers, this field\nis set to `-1` (\"not available\")\n", + "format": "int64", + "nullable": false, + "default": -1 + }, + "RefCount": { + "type": "integer", + "description": "The number of containers referencing this volume. This field\nis set to `-1` if the reference-count is not available.\n", + "format": "int64", + "nullable": false, + "default": -1 + } + }, + "description": "Usage details about the volume. This information is used by the\n`GET /system/df` endpoint, and omitted in other endpoints.\n", + "nullable": true, + "x-go-name": "UsageData" + } + } + }, + "VolumeCreateOptions": { + "title": "VolumeConfig", + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The new volume's name. If not specified, Docker generates a name.\n", + "nullable": false, + "example": "tardis" + }, + "Driver": { + "type": "string", + "description": "Name of the volume driver to use.", + "nullable": false, + "example": "custom", + "default": "local" + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A mapping of driver options and values. These options are\npassed directly to the driver and are driver specific.\n", + "example": { + "device": "tmpfs", + "o": "size=100m,uid=1000", + "type": "tmpfs" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "ClusterVolumeSpec": { + "$ref": "#/components/schemas/ClusterVolumeSpec" + } + }, + "description": "Volume configuration", + "x-go-name": "CreateOptions" + }, + "VolumeListResponse": { + "title": "VolumeListResponse", + "type": "object", + "properties": { + "Volumes": { + "type": "array", + "description": "List of volumes", + "items": { + "$ref": "#/components/schemas/Volume" + } + }, + "Warnings": { + "type": "array", + "description": "Warnings that occurred when fetching the list of volumes.\n", + "example": [], + "items": { + "type": "string" + } + } + }, + "description": "Volume list response", + "x-go-name": "ListResponse" + }, + "Network": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Id": { + "type": "string" + }, + "Created": { + "type": "string", + "format": "dateTime" + }, + "Scope": { + "type": "string" + }, + "Driver": { + "type": "string" + }, + "EnableIPv6": { + "type": "boolean" + }, + "IPAM": { + "$ref": "#/components/schemas/IPAM" + }, + "Internal": { + "type": "boolean" + }, + "Attachable": { + "type": "boolean" + }, + "Ingress": { + "type": "boolean" + }, + "Containers": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/NetworkContainer" + } + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "example": { + "Name": "net01", + "Id": "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99", + "Created": "2016-10-19T04:33:30.360899459Z", + "Scope": "local", + "Driver": "bridge", + "EnableIPv6": false, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.19.0.0/16", + "Gateway": "172.19.0.1" + } + ], + "Options": { + "foo": "bar" + } + }, + "Internal": false, + "Attachable": false, + "Ingress": false, + "Containers": { + "19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c": { + "Name": "test", + "EndpointID": "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a", + "MacAddress": "02:42:ac:13:00:02", + "IPv4Address": "172.19.0.2/16", + "IPv6Address": "" + } + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + }, + "IPAM": { + "type": "object", + "properties": { + "Driver": { + "type": "string", + "description": "Name of the IPAM driver to use.", + "default": "default" + }, + "Config": { + "type": "array", + "description": "List of IPAM configuration options, specified as a map:\n\n```\n{\"Subnet\": , \"IPRange\": , \"Gateway\": , \"AuxAddress\": }\n```\n", + "items": { + "$ref": "#/components/schemas/IPAMConfig" + } + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver-specific options, specified as a map." + } + } + }, + "IPAMConfig": { + "type": "object", + "properties": { + "Subnet": { + "type": "string" + }, + "IPRange": { + "type": "string" + }, + "Gateway": { + "type": "string" + }, + "AuxiliaryAddresses": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "NetworkContainer": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "EndpointID": { + "type": "string" + }, + "MacAddress": { + "type": "string" + }, + "IPv4Address": { + "type": "string" + }, + "IPv6Address": { + "type": "string" + } + } + }, + "BuildInfo": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "stream": { + "type": "string" + }, + "error": { + "type": "string" + }, + "errorDetail": { + "$ref": "#/components/schemas/ErrorDetail" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + }, + "aux": { + "$ref": "#/components/schemas/ImageID" + } + } + }, + "BuildCache": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Unique ID of the build cache record.\n", + "example": "ndlpt0hhvkqcdfkputsk4cq9c" + }, + "Parent": { + "type": "string", + "description": "ID of the parent build cache record.\n\n> **Deprecated**: This field is deprecated, and omitted if empty.\n", + "nullable": true, + "example": "" + }, + "Parents": { + "type": "array", + "description": "List of parent build cache record IDs.\n", + "nullable": true, + "example": [ + "hw53o5aio51xtltp5xjp8v7fx" + ], + "items": { + "type": "string" + } + }, + "Type": { + "type": "string", + "description": "Cache record type.\n", + "example": "regular", + "enum": [ + "internal", + "frontend", + "source.local", + "source.git.checkout", + "exec.cachemount", + "regular" + ] + }, + "Description": { + "type": "string", + "description": "Description of the build-step that produced the build cache.\n", + "example": "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache" + }, + "InUse": { + "type": "boolean", + "description": "Indicates if the build cache is in use.\n", + "example": false + }, + "Shared": { + "type": "boolean", + "description": "Indicates if the build cache is shared.\n", + "example": true + }, + "Size": { + "type": "integer", + "description": "Amount of disk space used by the build cache (in bytes).\n", + "example": 51 + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the build cache was created in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "LastUsedAt": { + "type": "string", + "description": "Date and time at which the build cache was last used in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "nullable": true, + "example": "2017-08-09T07:09:37.632105588Z" + }, + "UsageCount": { + "type": "integer", + "example": 26 + } + }, + "description": "BuildCache contains information about a build cache record.\n" + }, + "ImageID": { + "type": "object", + "properties": { + "ID": { + "type": "string" + } + }, + "description": "Image ID or Digest", + "example": { + "ID": "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" + } + }, + "CreateImageInfo": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "error": { + "type": "string" + }, + "errorDetail": { + "$ref": "#/components/schemas/ErrorDetail" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + } + } + }, + "PushImageInfo": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + } + } + }, + "ErrorDetail": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + }, + "ProgressDetail": { + "type": "object", + "properties": { + "current": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "ErrorResponse": { + "required": [ + "message" + ], + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "The error message.", + "nullable": false + } + }, + "description": "Represents an error.", + "example": { + "message": "Something went wrong." + } + }, + "IdResponse": { + "required": [ + "Id" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The id of the newly created object.", + "nullable": false + } + }, + "description": "Response to an API call that returns just an Id" + }, + "EndpointSettings": { + "type": "object", + "properties": { + "IPAMConfig": { + "$ref": "#/components/schemas/EndpointIPAMConfig" + }, + "Links": { + "type": "array", + "example": [ + "container_1", + "container_2" + ], + "items": { + "type": "string" + } + }, + "MacAddress": { + "type": "string", + "description": "MAC address for the endpoint on this network. The network driver might ignore this parameter.\n", + "example": "02:42:ac:11:00:04" + }, + "Aliases": { + "type": "array", + "example": [ + "server_x", + "server_y" + ], + "items": { + "type": "string" + } + }, + "NetworkID": { + "type": "string", + "description": "Unique ID of the network.\n", + "example": "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a" + }, + "EndpointID": { + "type": "string", + "description": "Unique ID for the service endpoint in a Sandbox.\n", + "example": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + }, + "Gateway": { + "type": "string", + "description": "Gateway address for this network.\n", + "example": "172.17.0.1" + }, + "IPAddress": { + "type": "string", + "description": "IPv4 address.\n", + "example": "172.17.0.4" + }, + "IPPrefixLen": { + "type": "integer", + "description": "Mask length of the IPv4 address.\n", + "example": 16 + }, + "IPv6Gateway": { + "type": "string", + "description": "IPv6 gateway address.\n", + "example": "2001:db8:2::100" + }, + "GlobalIPv6Address": { + "type": "string", + "description": "Global IPv6 address.\n", + "example": "2001:db8::5689" + }, + "GlobalIPv6PrefixLen": { + "type": "integer", + "description": "Mask length of the global IPv6 address.\n", + "format": "int64", + "example": 64 + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "DriverOpts is a mapping of driver options and values. These options\nare passed directly to the driver and are driver specific.\n", + "nullable": true, + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "DNSNames": { + "type": "array", + "description": "List of all DNS names an endpoint has on a specific network. This\nlist is based on the container name, network aliases, container short\nID, and hostname.\n\nThese DNS names are non-fully qualified but can contain several dots.\nYou can get fully qualified DNS names by appending `.`.\nFor instance, if container name is `my.ctr` and the network is named\n`testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be\n`my.ctr.testnet`.\n", + "example": [ + "foobar", + "server_x", + "server_y", + "my.ctr" + ], + "items": { + "type": "string" + } + } + }, + "description": "Configuration for a network endpoint." + }, + "EndpointIPAMConfig": { + "type": "object", + "properties": { + "IPv4Address": { + "type": "string", + "example": "172.20.30.33" + }, + "IPv6Address": { + "type": "string", + "example": "2001:db8:abcd::3033" + }, + "LinkLocalIPs": { + "type": "array", + "example": [ + "169.254.34.68", + "fe80::3468" + ], + "items": { + "type": "string" + } + } + }, + "description": "EndpointIPAMConfig represents an endpoint's IPAM configuration.\n", + "nullable": true, + "x-nullable": true + }, + "PluginMount": { + "required": [ + "Description", + "Destination", + "Name", + "Options", + "Settable", + "Source", + "Type" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false, + "example": "some-mount" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "This is a mount that's used by the plugin." + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Source": { + "type": "string", + "example": "/var/lib/docker/plugins/" + }, + "Destination": { + "type": "string", + "nullable": false, + "example": "/mnt/state" + }, + "Type": { + "type": "string", + "nullable": false, + "example": "bind" + }, + "Options": { + "type": "array", + "example": [ + "rbind", + "rw" + ], + "items": { + "type": "string" + } + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginDevice": { + "required": [ + "Description", + "Name", + "Path", + "Settable" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false + }, + "Description": { + "type": "string", + "nullable": false + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Path": { + "type": "string", + "example": "/dev/fuse" + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginEnv": { + "required": [ + "Description", + "Name", + "Settable", + "Value" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false + }, + "Description": { + "type": "string", + "nullable": false + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Value": { + "type": "string" + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginInterfaceType": { + "required": [ + "Capability", + "Prefix", + "Version" + ], + "type": "object", + "properties": { + "Prefix": { + "type": "string", + "nullable": false + }, + "Capability": { + "type": "string", + "nullable": false + }, + "Version": { + "type": "string", + "nullable": false + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginPrivilege": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "example": "network" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "example": [ + "host" + ], + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission the user has to accept upon installing\nthe plugin.\n", + "x-go-name": "PluginPrivilege" + }, + "Plugin": { + "required": [ + "Config", + "Enabled", + "Name", + "Settings" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "example": "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" + }, + "Name": { + "type": "string", + "nullable": false, + "example": "tiborvass/sample-volume-plugin" + }, + "Enabled": { + "type": "boolean", + "description": "True if the plugin is running. False if the plugin is not running, only installed.", + "nullable": false, + "example": true + }, + "Settings": { + "required": [ + "Args", + "Devices", + "Env", + "Mounts" + ], + "type": "object", + "properties": { + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginMount" + } + }, + "Env": { + "type": "array", + "example": [ + "DEBUG=0" + ], + "items": { + "type": "string" + } + }, + "Args": { + "type": "array", + "items": { + "type": "string" + } + }, + "Devices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginDevice" + } + } + }, + "description": "Settings that can be modified by users.", + "nullable": false + }, + "PluginReference": { + "type": "string", + "description": "plugin remote reference used to push/pull the plugin", + "nullable": false, + "example": "localhost:5000/tiborvass/sample-volume-plugin:latest" + }, + "Config": { + "required": [ + "Args", + "Description", + "Documentation", + "Entrypoint", + "Env", + "Interface", + "IpcHost", + "Linux", + "Mounts", + "Network", + "PidHost", + "PropagatedMount", + "WorkDir" + ], + "type": "object", + "properties": { + "DockerVersion": { + "type": "string", + "description": "Docker Version used to create the plugin", + "nullable": false, + "example": "17.06.0-ce" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "A sample volume plugin for Docker" + }, + "Documentation": { + "type": "string", + "nullable": false, + "example": "https://docs.docker.com/engine/extend/plugins/" + }, + "Interface": { + "required": [ + "Socket", + "Types" + ], + "type": "object", + "properties": { + "Types": { + "type": "array", + "example": [ + "docker.volumedriver/1.0" + ], + "items": { + "$ref": "#/components/schemas/PluginInterfaceType" + } + }, + "Socket": { + "type": "string", + "nullable": false, + "example": "plugins.sock" + }, + "ProtocolScheme": { + "type": "string", + "description": "Protocol to use for clients connecting to the plugin.", + "example": "some.protocol/v1.0", + "enum": [ + "", + "moby.plugins.http/v1" + ] + } + }, + "description": "The interface between Docker and the plugin", + "nullable": false + }, + "Entrypoint": { + "type": "array", + "example": [ + "/usr/bin/sample-volume-plugin", + "/data" + ], + "items": { + "type": "string" + } + }, + "WorkDir": { + "type": "string", + "nullable": false, + "example": "/bin/" + }, + "User": { + "type": "object", + "properties": { + "UID": { + "type": "integer", + "format": "uint32", + "example": 1000 + }, + "GID": { + "type": "integer", + "format": "uint32", + "example": 1000 + } + }, + "nullable": false + }, + "Network": { + "required": [ + "Type" + ], + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": false, + "example": "host" + } + }, + "nullable": false + }, + "Linux": { + "required": [ + "AllowAllDevices", + "Capabilities", + "Devices" + ], + "type": "object", + "properties": { + "Capabilities": { + "type": "array", + "example": [ + "CAP_SYS_ADMIN", + "CAP_SYSLOG" + ], + "items": { + "type": "string" + } + }, + "AllowAllDevices": { + "type": "boolean", + "nullable": false, + "example": false + }, + "Devices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginDevice" + } + } + }, + "nullable": false + }, + "PropagatedMount": { + "type": "string", + "nullable": false, + "example": "/mnt/volumes" + }, + "IpcHost": { + "type": "boolean", + "nullable": false, + "example": false + }, + "PidHost": { + "type": "boolean", + "nullable": false, + "example": false + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginMount" + } + }, + "Env": { + "type": "array", + "example": [ + { + "Name": "DEBUG", + "Description": "If set, prints debug messages", + "Value": "0" + } + ], + "items": { + "$ref": "#/components/schemas/PluginEnv" + } + }, + "Args": { + "required": [ + "Description", + "Name", + "Settable", + "Value" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false, + "example": "args" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "command line arguments" + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "nullable": false + }, + "rootfs": { + "type": "object", + "properties": { + "type": { + "type": "string", + "example": "layers" + }, + "diff_ids": { + "type": "array", + "example": [ + "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887", + "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" + ], + "items": { + "type": "string" + } + } + } + } + }, + "description": "The config of a plugin.", + "nullable": false + } + }, + "description": "A plugin for the Engine API" + }, + "ObjectVersion": { + "type": "object", + "properties": { + "Index": { + "type": "integer", + "format": "uint64", + "example": 373531 + } + }, + "description": "The version number of the object such as node, service, etc. This is needed\nto avoid conflicting writes. The client must send the version number along\nwith the modified specification when updating these objects.\n\nThis approach ensures safe concurrency and determinism in that the change\non the object may not be applied if the version number has changed from the\nlast read. In other words, if two update requests specify the same base\nversion, only one of the requests can succeed. As a result, two separate\nupdate requests that happen at the same time will not unintentionally\noverwrite each other.\n" + }, + "NodeSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name for the node.", + "example": "my-node" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Role": { + "type": "string", + "description": "Role of the node.", + "example": "manager", + "enum": [ + "worker", + "manager" + ] + }, + "Availability": { + "type": "string", + "description": "Availability of the node.", + "example": "active", + "enum": [ + "active", + "pause", + "drain" + ] + } + }, + "example": { + "Availability": "active", + "Name": "node-name", + "Role": "manager", + "Labels": { + "foo": "bar" + } + } + }, + "Node": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "example": "24ifsmvkjbyhk" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the node was added to the swarm in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "UpdatedAt": { + "type": "string", + "description": "Date and time at which the node was last updated in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2017-08-09T07:09:37.632105588Z" + }, + "Spec": { + "$ref": "#/components/schemas/NodeSpec" + }, + "Description": { + "$ref": "#/components/schemas/NodeDescription" + }, + "Status": { + "$ref": "#/components/schemas/NodeStatus" + }, + "ManagerStatus": { + "$ref": "#/components/schemas/ManagerStatus" + } + } + }, + "NodeDescription": { + "type": "object", + "properties": { + "Hostname": { + "type": "string", + "example": "bf3067039e47" + }, + "Platform": { + "$ref": "#/components/schemas/Platform" + }, + "Resources": { + "$ref": "#/components/schemas/ResourceObject" + }, + "Engine": { + "$ref": "#/components/schemas/EngineDescription" + }, + "TLSInfo": { + "$ref": "#/components/schemas/TLSInfo" + } + }, + "description": "NodeDescription encapsulates the properties of the Node as reported by the\nagent.\n" + }, + "Platform": { + "type": "object", + "properties": { + "Architecture": { + "type": "string", + "description": "Architecture represents the hardware architecture (for example,\n`x86_64`).\n", + "example": "x86_64" + }, + "OS": { + "type": "string", + "description": "OS represents the Operating System (for example, `linux` or `windows`).\n", + "example": "linux" + } + }, + "description": "Platform represents the platform (Arch/OS).\n" + }, + "EngineDescription": { + "type": "object", + "properties": { + "EngineVersion": { + "type": "string", + "example": "17.06.0" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "example": { + "foo": "bar" + } + }, + "Plugins": { + "type": "array", + "example": [ + { + "Type": "Log", + "Name": "awslogs" + }, + { + "Type": "Log", + "Name": "fluentd" + }, + { + "Type": "Log", + "Name": "gcplogs" + }, + { + "Type": "Log", + "Name": "gelf" + }, + { + "Type": "Log", + "Name": "journald" + }, + { + "Type": "Log", + "Name": "json-file" + }, + { + "Type": "Log", + "Name": "splunk" + }, + { + "Type": "Log", + "Name": "syslog" + }, + { + "Type": "Network", + "Name": "bridge" + }, + { + "Type": "Network", + "Name": "host" + }, + { + "Type": "Network", + "Name": "ipvlan" + }, + { + "Type": "Network", + "Name": "macvlan" + }, + { + "Type": "Network", + "Name": "null" + }, + { + "Type": "Network", + "Name": "overlay" + }, + { + "Type": "Volume", + "Name": "local" + }, + { + "Type": "Volume", + "Name": "localhost:5000/vieux/sshfs:latest" + }, + { + "Type": "Volume", + "Name": "vieux/sshfs:latest" + } + ], + "items": { + "type": "object", + "properties": { + "Type": { + "type": "string" + }, + "Name": { + "type": "string" + } + } + } + } + }, + "description": "EngineDescription provides information about an engine." + }, + "TLSInfo": { + "type": "object", + "properties": { + "TrustRoot": { + "type": "string", + "description": "The root CA certificate(s) that are used to validate leaf TLS\ncertificates.\n" + }, + "CertIssuerSubject": { + "type": "string", + "description": "The base64-url-safe-encoded raw subject bytes of the issuer." + }, + "CertIssuerPublicKey": { + "type": "string", + "description": "The base64-url-safe-encoded raw public key bytes of the issuer.\n" + } + }, + "description": "Information about the issuer of leaf TLS certificates and the trusted root\nCA certificate.\n", + "example": { + "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0\nMzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf\n3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO\nPQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz\npxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H\n-----END CERTIFICATE-----\n", + "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh", + "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A==" + } + }, + "NodeStatus": { + "type": "object", + "properties": { + "State": { + "$ref": "#/components/schemas/NodeState" + }, + "Message": { + "type": "string", + "example": "" + }, + "Addr": { + "type": "string", + "description": "IP address of the node.", + "example": "172.17.0.2" + } + }, + "description": "NodeStatus represents the status of a node.\n\nIt provides the current status of the node, as seen by the manager.\n" + }, + "NodeState": { + "type": "string", + "description": "NodeState represents the state of a node.", + "example": "ready", + "enum": [ + "unknown", + "down", + "ready", + "disconnected" + ] + }, + "ManagerStatus": { + "type": "object", + "properties": { + "Leader": { + "type": "boolean", + "example": true, + "default": false + }, + "Reachability": { + "$ref": "#/components/schemas/Reachability" + }, + "Addr": { + "type": "string", + "description": "The IP address and port at which the manager is reachable.\n", + "example": "10.0.0.46:2377" + } + }, + "description": "ManagerStatus represents the status of a manager.\n\nIt provides the current status of a node's manager component, if the node\nis a manager.\n", + "nullable": true, + "x-nullable": true + }, + "Reachability": { + "type": "string", + "description": "Reachability represents the reachability of a node.", + "example": "reachable", + "enum": [ + "unknown", + "unreachable", + "reachable" + ] + }, + "SwarmSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the swarm.", + "example": "default" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.corp.type": "production", + "com.example.corp.department": "engineering" + } + }, + "Orchestration": { + "type": "object", + "properties": { + "TaskHistoryRetentionLimit": { + "type": "integer", + "description": "The number of historic tasks to keep per instance or node. If\nnegative, never remove completed or failed tasks.\n", + "format": "int64", + "example": 10 + } + }, + "description": "Orchestration configuration.", + "nullable": true + }, + "Raft": { + "type": "object", + "properties": { + "SnapshotInterval": { + "type": "integer", + "description": "The number of log entries between snapshots.", + "format": "uint64", + "example": 10000 + }, + "KeepOldSnapshots": { + "type": "integer", + "description": "The number of snapshots to keep beyond the current snapshot.\n", + "format": "uint64" + }, + "LogEntriesForSlowFollowers": { + "type": "integer", + "description": "The number of log entries to keep around to sync up slow followers\nafter a snapshot is created.\n", + "format": "uint64", + "example": 500 + }, + "ElectionTick": { + "type": "integer", + "description": "The number of ticks that a follower will wait for a message from\nthe leader before becoming a candidate and starting an election.\n`ElectionTick` must be greater than `HeartbeatTick`.\n\nA tick currently defaults to one second, so these translate\ndirectly to seconds currently, but this is NOT guaranteed.\n", + "example": 3 + }, + "HeartbeatTick": { + "type": "integer", + "description": "The number of ticks between heartbeats. Every HeartbeatTick ticks,\nthe leader will send a heartbeat to the followers.\n\nA tick currently defaults to one second, so these translate\ndirectly to seconds currently, but this is NOT guaranteed.\n", + "example": 1 + } + }, + "description": "Raft configuration." + }, + "Dispatcher": { + "type": "object", + "properties": { + "HeartbeatPeriod": { + "type": "integer", + "description": "The delay for an agent to send a heartbeat to the dispatcher.\n", + "format": "int64", + "example": 5000000000 + } + }, + "description": "Dispatcher configuration.", + "nullable": true + }, + "CAConfig": { + "type": "object", + "properties": { + "NodeCertExpiry": { + "type": "integer", + "description": "The duration node certificates are issued for.", + "format": "int64", + "example": 7776000000000000 + }, + "ExternalCAs": { + "type": "array", + "description": "Configuration for forwarding signing requests to an external\ncertificate authority.\n", + "items": { + "type": "object", + "properties": { + "Protocol": { + "type": "string", + "description": "Protocol for communication with the external CA (currently\nonly `cfssl` is supported).\n", + "default": "cfssl", + "enum": [ + "cfssl" + ] + }, + "URL": { + "type": "string", + "description": "URL where certificate signing requests should be sent.\n" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "An object with key/value pairs that are interpreted as\nprotocol-specific options for the external CA driver.\n" + }, + "CACert": { + "type": "string", + "description": "The root CA certificate (in PEM format) this external CA uses\nto issue TLS certificates (assumed to be to the current swarm\nroot CA certificate if not provided).\n" + } + } + } + }, + "SigningCACert": { + "type": "string", + "description": "The desired signing CA certificate for all swarm node TLS leaf\ncertificates, in PEM format.\n" + }, + "SigningCAKey": { + "type": "string", + "description": "The desired signing CA key for all swarm node TLS leaf certificates,\nin PEM format.\n" + }, + "ForceRotate": { + "type": "integer", + "description": "An integer whose purpose is to force swarm to generate a new\nsigning CA certificate and key, if none have been specified in\n`SigningCACert` and `SigningCAKey`\n", + "format": "uint64" + } + }, + "description": "CA configuration.", + "nullable": true + }, + "EncryptionConfig": { + "type": "object", + "properties": { + "AutoLockManagers": { + "type": "boolean", + "description": "If set, generate a key and use it to lock data stored on the\nmanagers.\n", + "example": false + } + }, + "description": "Parameters related to encryption-at-rest." + }, + "TaskDefaults": { + "type": "object", + "properties": { + "LogDriver": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The log driver to use as a default for new tasks.\n", + "example": "json-file" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver-specific options for the selectd log driver, specified\nas key/value pairs.\n", + "example": { + "max-file": "10", + "max-size": "100m" + } + } + }, + "description": "The log driver to use for tasks created in the orchestrator if\nunspecified by a service.\n\nUpdating this value only affects new tasks. Existing tasks continue\nto use their previously configured log driver until recreated.\n" + } + }, + "description": "Defaults for creating tasks in this cluster." + } + }, + "description": "User modifiable swarm configuration." + }, + "ClusterInfo": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the swarm.", + "example": "abajmipo7b4xz5ip2nrla6b11" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the swarm was initialised in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "UpdatedAt": { + "type": "string", + "description": "Date and time at which the swarm was last updated in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2017-08-09T07:09:37.632105588Z" + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + }, + "TLSInfo": { + "$ref": "#/components/schemas/TLSInfo" + }, + "RootRotationInProgress": { + "type": "boolean", + "description": "Whether there is currently a root CA rotation in progress for the swarm\n", + "example": false + }, + "DataPathPort": { + "type": "integer", + "description": "DataPathPort specifies the data path port number for data traffic.\nAcceptable port range is 1024 to 49151.\nIf no port is set or is set to 0, the default port (4789) is used.\n", + "format": "uint32", + "example": 4789 + }, + "DefaultAddrPool": { + "type": "array", + "description": "Default Address Pool specifies default subnet pools for global scope\nnetworks.\n", + "items": { + "type": "string", + "format": "CIDR", + "example": "" + } + }, + "SubnetSize": { + "maximum": 29, + "type": "integer", + "description": "SubnetSize specifies the subnet size of the networks created from the\ndefault subnet pool.\n", + "format": "uint32", + "example": 24 + } + }, + "description": "ClusterInfo represents information about the swarm as is returned by the\n\"/info\" endpoint. Join-tokens are not included.\n", + "nullable": true, + "x-nullable": true + }, + "JoinTokens": { + "type": "object", + "properties": { + "Worker": { + "type": "string", + "description": "The token workers can use to join the swarm.\n", + "example": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx" + }, + "Manager": { + "type": "string", + "description": "The token managers can use to join the swarm.\n", + "example": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + }, + "description": "JoinTokens contains the tokens workers and managers need to join the swarm.\n" + }, + "Swarm": { + "allOf": [ + { + "$ref": "#/components/schemas/ClusterInfo" + }, + { + "type": "object", + "properties": { + "JoinTokens": { + "$ref": "#/components/schemas/JoinTokens" + } + } + } + ] + }, + "TaskSpec": { + "type": "object", + "properties": { + "PluginSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The name or 'alias' to use for the plugin." + }, + "Remote": { + "type": "string", + "description": "The plugin image reference to use." + }, + "Disabled": { + "type": "boolean", + "description": "Disable the plugin once scheduled." + }, + "PluginPrivilege": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + }, + "description": "Plugin spec for the service. *(Experimental release only.)*\n\n


\n\n> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n> mutually exclusive. PluginSpec is only used when the Runtime field\n> is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n> field is set to `attachment`.\n" + }, + "ContainerSpec": { + "type": "object", + "properties": { + "Image": { + "type": "string", + "description": "The image name to use for the container" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value data." + }, + "Command": { + "type": "array", + "description": "The command to be run in the image.", + "items": { + "type": "string" + } + }, + "Args": { + "type": "array", + "description": "Arguments to the command.", + "items": { + "type": "string" + } + }, + "Hostname": { + "type": "string", + "description": "The hostname to use for the container, as a valid\n[RFC 1123](https://tools.ietf.org/html/rfc1123) hostname.\n" + }, + "Env": { + "type": "array", + "description": "A list of environment variables in the form `VAR=value`.\n", + "items": { + "type": "string" + } + }, + "Dir": { + "type": "string", + "description": "The working directory for commands to run in." + }, + "User": { + "type": "string", + "description": "The user inside the container." + }, + "Groups": { + "type": "array", + "description": "A list of additional groups that the container process will run as.\n", + "items": { + "type": "string" + } + }, + "Privileges": { + "type": "object", + "properties": { + "CredentialSpec": { + "type": "object", + "properties": { + "Config": { + "type": "string", + "description": "Load credential spec from a Swarm Config with the given ID.\nThe specified config must also be present in the Configs\nfield with the Runtime property set.\n\n


\n\n\n> **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n> and `CredentialSpec.Config` are mutually exclusive.\n", + "example": "0bt9dmxjvjiqermk6xrop3ekq" + }, + "File": { + "type": "string", + "description": "Load credential spec from this file. The file is read by\nthe daemon, and must be present in the `CredentialSpecs`\nsubdirectory in the docker data directory, which defaults\nto `C:\\ProgramData\\Docker\\` on Windows.\n\nFor example, specifying `spec.json` loads\n`C:\\ProgramData\\Docker\\CredentialSpecs\\spec.json`.\n\n


\n\n> **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n> and `CredentialSpec.Config` are mutually exclusive.\n", + "example": "spec.json" + }, + "Registry": { + "type": "string", + "description": "Load credential spec from this value in the Windows\nregistry. The specified registry value must be located in:\n\n`HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Virtualization\\Containers\\CredentialSpecs`\n\n


\n\n\n> **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n> and `CredentialSpec.Config` are mutually exclusive.\n" + } + }, + "description": "CredentialSpec for managed service account (Windows only)" + }, + "SELinuxContext": { + "type": "object", + "properties": { + "Disable": { + "type": "boolean", + "description": "Disable SELinux" + }, + "User": { + "type": "string", + "description": "SELinux user label" + }, + "Role": { + "type": "string", + "description": "SELinux role label" + }, + "Type": { + "type": "string", + "description": "SELinux type label" + }, + "Level": { + "type": "string", + "description": "SELinux level label" + } + }, + "description": "SELinux labels of the container" + }, + "Seccomp": { + "type": "object", + "properties": { + "Mode": { + "type": "string", + "enum": [ + "default", + "unconfined", + "custom" + ] + }, + "Profile": { + "type": "string", + "description": "The custom seccomp profile as a json object" + } + }, + "description": "Options for configuring seccomp on the container" + }, + "AppArmor": { + "type": "object", + "properties": { + "Mode": { + "type": "string", + "enum": [ + "default", + "disabled" + ] + } + }, + "description": "Options for configuring AppArmor on the container" + }, + "NoNewPrivileges": { + "type": "boolean", + "description": "Configuration of the no_new_privs bit in the container" + } + }, + "description": "Security options for the container" + }, + "TTY": { + "type": "boolean", + "description": "Whether a pseudo-TTY should be allocated." + }, + "OpenStdin": { + "type": "boolean", + "description": "Open `stdin`" + }, + "ReadOnly": { + "type": "boolean", + "description": "Mount the container's root filesystem as read only." + }, + "Mounts": { + "type": "array", + "description": "Specification for mounts to be added to containers created as part\nof the service.\n", + "items": { + "$ref": "#/components/schemas/Mount" + } + }, + "StopSignal": { + "type": "string", + "description": "Signal to stop the container." + }, + "StopGracePeriod": { + "type": "integer", + "description": "Amount of time to wait for the container to terminate before\nforcefully killing it.\n", + "format": "int64" + }, + "HealthCheck": { + "$ref": "#/components/schemas/HealthConfig" + }, + "Hosts": { + "type": "array", + "description": "A list of hostname/IP mappings to add to the container's `hosts`\nfile. The format of extra hosts is specified in the\n[hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html)\nman page:\n\n IP_address canonical_hostname [aliases...]\n", + "items": { + "type": "string" + } + }, + "DNSConfig": { + "type": "object", + "properties": { + "Nameservers": { + "type": "array", + "description": "The IP addresses of the name servers.", + "items": { + "type": "string" + } + }, + "Search": { + "type": "array", + "description": "A search list for host-name lookup.", + "items": { + "type": "string" + } + }, + "Options": { + "type": "array", + "description": "A list of internal resolver variables to be modified (e.g.,\n`debug`, `ndots:3`, etc.).\n", + "items": { + "type": "string" + } + } + }, + "description": "Specification for DNS related configurations in resolver configuration\nfile (`resolv.conf`).\n" + }, + "Secrets": { + "type": "array", + "description": "Secrets contains references to zero or more secrets that will be\nexposed to the service.\n", + "items": { + "type": "object", + "properties": { + "File": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name represents the final filename in the filesystem.\n" + }, + "UID": { + "type": "string", + "description": "UID represents the file UID." + }, + "GID": { + "type": "string", + "description": "GID represents the file GID." + }, + "Mode": { + "type": "integer", + "description": "Mode represents the FileMode of the file.", + "format": "uint32" + } + }, + "description": "File represents a specific target that is backed by a file.\n" + }, + "SecretID": { + "type": "string", + "description": "SecretID represents the ID of the specific secret that we're\nreferencing.\n" + }, + "SecretName": { + "type": "string", + "description": "SecretName is the name of the secret that this references,\nbut this is just provided for lookup/display purposes. The\nsecret in the reference will be identified by its ID.\n" + } + } + } + }, + "Configs": { + "type": "array", + "description": "Configs contains references to zero or more configs that will be\nexposed to the service.\n", + "items": { + "type": "object", + "properties": { + "File": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name represents the final filename in the filesystem.\n" + }, + "UID": { + "type": "string", + "description": "UID represents the file UID." + }, + "GID": { + "type": "string", + "description": "GID represents the file GID." + }, + "Mode": { + "type": "integer", + "description": "Mode represents the FileMode of the file.", + "format": "uint32" + } + }, + "description": "File represents a specific target that is backed by a file.\n\n


\n\n> **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive\n" + }, + "Runtime": { + "type": "object", + "properties": {}, + "description": "Runtime represents a target that is not mounted into the\ncontainer but is used by the task\n\n


\n\n> **Note**: `Configs.File` and `Configs.Runtime` are mutually\n> exclusive\n" + }, + "ConfigID": { + "type": "string", + "description": "ConfigID represents the ID of the specific config that we're\nreferencing.\n" + }, + "ConfigName": { + "type": "string", + "description": "ConfigName is the name of the config that this references,\nbut this is just provided for lookup/display purposes. The\nconfig in the reference will be identified by its ID.\n" + } + } + } + }, + "Isolation": { + "type": "string", + "description": "Isolation technology of the containers running the service.\n(Windows only)\n", + "enum": [ + "default", + "process", + "hyperv" + ] + }, + "Init": { + "type": "boolean", + "description": "Run an init inside the container that forwards signals and reaps\nprocesses. This field is omitted if empty, and the default (as\nconfigured on the daemon) is used.\n", + "nullable": true + }, + "Sysctls": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Set kernel namedspaced parameters (sysctls) in the container.\nThe Sysctls option on services accepts the same sysctls as the\nare supported on containers. Note that while the same sysctls are\nsupported, no guarantees or checks are made about their\nsuitability for a clustered environment, and it's up to the user\nto determine whether a given sysctl will work properly in a\nService.\n" + }, + "CapabilityAdd": { + "type": "array", + "description": "A list of kernel capabilities to add to the default set\nfor the container.\n", + "example": [ + "CAP_NET_RAW", + "CAP_SYS_ADMIN", + "CAP_SYS_CHROOT", + "CAP_SYSLOG" + ], + "items": { + "type": "string" + } + }, + "CapabilityDrop": { + "type": "array", + "description": "A list of kernel capabilities to drop from the default set\nfor the container.\n", + "example": [ + "CAP_NET_RAW" + ], + "items": { + "type": "string" + } + }, + "Ulimits": { + "type": "array", + "description": "A list of resource limits to set in the container. For example: `{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}`\"\n", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of ulimit" + }, + "Soft": { + "type": "integer", + "description": "Soft limit" + }, + "Hard": { + "type": "integer", + "description": "Hard limit" + } + } + } + } + }, + "description": "Container spec for the service.\n\n


\n\n> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n> mutually exclusive. PluginSpec is only used when the Runtime field\n> is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n> field is set to `attachment`.\n" + }, + "NetworkAttachmentSpec": { + "type": "object", + "properties": { + "ContainerID": { + "type": "string", + "description": "ID of the container represented by this task" + } + }, + "description": "Read-only spec type for non-swarm containers attached to swarm overlay\nnetworks.\n\n


\n\n> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n> mutually exclusive. PluginSpec is only used when the Runtime field\n> is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n> field is set to `attachment`.\n" + }, + "Resources": { + "type": "object", + "properties": { + "Limits": { + "$ref": "#/components/schemas/Limit" + }, + "Reservations": { + "$ref": "#/components/schemas/ResourceObject" + } + }, + "description": "Resource requirements which apply to each individual container created\nas part of the service.\n" + }, + "RestartPolicy": { + "type": "object", + "properties": { + "Condition": { + "type": "string", + "description": "Condition for restart.", + "enum": [ + "none", + "on-failure", + "any" + ] + }, + "Delay": { + "type": "integer", + "description": "Delay between restart attempts.", + "format": "int64" + }, + "MaxAttempts": { + "type": "integer", + "description": "Maximum attempts to restart a given container before giving up\n(default value is 0, which is ignored).\n", + "format": "int64", + "default": 0 + }, + "Window": { + "type": "integer", + "description": "Windows is the time window used to evaluate the restart policy\n(default value is 0, which is unbounded).\n", + "format": "int64", + "default": 0 + } + }, + "description": "Specification for the restart policy which applies to containers\ncreated as part of this service.\n" + }, + "Placement": { + "type": "object", + "properties": { + "Constraints": { + "type": "array", + "description": "An array of constraint expressions to limit the set of nodes where\na task can be scheduled. Constraint expressions can either use a\n_match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find\nnodes that satisfy every expression (AND match). Constraints can\nmatch node or Docker Engine labels as follows:\n\nnode attribute | matches | example\n---------------------|--------------------------------|-----------------------------------------------\n`node.id` | Node ID | `node.id==2ivku8v2gvtg4`\n`node.hostname` | Node hostname | `node.hostname!=node-2`\n`node.role` | Node role (`manager`/`worker`) | `node.role==manager`\n`node.platform.os` | Node operating system | `node.platform.os==windows`\n`node.platform.arch` | Node architecture | `node.platform.arch==x86_64`\n`node.labels` | User-defined node labels | `node.labels.security==high`\n`engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-14.04`\n\n`engine.labels` apply to Docker Engine labels like operating system,\ndrivers, etc. Swarm administrators add `node.labels` for operational\npurposes by using the [`node update endpoint`](#operation/NodeUpdate).\n", + "example": [ + "node.hostname!=node3.corp.example.com", + "node.role!=manager", + "node.labels.type==production", + "node.platform.os==linux", + "node.platform.arch==x86_64" + ], + "items": { + "type": "string" + } + }, + "Preferences": { + "type": "array", + "description": "Preferences provide a way to make the scheduler aware of factors\nsuch as topology. They are provided in order from highest to\nlowest precedence.\n", + "example": [ + { + "Spread": { + "SpreadDescriptor": "node.labels.datacenter" + } + }, + { + "Spread": { + "SpreadDescriptor": "node.labels.rack" + } + } + ], + "items": { + "type": "object", + "properties": { + "Spread": { + "type": "object", + "properties": { + "SpreadDescriptor": { + "type": "string", + "description": "label descriptor, such as `engine.labels.az`.\n" + } + } + } + } + } + }, + "MaxReplicas": { + "type": "integer", + "description": "Maximum number of replicas for per node (default value is 0, which\nis unlimited)\n", + "format": "int64", + "default": 0 + }, + "Platforms": { + "type": "array", + "description": "Platforms stores all the platforms that the service's image can\nrun on. This field is used in the platform filter for scheduling.\nIf empty, then the platform filter is off, meaning there are no\nscheduling restrictions.\n", + "items": { + "$ref": "#/components/schemas/Platform" + } + } + } + }, + "ForceUpdate": { + "type": "integer", + "description": "A counter that triggers an update even if no relevant parameters have\nbeen changed.\n" + }, + "Runtime": { + "type": "string", + "description": "Runtime is the type of runtime specified for the task executor.\n" + }, + "Networks": { + "type": "array", + "description": "Specifies which networks the service should attach to.", + "items": { + "$ref": "#/components/schemas/NetworkAttachmentConfig" + } + }, + "LogDriver": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "Specifies the log driver to use for tasks created from this spec. If\nnot present, the default one for the swarm will be used, finally\nfalling back to the engine default if not specified.\n" + } + }, + "description": "User modifiable task configuration." + }, + "TaskState": { + "type": "string", + "enum": [ + "new", + "allocated", + "pending", + "assigned", + "accepted", + "preparing", + "ready", + "starting", + "running", + "complete", + "shutdown", + "failed", + "rejected", + "remove", + "orphaned" + ] + }, + "ContainerStatus": { + "type": "object", + "properties": { + "ContainerID": { + "type": "string" + }, + "PID": { + "type": "integer" + }, + "ExitCode": { + "type": "integer" + } + }, + "description": "represents the status of a container." + }, + "PortStatus": { + "type": "object", + "properties": { + "Ports": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EndpointPortConfig" + } + } + }, + "description": "represents the port status of a task's host ports whose service has published host ports" + }, + "TaskStatus": { + "type": "object", + "properties": { + "Timestamp": { + "type": "string", + "format": "dateTime" + }, + "State": { + "$ref": "#/components/schemas/TaskState" + }, + "Message": { + "type": "string" + }, + "Err": { + "type": "string" + }, + "ContainerStatus": { + "$ref": "#/components/schemas/ContainerStatus" + }, + "PortStatus": { + "$ref": "#/components/schemas/PortStatus" + } + }, + "description": "represents the status of a task." + }, + "Task": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the task." + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Name": { + "type": "string", + "description": "Name of the task." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Spec": { + "$ref": "#/components/schemas/TaskSpec" + }, + "ServiceID": { + "type": "string", + "description": "The ID of the service this task is part of." + }, + "Slot": { + "type": "integer" + }, + "NodeID": { + "type": "string", + "description": "The ID of the node that this task is on." + }, + "AssignedGenericResources": { + "$ref": "#/components/schemas/GenericResources" + }, + "Status": { + "$ref": "#/components/schemas/TaskStatus" + }, + "DesiredState": { + "$ref": "#/components/schemas/TaskState" + }, + "JobIteration": { + "$ref": "#/components/schemas/ObjectVersion" + } + }, + "example": { + "ID": "0kzzo1i0y4jz6027t0k7aezc7", + "Version": { + "Index": 71 + }, + "CreatedAt": "2016-06-07T21:07:31.171892745Z", + "UpdatedAt": "2016-06-07T21:07:31.376370513Z", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:31.290032978Z", + "State": "running", + "Message": "started", + "ContainerStatus": { + "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035", + "PID": 677 + } + }, + "DesiredState": "running", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.10/16" + ] + } + ], + "AssignedGenericResources": [ + { + "DiscreteResourceSpec": { + "Kind": "SSD", + "Value": 3 + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID1" + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID2" + } + } + ] + } + }, + "ServiceSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the service." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "TaskTemplate": { + "$ref": "#/components/schemas/TaskSpec" + }, + "Mode": { + "type": "object", + "properties": { + "Replicated": { + "type": "object", + "properties": { + "Replicas": { + "type": "integer", + "format": "int64" + } + } + }, + "Global": { + "type": "object", + "properties": {} + }, + "ReplicatedJob": { + "type": "object", + "properties": { + "MaxConcurrent": { + "type": "integer", + "description": "The maximum number of replicas to run simultaneously.\n", + "format": "int64", + "default": 1 + }, + "TotalCompletions": { + "type": "integer", + "description": "The total number of replicas desired to reach the Completed\nstate. If unset, will default to the value of `MaxConcurrent`\n", + "format": "int64" + } + }, + "description": "The mode used for services with a finite number of tasks that run\nto a completed state.\n" + }, + "GlobalJob": { + "type": "object", + "properties": {}, + "description": "The mode used for services which run a task to the completed state\non each valid node.\n" + } + }, + "description": "Scheduling mode for the service." + }, + "UpdateConfig": { + "type": "object", + "properties": { + "Parallelism": { + "type": "integer", + "description": "Maximum number of tasks to be updated in one iteration (0 means\nunlimited parallelism).\n", + "format": "int64" + }, + "Delay": { + "type": "integer", + "description": "Amount of time between updates, in nanoseconds.", + "format": "int64" + }, + "FailureAction": { + "type": "string", + "description": "Action to take if an updated task fails to run, or stops running\nduring the update.\n", + "enum": [ + "continue", + "pause", + "rollback" + ] + }, + "Monitor": { + "type": "integer", + "description": "Amount of time to monitor each updated task for failures, in\nnanoseconds.\n", + "format": "int64" + }, + "MaxFailureRatio": { + "type": "number", + "description": "The fraction of tasks that may fail during an update before the\nfailure action is invoked, specified as a floating point number\nbetween 0 and 1.\n" + }, + "Order": { + "type": "string", + "description": "The order of operations when rolling out an updated task. Either\nthe old task is shut down before the new task is started, or the\nnew task is started before the old task is shut down.\n", + "enum": [ + "stop-first", + "start-first" + ] + } + }, + "description": "Specification for the update strategy of the service." + }, + "RollbackConfig": { + "type": "object", + "properties": { + "Parallelism": { + "type": "integer", + "description": "Maximum number of tasks to be rolled back in one iteration (0 means\nunlimited parallelism).\n", + "format": "int64" + }, + "Delay": { + "type": "integer", + "description": "Amount of time between rollback iterations, in nanoseconds.\n", + "format": "int64" + }, + "FailureAction": { + "type": "string", + "description": "Action to take if an rolled back task fails to run, or stops\nrunning during the rollback.\n", + "enum": [ + "continue", + "pause" + ] + }, + "Monitor": { + "type": "integer", + "description": "Amount of time to monitor each rolled back task for failures, in\nnanoseconds.\n", + "format": "int64" + }, + "MaxFailureRatio": { + "type": "number", + "description": "The fraction of tasks that may fail during a rollback before the\nfailure action is invoked, specified as a floating point number\nbetween 0 and 1.\n" + }, + "Order": { + "type": "string", + "description": "The order of operations when rolling back a task. Either the old\ntask is shut down before the new task is started, or the new task\nis started before the old task is shut down.\n", + "enum": [ + "stop-first", + "start-first" + ] + } + }, + "description": "Specification for the rollback strategy of the service." + }, + "Networks": { + "type": "array", + "description": "Specifies which networks the service should attach to.\n\nDeprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead.\n", + "items": { + "$ref": "#/components/schemas/NetworkAttachmentConfig" + } + }, + "EndpointSpec": { + "$ref": "#/components/schemas/EndpointSpec" + } + }, + "description": "User modifiable configuration for a service." + }, + "EndpointPortConfig": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Protocol": { + "type": "string", + "enum": [ + "tcp", + "udp", + "sctp" + ] + }, + "TargetPort": { + "type": "integer", + "description": "The port inside the container." + }, + "PublishedPort": { + "type": "integer", + "description": "The port on the swarm hosts." + }, + "PublishMode": { + "type": "string", + "description": "The mode in which port is published.\n\n


\n\n- \"ingress\" makes the target port accessible on every node,\n regardless of whether there is a task for the service running on\n that node or not.\n- \"host\" bypasses the routing mesh and publish the port directly on\n the swarm node where that service is running.\n", + "example": "ingress", + "default": "ingress", + "enum": [ + "ingress", + "host" + ] + } + } + }, + "EndpointSpec": { + "type": "object", + "properties": { + "Mode": { + "type": "string", + "description": "The mode of resolution to use for internal load balancing between tasks.\n", + "default": "vip", + "enum": [ + "vip", + "dnsrr" + ] + }, + "Ports": { + "type": "array", + "description": "List of exposed ports that this service is accessible on from the\noutside. Ports can only be provided if `vip` resolution mode is used.\n", + "items": { + "$ref": "#/components/schemas/EndpointPortConfig" + } + } + }, + "description": "Properties that can be configured to access and load balance a service." + }, + "Service": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Spec": { + "$ref": "#/components/schemas/ServiceSpec" + }, + "Endpoint": { + "type": "object", + "properties": { + "Spec": { + "$ref": "#/components/schemas/EndpointSpec" + }, + "Ports": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EndpointPortConfig" + } + }, + "VirtualIPs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "NetworkID": { + "type": "string" + }, + "Addr": { + "type": "string" + } + } + } + } + } + }, + "UpdateStatus": { + "type": "object", + "properties": { + "State": { + "type": "string", + "enum": [ + "updating", + "paused", + "completed" + ] + }, + "StartedAt": { + "type": "string", + "format": "dateTime" + }, + "CompletedAt": { + "type": "string", + "format": "dateTime" + }, + "Message": { + "type": "string" + } + }, + "description": "The status of a service update." + }, + "ServiceStatus": { + "type": "object", + "properties": { + "RunningTasks": { + "type": "integer", + "description": "The number of tasks for the service currently in the Running state.\n", + "format": "uint64", + "example": 7 + }, + "DesiredTasks": { + "type": "integer", + "description": "The number of tasks for the service desired to be running.\nFor replicated services, this is the replica count from the\nservice spec. For global services, this is computed by taking\ncount of all tasks for the service with a Desired State other\nthan Shutdown.\n", + "format": "uint64", + "example": 10 + }, + "CompletedTasks": { + "type": "integer", + "description": "The number of tasks for a job that are in the Completed state.\nThis field must be cross-referenced with the service type, as the\nvalue of 0 may mean the service is not in a job mode, or it may\nmean the job-mode service has no tasks yet Completed.\n", + "format": "uint64" + } + }, + "description": "The status of the service's tasks. Provided only when requested as\npart of a ServiceList operation.\n" + }, + "JobStatus": { + "type": "object", + "properties": { + "JobIteration": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "LastExecution": { + "type": "string", + "description": "The last time, as observed by the server, that this job was\nstarted.\n", + "format": "dateTime" + } + }, + "description": "The status of the service when it is in one of ReplicatedJob or\nGlobalJob modes. Absent on Replicated and Global mode services. The\nJobIteration is an ObjectVersion, but unlike the Service's version,\ndoes not need to be sent with an update request.\n" + } + }, + "example": { + "ID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Version": { + "Index": 19 + }, + "CreatedAt": "2016-06-07T21:05:51.880065305Z", + "UpdatedAt": "2016-06-07T21:07:29.962229872Z", + "Spec": { + "Name": "hopeful_cori", + "TaskTemplate": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {}, + "ForceUpdate": 0 + }, + "Mode": { + "Replicated": { + "Replicas": 1 + } + }, + "UpdateConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Mode": "vip", + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ] + } + }, + "Endpoint": { + "Spec": { + "Mode": "vip", + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ] + }, + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ], + "VirtualIPs": [ + { + "NetworkID": "4qvuz4ko70xaltuqbt8956gd1", + "Addr": "10.255.0.2/16" + }, + { + "NetworkID": "4qvuz4ko70xaltuqbt8956gd1", + "Addr": "10.255.0.3/16" + } + ] + } + } + }, + "ImageDeleteResponseItem": { + "type": "object", + "properties": { + "Untagged": { + "type": "string", + "description": "The image ID of an image that was untagged" + }, + "Deleted": { + "type": "string", + "description": "The image ID of an image that was deleted" + } + }, + "x-go-name": "DeleteResponse" + }, + "ServiceCreateResponse": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the created service.", + "nullable": false, + "example": "ak7w3gjqoa3kuz8xcpnyy0pvl" + }, + "Warnings": { + "type": "array", + "description": "Optional warning message.\n\nFIXME(thaJeztah): this should have \"omitempty\" in the generated type.\n", + "nullable": true, + "example": [ + "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + ], + "items": { + "type": "string" + } + } + }, + "description": "contains the information returned to a client on the\ncreation of a new service.\n" + }, + "ServiceUpdateResponse": { + "type": "object", + "properties": { + "Warnings": { + "type": "array", + "description": "Optional warning messages", + "items": { + "type": "string" + } + } + }, + "example": { + "Warnings": [ + "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + ] + } + }, + "ContainerSummary": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of this container", + "x-go-name": "ID" + }, + "Names": { + "type": "array", + "description": "The names that this container has been given", + "items": { + "type": "string" + } + }, + "Image": { + "type": "string", + "description": "The name of the image used when creating this container" + }, + "ImageID": { + "type": "string", + "description": "The ID of the image that this container was created from" + }, + "Command": { + "type": "string", + "description": "Command to run when starting the container" + }, + "Created": { + "type": "integer", + "description": "When the container was created", + "format": "int64" + }, + "Ports": { + "type": "array", + "description": "The ports exposed by this container", + "items": { + "$ref": "#/components/schemas/Port" + } + }, + "SizeRw": { + "type": "integer", + "description": "The size of files that have been created or changed by this container", + "format": "int64" + }, + "SizeRootFs": { + "type": "integer", + "description": "The total size of all the files in this container", + "format": "int64" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "State": { + "type": "string", + "description": "The state of this container (e.g. `Exited`)" + }, + "Status": { + "type": "string", + "description": "Additional human-readable status of this container (e.g. `Exit 0`)" + }, + "HostConfig": { + "type": "object", + "properties": { + "NetworkMode": { + "type": "string" + } + } + }, + "NetworkSettings": { + "type": "object", + "properties": { + "Networks": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + } + } + }, + "description": "A summary of the container's network settings" + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MountPoint" + } + } + } + }, + "Driver": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the driver.", + "nullable": false, + "example": "some-driver" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Key/value map of driver-specific options.", + "nullable": false, + "example": { + "OptionA": "value for driver-specific option A", + "OptionB": "value for driver-specific option B" + } + } + }, + "description": "Driver represents a driver (network, logging, secrets)." + }, + "SecretSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "User-defined name of the secret." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "Data": { + "type": "string", + "description": "Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5))\ndata to store as secret.\n\nThis field is only used to _create_ a secret, and is not returned by\nother endpoints.\n", + "example": "" + }, + "Driver": { + "$ref": "#/components/schemas/Driver" + }, + "Templating": { + "$ref": "#/components/schemas/Driver" + } + } + }, + "Secret": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "example": "blt1owaxmitz71s9v5zh81zun" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime", + "example": "2017-07-20T13:55:28.678958722Z" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime", + "example": "2017-07-20T13:55:28.678958722Z" + }, + "Spec": { + "$ref": "#/components/schemas/SecretSpec" + } + } + }, + "ConfigSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "User-defined name of the config." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Data": { + "type": "string", + "description": "Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5))\nconfig data.\n" + }, + "Templating": { + "$ref": "#/components/schemas/Driver" + } + } + }, + "Config": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Spec": { + "$ref": "#/components/schemas/ConfigSpec" + } + } + }, + "ContainerState": { + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "String representation of the container state. Can be one of \"created\",\n\"running\", \"paused\", \"restarting\", \"removing\", \"exited\", or \"dead\".\n", + "example": "running", + "enum": [ + "created", + "running", + "paused", + "restarting", + "removing", + "exited", + "dead" + ] + }, + "Running": { + "type": "boolean", + "description": "Whether this container is running.\n\nNote that a running container can be _paused_. The `Running` and `Paused`\nbooleans are not mutually exclusive:\n\nWhen pausing a container (on Linux), the freezer cgroup is used to suspend\nall processes in the container. Freezing the process requires the process to\nbe running. As a result, paused containers are both `Running` _and_ `Paused`.\n\nUse the `Status` field instead to determine if a container's state is \"running\".\n", + "example": true + }, + "Paused": { + "type": "boolean", + "description": "Whether this container is paused.", + "example": false + }, + "Restarting": { + "type": "boolean", + "description": "Whether this container is restarting.", + "example": false + }, + "OOMKilled": { + "type": "boolean", + "description": "Whether a process within this container has been killed because it ran\nout of memory since the container was last started.\n", + "example": false + }, + "Dead": { + "type": "boolean", + "example": false + }, + "Pid": { + "type": "integer", + "description": "The process ID of this container", + "example": 1234 + }, + "ExitCode": { + "type": "integer", + "description": "The last exit code of this container", + "example": 0 + }, + "Error": { + "type": "string" + }, + "StartedAt": { + "type": "string", + "description": "The time when this container was last started.", + "example": "2020-01-06T09:06:59.461876391Z" + }, + "FinishedAt": { + "type": "string", + "description": "The time when this container last exited.", + "example": "2020-01-06T09:07:59.461876391Z" + }, + "Health": { + "$ref": "#/components/schemas/Health" + } + }, + "description": "ContainerState stores container's running state. It's part of ContainerJSONBase\nand will be returned by the \"inspect\" command.\n", + "nullable": true, + "x-nullable": true + }, + "ContainerCreateResponse": { + "title": "ContainerCreateResponse", + "required": [ + "Id", + "Warnings" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the created container", + "nullable": false, + "example": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + }, + "Warnings": { + "type": "array", + "description": "Warnings encountered when creating the container", + "nullable": false, + "example": [], + "items": { + "type": "string" + } + } + }, + "description": "OK response to ContainerCreate operation", + "x-go-name": "CreateResponse" + }, + "ContainerWaitResponse": { + "title": "ContainerWaitResponse", + "required": [ + "StatusCode" + ], + "type": "object", + "properties": { + "StatusCode": { + "type": "integer", + "description": "Exit code of the container", + "format": "int64", + "nullable": false + }, + "Error": { + "$ref": "#/components/schemas/ContainerWaitExitError" + } + }, + "description": "OK response to ContainerWait operation", + "x-go-name": "WaitResponse" + }, + "ContainerWaitExitError": { + "type": "object", + "properties": { + "Message": { + "type": "string", + "description": "Details of an error" + } + }, + "description": "container waiting error, if any", + "x-go-name": "WaitExitError" + }, + "SystemVersion": { + "type": "object", + "properties": { + "Platform": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string" + } + } + }, + "Components": { + "type": "array", + "description": "Information about system components\n", + "items": { + "required": [ + "Name", + "Version" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the component\n", + "example": "Engine" + }, + "Version": { + "type": "string", + "description": "Version of the component\n", + "nullable": false, + "example": "19.03.12" + }, + "Details": { + "type": "object", + "properties": {}, + "description": "Key/value pairs of strings with additional information about the\ncomponent. These values are intended for informational purposes\nonly, and their content is not defined, and not part of the API\nspecification.\n\nThese messages can be printed by the client as information to the user.\n", + "nullable": true + } + }, + "x-go-name": "ComponentVersion" + } + }, + "Version": { + "type": "string", + "description": "The version of the daemon", + "example": "19.03.12" + }, + "ApiVersion": { + "type": "string", + "description": "The default (and highest) API version that is supported by the daemon\n", + "example": "1.40" + }, + "MinAPIVersion": { + "type": "string", + "description": "The minimum API version that is supported by the daemon\n", + "example": "1.12" + }, + "GitCommit": { + "type": "string", + "description": "The Git commit of the source code that was used to build the daemon\n", + "example": "48a66213fe" + }, + "GoVersion": { + "type": "string", + "description": "The version Go used to compile the daemon, and the version of the Go\nruntime in use.\n", + "example": "go1.13.14" + }, + "Os": { + "type": "string", + "description": "The operating system that the daemon is running on (\"linux\" or \"windows\")\n", + "example": "linux" + }, + "Arch": { + "type": "string", + "description": "The architecture that the daemon is running on\n", + "example": "amd64" + }, + "KernelVersion": { + "type": "string", + "description": "The kernel version (`uname -r`) that the daemon is running on.\n\nThis field is omitted when empty.\n", + "example": "4.19.76-linuxkit" + }, + "Experimental": { + "type": "boolean", + "description": "Indicates if the daemon is started with experimental features enabled.\n\nThis field is omitted when empty / false.\n", + "example": true + }, + "BuildTime": { + "type": "string", + "description": "The date and time that the daemon was compiled.\n", + "example": "2020-06-22T15:49:27.000000000+00:00" + } + }, + "description": "Response of Engine API: GET \"/version\"\n" + }, + "SystemInfo": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Unique identifier of the daemon.\n\n


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


\n\n> **Note**: The information returned in this field, including the\n> formatting of values and labels, should not be considered stable,\n> and may change without notice.\n", + "example": [ + [ + "Backing Filesystem", + "extfs" + ], + [ + "Supports d_type", + "true" + ], + [ + "Native Overlay Diff", + "true" + ] + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "DockerRootDir": { + "type": "string", + "description": "Root directory of persistent Docker state.\n\nDefaults to `/var/lib/docker` on Linux, and `C:\\ProgramData\\docker`\non Windows.\n", + "example": "/var/lib/docker" + }, + "Plugins": { + "$ref": "#/components/schemas/PluginsInfo" + }, + "MemoryLimit": { + "type": "boolean", + "description": "Indicates if the host has memory limit support enabled.", + "example": true + }, + "SwapLimit": { + "type": "boolean", + "description": "Indicates if the host has memory swap limit support enabled.", + "example": true + }, + "KernelMemoryTCP": { + "type": "boolean", + "description": "Indicates if the host has kernel memory TCP limit support enabled. This\nfield is omitted if not supported.\n\nKernel memory TCP limits are not supported when using cgroups v2, which\ndoes not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup.\n", + "example": true + }, + "CpuCfsPeriod": { + "type": "boolean", + "description": "Indicates if CPU CFS(Completely Fair Scheduler) period is supported by\nthe host.\n", + "example": true + }, + "CpuCfsQuota": { + "type": "boolean", + "description": "Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by\nthe host.\n", + "example": true + }, + "CPUShares": { + "type": "boolean", + "description": "Indicates if CPU Shares limiting is supported by the host.\n", + "example": true + }, + "CPUSet": { + "type": "boolean", + "description": "Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host.\n\nSee [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt)\n", + "example": true + }, + "PidsLimit": { + "type": "boolean", + "description": "Indicates if the host kernel has PID limit support enabled.", + "example": true + }, + "OomKillDisable": { + "type": "boolean", + "description": "Indicates if OOM killer disable is supported on the host." + }, + "IPv4Forwarding": { + "type": "boolean", + "description": "Indicates IPv4 forwarding is enabled.", + "example": true + }, + "BridgeNfIptables": { + "type": "boolean", + "description": "Indicates if `bridge-nf-call-iptables` is available on the host.", + "example": true + }, + "BridgeNfIp6tables": { + "type": "boolean", + "description": "Indicates if `bridge-nf-call-ip6tables` is available on the host.", + "example": true + }, + "Debug": { + "type": "boolean", + "description": "Indicates if the daemon is running in debug-mode / with debug-level\nlogging enabled.\n", + "example": true + }, + "NFd": { + "type": "integer", + "description": "The total number of file Descriptors in use by the daemon process.\n\nThis information is only returned if debug-mode is enabled.\n", + "example": 64 + }, + "NGoroutines": { + "type": "integer", + "description": "The number of goroutines that currently exist.\n\nThis information is only returned if debug-mode is enabled.\n", + "example": 174 + }, + "SystemTime": { + "type": "string", + "description": "Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt)\nformat with nano-seconds.\n", + "example": "2017-08-08T20:28:29.06202363Z" + }, + "LoggingDriver": { + "type": "string", + "description": "The logging driver to use as a default for new containers.\n" + }, + "CgroupDriver": { + "type": "string", + "description": "The driver to use for managing cgroups.\n", + "example": "cgroupfs", + "default": "cgroupfs", + "enum": [ + "cgroupfs", + "systemd", + "none" + ] + }, + "CgroupVersion": { + "type": "string", + "description": "The version of the cgroup.\n", + "example": "1", + "default": "1", + "enum": [ + "1", + "2" + ] + }, + "NEventsListener": { + "type": "integer", + "description": "Number of event listeners subscribed.", + "example": 30 + }, + "KernelVersion": { + "type": "string", + "description": "Kernel version of the host.\n\nOn Linux, this information obtained from `uname`. On Windows this\ninformation is queried from the HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\\nregistry value, for example _\"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)\"_.\n", + "example": "4.9.38-moby" + }, + "OperatingSystem": { + "type": "string", + "description": "Name of the host's operating system, for example: \"Ubuntu 16.04.2 LTS\"\nor \"Windows Server 2016 Datacenter\"\n", + "example": "Alpine Linux v3.5" + }, + "OSVersion": { + "type": "string", + "description": "Version of the host's operating system\n\n


\n\n> **Note**: The information returned in this field, including its\n> very existence, and the formatting of values, should not be considered\n> stable, and may change without notice.\n", + "example": "16.04" + }, + "OSType": { + "type": "string", + "description": "Generic type of the operating system of the host, as returned by the\nGo runtime (`GOOS`).\n\nCurrently returned values are \"linux\" and \"windows\". A full list of\npossible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment).\n", + "example": "linux" + }, + "Architecture": { + "type": "string", + "description": "Hardware architecture of the host, as returned by the Go runtime\n(`GOARCH`).\n\nA full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment).\n", + "example": "x86_64" + }, + "NCPU": { + "type": "integer", + "description": "The number of logical CPUs usable by the daemon.\n\nThe number of available CPUs is checked by querying the operating\nsystem when the daemon starts. Changes to operating system CPU\nallocation after the daemon is started are not reflected.\n", + "example": 4 + }, + "MemTotal": { + "type": "integer", + "description": "Total amount of physical memory available on the host, in bytes.\n", + "format": "int64", + "example": 2095882240 + }, + "IndexServerAddress": { + "type": "string", + "description": "Address / URL of the index server that is used for image search,\nand as a default for user authentication for Docker Hub and Docker Cloud.\n", + "example": "https://index.docker.io/v1/", + "default": "https://index.docker.io/v1/" + }, + "RegistryConfig": { + "$ref": "#/components/schemas/RegistryServiceConfig" + }, + "GenericResources": { + "$ref": "#/components/schemas/GenericResources" + }, + "HttpProxy": { + "type": "string", + "description": "HTTP-proxy configured for the daemon. This value is obtained from the\n[`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable.\nCredentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL\nare masked in the API response.\n\nContainers do not automatically inherit this configuration.\n", + "example": "http://xxxxx:xxxxx@proxy.corp.example.com:8080" + }, + "HttpsProxy": { + "type": "string", + "description": "HTTPS-proxy configured for the daemon. This value is obtained from the\n[`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable.\nCredentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL\nare masked in the API response.\n\nContainers do not automatically inherit this configuration.\n", + "example": "https://xxxxx:xxxxx@proxy.corp.example.com:4443" + }, + "NoProxy": { + "type": "string", + "description": "Comma-separated list of domain extensions for which no proxy should be\nused. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html)\nenvironment variable.\n\nContainers do not automatically inherit this configuration.\n", + "example": "*.local, 169.254/16" + }, + "Name": { + "type": "string", + "description": "Hostname of the host.", + "example": "node5.corp.example.com" + }, + "Labels": { + "type": "array", + "description": "User-defined labels (key/value metadata) as set on the daemon.\n\n


\n\n> **Note**: When part of a Swarm, nodes can both have _daemon_ labels,\n> set through the daemon configuration, and _node_ labels, set from a\n> manager node in the Swarm. Node labels are not included in this\n> field. Node labels can be retrieved using the `/nodes/(id)` endpoint\n> on a manager node in the Swarm.\n", + "example": [ + "storage=ssd", + "production" + ], + "items": { + "type": "string" + } + }, + "ExperimentalBuild": { + "type": "boolean", + "description": "Indicates if experimental features are enabled on the daemon.\n", + "example": true + }, + "ServerVersion": { + "type": "string", + "description": "Version string of the daemon.\n", + "example": "24.0.2" + }, + "Runtimes": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Runtime" + }, + "description": "List of [OCI compliant](https://github.com/opencontainers/runtime-spec)\nruntimes configured on the daemon. Keys hold the \"name\" used to\nreference the runtime.\n\nThe Docker daemon relies on an OCI compliant runtime (invoked via the\n`containerd` daemon) as its interface to the Linux kernel namespaces,\ncgroups, and SELinux.\n\nThe default runtime is `runc`, and automatically configured. Additional\nruntimes can be configured by the user and will be listed here.\n", + "example": { + "runc": { + "path": "runc" + }, + "runc-master": { + "path": "/go/bin/runc" + }, + "custom": { + "path": "/usr/local/bin/my-oci-runtime", + "runtimeArgs": [ + "--debug", + "--systemd-cgroup=false" + ] + } + } + }, + "DefaultRuntime": { + "type": "string", + "description": "Name of the default OCI runtime that is used when starting containers.\n\nThe default can be overridden per-container at create time.\n", + "example": "runc", + "default": "runc" + }, + "Swarm": { + "$ref": "#/components/schemas/SwarmInfo" + }, + "LiveRestoreEnabled": { + "type": "boolean", + "description": "Indicates if live restore is enabled.\n\nIf enabled, containers are kept running when the daemon is shutdown\nor upon daemon start if running containers are detected.\n", + "example": false, + "default": false + }, + "Isolation": { + "type": "string", + "description": "Represents the isolation technology to use as a default for containers.\nThe supported values are platform-specific.\n\nIf no isolation value is specified on daemon start, on Windows client,\nthe default is `hyperv`, and on Windows server, the default is `process`.\n\nThis option is currently not used on other platforms.\n", + "default": "default", + "enum": [ + "default", + "hyperv", + "process" + ] + }, + "InitBinary": { + "type": "string", + "description": "Name and, optional, path of the `docker-init` binary.\n\nIf the path is omitted, the daemon searches the host's `$PATH` for the\nbinary and uses the first result.\n", + "example": "docker-init" + }, + "ContainerdCommit": { + "$ref": "#/components/schemas/Commit" + }, + "RuncCommit": { + "$ref": "#/components/schemas/Commit" + }, + "InitCommit": { + "$ref": "#/components/schemas/Commit" + }, + "SecurityOptions": { + "type": "array", + "description": "List of security features that are enabled on the daemon, such as\napparmor, seccomp, SELinux, user-namespaces (userns), rootless and\nno-new-privileges.\n\nAdditional configuration options for each security feature may\nbe present, and are included as a comma-separated list of key/value\npairs.\n", + "example": [ + "name=apparmor", + "name=seccomp,profile=default", + "name=selinux", + "name=userns", + "name=rootless" + ], + "items": { + "type": "string" + } + }, + "ProductLicense": { + "type": "string", + "description": "Reports a summary of the product license on the daemon.\n\nIf a commercial license has been applied to the daemon, information\nsuch as number of nodes, and expiration are included.\n", + "example": "Community Engine" + }, + "DefaultAddressPools": { + "type": "array", + "description": "List of custom default address pools for local networks, which can be\nspecified in the daemon.json file or dockerd option.\n\nExample: a Base \"10.10.0.0/16\" with Size 24 will define the set of 256\n10.10.[0-255].0/24 address pools.\n", + "items": { + "type": "object", + "properties": { + "Base": { + "type": "string", + "description": "The network address in CIDR format", + "example": "10.10.0.0/16" + }, + "Size": { + "type": "integer", + "description": "The network pool size", + "example": 24 + } + } + } + }, + "Warnings": { + "type": "array", + "description": "List of warnings / informational messages about missing features, or\nissues related to the daemon configuration.\n\nThese messages can be printed by the client as information to the user.\n", + "example": [ + "WARNING: No memory limit support", + "WARNING: bridge-nf-call-iptables is disabled", + "WARNING: bridge-nf-call-ip6tables is disabled" + ], + "items": { + "type": "string" + } + }, + "CDISpecDirs": { + "type": "array", + "description": "List of directories where (Container Device Interface) CDI\nspecifications are located.\n\nThese specifications define vendor-specific modifications to an OCI\nruntime specification for a container being created.\n\nAn empty list indicates that CDI device injection is disabled.\n\nNote that since using CDI device injection requires the daemon to have\nexperimental enabled. For non-experimental daemons an empty list will\nalways be returned.\n", + "example": [ + "/etc/cdi", + "/var/run/cdi" + ], + "items": { + "type": "string" + } + } + } + }, + "PluginsInfo": { + "type": "object", + "properties": { + "Volume": { + "type": "array", + "description": "Names of available volume-drivers, and network-driver plugins.", + "example": [ + "local" + ], + "items": { + "type": "string" + } + }, + "Network": { + "type": "array", + "description": "Names of available network-drivers, and network-driver plugins.", + "example": [ + "bridge", + "host", + "ipvlan", + "macvlan", + "null", + "overlay" + ], + "items": { + "type": "string" + } + }, + "Authorization": { + "type": "array", + "description": "Names of available authorization plugins.", + "example": [ + "img-authz-plugin", + "hbm" + ], + "items": { + "type": "string" + } + }, + "Log": { + "type": "array", + "description": "Names of available logging-drivers, and logging-driver plugins.", + "example": [ + "awslogs", + "fluentd", + "gcplogs", + "gelf", + "journald", + "json-file", + "splunk", + "syslog" + ], + "items": { + "type": "string" + } + } + }, + "description": "Available plugins per type.\n\n


\n\n> **Note**: Only unmanaged (V1) plugins are included in this list.\n> V1 plugins are \"lazily\" loaded, and are not returned in this list\n> if there is no resource using the plugin.\n" + }, + "RegistryServiceConfig": { + "type": "object", + "properties": { + "AllowNondistributableArtifactsCIDRs": { + "type": "array", + "description": "List of IP ranges to which nondistributable artifacts can be pushed,\nusing the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632).\n\nSome images (for example, Windows base images) contain artifacts\nwhose distribution is restricted by license. When these images are\npushed to a registry, restricted artifacts are not included.\n\nThis configuration override this behavior, and enables the daemon to\npush nondistributable artifacts to all registries whose resolved IP\naddress is within the subnet described by the CIDR syntax.\n\nThis option is useful when pushing images containing\nnondistributable artifacts to a registry on an air-gapped network so\nhosts on that network can pull the images without connecting to\nanother server.\n\n> **Warning**: Nondistributable artifacts typically have restrictions\n> on how and where they can be distributed and shared. Only use this\n> feature to push artifacts to private registries and ensure that you\n> are in compliance with any terms that cover redistributing\n> nondistributable artifacts.\n", + "example": [ + "::1/128", + "127.0.0.0/8" + ], + "items": { + "type": "string" + } + }, + "AllowNondistributableArtifactsHostnames": { + "type": "array", + "description": "List of registry hostnames to which nondistributable artifacts can be\npushed, using the format `[:]` or `[:]`.\n\nSome images (for example, Windows base images) contain artifacts\nwhose distribution is restricted by license. When these images are\npushed to a registry, restricted artifacts are not included.\n\nThis configuration override this behavior for the specified\nregistries.\n\nThis option is useful when pushing images containing\nnondistributable artifacts to a registry on an air-gapped network so\nhosts on that network can pull the images without connecting to\nanother server.\n\n> **Warning**: Nondistributable artifacts typically have restrictions\n> on how and where they can be distributed and shared. Only use this\n> feature to push artifacts to private registries and ensure that you\n> are in compliance with any terms that cover redistributing\n> nondistributable artifacts.\n", + "example": [ + "registry.internal.corp.example.com:3000", + "[2001:db8:a0b:12f0::1]:443" + ], + "items": { + "type": "string" + } + }, + "InsecureRegistryCIDRs": { + "type": "array", + "description": "List of IP ranges of insecure registries, using the CIDR syntax\n([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries\naccept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates\nfrom unknown CAs) communication.\n\nBy default, local registries (`127.0.0.0/8`) are configured as\ninsecure. All other registries are secure. Communicating with an\ninsecure registry is not possible if the daemon assumes that registry\nis secure.\n\nThis configuration override this behavior, insecure communication with\nregistries whose resolved IP address is within the subnet described by\nthe CIDR syntax.\n\nRegistries can also be marked insecure by hostname. Those registries\nare listed under `IndexConfigs` and have their `Secure` field set to\n`false`.\n\n> **Warning**: Using this option can be useful when running a local\n> registry, but introduces security vulnerabilities. This option\n> should therefore ONLY be used for testing purposes. For increased\n> security, users should add their CA to their system's list of trusted\n> CAs instead of enabling this option.\n", + "example": [ + "::1/128", + "127.0.0.0/8" + ], + "items": { + "type": "string" + } + }, + "IndexConfigs": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/IndexInfo" + }, + "example": { + "127.0.0.1:5000": { + "Name": "127.0.0.1:5000", + "Mirrors": [], + "Secure": false, + "Official": false + }, + "[2001:db8:a0b:12f0::1]:80": { + "Name": "[2001:db8:a0b:12f0::1]:80", + "Mirrors": [], + "Secure": false, + "Official": false + }, + "docker.io": { + "Name": "docker.io", + "Mirrors": [ + "https://hub-mirror.corp.example.com:5000/" + ], + "Secure": true, + "Official": true + }, + "registry.internal.corp.example.com:3000": { + "Name": "registry.internal.corp.example.com:3000", + "Mirrors": [], + "Secure": false, + "Official": false + } + } + }, + "Mirrors": { + "type": "array", + "description": "List of registry URLs that act as a mirror for the official\n(`docker.io`) registry.\n", + "example": [ + "https://hub-mirror.corp.example.com:5000/", + "https://[2001:db8:a0b:12f0::1]/" + ], + "items": { + "type": "string" + } + } + }, + "description": "RegistryServiceConfig stores daemon registry services configuration.\n", + "nullable": true, + "x-nullable": true + }, + "IndexInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the registry, such as \"docker.io\".\n", + "example": "docker.io" + }, + "Mirrors": { + "type": "array", + "description": "List of mirrors, expressed as URIs.\n", + "example": [ + "https://hub-mirror.corp.example.com:5000/", + "https://registry-2.docker.io/", + "https://registry-3.docker.io/" + ], + "items": { + "type": "string" + } + }, + "Secure": { + "type": "boolean", + "description": "Indicates if the registry is part of the list of insecure\nregistries.\n\nIf `false`, the registry is insecure. Insecure registries accept\nun-encrypted (HTTP) and/or untrusted (HTTPS with certificates from\nunknown CAs) communication.\n\n> **Warning**: Insecure registries can be useful when running a local\n> registry. However, because its use creates security vulnerabilities\n> it should ONLY be enabled for testing purposes. For increased\n> security, users should add their CA to their system's list of\n> trusted CAs instead of enabling this option.\n", + "example": true + }, + "Official": { + "type": "boolean", + "description": "Indicates whether this is an official registry (i.e., Docker Hub / docker.io)\n", + "example": true + } + }, + "description": "IndexInfo contains information about a registry.", + "nullable": true, + "x-nullable": true + }, + "Runtime": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "Name and, optional, path, of the OCI executable binary.\n\nIf the path is omitted, the daemon searches the host's `$PATH` for the\nbinary and uses the first result.\n", + "example": "/usr/local/bin/my-oci-runtime" + }, + "runtimeArgs": { + "type": "array", + "description": "List of command-line arguments to pass to the runtime when invoked.\n", + "nullable": true, + "example": [ + "--debug", + "--systemd-cgroup=false" + ], + "items": { + "type": "string" + } + }, + "status": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Information specific to the runtime.\n\nWhile this API specification does not define data provided by runtimes,\nthe following well-known properties may be provided by runtimes:\n\n`org.opencontainers.runtime-spec.features`: features structure as defined\nin the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md),\nin a JSON string representation.\n\n


\n\n> **Note**: The information returned in this field, including the\n> formatting of values and labels, should not be considered stable,\n> and may change without notice.\n", + "nullable": true, + "example": { + "org.opencontainers.runtime-spec.features": "{\"ociVersionMin\":\"1.0.0\",\"ociVersionMax\":\"1.1.0\",\"...\":\"...\"}" + } + } + }, + "description": "Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec)\nruntime.\n\nThe runtime is invoked by the daemon via the `containerd` daemon. OCI\nruntimes act as an interface to the Linux kernel namespaces, cgroups,\nand SELinux.\n" + }, + "Commit": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Actual commit ID of external tool.", + "example": "cfb82a876ecc11b5ca0977d1733adbe58599088a" + }, + "Expected": { + "type": "string", + "description": "Commit ID of external tool expected by dockerd as set at build time.\n", + "example": "2d41c047c83e09a6d61d464906feb2a2f3c52aa4" + } + }, + "description": "Commit holds the Git-commit (SHA1) that a binary was built from, as\nreported in the version-string of external tools, such as `containerd`,\nor `runC`.\n" + }, + "SwarmInfo": { + "type": "object", + "properties": { + "NodeID": { + "type": "string", + "description": "Unique identifier of for this node in the swarm.", + "example": "k67qz4598weg5unwwffg6z1m1", + "default": "" + }, + "NodeAddr": { + "type": "string", + "description": "IP address at which this node can be reached by other nodes in the\nswarm.\n", + "example": "10.0.0.46", + "default": "" + }, + "LocalNodeState": { + "$ref": "#/components/schemas/LocalNodeState" + }, + "ControlAvailable": { + "type": "boolean", + "example": true, + "default": false + }, + "Error": { + "type": "string", + "default": "" + }, + "RemoteManagers": { + "type": "array", + "description": "List of ID's and addresses of other managers in the swarm.\n", + "nullable": true, + "example": [ + { + "NodeID": "71izy0goik036k48jg985xnds", + "Addr": "10.0.0.158:2377" + }, + { + "NodeID": "79y6h1o4gv8n120drcprv5nmc", + "Addr": "10.0.0.159:2377" + }, + { + "NodeID": "k67qz4598weg5unwwffg6z1m1", + "Addr": "10.0.0.46:2377" + } + ], + "items": { + "$ref": "#/components/schemas/PeerNode" + } + }, + "Nodes": { + "type": "integer", + "description": "Total number of nodes in the swarm.", + "nullable": true, + "example": 4 + }, + "Managers": { + "type": "integer", + "description": "Total number of managers in the swarm.", + "nullable": true, + "example": 3 + }, + "Cluster": { + "$ref": "#/components/schemas/ClusterInfo" + } + }, + "description": "Represents generic information about swarm.\n" + }, + "LocalNodeState": { + "type": "string", + "description": "Current local status of this node.", + "example": "active", + "default": "", + "enum": [ + "", + "inactive", + "pending", + "active", + "error", + "locked" + ] + }, + "PeerNode": { + "type": "object", + "properties": { + "NodeID": { + "type": "string", + "description": "Unique identifier of for this node in the swarm." + }, + "Addr": { + "type": "string", + "description": "IP address and ports at which this node can be reached.\n" + } + }, + "description": "Represents a peer-node in the swarm" + }, + "NetworkAttachmentConfig": { + "type": "object", + "properties": { + "Target": { + "type": "string", + "description": "The target network for attachment. Must be a network name or ID.\n" + }, + "Aliases": { + "type": "array", + "description": "Discoverable alternate names for the service on this network.\n", + "items": { + "type": "string" + } + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver attachment options for the network target.\n" + } + }, + "description": "Specifies how a service should be attached to a particular network.\n" + }, + "EventActor": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the object emitting the event", + "example": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + }, + "Attributes": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Various key/value attributes of the object, depending on its type.\n", + "example": { + "com.example.some-label": "some-label-value", + "image": "alpine:latest", + "name": "my-container" + } + } + }, + "description": "Actor describes something that generates events, like a container, network,\nor a volume.\n" + }, + "EventMessage": { + "title": "SystemEventsResponse", + "type": "object", + "properties": { + "Type": { + "type": "string", + "description": "The type of object emitting the event", + "example": "container", + "enum": [ + "builder", + "config", + "container", + "daemon", + "image", + "network", + "node", + "plugin", + "secret", + "service", + "volume" + ] + }, + "Action": { + "type": "string", + "description": "The type of event", + "example": "create" + }, + "Actor": { + "$ref": "#/components/schemas/EventActor" + }, + "scope": { + "type": "string", + "description": "Scope of the event. Engine events are `local` scope. Cluster (Swarm)\nevents are `swarm` scope.\n", + "enum": [ + "local", + "swarm" + ] + }, + "time": { + "type": "integer", + "description": "Timestamp of event", + "format": "int64", + "example": 1629574695 + }, + "timeNano": { + "type": "integer", + "description": "Timestamp of event, with nanosecond accuracy", + "format": "int64", + "example": 1629574695515050000 + } + }, + "description": "EventMessage represents the information an event contains.\n" + }, + "OCIDescriptor": { + "type": "object", + "properties": { + "mediaType": { + "type": "string", + "description": "The media type of the object this schema refers to.\n", + "example": "application/vnd.docker.distribution.manifest.v2+json" + }, + "digest": { + "type": "string", + "description": "The digest of the targeted content.\n", + "example": "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96" + }, + "size": { + "type": "integer", + "description": "The size in bytes of the blob.\n", + "format": "int64", + "example": 3987495 + } + }, + "description": "A descriptor struct containing digest, media type, and size, as defined in\nthe [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md).\n", + "x-go-name": "Descriptor" + }, + "OCIPlatform": { + "type": "object", + "properties": { + "architecture": { + "type": "string", + "description": "The CPU architecture, for example `amd64` or `ppc64`.\n", + "example": "arm" + }, + "os": { + "type": "string", + "description": "The operating system, for example `linux` or `windows`.\n", + "example": "windows" + }, + "os.version": { + "type": "string", + "description": "Optional field specifying the operating system version, for example on\nWindows `10.0.19041.1165`.\n", + "example": "10.0.19041.1165" + }, + "os.features": { + "type": "array", + "description": "Optional field specifying an array of strings, each listing a required\nOS feature (for example on Windows `win32k`).\n", + "example": [ + "win32k" + ], + "items": { + "type": "string" + } + }, + "variant": { + "type": "string", + "description": "Optional field specifying a variant of the CPU, for example `v7` to\nspecify ARMv7 when architecture is `arm`.\n", + "example": "v7" + } + }, + "description": "Describes the platform which the image in the manifest runs on, as defined\nin the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md).\n", + "x-go-name": "Platform" + }, + "DistributionInspect": { + "title": "DistributionInspectResponse", + "required": [ + "Descriptor", + "Platforms" + ], + "type": "object", + "properties": { + "Descriptor": { + "$ref": "#/components/schemas/OCIDescriptor" + }, + "Platforms": { + "type": "array", + "description": "An array containing all platforms supported by the image.\n", + "items": { + "$ref": "#/components/schemas/OCIPlatform" + } + } + }, + "description": "Describes the result obtained from contacting the registry to retrieve\nimage metadata.\n", + "x-go-name": "DistributionInspect" + }, + "ClusterVolume": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The Swarm ID of this volume. Because cluster volumes are Swarm\nobjects, they have an ID, unlike non-cluster volumes. This ID can\nbe used to refer to the Volume instead of the name.\n" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Spec": { + "$ref": "#/components/schemas/ClusterVolumeSpec" + }, + "Info": { + "type": "object", + "properties": { + "CapacityBytes": { + "type": "integer", + "description": "The capacity of the volume in bytes. A value of 0 indicates that\nthe capacity is unknown.\n", + "format": "int64" + }, + "VolumeContext": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of strings to strings returned from the storage plugin when\nthe volume is created.\n" + }, + "VolumeID": { + "type": "string", + "description": "The ID of the volume as returned by the CSI storage plugin. This\nis distinct from the volume's ID as provided by Docker. This ID\nis never used by the user when communicating with Docker to refer\nto this volume. If the ID is blank, then the Volume has not been\nsuccessfully created in the plugin yet.\n" + }, + "AccessibleTopology": { + "type": "array", + "description": "The topology this volume is actually accessible from.\n", + "items": { + "$ref": "#/components/schemas/Topology" + } + } + }, + "description": "Information about the global status of the volume.\n" + }, + "PublishStatus": { + "type": "array", + "description": "The status of the volume as it pertains to its publishing and use on\nspecific nodes\n", + "items": { + "type": "object", + "properties": { + "NodeID": { + "type": "string", + "description": "The ID of the Swarm node the volume is published on.\n" + }, + "State": { + "type": "string", + "description": "The published state of the volume.\n* `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed.\n* `published` The volume is published successfully to the node.\n* `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so.\n* `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller.\n", + "enum": [ + "pending-publish", + "published", + "pending-node-unpublish", + "pending-controller-unpublish" + ] + }, + "PublishContext": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of strings to strings returned by the CSI controller\nplugin when a volume is published.\n" + } + } + } + } + }, + "description": "Options and information specific to, and only present on, Swarm CSI\ncluster volumes.\n" + }, + "ClusterVolumeSpec": { + "type": "object", + "properties": { + "Group": { + "type": "string", + "description": "Group defines the volume group of this volume. Volumes belonging to\nthe same group can be referred to by group name when creating\nServices. Referring to a volume by group instructs Swarm to treat\nvolumes in that group interchangeably for the purpose of scheduling.\nVolumes with an empty string for a group technically all belong to\nthe same, emptystring group.\n" + }, + "AccessMode": { + "type": "object", + "properties": { + "Scope": { + "type": "string", + "description": "The set of nodes this volume can be used on at one time.\n- `single` The volume may only be scheduled to one node at a time.\n- `multi` the volume may be scheduled to any supported number of nodes at a time.\n", + "nullable": false, + "default": "single", + "enum": [ + "single", + "multi" + ] + }, + "Sharing": { + "type": "string", + "description": "The number and way that different tasks can use this volume\nat one time.\n- `none` The volume may only be used by one task at a time.\n- `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly\n- `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write.\n- `all` The volume may have any number of readers and writers.\n", + "nullable": false, + "default": "none", + "enum": [ + "none", + "readonly", + "onewriter", + "all" + ] + }, + "MountVolume": { + "type": "object", + "properties": {}, + "description": "Options for using this volume as a Mount-type volume.\n\n Either MountVolume or BlockVolume, but not both, must be\n present.\n properties:\n FsType:\n type: \"string\"\n description: |\n Specifies the filesystem type for the mount volume.\n Optional.\n MountFlags:\n type: \"array\"\n description: |\n Flags to pass when mounting the volume. Optional.\n items:\n type: \"string\"\nBlockVolume:\n type: \"object\"\n description: |\n Options for using this volume as a Block-type volume.\n Intentionally empty.\n" + }, + "Secrets": { + "type": "array", + "description": "Swarm Secrets that are passed to the CSI storage plugin when\noperating on this volume.\n", + "items": { + "type": "object", + "properties": { + "Key": { + "type": "string", + "description": "Key is the name of the key of the key-value pair passed to\nthe plugin.\n" + }, + "Secret": { + "type": "string", + "description": "Secret is the swarm Secret object from which to read data.\nThis can be a Secret name or ID. The Secret data is\nretrieved by swarm and used as the value of the key-value\npair passed to the plugin.\n" + } + }, + "description": "One cluster volume secret entry. Defines a key-value pair that\nis passed to the plugin.\n" + } + }, + "AccessibilityRequirements": { + "type": "object", + "properties": { + "Requisite": { + "type": "array", + "description": "A list of required topologies, at least one of which the\nvolume must be accessible from.\n", + "items": { + "$ref": "#/components/schemas/Topology" + } + }, + "Preferred": { + "type": "array", + "description": "A list of topologies that the volume should attempt to be\nprovisioned in.\n", + "items": { + "$ref": "#/components/schemas/Topology" + } + } + }, + "description": "Requirements for the accessible topology of the volume. These\nfields are optional. For an in-depth description of what these\nfields mean, see the CSI specification.\n" + }, + "CapacityRange": { + "type": "object", + "properties": { + "RequiredBytes": { + "type": "integer", + "description": "The volume must be at least this big. The value of 0\nindicates an unspecified minimum\n", + "format": "int64" + }, + "LimitBytes": { + "type": "integer", + "description": "The volume must not be bigger than this. The value of 0\nindicates an unspecified maximum.\n", + "format": "int64" + } + }, + "description": "The desired capacity that the volume should be created with. If\nempty, the plugin will decide the capacity.\n" + }, + "Availability": { + "type": "string", + "description": "The availability of the volume for use in tasks.\n- `active` The volume is fully available for scheduling on the cluster\n- `pause` No new workloads should use the volume, but existing workloads are not stopped.\n- `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started.\n", + "nullable": false, + "default": "active", + "enum": [ + "active", + "pause", + "drain" + ] + } + }, + "description": "Defines how the volume is used by tasks.\n" + } + }, + "description": "Cluster-specific options used to create the volume.\n" + }, + "Topology": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of topological domains to topological segments. For in depth\ndetails, see documentation for the Topology object in the CSI\nspecification.\n" + } + } + } +} diff --git a/spec/v1.45.json b/spec/v1.45.json new file mode 100644 index 00000000..b896416a --- /dev/null +++ b/spec/v1.45.json @@ -0,0 +1,16806 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Docker Engine API", + "description": "The Engine API is an HTTP API served by Docker Engine. It is the API the\nDocker client uses to communicate with the Engine, so everything the Docker\nclient can do can be done with the API.\n\nMost of the client's commands map directly to API endpoints (e.g. `docker ps`\nis `GET /containers/json`). The notable exception is running containers,\nwhich consists of several API calls.\n\n# Errors\n\nThe API uses standard HTTP status codes to indicate the success or failure\nof the API call. The body of the response will be JSON in the following\nformat:\n\n```\n{\n \"message\": \"page not found\"\n}\n```\n\n# Versioning\n\nThe API is usually changed in each release, so API calls are versioned to\nensure that clients don't break. To lock to a specific version of the API,\nyou prefix the URL with its version, for example, call `/v1.30/info` to use\nthe v1.30 version of the `/info` endpoint. If the API version specified in\nthe URL is not supported by the daemon, a HTTP `400 Bad Request` error message\nis returned.\n\nIf you omit the version-prefix, the current version of the API (v1.45) is used.\nFor example, calling `/info` is the same as calling `/v1.45/info`. Using the\nAPI without a version-prefix is deprecated and will be removed in a future release.\n\nEngine releases in the near future should support this version of the API,\nso your client will continue to work even if it is talking to a newer Engine.\n\nThe API uses an open schema model, which means server may add extra properties\nto responses. Likewise, the server will ignore any extra query parameters and\nrequest body properties. When you write clients, you need to ignore additional\nproperties in responses to ensure they do not break when talking to newer\ndaemons.\n\n\n# Authentication\n\nAuthentication for registries is handled client side. The client has to send\nauthentication details to various endpoints that need to communicate with\nregistries, such as `POST /images/(name)/push`. These are sent as\n`X-Registry-Auth` header as a [base64url encoded](https://tools.ietf.org/html/rfc4648#section-5)\n(JSON) string with the following structure:\n\n```\n{\n \"username\": \"string\",\n \"password\": \"string\",\n \"email\": \"string\",\n \"serveraddress\": \"string\"\n}\n```\n\nThe `serveraddress` is a domain/IP without a protocol. Throughout this\nstructure, double quotes are required.\n\nIf you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth),\nyou can just pass this instead of credentials:\n\n```\n{\n \"identitytoken\": \"9cbaf023786cd7...\"\n}\n```\n", + "version": "1.45", + "x-logo": { + "url": "https://docs.docker.com/assets/images/logo-docker-main.png" + } + }, + "servers": [ + { + "url": "/v1.45" + } + ], + "tags": [ + { + "name": "Container", + "description": "Create and manage containers.\n", + "x-displayName": "Containers" + }, + { + "name": "Image", + "x-displayName": "Images" + }, + { + "name": "Network", + "description": "Networks are user-defined networks that containers can be attached to.\nSee the [networking documentation](https://docs.docker.com/network/)\nfor more information.\n", + "x-displayName": "Networks" + }, + { + "name": "Volume", + "description": "Create and manage persistent storage that can be attached to containers.\n", + "x-displayName": "Volumes" + }, + { + "name": "Exec", + "description": "Run new commands inside running containers. Refer to the\n[command-line reference](https://docs.docker.com/engine/reference/commandline/exec/)\nfor more information.\n\nTo exec a command in a container, you first need to create an exec instance,\nthen start it. These two API endpoints are wrapped up in a single command-line\ncommand, `docker exec`.\n", + "x-displayName": "Exec" + }, + { + "name": "Swarm", + "description": "Engines can be clustered together in a swarm. Refer to the\n[swarm mode documentation](https://docs.docker.com/engine/swarm/)\nfor more information.\n", + "x-displayName": "Swarm" + }, + { + "name": "Node", + "description": "Nodes are instances of the Engine participating in a swarm. Swarm mode\nmust be enabled for these endpoints to work.\n", + "x-displayName": "Nodes" + }, + { + "name": "Service", + "description": "Services are the definitions of tasks to run on a swarm. Swarm mode must\nbe enabled for these endpoints to work.\n", + "x-displayName": "Services" + }, + { + "name": "Task", + "description": "A task is a container running on a swarm. It is the atomic scheduling unit\nof swarm. Swarm mode must be enabled for these endpoints to work.\n", + "x-displayName": "Tasks" + }, + { + "name": "Secret", + "description": "Secrets are sensitive data that can be used by services. Swarm mode must\nbe enabled for these endpoints to work.\n", + "x-displayName": "Secrets" + }, + { + "name": "Config", + "description": "Configs are application configurations that can be used by services. Swarm\nmode must be enabled for these endpoints to work.\n", + "x-displayName": "Configs" + }, + { + "name": "Plugin", + "x-displayName": "Plugins" + }, + { + "name": "System", + "x-displayName": "System" + } + ], + "paths": { + "/containers/json": { + "get": { + "tags": [ + "Container" + ], + "summary": "List containers", + "description": "Returns a list of containers. For details on the format, see the\n[inspect endpoint](#operation/ContainerInspect).\n\nNote that it uses a different, smaller representation of a container\nthan inspecting a single container. For example, the list of linked\ncontainers is not propagated .\n", + "operationId": "ContainerList", + "parameters": [ + { + "name": "all", + "in": "query", + "description": "Return all containers. By default, only running containers are shown.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "limit", + "in": "query", + "description": "Return this number of most recently created containers, including\nnon-running ones.\n", + "schema": { + "type": "integer" + } + }, + { + "name": "size", + "in": "query", + "description": "Return the size of container as fields `SizeRw` and `SizeRootFs`.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "filters", + "in": "query", + "description": "Filters to process on the container list, encoded as JSON (a\n`map[string][]string`). For example, `{\"status\": [\"paused\"]}` will\nonly return paused containers.\n\nAvailable filters:\n\n- `ancestor`=(`[:]`, ``, or ``)\n- `before`=(`` or ``)\n- `expose`=(`[/]`|`/[]`)\n- `exited=` containers with exit code of ``\n- `health`=(`starting`|`healthy`|`unhealthy`|`none`)\n- `id=` a container's ID\n- `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only)\n- `is-task=`(`true`|`false`)\n- `label=key` or `label=\"key=value\"` of a container label\n- `name=` a container's name\n- `network`=(`` or ``)\n- `publish`=(`[/]`|`/[]`)\n- `since`=(`` or ``)\n- `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`)\n- `volume`=(`` or ``)\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerSummary" + } + }, + "example": [ + { + "Id": "8dfafdbc3a40", + "Names": [ + "/boring_feynman" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 1", + "Created": 1367854155, + "State": "Exited", + "Status": "Exit 0", + "Ports": [ + { + "PrivatePort": 2222, + "PublicPort": 3333, + "Type": "tcp" + } + ], + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "2cdc4edb1ded3631c81f57966563e5c8525b81121bb3706a9a9a3ae102711f3f", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:02" + } + } + }, + "Mounts": [ + { + "Name": "fac362...80535", + "Source": "/data", + "Destination": "/data", + "Driver": "local", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" + } + ] + }, + { + "Id": "9cd87474be90", + "Names": [ + "/coolName" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 222222", + "Created": 1367854155, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "88eaed7b37b38c2a3f0c4bc796494fdf51b270c2d22656412a2ca5d559a64d7a", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.8", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:08" + } + } + }, + "Mounts": [] + }, + { + "Id": "3176a2479c92", + "Names": [ + "/sleepy_dog" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "8b27c041c30326d59cd6e6f510d4f8d1d570a228466f956edf7815508f78e30d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.6", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:06" + } + } + }, + "Mounts": [] + }, + { + "Id": "4cb07b47f9fb", + "Names": [ + "/running_cat" + ], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "State": "Exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "d91c7b2f0644403d7ef3095985ea0e2370325cd2332ff3a3225c4247328e66e9", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.5", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:05" + } + } + }, + "Mounts": [] + } + ] + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/create": { + "post": { + "tags": [ + "Container" + ], + "summary": "Create a container", + "operationId": "ContainerCreate", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Assign the specified name to the container. Must match\n`/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`.\n", + "schema": { + "pattern": "^/?[a-zA-Z0-9][a-zA-Z0-9_.-]+$", + "type": "string" + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform in the format `os[/arch[/variant]]` used for image lookup.\n\nWhen specified, the daemon checks if the requested image is present\nin the local image cache with the given OS and Architecture, and\notherwise returns a `404` status.\n\nIf the option is not set, the host's native OS and Architecture are\nused to look up the image in the image cache. However, if no platform\nis passed and the given image does exist in the local image cache,\nbut its OS or architecture does not match, the container is created\nwith the available image, and a warning is added to the `Warnings`\nfield in the response, for example;\n\n WARNING: The requested image's platform (linux/arm64/v8) does not\n match the detected host platform (linux/amd64) and no\n specific platform was requested\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Container to create", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ContainerConfig" + }, + { + "type": "object", + "properties": { + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "NetworkingConfig": { + "$ref": "#/components/schemas/NetworkingConfig" + } + } + } + ] + } + }, + "application/octet-stream": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ContainerConfig" + }, + { + "type": "object", + "properties": { + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "NetworkingConfig": { + "$ref": "#/components/schemas/NetworkingConfig" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Container created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContainerCreateResponse" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such image: c2ada9df5af8" + } + } + } + }, + "409": { + "description": "conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/containers/{id}/json": { + "get": { + "tags": [ + "Container" + ], + "summary": "Inspect a container", + "description": "Return low-level information about a container.", + "operationId": "ContainerInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "size", + "in": "query", + "description": "Return the size of container as fields `SizeRw` and `SizeRootFs`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "ContainerInspectResponse", + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the container" + }, + "Created": { + "type": "string", + "description": "The time the container was created" + }, + "Path": { + "type": "string", + "description": "The path to the command being run" + }, + "Args": { + "type": "array", + "description": "The arguments to the command being run", + "items": { + "type": "string" + } + }, + "State": { + "$ref": "#/components/schemas/ContainerState" + }, + "Image": { + "type": "string", + "description": "The container's image ID" + }, + "ResolvConfPath": { + "type": "string" + }, + "HostnamePath": { + "type": "string" + }, + "HostsPath": { + "type": "string" + }, + "LogPath": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "RestartCount": { + "type": "integer" + }, + "Driver": { + "type": "string" + }, + "Platform": { + "type": "string" + }, + "MountLabel": { + "type": "string" + }, + "ProcessLabel": { + "type": "string" + }, + "AppArmorProfile": { + "type": "string" + }, + "ExecIDs": { + "type": "array", + "description": "IDs of exec instances that are running in the container.", + "nullable": true, + "items": { + "type": "string" + } + }, + "HostConfig": { + "$ref": "#/components/schemas/HostConfig" + }, + "GraphDriver": { + "$ref": "#/components/schemas/GraphDriverData" + }, + "SizeRw": { + "type": "integer", + "description": "The size of files that have been created or changed by this\ncontainer.\n", + "format": "int64" + }, + "SizeRootFs": { + "type": "integer", + "description": "The total size of all the files in this container.", + "format": "int64" + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MountPoint" + } + }, + "Config": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "NetworkSettings": { + "$ref": "#/components/schemas/NetworkSettings" + } + } + }, + "example": { + "AppArmorProfile": "", + "Args": [ + "-c", + "exit 9" + ], + "Config": { + "AttachStderr": true, + "AttachStdin": false, + "AttachStdout": true, + "Cmd": [ + "/bin/sh", + "-c", + "exit 9" + ], + "Domainname": "", + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Healthcheck": { + "Test": [ + "CMD-SHELL", + "exit 0" + ] + }, + "Hostname": "ba033ac44011", + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "MacAddress": "", + "NetworkDisabled": false, + "OpenStdin": false, + "StdinOnce": false, + "Tty": false, + "User": "", + "Volumes": { + "/volumes/data": {} + }, + "WorkingDir": "", + "StopSignal": "SIGTERM", + "StopTimeout": 10 + }, + "Created": "2015-01-06T15:47:31.485331387Z", + "Driver": "overlay2", + "ExecIDs": [ + "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca", + "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4" + ], + "HostConfig": { + "MaximumIOps": 0, + "MaximumIOBps": 0, + "BlkioWeight": 0, + "BlkioWeightDevice": [ + {} + ], + "BlkioDeviceReadBps": [ + {} + ], + "BlkioDeviceWriteBps": [ + {} + ], + "BlkioDeviceReadIOps": [ + {} + ], + "BlkioDeviceWriteIOps": [ + {} + ], + "ContainerIDFile": "", + "CpusetCpus": "", + "CpusetMems": "", + "CpuPercent": 80, + "CpuShares": 0, + "CpuPeriod": 100000, + "CpuRealtimePeriod": 1000000, + "CpuRealtimeRuntime": 10000, + "Devices": [], + "DeviceRequests": [ + { + "Driver": "nvidia", + "Count": -1, + "DeviceIDs\"": [ + "0", + "1", + "GPU-fef8089b-4820-abfc-e83e-94318197576e" + ], + "Capabilities": [ + [ + "gpu", + "nvidia", + "compute" + ] + ], + "Options": { + "property1": "string", + "property2": "string" + } + } + ], + "IpcMode": "", + "Memory": 0, + "MemorySwap": 0, + "MemoryReservation": 0, + "OomKillDisable": false, + "OomScoreAdj": 500, + "NetworkMode": "bridge", + "PidMode": "", + "PortBindings": {}, + "Privileged": false, + "ReadonlyRootfs": false, + "PublishAllPorts": false, + "RestartPolicy": { + "MaximumRetryCount": 2, + "Name": "on-failure" + }, + "LogConfig": { + "Type": "json-file" + }, + "Sysctls": { + "net.ipv4.ip_forward": "1" + }, + "Ulimits": [ + {} + ], + "VolumeDriver": "", + "ShmSize": 67108864 + }, + "HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname", + "HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts", + "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log", + "Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39", + "Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2", + "MountLabel": "", + "Name": "/boring_euclid", + "NetworkSettings": { + "Bridge": "", + "SandboxID": "", + "HairpinMode": false, + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + "SandboxKey": "", + "EndpointID": "", + "Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "IPAddress": "", + "IPPrefixLen": 0, + "IPv6Gateway": "", + "MacAddress": "", + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Path": "/bin/sh", + "ProcessLabel": "", + "ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf", + "RestartCount": 1, + "State": { + "Error": "", + "ExitCode": 9, + "FinishedAt": "2015-01-06T15:47:32.080254511Z", + "Health": { + "Status": "healthy", + "FailingStreak": 0, + "Log": [ + { + "Start": "2019-12-22T10:59:05.6385933Z", + "End": "2019-12-22T10:59:05.8078452Z", + "ExitCode": 0, + "Output": "" + } + ] + }, + "OOMKilled": false, + "Dead": false, + "Paused": false, + "Pid": 0, + "Restarting": false, + "Running": true, + "StartedAt": "2015-01-06T15:47:32.072697474Z", + "Status": "running" + }, + "Mounts": [ + { + "Name": "fac362...80535", + "Source": "/data", + "Destination": "/data", + "Driver": "local", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" + } + ] + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/top": { + "get": { + "tags": [ + "Container" + ], + "summary": "List processes running inside a container", + "description": "On Unix systems, this is done by running the `ps` command. This endpoint\nis not supported on Windows.\n", + "operationId": "ContainerTop", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "ps_args", + "in": "query", + "description": "The arguments to pass to `ps`. For example, `aux`", + "schema": { + "type": "string", + "default": "-ef" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "ContainerTopResponse", + "type": "object", + "properties": { + "Titles": { + "type": "array", + "description": "The ps column titles", + "items": { + "type": "string" + } + }, + "Processes": { + "type": "array", + "description": "Each process running in the container, where each is process\nis an array of values corresponding to the titles.\n", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "description": "OK response to ContainerTop operation" + }, + "example": { + "Titles": [ + "UID", + "PID", + "PPID", + "C", + "STIME", + "TTY", + "TIME", + "CMD" + ], + "Processes": [ + [ + "root", + "13642", + "882", + "0", + "17:03", + "pts/0", + "00:00:00", + "/bin/bash" + ], + [ + "root", + "13735", + "13642", + "0", + "17:06", + "pts/0", + "00:00:00", + "sleep 10" + ] + ] + } + }, + "text/plain": { + "schema": { + "title": "ContainerTopResponse", + "type": "object", + "properties": { + "Titles": { + "type": "array", + "description": "The ps column titles", + "items": { + "type": "string" + } + }, + "Processes": { + "type": "array", + "description": "Each process running in the container, where each is process\nis an array of values corresponding to the titles.\n", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "description": "OK response to ContainerTop operation" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/logs": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get container logs", + "description": "Get `stdout` and `stderr` logs from a container.\n\nNote: This endpoint works only for containers with the `json-file` or\n`journald` logging driver.\n", + "operationId": "ContainerLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "follow", + "in": "query", + "description": "Keep connection after returning logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "until", + "in": "query", + "description": "Only return logs before this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs.\nSpecify as an integer or `all` to output all log lines.\n", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "200": { + "description": "logs returned as a stream in response body.\nFor the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach).\nNote that unlike the attach endpoint, the logs endpoint does not\nupgrade the connection and does not set Content-Type.\n", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/changes": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get changes on a container’s filesystem", + "description": "Returns which files in a container's filesystem have been added, deleted,\nor modified. The `Kind` of modification can be one of:\n\n- `0`: Modified (\"C\")\n- `1`: Added (\"A\")\n- `2`: Deleted (\"D\")\n", + "operationId": "ContainerChanges", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The list of changes", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FilesystemChange" + } + }, + "example": [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/export": { + "get": { + "tags": [ + "Container" + ], + "summary": "Export a container", + "description": "Export the contents of a container as a tarball.", + "operationId": "ContainerExport", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/stats": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get container stats based on resource usage", + "description": "This endpoint returns a live stream of a container’s resource usage\nstatistics.\n\nThe `precpu_stats` is the CPU statistic of the *previous* read, and is\nused to calculate the CPU usage percentage. It is not an exact copy\nof the `cpu_stats` field.\n\nIf either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is\nnil then for compatibility with older daemons the length of the\ncorresponding `cpu_usage.percpu_usage` array should be used.\n\nOn a cgroup v2 host, the following fields are not set\n* `blkio_stats`: all fields other than `io_service_bytes_recursive`\n* `cpu_stats`: `cpu_usage.percpu_usage`\n* `memory_stats`: `max_usage` and `failcnt`\nAlso, `memory_stats.stats` fields are incompatible with cgroup v1.\n\nTo calculate the values shown by the `stats` command of the docker cli tool\nthe following formulas can be used:\n* used_memory = `memory_stats.usage - memory_stats.stats.cache`\n* available_memory = `memory_stats.limit`\n* Memory usage % = `(used_memory / available_memory) * 100.0`\n* cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage`\n* system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage`\n* number_cpus = `lenght(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus`\n* CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0`\n", + "operationId": "ContainerStats", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "stream", + "in": "query", + "description": "Stream the output. If false, the stats will be output once and then\nit will disconnect.\n", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "one-shot", + "in": "query", + "description": "Only get a single stat instead of waiting for 2 cycles. Must be used\nwith `stream=false`.\n", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "read": "2015-01-08T22:57:31.547920715Z", + "pids_stats": { + "current": 3 + }, + "networks": { + "eth0": { + "rx_bytes": 5338, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 36, + "tx_bytes": 648, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 8 + }, + "eth5": { + "rx_bytes": 4641, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 26, + "tx_bytes": 690, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 9 + } + }, + "memory_stats": { + "stats": { + "total_pgmajfault": 0, + "cache": 0, + "mapped_file": 0, + "total_inactive_file": 0, + "pgpgout": 414, + "rss": 6537216, + "total_mapped_file": 0, + "writeback": 0, + "unevictable": 0, + "pgpgin": 477, + "total_unevictable": 0, + "pgmajfault": 0, + "total_rss": 6537216, + "total_rss_huge": 6291456, + "total_writeback": 0, + "total_inactive_anon": 0, + "rss_huge": 6291456, + "hierarchical_memory_limit": 67108864, + "total_pgfault": 964, + "total_active_file": 0, + "active_anon": 6537216, + "total_active_anon": 6537216, + "total_pgpgout": 414, + "total_cache": 0, + "inactive_anon": 0, + "active_file": 0, + "pgfault": 964, + "inactive_file": 0, + "total_pgpgin": 477 + }, + "max_usage": 6651904, + "usage": 6537216, + "failcnt": 0, + "limit": 67108864 + }, + "blkio_stats": {}, + "cpu_stats": { + "cpu_usage": { + "percpu_usage": [ + 8646879, + 24472255, + 36438778, + 30657443 + ], + "usage_in_usermode": 50000000, + "total_usage": 100215355, + "usage_in_kernelmode": 30000000 + }, + "system_cpu_usage": 739306590000000, + "online_cpus": 4, + "throttling_data": { + "periods": 0, + "throttled_periods": 0, + "throttled_time": 0 + } + }, + "precpu_stats": { + "cpu_usage": { + "percpu_usage": [ + 8646879, + 24350896, + 36438778, + 30657443 + ], + "usage_in_usermode": 50000000, + "total_usage": 100093996, + "usage_in_kernelmode": 30000000 + }, + "system_cpu_usage": 9492140000000, + "online_cpus": 4, + "throttling_data": { + "periods": 0, + "throttled_periods": 0, + "throttled_time": 0 + } + } + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/resize": { + "post": { + "tags": [ + "Container" + ], + "summary": "Resize a container TTY", + "description": "Resize the TTY for a container.", + "operationId": "ContainerResize", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "h", + "in": "query", + "description": "Height of the TTY session in characters", + "schema": { + "type": "integer" + } + }, + { + "name": "w", + "in": "query", + "description": "Width of the TTY session in characters", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "cannot resize container", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/start": { + "post": { + "tags": [ + "Container" + ], + "summary": "Start a container", + "operationId": "ContainerStart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container. Format is a\nsingle character `[a-Z]` or `ctrl-` where `` is one\nof: `a-z`, `@`, `^`, `[`, `,` or `_`.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "304": { + "description": "container already started", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/stop": { + "post": { + "tags": [ + "Container" + ], + "summary": "Stop a container", + "operationId": "ContainerStop", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "signal", + "in": "query", + "description": "Signal to send to the container as an integer or string (e.g. `SIGINT`).\n", + "schema": { + "type": "string" + } + }, + { + "name": "t", + "in": "query", + "description": "Number of seconds to wait before killing the container", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "304": { + "description": "container already stopped", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/restart": { + "post": { + "tags": [ + "Container" + ], + "summary": "Restart a container", + "operationId": "ContainerRestart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "signal", + "in": "query", + "description": "Signal to send to the container as an integer or string (e.g. `SIGINT`).\n", + "schema": { + "type": "string" + } + }, + { + "name": "t", + "in": "query", + "description": "Number of seconds to wait before killing the container", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/kill": { + "post": { + "tags": [ + "Container" + ], + "summary": "Kill a container", + "description": "Send a POSIX signal to a container, defaulting to killing to the\ncontainer.\n", + "operationId": "ContainerKill", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "signal", + "in": "query", + "description": "Signal to send to the container as an integer or string (e.g. `SIGINT`).\n", + "schema": { + "type": "string", + "default": "SIGKILL" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "container is not running", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "Container d37cde0fe4ad63c3a7252023b2f9800282894247d145cb5933ddf6e52cc03a28 is not running" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/update": { + "post": { + "tags": [ + "Container" + ], + "summary": "Update a container", + "description": "Change various configuration options of a container without having to\nrecreate it.\n", + "operationId": "ContainerUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Resources" + }, + { + "type": "object", + "properties": { + "RestartPolicy": { + "$ref": "#/components/schemas/RestartPolicy" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The container has been updated.", + "content": { + "application/json": { + "schema": { + "title": "ContainerUpdateResponse", + "type": "object", + "properties": { + "Warnings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "OK response to ContainerUpdate operation" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "update" + } + }, + "/containers/{id}/rename": { + "post": { + "tags": [ + "Container" + ], + "summary": "Rename a container", + "operationId": "ContainerRename", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "description": "New name for the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "name already in use", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/pause": { + "post": { + "tags": [ + "Container" + ], + "summary": "Pause a container", + "description": "Use the freezer cgroup to suspend all processes in a container.\n\nTraditionally, when suspending a process the `SIGSTOP` signal is used,\nwhich is observable by the process being suspended. With the freezer\ncgroup the process is unaware, and unable to capture, that it is being\nsuspended, and subsequently resumed.\n", + "operationId": "ContainerPause", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/unpause": { + "post": { + "tags": [ + "Container" + ], + "summary": "Unpause a container", + "description": "Resume a container which has been paused.", + "operationId": "ContainerUnpause", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/attach": { + "post": { + "tags": [ + "Container" + ], + "summary": "Attach to a container", + "description": "Attach to a container to read its output or send it input. You can attach\nto the same container multiple times and you can reattach to containers\nthat have been detached.\n\nEither the `stream` or `logs` parameter must be `true` for this endpoint\nto do anything.\n\nSee the [documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/)\nfor more details.\n\n### Hijacking\n\nThis endpoint hijacks the HTTP connection to transport `stdin`, `stdout`,\nand `stderr` on the same socket.\n\nThis is the response from the daemon for an attach request:\n\n```\nHTTP/1.1 200 OK\nContent-Type: application/vnd.docker.raw-stream\n\n[STREAM]\n```\n\nAfter the headers and two new lines, the TCP connection can now be used\nfor raw, bidirectional communication between the client and server.\n\nTo hint potential proxies about connection hijacking, the Docker client\ncan also optionally send connection upgrade headers.\n\nFor example, the client sends this request to upgrade the connection:\n\n```\nPOST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1\nUpgrade: tcp\nConnection: Upgrade\n```\n\nThe Docker daemon will respond with a `101 UPGRADED` response, and will\nsimilarly follow with the raw stream:\n\n```\nHTTP/1.1 101 UPGRADED\nContent-Type: application/vnd.docker.raw-stream\nConnection: Upgrade\nUpgrade: tcp\n\n[STREAM]\n```\n\n### Stream format\n\nWhen the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate),\nthe HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream\nand the stream over the hijacked connected is multiplexed to separate out\n`stdout` and `stderr`. The stream consists of a series of frames, each\ncontaining a header and a payload.\n\nThe header contains the information which the stream writes (`stdout` or\n`stderr`). It also contains the size of the associated frame encoded in\nthe last four bytes (`uint32`).\n\nIt is encoded on the first eight bytes like this:\n\n```go\nheader := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n```\n\n`STREAM_TYPE` can be:\n\n- 0: `stdin` (is written on `stdout`)\n- 1: `stdout`\n- 2: `stderr`\n\n`SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size\nencoded as big endian.\n\nFollowing the header is the payload, which is the specified number of\nbytes of `STREAM_TYPE`.\n\nThe simplest way to implement this protocol is the following:\n\n1. Read 8 bytes.\n2. Choose `stdout` or `stderr` depending on the first byte.\n3. Extract the frame size from the last four bytes.\n4. Read the extracted size and output it on the correct output.\n5. Goto 1.\n\n### Stream format when using a TTY\n\nWhen the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate),\nthe stream is not multiplexed. The data exchanged over the hijacked\nconnection is simply the raw data from the process PTY and client's\n`stdin`.\n", + "operationId": "ContainerAttach", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container.Format is a single\ncharacter `[a-Z]` or `ctrl-` where `` is one of: `a-z`,\n`@`, `^`, `[`, `,` or `_`.\n", + "schema": { + "type": "string" + } + }, + { + "name": "logs", + "in": "query", + "description": "Replay previous logs from the container.\n\nThis is useful for attaching to a container that has started and you\nwant to output everything since the container started.\n\nIf `stream` is also enabled, once all the previous output has been\nreturned, it will seamlessly transition into streaming current\noutput.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stream", + "in": "query", + "description": "Stream attached streams from the time the request was made onwards.\n", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdin", + "in": "query", + "description": "Attach to `stdin`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Attach to `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Attach to `stderr`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "101": { + "description": "no error, hints proxy about hijacking", + "content": {} + }, + "200": { + "description": "no error, no upgrade header found", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/attach/ws": { + "get": { + "tags": [ + "Container" + ], + "summary": "Attach to a container via a websocket", + "operationId": "ContainerAttachWebsocket", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "detachKeys", + "in": "query", + "description": "Override the key sequence for detaching a container.Format is a single\ncharacter `[a-Z]` or `ctrl-` where `` is one of: `a-z`,\n`@`, `^`, `[`, `,`, or `_`.\n", + "schema": { + "type": "string" + } + }, + { + "name": "logs", + "in": "query", + "description": "Return logs", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stream", + "in": "query", + "description": "Return stream", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdin", + "in": "query", + "description": "Attach to `stdin`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Attach to `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Attach to `stderr`", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "101": { + "description": "no error, hints proxy about hijacking", + "content": {} + }, + "200": { + "description": "no error, no upgrade header found", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/wait": { + "post": { + "tags": [ + "Container" + ], + "summary": "Wait for a container", + "description": "Block until a container stops, then returns the exit code.", + "operationId": "ContainerWait", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "condition", + "in": "query", + "description": "Wait until a container state reaches the given condition.\n\nDefaults to `not-running` if omitted or empty.\n", + "schema": { + "type": "string", + "default": "not-running", + "enum": [ + "not-running", + "next-exit", + "removed" + ] + } + } + ], + "responses": { + "200": { + "description": "The container has exit.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContainerWaitResponse" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}": { + "delete": { + "tags": [ + "Container" + ], + "summary": "Remove a container", + "operationId": "ContainerDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "v", + "in": "query", + "description": "Remove anonymous volumes associated with the container.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "force", + "in": "query", + "description": "If the container is running, kill it before removing it.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "link", + "in": "query", + "description": "Remove the specified link associated with the container.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "You cannot remove a running container: c2ada9df5af8. Stop the\ncontainer before attempting removal or force remove\n" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/{id}/archive": { + "get": { + "tags": [ + "Container" + ], + "summary": "Get an archive of a filesystem resource in a container", + "description": "Get a tar archive of a resource in the filesystem of container id.", + "operationId": "ContainerArchive", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Resource in the container’s filesystem to archive.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Container or path does not exist", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Container" + ], + "summary": "Extract an archive of files or folders to a directory in a container", + "description": "Upload a tar archive to be extracted to a path in the filesystem of container id.\n`path` parameter is asserted to be a directory. If it exists as a file, 400 error\nwill be returned with message \"not a directory\".\n", + "operationId": "PutContainerArchive", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Path to a directory in the container to extract the archive’s contents into. ", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "noOverwriteDirNonDir", + "in": "query", + "description": "If `1`, `true`, or `True` then it will be an error if unpacking the\ngiven content would cause an existing directory to be replaced with\na non-directory and vice versa.\n", + "schema": { + "type": "string" + } + }, + { + "name": "copyUIDGID", + "in": "query", + "description": "If `1`, `true`, then it will copy UID/GID maps to the dest file or\ndir\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The input stream must be a tar archive compressed with one of the\nfollowing algorithms: `identity` (no compression), `gzip`, `bzip2`,\nor `xz`.\n", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The content was extracted successfully", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "not a directory" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "Permission denied, the volume or container rootfs is marked as read-only.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "No such container or path does not exist inside the container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputStream" + }, + "head": { + "tags": [ + "Container" + ], + "summary": "Get information about files in a container", + "description": "A response header `X-Docker-Container-Path-Stat` is returned, containing\na base64 - encoded JSON object with some filesystem header information\nabout the path.\n", + "operationId": "ContainerArchiveInfo", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the container", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "Resource in the container’s filesystem to archive.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "headers": { + "X-Docker-Container-Path-Stat": { + "description": "A base64 - encoded JSON object with some filesystem header\ninformation about the path\n", + "schema": { + "type": "string" + } + } + }, + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Container or path does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/containers/prune": { + "post": { + "tags": [ + "Container" + ], + "summary": "Delete stopped containers", + "operationId": "ContainerPrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `until=` Prune containers created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune containers with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ContainerPruneResponse", + "type": "object", + "properties": { + "ContainersDeleted": { + "type": "array", + "description": "Container IDs that were deleted", + "items": { + "type": "string" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/json": { + "get": { + "tags": [ + "Image" + ], + "summary": "List Images", + "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.", + "operationId": "ImageList", + "parameters": [ + { + "name": "all", + "in": "query", + "description": "Show all images. Only images from a final layer (no children) are shown by default.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the images list.\n\nAvailable filters:\n\n- `before`=(`[:]`, `` or ``)\n- `dangling=true`\n- `label=key` or `label=\"key=value\"` of an image label\n- `reference`=(`[:]`)\n- `since`=(`[:]`, `` or ``)\n- `until=`\n", + "schema": { + "type": "string" + } + }, + { + "name": "shared-size", + "in": "query", + "description": "Compute and show shared size as a `SharedSize` field on each image.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "digests", + "in": "query", + "description": "Show digest information as a `RepoDigests` field on each image.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Summary image data for the images matching the query", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/build": { + "post": { + "tags": [ + "Image" + ], + "summary": "Build an image", + "description": "Build an image from a tar archive with a `Dockerfile` in it.\n\nThe `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/).\n\nThe 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.\n\nThe build is canceled if the client drops the connection by quitting or being killed.\n", + "operationId": "ImageBuild", + "parameters": [ + { + "name": "dockerfile", + "in": "query", + "description": "Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`.", + "schema": { + "type": "string", + "default": "Dockerfile" + } + }, + { + "name": "t", + "in": "query", + "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.", + "schema": { + "type": "string" + } + }, + { + "name": "extrahosts", + "in": "query", + "description": "Extra hosts to add to /etc/hosts", + "schema": { + "type": "string" + } + }, + { + "name": "remote", + "in": "query", + "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.", + "schema": { + "type": "string" + } + }, + { + "name": "q", + "in": "query", + "description": "Suppress verbose build output.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "nocache", + "in": "query", + "description": "Do not use the cache when building the image.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "cachefrom", + "in": "query", + "description": "JSON array of images used for build cache resolution.", + "schema": { + "type": "string" + } + }, + { + "name": "pull", + "in": "query", + "description": "Attempt to pull the image even if an older image exists locally.", + "schema": { + "type": "string" + } + }, + { + "name": "rm", + "in": "query", + "description": "Remove intermediate containers after a successful build.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "forcerm", + "in": "query", + "description": "Always remove intermediate containers, even upon failure.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "memory", + "in": "query", + "description": "Set memory limit for build.", + "schema": { + "type": "integer" + } + }, + { + "name": "memswap", + "in": "query", + "description": "Total memory (memory + swap). Set as `-1` to disable swap.", + "schema": { + "type": "integer" + } + }, + { + "name": "cpushares", + "in": "query", + "description": "CPU shares (relative weight).", + "schema": { + "type": "integer" + } + }, + { + "name": "cpusetcpus", + "in": "query", + "description": "CPUs in which to allow execution (e.g., `0-3`, `0,1`).", + "schema": { + "type": "string" + } + }, + { + "name": "cpuperiod", + "in": "query", + "description": "The length of a CPU period in microseconds.", + "schema": { + "type": "integer" + } + }, + { + "name": "cpuquota", + "in": "query", + "description": "Microseconds of CPU time that the container can get in a CPU period.", + "schema": { + "type": "integer" + } + }, + { + "name": "buildargs", + "in": "query", + "description": "JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values.\n\nFor example, the build arg `FOO=bar` would become `{\"FOO\":\"bar\"}` in JSON. This would result in the query parameter `buildargs={\"FOO\":\"bar\"}`. Note that `{\"FOO\":\"bar\"}` should be URI component encoded.\n\n[Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg)\n", + "schema": { + "type": "string" + } + }, + { + "name": "shmsize", + "in": "query", + "description": "Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB.", + "schema": { + "type": "integer" + } + }, + { + "name": "squash", + "in": "query", + "description": "Squash the resulting images layers into a single layer. *(Experimental release only.)*", + "schema": { + "type": "boolean" + } + }, + { + "name": "labels", + "in": "query", + "description": "Arbitrary key/value labels to set on the image, as a JSON map of string pairs.", + "schema": { + "type": "string" + } + }, + { + "name": "networkmode", + "in": "query", + "description": "Sets the networking mode for the run commands during build. Supported\nstandard values are: `bridge`, `host`, `none`, and `container:`.\nAny other value is taken as a custom network's name or ID to which this\ncontainer should connect to.\n", + "schema": { + "type": "string" + } + }, + { + "name": "Content-type", + "in": "header", + "schema": { + "type": "string", + "default": "application/x-tar", + "enum": [ + "application/x-tar" + ] + } + }, + { + "name": "X-Registry-Config", + "in": "header", + "description": "This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to.\n\nThe key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example:\n\n```\n{\n \"docker.example.com\": {\n \"username\": \"janedoe\",\n \"password\": \"hunter2\"\n },\n \"https://index.docker.io/v1/\": {\n \"username\": \"mobydock\",\n \"password\": \"conta1n3rize14\"\n }\n}\n```\n\nOnly 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.\n", + "schema": { + "type": "string" + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform in the format os[/arch[/variant]]", + "schema": { + "type": "string" + } + }, + { + "name": "target", + "in": "query", + "description": "Target build stage", + "schema": { + "type": "string" + } + }, + { + "name": "outputs", + "in": "query", + "description": "BuildKit output configuration", + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "Version of the builder backend to use.\n\n- `1` is the first generation classic (deprecated) builder in the Docker daemon (default)\n- `2` is [BuildKit](https://github.com/moby/buildkit)\n", + "schema": { + "type": "string", + "default": "1", + "enum": [ + "1", + "2" + ] + } + } + ], + "requestBody": { + "description": "A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz.", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputStream" + } + }, + "/build/prune": { + "post": { + "tags": [ + "Image" + ], + "summary": "Delete builder cache", + "operationId": "BuildPrune", + "parameters": [ + { + "name": "keep-storage", + "in": "query", + "description": "Amount of disk space in bytes to keep for cache", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "all", + "in": "query", + "description": "Remove all types of build cache", + "schema": { + "type": "boolean" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the list of build cache objects.\n\nAvailable filters:\n\n- `until=` remove cache older than ``. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time.\n- `id=`\n- `parent=`\n- `type=`\n- `description=`\n- `inuse`\n- `shared`\n- `private`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "BuildPruneResponse", + "type": "object", + "properties": { + "CachesDeleted": { + "type": "array", + "items": { + "type": "string", + "description": "ID of build cache object" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/create": { + "post": { + "tags": [ + "Image" + ], + "summary": "Create an image", + "description": "Pull or import an image.", + "operationId": "ImageCreate", + "parameters": [ + { + "name": "fromImage", + "in": "query", + "description": "Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed.", + "schema": { + "type": "string" + } + }, + { + "name": "fromSrc", + "in": "query", + "description": "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image.", + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled.", + "schema": { + "type": "string" + } + }, + { + "name": "message", + "in": "query", + "description": "Set commit message for imported image.", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + }, + { + "name": "changes", + "in": "query", + "description": "Apply `Dockerfile` instructions to the image that is created,\nfor example: `changes=ENV DEBUG=true`.\nNote that `ENV DEBUG=true` should be URI component encoded.\n\nSupported `Dockerfile` instructions:\n`CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR`\n", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform in the format os[/arch[/variant]].\n\nWhen used in combination with the `fromImage` option, the daemon checks\nif the given image is present in the local image cache with the given\nOS and Architecture, and otherwise attempts to pull the image. If the\noption is not set, the host's native OS and Architecture are used.\nIf the given image does not exist in the local image cache, the daemon\nattempts to pull the image with the host's native OS and Architecture.\nIf the given image does exists in the local image cache, but its OS or\narchitecture does not match, a warning is produced.\n\nWhen used with the `fromSrc` option to import an image from an archive,\nthis option sets the platform information for the imported image. If\nthe option is not set, the host's native OS and Architecture are used\nfor the imported image.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Image content if the value `-` has been specified in fromSrc query parameter", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/octet-stream": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "repository does not exist or no read access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "inputImage" + } + }, + "/images/{name}/json": { + "get": { + "tags": [ + "Image" + ], + "summary": "Inspect an image", + "description": "Return low-level information about an image.", + "operationId": "ImageInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ImageInspect" + } + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such image: someimage (tag: latest)" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/history": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get the history of an image", + "description": "Return parent layers of an image.", + "operationId": "ImageHistory", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "List of image layers", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "HistoryResponseItem", + "required": [ + "Comment", + "Created", + "CreatedBy", + "Id", + "Size", + "Tags" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": false + }, + "Created": { + "type": "integer", + "format": "int64", + "nullable": false + }, + "CreatedBy": { + "type": "string", + "nullable": false + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "Size": { + "type": "integer", + "format": "int64", + "nullable": false + }, + "Comment": { + "type": "string", + "nullable": false + } + }, + "description": "individual image layer information in response to ImageHistory operation", + "x-go-name": "HistoryResponseItem" + } + }, + "example": [ + { + "Id": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710", + "Created": 1398108230, + "CreatedBy": "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /", + "Tags": [ + "ubuntu:lucid", + "ubuntu:10.04" + ], + "Size": 182964289, + "Comment": "" + }, + { + "Id": "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8", + "Created": 1398108222, + "CreatedBy": "/bin/sh -c #(nop) MAINTAINER Tianon Gravi - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/", + "Tags": [], + "Size": 0, + "Comment": "" + }, + { + "Id": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158", + "Created": 1371157430, + "CreatedBy": "", + "Tags": [ + "scratch12:latest", + "scratch:latest" + ], + "Size": 0, + "Comment": "Imported from -" + } + ] + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/push": { + "post": { + "tags": [ + "Image" + ], + "summary": "Push an image", + "description": "Push an image to a registry.\n\nIf you wish to push an image on to a private registry, that image must\nalready have a tag which references the registry. For example,\n`registry.example.com/myimage:latest`.\n\nThe push is cancelled if the HTTP connection is closed.\n", + "operationId": "ImagePush", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag to associate with the image on the registry.", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/tag": { + "post": { + "tags": [ + "Image" + ], + "summary": "Tag an image", + "description": "Tag an image so that it becomes part of a repository.", + "operationId": "ImageTag", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID to tag.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "The repository to tag in. For example, `someuser/someimage`.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The name of the new tag.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "No error", + "content": {} + }, + "400": { + "description": "Bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}": { + "delete": { + "tags": [ + "Image" + ], + "summary": "Remove an image", + "description": "Remove an image, along with any untagged parent images that were\nreferenced by that image.\n\nImages can't be removed if they have descendant images, are being\nused by a running container or are being used by a build.\n", + "operationId": "ImageDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Remove the image even if it is being used by stopped containers or has other tags", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "noprune", + "in": "query", + "description": "Do not delete untagged parent images", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "The image was deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageDeleteResponseItem" + } + }, + "example": [ + { + "Untagged": "3e2f21a89f" + }, + { + "Deleted": "3e2f21a89f" + }, + { + "Deleted": "53b4f83ac9" + } + ] + } + } + }, + "404": { + "description": "No such image", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/search": { + "get": { + "tags": [ + "Image" + ], + "summary": "Search images", + "description": "Search for an image on Docker Hub.", + "operationId": "ImageSearch", + "parameters": [ + { + "name": "term", + "in": "query", + "description": "Term to search", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "schema": { + "type": "integer" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:\n\n- `is-official=(true|false)`\n- `stars=` Matches images that has at least 'number' stars.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "ImageSearchResponseItem", + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "is_official": { + "type": "boolean" + }, + "is_automated": { + "type": "boolean", + "description": "Whether this repository has automated builds enabled.\n\n


\n\n> **Deprecated**: This field is deprecated and will always be \"false\".\n", + "example": false + }, + "name": { + "type": "string" + }, + "star_count": { + "type": "integer" + } + } + } + }, + "example": [ + { + "description": "A minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size!", + "is_official": true, + "is_automated": false, + "name": "alpine", + "star_count": 10093 + }, + { + "description": "Busybox base image.", + "is_official": true, + "is_automated": false, + "name": "Busybox base image.", + "star_count": 3037 + }, + { + "description": "The PostgreSQL object-relational database system provides reliability and data integrity.", + "is_official": true, + "is_automated": false, + "name": "postgres", + "star_count": 12408 + } + ] + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/prune": { + "post": { + "tags": [ + "Image" + ], + "summary": "Delete unused images", + "operationId": "ImagePrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters:\n\n- `dangling=` When set to `true` (or `1`), prune only\n unused *and* untagged images. When set to `false`\n (or `0`), all unused images are pruned.\n- `until=` Prune images created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune images with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ImagePruneResponse", + "type": "object", + "properties": { + "ImagesDeleted": { + "type": "array", + "description": "Images that were deleted", + "items": { + "$ref": "#/components/schemas/ImageDeleteResponseItem" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/auth": { + "post": { + "tags": [ + "System" + ], + "summary": "Check auth configuration", + "description": "Validate credentials for a registry and, if available, get an identity\ntoken for accessing the registry without password.\n", + "operationId": "SystemAuth", + "requestBody": { + "description": "Authentication to check", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthConfig" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "An identity token was generated successfully.", + "content": { + "application/json": { + "schema": { + "title": "SystemAuthResponse", + "required": [ + "Status" + ], + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "The status of the authentication", + "nullable": false + }, + "IdentityToken": { + "type": "string", + "description": "An opaque token used to authenticate a user after a successful login", + "nullable": false + } + } + }, + "example": { + "Status": "Login Succeeded", + "IdentityToken": "9cbaf023786cd7..." + } + } + } + }, + "204": { + "description": "No error", + "content": {} + }, + "401": { + "description": "Auth error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "authConfig" + } + }, + "/info": { + "get": { + "tags": [ + "System" + ], + "summary": "Get system information", + "operationId": "SystemInfo", + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/version": { + "get": { + "tags": [ + "System" + ], + "summary": "Get version", + "description": "Returns the version of Docker that is running and various information about the system that Docker is running on.", + "operationId": "SystemVersion", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemVersion" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/_ping": { + "get": { + "tags": [ + "System" + ], + "summary": "Ping", + "description": "This is a dummy endpoint you can use to test if the server is accessible.", + "operationId": "SystemPing", + "responses": { + "200": { + "description": "no error", + "headers": { + "Swarm": { + "description": "Contains information about Swarm status of the daemon,\nand if the daemon is acting as a manager or worker node.\n", + "schema": { + "type": "string", + "default": "inactive", + "enum": [ + "inactive", + "pending", + "error", + "locked", + "active/worker", + "active/manager" + ] + } + }, + "Docker-Experimental": { + "description": "If the server is running with experimental mode enabled", + "schema": { + "type": "boolean" + } + }, + "Cache-Control": { + "schema": { + "type": "string", + "default": "no-cache, no-store, must-revalidate" + } + }, + "Pragma": { + "schema": { + "type": "string", + "default": "no-cache" + } + }, + "API-Version": { + "description": "Max API Version the server supports", + "schema": { + "type": "string" + } + }, + "Builder-Version": { + "description": "Default version of docker image builder\n\nThe default on Linux is version \"2\" (BuildKit), but the daemon\ncan be configured to recommend version \"1\" (classic Builder).\nWindows does not yet support BuildKit for native Windows images,\nand uses \"1\" (classic builder) as a default.\n\nThis value is a recommendation as advertised by the daemon, and\nit is up to the client to choose which builder to use.\n", + "schema": { + "type": "string", + "default": "2" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string", + "example": "OK" + } + } + } + }, + "500": { + "description": "server error", + "headers": { + "Cache-Control": { + "schema": { + "type": "string", + "default": "no-cache, no-store, must-revalidate" + } + }, + "Pragma": { + "schema": { + "type": "string", + "default": "no-cache" + } + } + }, + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "head": { + "tags": [ + "System" + ], + "summary": "Ping", + "description": "This is a dummy endpoint you can use to test if the server is accessible.", + "operationId": "SystemPingHead", + "responses": { + "200": { + "description": "no error", + "headers": { + "Swarm": { + "description": "Contains information about Swarm status of the daemon,\nand if the daemon is acting as a manager or worker node.\n", + "schema": { + "type": "string", + "default": "inactive", + "enum": [ + "inactive", + "pending", + "error", + "locked", + "active/worker", + "active/manager" + ] + } + }, + "Docker-Experimental": { + "description": "If the server is running with experimental mode enabled", + "schema": { + "type": "boolean" + } + }, + "Cache-Control": { + "schema": { + "type": "string", + "default": "no-cache, no-store, must-revalidate" + } + }, + "Pragma": { + "schema": { + "type": "string", + "default": "no-cache" + } + }, + "API-Version": { + "description": "Max API Version the server supports", + "schema": { + "type": "string" + } + }, + "Builder-Version": { + "description": "Default version of docker image builder", + "schema": { + "type": "string" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string", + "example": "(empty)" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/commit": { + "post": { + "tags": [ + "Image" + ], + "summary": "Create a new image from a container", + "operationId": "ImageCommit", + "parameters": [ + { + "name": "container", + "in": "query", + "description": "The ID or name of the container to commit", + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "in": "query", + "description": "Repository name for the created image", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "Tag name for the create image", + "schema": { + "type": "string" + } + }, + { + "name": "comment", + "in": "query", + "description": "Commit message", + "schema": { + "type": "string" + } + }, + { + "name": "author", + "in": "query", + "description": "Author of the image (e.g., `John Hannibal Smith `)", + "schema": { + "type": "string" + } + }, + { + "name": "pause", + "in": "query", + "description": "Whether to pause the container before committing", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "changes", + "in": "query", + "description": "`Dockerfile` instructions to apply while committing", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The container configuration", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContainerConfig" + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "containerConfig" + } + }, + "/events": { + "get": { + "tags": [ + "System" + ], + "summary": "Monitor events", + "description": "Stream real-time events from the server.\n\nVarious objects within Docker report events when something happens to them.\n\nContainers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune`\n\nImages report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune`\n\nVolumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune`\n\nNetworks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune`\n\nThe Docker daemon reports these events: `reload`\n\nServices report these events: `create`, `update`, and `remove`\n\nNodes report these events: `create`, `update`, and `remove`\n\nSecrets report these events: `create`, `update`, and `remove`\n\nConfigs report these events: `create`, `update`, and `remove`\n\nThe Builder reports `prune` events\n", + "operationId": "SystemEvents", + "parameters": [ + { + "name": "since", + "in": "query", + "description": "Show events created since this timestamp then stream new events.", + "schema": { + "type": "string" + } + }, + { + "name": "until", + "in": "query", + "description": "Show events created until this timestamp then stop streaming.", + "schema": { + "type": "string" + } + }, + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters:\n\n- `config=` config name or ID\n- `container=` container name or ID\n- `daemon=` daemon name or ID\n- `event=` event type\n- `image=` image name or ID\n- `label=` image or container label\n- `network=` network name or ID\n- `node=` node ID\n- `plugin`= plugin name or ID\n- `scope`= local or swarm\n- `secret=` secret name or ID\n- `service=` service name or ID\n- `type=` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config`\n- `volume=` volume name\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventMessage" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/system/df": { + "get": { + "tags": [ + "System" + ], + "summary": "Get data usage information", + "operationId": "SystemDataUsage", + "parameters": [ + { + "name": "type", + "in": "query", + "description": "Object types, for which to compute and return data.\n", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "container", + "image", + "volume", + "build-cache" + ] + } + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "SystemDataUsageResponse", + "type": "object", + "properties": { + "LayersSize": { + "type": "integer", + "format": "int64" + }, + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + }, + "Containers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerSummary" + } + }, + "Volumes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Volume" + } + }, + "BuildCache": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BuildCache" + } + } + }, + "example": { + "LayersSize": 1092588, + "Images": [ + { + "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "ParentId": "", + "RepoTags": [ + "busybox:latest" + ], + "RepoDigests": [ + "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + ], + "Created": 1466724217, + "Size": 1092588, + "SharedSize": 0, + "Labels": {}, + "Containers": 1 + } + ], + "Containers": [ + { + "Id": "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148", + "Names": [ + "/top" + ], + "Image": "busybox", + "ImageID": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "Command": "top", + "Created": 1472592424, + "Ports": [], + "SizeRootFs": 1092588, + "Labels": {}, + "State": "exited", + "Status": "Exited (0) 56 minutes ago", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92", + "EndpointID": "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a", + "Gateway": "172.18.0.1", + "IPAddress": "172.18.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Mounts": [] + } + ], + "Volumes": [ + { + "Name": "my-volume", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/my-volume/_data", + "Scope": "local", + "UsageData": { + "Size": 10920104, + "RefCount": 2 + } + } + ], + "BuildCache": [ + { + "ID": "hw53o5aio51xtltp5xjp8v7fx", + "Parents": [], + "Type": "regular", + "Description": "pulled from docker.io/library/debian@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0", + "InUse": false, + "Shared": true, + "Size": 0, + "CreatedAt": "2021-06-28T13:31:01.474619385Z", + "LastUsedAt": "2021-07-07T22:02:32.738075951Z", + "UsageCount": 26 + }, + { + "ID": "ndlpt0hhvkqcdfkputsk4cq9c", + "Parents": [ + "ndlpt0hhvkqcdfkputsk4cq9c" + ], + "Type": "regular", + "Description": "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache", + "InUse": false, + "Shared": true, + "Size": 51, + "CreatedAt": "2021-06-28T13:31:03.002625487Z", + "LastUsedAt": "2021-07-07T22:02:32.773909517Z", + "UsageCount": 26 + } + ] + } + } + }, + "text/plain": { + "schema": { + "title": "SystemDataUsageResponse", + "type": "object", + "properties": { + "LayersSize": { + "type": "integer", + "format": "int64" + }, + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageSummary" + } + }, + "Containers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerSummary" + } + }, + "Volumes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Volume" + } + }, + "BuildCache": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BuildCache" + } + } + }, + "example": { + "LayersSize": 1092588, + "Images": [ + { + "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "ParentId": "", + "RepoTags": [ + "busybox:latest" + ], + "RepoDigests": [ + "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + ], + "Created": 1466724217, + "Size": 1092588, + "SharedSize": 0, + "Labels": {}, + "Containers": 1 + } + ], + "Containers": [ + { + "Id": "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148", + "Names": [ + "/top" + ], + "Image": "busybox", + "ImageID": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "Command": "top", + "Created": 1472592424, + "Ports": [], + "SizeRootFs": 1092588, + "Labels": {}, + "State": "exited", + "Status": "Exited (0) 56 minutes ago", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "NetworkID": "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92", + "EndpointID": "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a", + "Gateway": "172.18.0.1", + "IPAddress": "172.18.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Mounts": [] + } + ], + "Volumes": [ + { + "Name": "my-volume", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/my-volume/_data", + "Scope": "local", + "UsageData": { + "Size": 10920104, + "RefCount": 2 + } + } + ], + "BuildCache": [ + { + "ID": "hw53o5aio51xtltp5xjp8v7fx", + "Parents": [], + "Type": "regular", + "Description": "pulled from docker.io/library/debian@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0", + "InUse": false, + "Shared": true, + "Size": 0, + "CreatedAt": "2021-06-28T13:31:01.474619385Z", + "LastUsedAt": "2021-07-07T22:02:32.738075951Z", + "UsageCount": 26 + }, + { + "ID": "ndlpt0hhvkqcdfkputsk4cq9c", + "Parents": [ + "ndlpt0hhvkqcdfkputsk4cq9c" + ], + "Type": "regular", + "Description": "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache", + "InUse": false, + "Shared": true, + "Size": 51, + "CreatedAt": "2021-06-28T13:31:03.002625487Z", + "LastUsedAt": "2021-07-07T22:02:32.773909517Z", + "UsageCount": 26 + } + ] + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/{name}/get": { + "get": { + "tags": [ + "Image" + ], + "summary": "Export an image", + "description": "Get a tarball containing all images and metadata for a repository.\n\nIf `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.\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID), each containing these files:\n\n- `VERSION`: currently `1.0` - the file format version\n- `json`: detailed layer information, similar to `docker inspect layer_id`\n- `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions.\n\nIf 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.\n\n```json\n{\n \"hello-world\": {\n \"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"\n }\n}\n```\n", + "operationId": "ImageGet", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/get": { + "get": { + "tags": [ + "Image" + ], + "summary": "Export several images", + "description": "Get a tarball containing all images and metadata for several image\nrepositories.\n\nFor each value of the `names` parameter: if it is a specific name and\ntag (e.g. `ubuntu:latest`), then only that image (and its parents) are\nreturned; if it is an image ID, similarly only that image (and its parents)\nare returned and there would be no names referenced in the 'repositories'\nfile for this image ID.\n\nFor details on the format, see the [export image endpoint](#operation/ImageGet).\n", + "operationId": "ImageGetAll", + "parameters": [ + { + "name": "names", + "in": "query", + "description": "Image names to filter by", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/x-tar": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/images/load": { + "post": { + "tags": [ + "Image" + ], + "summary": "Import images", + "description": "Load a set of images and tags into a repository.\n\nFor details on the format, see the [export image endpoint](#operation/ImageGet).\n", + "operationId": "ImageLoad", + "parameters": [ + { + "name": "quiet", + "in": "query", + "description": "Suppress progress details during load.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "Tar archive containing images", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "imagesTarball" + } + }, + "/containers/{id}/exec": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Create an exec instance", + "description": "Run a command inside a running container.", + "operationId": "ContainerExec", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of container", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Exec configuration", + "content": { + "application/json": { + "schema": { + "title": "ExecConfig", + "type": "object", + "properties": { + "AttachStdin": { + "type": "boolean", + "description": "Attach to `stdin` of the exec command." + }, + "AttachStdout": { + "type": "boolean", + "description": "Attach to `stdout` of the exec command." + }, + "AttachStderr": { + "type": "boolean", + "description": "Attach to `stderr` of the exec command." + }, + "ConsoleSize": { + "maxItems": 2, + "minItems": 2, + "type": "array", + "description": "Initial console size, as an `[height, width]` array.", + "nullable": true, + "items": { + "minimum": 0, + "type": "integer" + } + }, + "DetachKeys": { + "type": "string", + "description": "Override the key sequence for detaching a container. Format is\na single character `[a-Z]` or `ctrl-` where ``\nis one of: `a-z`, `@`, `^`, `[`, `,` or `_`.\n" + }, + "Tty": { + "type": "boolean", + "description": "Allocate a pseudo-TTY." + }, + "Env": { + "type": "array", + "description": "A list of environment variables in the form `[\"VAR=value\", ...]`.\n", + "items": { + "type": "string" + } + }, + "Cmd": { + "type": "array", + "description": "Command to run, as a string or array of strings.", + "items": { + "type": "string" + } + }, + "Privileged": { + "type": "boolean", + "description": "Runs the exec process with extended privileges.", + "default": false + }, + "User": { + "type": "string", + "description": "The user, and optionally, group to run the exec process inside\nthe container. Format is one of: `user`, `user:group`, `uid`,\nor `uid:gid`.\n" + }, + "WorkingDir": { + "type": "string", + "description": "The working directory for the exec process inside the container.\n" + } + }, + "example": { + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "DetachKeys": "ctrl-p,ctrl-q", + "Tty": false, + "Cmd": [ + "date" + ], + "Env": [ + "FOO=bar", + "BAZ=quux" + ] + } + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "404": { + "description": "no such container", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such container: c2ada9df5af8" + } + } + } + }, + "409": { + "description": "container is paused", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "execConfig" + } + }, + "/exec/{id}/start": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Start an exec instance", + "description": "Starts a previously set up exec instance. If detach is true, this endpoint\nreturns immediately after starting the command. Otherwise, it sets up an\ninteractive session with the command.\n", + "operationId": "ExecStart", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "ExecStartConfig", + "type": "object", + "properties": { + "Detach": { + "type": "boolean", + "description": "Detach from the command." + }, + "Tty": { + "type": "boolean", + "description": "Allocate a pseudo-TTY." + }, + "ConsoleSize": { + "maxItems": 2, + "minItems": 2, + "type": "array", + "description": "Initial console size, as an `[height, width]` array.", + "nullable": true, + "items": { + "minimum": 0, + "type": "integer" + } + } + }, + "example": { + "Detach": false, + "Tty": true, + "ConsoleSize": [ + 80, + 64 + ] + } + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "404": { + "description": "No such exec instance", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Container is stopped or paused", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "execStartConfig" + } + }, + "/exec/{id}/resize": { + "post": { + "tags": [ + "Exec" + ], + "summary": "Resize an exec instance", + "description": "Resize the TTY session used by an exec instance. This endpoint only works\nif `tty` was specified as part of creating and starting the exec instance.\n", + "operationId": "ExecResize", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "h", + "in": "query", + "description": "Height of the TTY session in characters", + "schema": { + "type": "integer" + } + }, + { + "name": "w", + "in": "query", + "description": "Width of the TTY session in characters", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "No such exec instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/exec/{id}/json": { + "get": { + "tags": [ + "Exec" + ], + "summary": "Inspect an exec instance", + "description": "Return low-level information about an exec instance.", + "operationId": "ExecInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Exec instance ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "ExecInspectResponse", + "type": "object", + "properties": { + "CanRemove": { + "type": "boolean" + }, + "DetachKeys": { + "type": "string" + }, + "ID": { + "type": "string" + }, + "Running": { + "type": "boolean" + }, + "ExitCode": { + "type": "integer" + }, + "ProcessConfig": { + "$ref": "#/components/schemas/ProcessConfig" + }, + "OpenStdin": { + "type": "boolean" + }, + "OpenStderr": { + "type": "boolean" + }, + "OpenStdout": { + "type": "boolean" + }, + "ContainerID": { + "type": "string" + }, + "Pid": { + "type": "integer", + "description": "The system process ID for the exec process." + } + } + }, + "example": { + "CanRemove": false, + "ContainerID": "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126", + "DetachKeys": "", + "ExitCode": 2, + "ID": "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b", + "OpenStderr": true, + "OpenStdin": true, + "OpenStdout": true, + "ProcessConfig": { + "arguments": [ + "-c", + "exit 2" + ], + "entrypoint": "sh", + "privileged": false, + "tty": true, + "user": "1000" + }, + "Running": false, + "Pid": 42000 + } + } + } + }, + "404": { + "description": "No such exec instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes": { + "get": { + "tags": [ + "Volume" + ], + "summary": "List volumes", + "operationId": "VolumeList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the volumes list. Available filters:\n\n- `dangling=` When set to `true` (or `1`), returns all\n volumes that are not in use by a container. When set to `false`\n (or `0`), only volumes that are in use by one or more\n containers are returned.\n- `driver=` Matches volumes based on their driver.\n- `label=` or `label=:` Matches volumes based on\n the presence of a `label` alone or a `label` and a value.\n- `name=` Matches all or part of a volume name.\n", + "schema": { + "type": "string", + "format": "json" + } + } + ], + "responses": { + "200": { + "description": "Summary volume data that matches the query", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VolumeListResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes/create": { + "post": { + "tags": [ + "Volume" + ], + "summary": "Create a volume", + "operationId": "VolumeCreate", + "requestBody": { + "description": "Volume configuration", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VolumeCreateOptions" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "The volume was created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Volume" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "volumeConfig" + } + }, + "/volumes/{name}": { + "get": { + "tags": [ + "Volume" + ], + "summary": "Inspect a volume", + "operationId": "VolumeInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Volume name or ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Volume" + } + } + } + }, + "404": { + "description": "No such volume", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Volume" + ], + "summary": "\"Update a volume. Valid only for Swarm cluster volumes\"\n", + "operationId": "VolumeUpdate", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name or ID of the volume", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the volume being updated. This is required to\navoid conflicting writes. Found in the volume's `ClusterVolume`\nfield.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "The spec of the volume to update. Currently, only Availability may\nchange. All other fields must remain unchanged.\n", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "Spec": { + "$ref": "#/components/schemas/ClusterVolumeSpec" + } + }, + "description": "Volume configuration" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such volume", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + }, + "delete": { + "tags": [ + "Volume" + ], + "summary": "Remove a volume", + "description": "Instruct the driver to remove the volume.", + "operationId": "VolumeDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Volume name or ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force the removal of the volume", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "The volume was removed", + "content": {} + }, + "404": { + "description": "No such volume or volume driver", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Volume is in use and cannot be removed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/volumes/prune": { + "post": { + "tags": [ + "Volume" + ], + "summary": "Delete unused volumes", + "operationId": "VolumePrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels.\n- `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "VolumePruneResponse", + "type": "object", + "properties": { + "VolumesDeleted": { + "type": "array", + "description": "Volumes that were deleted", + "items": { + "type": "string" + } + }, + "SpaceReclaimed": { + "type": "integer", + "description": "Disk space reclaimed in bytes", + "format": "int64" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks": { + "get": { + "tags": [ + "Network" + ], + "summary": "List networks", + "description": "Returns a list of networks. For details on the format, see the\n[network inspect endpoint](#operation/NetworkInspect).\n\nNote that it uses a different, smaller representation of a network than\ninspecting a single network. For example, the list of containers attached\nto the network is not propagated in API versions 1.28 and up.\n", + "operationId": "NetworkList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "JSON encoded value of the filters (a `map[string][]string`) to process\non the networks list.\n\nAvailable filters:\n\n- `dangling=` When set to `true` (or `1`), returns all\n networks that are not in use by a container. When set to `false`\n (or `0`), only networks that are in use by one or more\n containers are returned.\n- `driver=` Matches a network's driver.\n- `id=` Matches all or part of a network ID.\n- `label=` or `label==` of a network label.\n- `name=` Matches all or part of a network name.\n- `scope=[\"swarm\"|\"global\"|\"local\"]` Filters networks by scope (`swarm`, `global`, or `local`).\n- `type=[\"custom\"|\"builtin\"]` Filters networks by type. The `custom` keyword returns all user-defined networks.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Network" + } + }, + "example": [ + { + "Name": "bridge", + "Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566", + "Created": "2016-10-19T06:21:00.416543526Z", + "Scope": "local", + "Driver": "bridge", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.17.0.0/16" + } + ] + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + } + }, + { + "Name": "none", + "Id": "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794", + "Created": "0001-01-01T00:00:00Z", + "Scope": "local", + "Driver": "null", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + }, + { + "Name": "host", + "Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e", + "Created": "0001-01-01T00:00:00Z", + "Scope": "local", + "Driver": "host", + "EnableIPv6": false, + "Internal": false, + "Attachable": false, + "Ingress": false, + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + } + ] + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks/{id}": { + "get": { + "tags": [ + "Network" + ], + "summary": "Inspect a network", + "operationId": "NetworkInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "verbose", + "in": "query", + "description": "Detailed inspect output for troubleshooting", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "scope", + "in": "query", + "description": "Filter the network by scope (swarm, global, or local)", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Network" + } + } + } + }, + "404": { + "description": "Network not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Network" + ], + "summary": "Remove a network", + "operationId": "NetworkDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No error", + "content": {} + }, + "403": { + "description": "operation not supported for pre-defined networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such network", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/networks/create": { + "post": { + "tags": [ + "Network" + ], + "summary": "Create a network", + "operationId": "NetworkCreate", + "requestBody": { + "description": "Network configuration", + "content": { + "application/json": { + "schema": { + "title": "NetworkCreateRequest", + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The network's name." + }, + "CheckDuplicate": { + "type": "boolean", + "description": "Deprecated: CheckDuplicate is now always enabled.\n" + }, + "Driver": { + "type": "string", + "description": "Name of the network driver plugin to use.", + "default": "bridge" + }, + "Internal": { + "type": "boolean", + "description": "Restrict external access to the network." + }, + "Attachable": { + "type": "boolean", + "description": "Globally scoped network is manually attachable by regular\ncontainers from workers in swarm mode.\n" + }, + "Ingress": { + "type": "boolean", + "description": "Ingress network is the network which provides the routing-mesh\nin swarm mode.\n" + }, + "IPAM": { + "$ref": "#/components/schemas/IPAM" + }, + "EnableIPv6": { + "type": "boolean", + "description": "Enable IPv6 on the network." + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Network specific options to be used by the drivers." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + } + }, + "example": { + "Name": "isolated_nw", + "CheckDuplicate": false, + "Driver": "bridge", + "EnableIPv6": true, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.20.0.0/16", + "IPRange": "172.20.10.0/24", + "Gateway": "172.20.10.11" + }, + { + "Subnet": "2001:db8:abcd::/64", + "Gateway": "2001:db8:abcd::1011" + } + ], + "Options": { + "foo": "bar" + } + }, + "Internal": true, + "Attachable": false, + "Ingress": false, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "NetworkCreateResponse", + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the created network." + }, + "Warning": { + "type": "string" + } + }, + "example": { + "Id": "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30", + "Warning": "" + } + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "Forbidden operation. This happens when trying to create a network named after a pre-defined network,\nor when trying to create an overlay network on a daemon which is not part of a Swarm cluster.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "plugin not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "networkConfig" + } + }, + "/networks/{id}/connect": { + "post": { + "tags": [ + "Network" + ], + "summary": "Connect a container to a network", + "description": "The network must be either a local-scoped network or a swarm-scoped network with the `attachable` option set. A network cannot be re-attached to a running container", + "operationId": "NetworkConnect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "NetworkConnectRequest", + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "The ID or name of the container to connect to the network." + }, + "EndpointConfig": { + "$ref": "#/components/schemas/EndpointSettings" + } + }, + "example": { + "Container": "3613f73ba0e4", + "EndpointConfig": { + "IPAMConfig": { + "IPv4Address": "172.24.56.89", + "IPv6Address": "2001:db8::5689" + }, + "MacAddress": "02:42:ac:12:05:02" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "Operation forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Network or container not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "container" + } + }, + "/networks/{id}/disconnect": { + "post": { + "tags": [ + "Network" + ], + "summary": "Disconnect a container from a network", + "operationId": "NetworkDisconnect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Network ID or name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "NetworkDisconnectRequest", + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "The ID or name of the container to disconnect from the network.\n" + }, + "Force": { + "type": "boolean", + "description": "Force the container to disconnect from the network.\n" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "No error", + "content": {} + }, + "403": { + "description": "Operation not supported for swarm scoped networks", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Network or container not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "container" + } + }, + "/networks/prune": { + "post": { + "tags": [ + "Network" + ], + "summary": "Delete unused networks", + "operationId": "NetworkPrune", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `until=` Prune networks created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.\n- `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune networks with (or without, in case `label!=...` is used) the specified labels.\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "title": "NetworkPruneResponse", + "type": "object", + "properties": { + "NetworksDeleted": { + "type": "array", + "description": "Networks that were deleted", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "List plugins", + "description": "Returns information about installed plugins.", + "operationId": "PluginList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the plugin list.\n\nAvailable filters:\n\n- `capability=`\n- `enable=|`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "No error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Plugin" + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/privileges": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "Get plugin privileges", + "operationId": "GetPluginPrivileges", + "parameters": [ + { + "name": "remote", + "in": "query", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/pull": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Install a plugin", + "description": "Pulls and installs a plugin. After the plugin is installed, it can be\nenabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable).\n", + "operationId": "PluginPull", + "parameters": [ + { + "name": "remote", + "in": "query", + "description": "Remote reference for plugin to install.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "description": "Local name for the pulled plugin.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration to use when pulling a plugin\nfrom a registry.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/plugins/{name}/json": { + "get": { + "tags": [ + "Plugin" + ], + "summary": "Inspect a plugin", + "operationId": "PluginInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + } + } + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}": { + "delete": { + "tags": [ + "Plugin" + ], + "summary": "Remove a plugin", + "operationId": "PluginDelete", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Disable the plugin before removing. This may result in issues if the\nplugin is in use by a container.\n", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + } + } + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/enable": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Enable a plugin", + "operationId": "PluginEnable", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Set the HTTP client timeout (in seconds)", + "schema": { + "type": "integer", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/disable": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Disable a plugin", + "operationId": "PluginDisable", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force disable a plugin even if still in use.\n", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin is not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/upgrade": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Upgrade a plugin", + "operationId": "PluginUpgrade", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "remote", + "in": "query", + "description": "Remote reference to upgrade to.\n\nThe `:latest` tag is optional, and is used as the default if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration to use when pulling a plugin\nfrom a registry.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "example": [ + { + "Name": "network", + "Description": "", + "Value": [ + "host" + ] + }, + { + "Name": "mount", + "Description": "", + "Value": [ + "/data" + ] + }, + { + "Name": "device", + "Description": "", + "Value": [ + "/dev/cpu_dma_latency" + ] + } + ], + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/plugins/create": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Create a plugin", + "operationId": "PluginCreate", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Path to tar containing plugin rootfs and manifest", + "content": { + "application/x-tar": { + "schema": { + "type": "string", + "format": "binary" + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "tarContext" + } + }, + "/plugins/{name}/push": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Push a plugin", + "description": "Push a plugin to the registry.\n", + "operationId": "PluginPush", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/plugins/{name}/set": { + "post": { + "tags": [ + "Plugin" + ], + "summary": "Configure a plugin", + "operationId": "PluginSet", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the plugin. The `:latest` tag is optional, and is the\ndefault if omitted.\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + "DEBUG=1" + ], + "items": { + "type": "string" + } + } + } + }, + "required": false + }, + "responses": { + "204": { + "description": "No error", + "content": {} + }, + "404": { + "description": "Plugin not installed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/nodes": { + "get": { + "tags": [ + "Node" + ], + "summary": "List nodes", + "operationId": "NodeList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "Filters to process on the nodes list, encoded as JSON (a `map[string][]string`).\n\nAvailable filters:\n- `id=`\n- `label=`\n- `membership=`(`accepted`|`pending`)`\n- `name=`\n- `node.label=`\n- `role=`(`manager`|`worker`)`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Node" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Node" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/nodes/{id}": { + "get": { + "tags": [ + "Node" + ], + "summary": "Inspect a node", + "operationId": "NodeInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the node", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Node" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Node" + } + } + } + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Node" + ], + "summary": "Delete a node", + "operationId": "NodeDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the node", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "Force remove a node from the swarm", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/nodes/{id}/update": { + "post": { + "tags": [ + "Node" + ], + "summary": "Update a node", + "operationId": "NodeUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the node", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the node object being updated. This is required\nto avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NodeSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/NodeSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm": { + "get": { + "tags": [ + "Swarm" + ], + "summary": "Inspect swarm", + "operationId": "SwarmInspect", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Swarm" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Swarm" + } + } + } + }, + "404": { + "description": "no such swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/init": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Initialize a new swarm", + "operationId": "SwarmInit", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "SwarmInitRequest", + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication, as well\nas determining the networking interface used for the VXLAN\nTunnel Endpoint (VTEP). This can either be an address/port\ncombination in the form `192.168.1.1:4567`, or an interface\nfollowed by a port number, like `eth0:4567`. If the port number\nis omitted, the default swarm listening port is used.\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "DataPathPort": { + "type": "integer", + "description": "DataPathPort specifies the data path port number for data traffic.\nAcceptable port range is 1024 to 49151.\nif no port is set or is set to 0, default port 4789 will be used.\n", + "format": "uint32" + }, + "DefaultAddrPool": { + "type": "array", + "description": "Default Address Pool specifies default subnet pools for global\nscope networks.\n", + "items": { + "type": "string", + "example": "" + } + }, + "ForceNewCluster": { + "type": "boolean", + "description": "Force creation of a new swarm." + }, + "SubnetSize": { + "type": "integer", + "description": "SubnetSize specifies the subnet size of the networks created\nfrom the default subnet pool.\n", + "format": "uint32" + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "DataPathPort": 4789, + "DefaultAddrPool": [ + "10.10.0.0/8", + "20.20.0.0/8" + ], + "SubnetSize": 24, + "ForceNewCluster": false, + "Spec": { + "Orchestration": {}, + "Raft": {}, + "Dispatcher": {}, + "CAConfig": {}, + "EncryptionConfig": { + "AutoLockManagers": false + } + } + } + } + }, + "text/plain": { + "schema": { + "title": "SwarmInitRequest", + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication, as well\nas determining the networking interface used for the VXLAN\nTunnel Endpoint (VTEP). This can either be an address/port\ncombination in the form `192.168.1.1:4567`, or an interface\nfollowed by a port number, like `eth0:4567`. If the port number\nis omitted, the default swarm listening port is used.\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "DataPathPort": { + "type": "integer", + "description": "DataPathPort specifies the data path port number for data traffic.\nAcceptable port range is 1024 to 49151.\nif no port is set or is set to 0, default port 4789 will be used.\n", + "format": "uint32" + }, + "DefaultAddrPool": { + "type": "array", + "description": "Default Address Pool specifies default subnet pools for global\nscope networks.\n", + "items": { + "type": "string", + "example": "" + } + }, + "ForceNewCluster": { + "type": "boolean", + "description": "Force creation of a new swarm." + }, + "SubnetSize": { + "type": "integer", + "description": "SubnetSize specifies the subnet size of the networks created\nfrom the default subnet pool.\n", + "format": "uint32" + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "DataPathPort": 4789, + "DefaultAddrPool": [ + "10.10.0.0/8", + "20.20.0.0/8" + ], + "SubnetSize": 24, + "ForceNewCluster": false, + "Spec": { + "Orchestration": {}, + "Raft": {}, + "Dispatcher": {}, + "CAConfig": {}, + "EncryptionConfig": { + "AutoLockManagers": false + } + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "string", + "description": "The node ID", + "example": "7v2t30z9blmxuhnyo6s4cpenp" + } + }, + "text/plain": { + "schema": { + "type": "string", + "description": "The node ID", + "example": "7v2t30z9blmxuhnyo6s4cpenp" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is already part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/join": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Join an existing swarm", + "operationId": "SwarmJoin", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "SwarmJoinRequest", + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication if the node\ngets promoted to manager, as well as determining the networking\ninterface used for the VXLAN Tunnel Endpoint (VTEP).\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "RemoteAddrs": { + "type": "array", + "description": "Addresses of manager nodes already participating in the swarm.\n", + "items": { + "type": "string" + } + }, + "JoinToken": { + "type": "string", + "description": "Secret token for joining this swarm." + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "RemoteAddrs": [ + "node1:2377" + ], + "JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + } + }, + "text/plain": { + "schema": { + "title": "SwarmJoinRequest", + "type": "object", + "properties": { + "ListenAddr": { + "type": "string", + "description": "Listen address used for inter-manager communication if the node\ngets promoted to manager, as well as determining the networking\ninterface used for the VXLAN Tunnel Endpoint (VTEP).\n" + }, + "AdvertiseAddr": { + "type": "string", + "description": "Externally reachable address advertised to other nodes. This\ncan either be an address/port combination in the form\n`192.168.1.1:4567`, or an interface followed by a port number,\nlike `eth0:4567`. If the port number is omitted, the port\nnumber from the listen address is used. If `AdvertiseAddr` is\nnot specified, it will be automatically detected when possible.\n" + }, + "DataPathAddr": { + "type": "string", + "description": "Address or interface to use for data path traffic (format:\n``), for example, `192.168.1.1`, or an interface,\nlike `eth0`. If `DataPathAddr` is unspecified, the same address\nas `AdvertiseAddr` is used.\n\nThe `DataPathAddr` specifies the address that global scope\nnetwork drivers will publish towards other nodes in order to\nreach the containers running on this node. Using this parameter\nit is possible to separate the container data traffic from the\nmanagement traffic of the cluster.\n" + }, + "RemoteAddrs": { + "type": "array", + "description": "Addresses of manager nodes already participating in the swarm.\n", + "items": { + "type": "string" + } + }, + "JoinToken": { + "type": "string", + "description": "Secret token for joining this swarm." + } + }, + "example": { + "ListenAddr": "0.0.0.0:2377", + "AdvertiseAddr": "192.168.1.1:2377", + "RemoteAddrs": [ + "node1:2377" + ], + "JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is already part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/leave": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Leave a swarm", + "operationId": "SwarmLeave", + "parameters": [ + { + "name": "force", + "in": "query", + "description": "Force leave swarm, even if this is the last manager or that it will\nbreak the cluster.\n", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/update": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Update a swarm", + "operationId": "SwarmUpdate", + "parameters": [ + { + "name": "version", + "in": "query", + "description": "The version number of the swarm object being updated. This is\nrequired to avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "rotateWorkerToken", + "in": "query", + "description": "Rotate the worker join token.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "rotateManagerToken", + "in": "query", + "description": "Rotate the manager join token.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "rotateManagerUnlockKey", + "in": "query", + "description": "Rotate the manager unlock key.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwarmSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/SwarmSpec" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/swarm/unlockkey": { + "get": { + "tags": [ + "Swarm" + ], + "summary": "Get the unlock key", + "operationId": "SwarmUnlockkey", + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "title": "UnlockKeyResponse", + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + }, + "text/plain": { + "schema": { + "title": "UnlockKeyResponse", + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/swarm/unlock": { + "post": { + "tags": [ + "Swarm" + ], + "summary": "Unlock a locked manager", + "operationId": "SwarmUnlock", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "SwarmUnlockRequest", + "type": "object", + "properties": { + "UnlockKey": { + "type": "string", + "description": "The swarm's unlock key." + } + }, + "example": { + "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services": { + "get": { + "tags": [ + "Service" + ], + "summary": "List services", + "operationId": "ServiceList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the services list.\n\nAvailable filters:\n\n- `id=`\n- `label=`\n- `mode=[\"replicated\"|\"global\"]`\n- `name=`\n", + "schema": { + "type": "string" + } + }, + { + "name": "status", + "in": "query", + "description": "Include service status, with count of running and desired tasks.\n", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/services/create": { + "post": { + "tags": [ + "Service" + ], + "summary": "Create a service", + "operationId": "ServiceCreate", + "parameters": [ + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration for pulling from private\nregistries.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServiceSpec" + }, + { + "type": "object", + "example": { + "Name": "web", + "TaskTemplate": { + "ContainerSpec": { + "Image": "nginx:alpine", + "Mounts": [ + { + "ReadOnly": true, + "Source": "web-data", + "Target": "/usr/share/nginx/html", + "Type": "volume", + "VolumeOptions": { + "DriverConfig": {}, + "Labels": { + "com.example.something": "something-value" + } + } + } + ], + "Hosts": [ + "10.10.10.10 host1", + "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 host2" + ], + "User": "33", + "DNSConfig": { + "Nameservers": [ + "8.8.8.8" + ], + "Search": [ + "example.org" + ], + "Options": [ + "timeout:3" + ] + }, + "Secrets": [ + { + "File": { + "Name": "www.example.org.key", + "UID": "33", + "GID": "33", + "Mode": 384 + }, + "SecretID": "fpjqlhnwb19zds35k8wn80lq9", + "SecretName": "example_org_domain_key" + } + ] + }, + "LogDriver": { + "Name": "json-file", + "Options": { + "max-file": "3", + "max-size": "10M" + } + }, + "Placement": {}, + "Resources": { + "Limits": { + "MemoryBytes": 104857600 + }, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "on-failure", + "Delay": 10000000000, + "MaxAttempts": 10 + } + }, + "Mode": { + "Replicated": { + "Replicas": 4 + } + }, + "UpdateConfig": { + "Parallelism": 2, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Ports": [ + { + "Protocol": "tcp", + "PublishedPort": 8080, + "TargetPort": 80 + } + ] + }, + "Labels": { + "foo": "bar" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceCreateResponse" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "network is not eligible for services", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services/{id}": { + "get": { + "tags": [ + "Service" + ], + "summary": "Inspect a service", + "operationId": "ServiceInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "insertDefaults", + "in": "query", + "description": "Fill empty fields with default values.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Service" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/Service" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Service" + ], + "summary": "Delete a service", + "operationId": "ServiceDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/services/{id}/update": { + "post": { + "tags": [ + "Service" + ], + "summary": "Update a service", + "operationId": "ServiceUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of service.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the service object being updated. This is\nrequired to avoid conflicting writes.\nThis version number should be the value as currently set on the\nservice *before* the update. You can find the current version by\ncalling `GET /services/{id}`\n", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "registryAuthFrom", + "in": "query", + "description": "If the `X-Registry-Auth` header is not specified, this parameter\nindicates where to find registry authorization credentials.\n", + "schema": { + "type": "string", + "default": "spec", + "enum": [ + "spec", + "previous-spec" + ] + } + }, + { + "name": "rollback", + "in": "query", + "description": "Set to this parameter to `previous` to cause a server-side rollback\nto the previous service spec. The supplied spec will be ignored in\nthis case.\n", + "schema": { + "type": "string" + } + }, + { + "name": "X-Registry-Auth", + "in": "header", + "description": "A base64url-encoded auth configuration for pulling from private\nregistries.\n\nRefer to the [authentication section](#section/Authentication) for\ndetails.\n", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServiceSpec" + }, + { + "type": "object", + "example": { + "Name": "top", + "TaskTemplate": { + "ContainerSpec": { + "Image": "busybox", + "Args": [ + "top" + ] + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {}, + "ForceUpdate": 0 + }, + "Mode": { + "Replicated": { + "Replicas": 1 + } + }, + "UpdateConfig": { + "Parallelism": 2, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Mode": "vip" + } + } + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUpdateResponse" + } + } + } + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/services/{id}/logs": { + "get": { + "tags": [ + "Service" + ], + "summary": "Get service logs", + "description": "Get `stdout` and `stderr` logs from a service. See also\n[`/containers/{id}/logs`](#operation/ContainerLogs).\n\n**Note**: This endpoint works only for services with the `local`,\n`json-file` or `journald` logging drivers.\n", + "operationId": "ServiceLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID or name of the service", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "details", + "in": "query", + "description": "Show service context and extra details provided to logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "follow", + "in": "query", + "description": "Keep connection after returning logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs.\nSpecify as an integer or `all` to output all log lines.\n", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "200": { + "description": "logs returned as a stream in response body", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "no such service", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such service: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks": { + "get": { + "tags": [ + "Task" + ], + "summary": "List tasks", + "operationId": "TaskList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the tasks list.\n\nAvailable filters:\n\n- `desired-state=(running | shutdown | accepted)`\n- `id=`\n- `label=key` or `label=\"key=value\"`\n- `name=`\n- `node=`\n- `service=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "0kzzo1i0y4jz6027t0k7aezc7", + "Version": { + "Index": 71 + }, + "CreatedAt": "2016-06-07T21:07:31.171892745Z", + "UpdatedAt": "2016-06-07T21:07:31.376370513Z", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:31.290032978Z", + "State": "running", + "Message": "started", + "ContainerStatus": { + "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035", + "PID": 677 + } + }, + "DesiredState": "running", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.10/16" + ] + } + ] + }, + { + "ID": "1yljwbmlr8er2waf8orvqpwms", + "Version": { + "Index": 30 + }, + "CreatedAt": "2016-06-07T21:07:30.019104782Z", + "UpdatedAt": "2016-06-07T21:07:30.231958098Z", + "Name": "hopeful_cori", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:30.202183143Z", + "State": "shutdown", + "Message": "shutdown", + "ContainerStatus": { + "ContainerID": "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213" + } + }, + "DesiredState": "shutdown", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.5/16" + ] + } + ] + } + ], + "items": { + "$ref": "#/components/schemas/Task" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks/{id}": { + "get": { + "tags": [ + "Task" + ], + "summary": "Inspect a task", + "operationId": "TaskInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the task", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Task" + } + } + } + }, + "404": { + "description": "no such task", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/tasks/{id}/logs": { + "get": { + "tags": [ + "Task" + ], + "summary": "Get task logs", + "description": "Get `stdout` and `stderr` logs from a task.\nSee also [`/containers/{id}/logs`](#operation/ContainerLogs).\n\n**Note**: This endpoint works only for services with the `local`,\n`json-file` or `journald` logging drivers.\n", + "operationId": "TaskLogs", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the task", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "details", + "in": "query", + "description": "Show task context and extra details provided to logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "follow", + "in": "query", + "description": "Keep connection after returning logs.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stdout", + "in": "query", + "description": "Return logs from `stdout`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "stderr", + "in": "query", + "description": "Return logs from `stderr`", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "since", + "in": "query", + "description": "Only return logs since this time, as a UNIX timestamp", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "timestamps", + "in": "query", + "description": "Add timestamps to every log line", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "tail", + "in": "query", + "description": "Only return this number of log lines from the end of the logs.\nSpecify as an integer or `all` to output all log lines.\n", + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "200": { + "description": "logs returned as a stream in response body", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "no such task", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/json": { + "example": { + "message": "No such task: c2ada9df5af8" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "application/vnd.docker.multiplexed-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets": { + "get": { + "tags": [ + "Secret" + ], + "summary": "List secrets", + "operationId": "SecretList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the secrets list.\n\nAvailable filters:\n\n- `id=`\n- `label= or label==value`\n- `name=`\n- `names=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "blt1owaxmitz71s9v5zh81zun", + "Version": { + "Index": 85 + }, + "CreatedAt": "2017-07-20T13:55:28.678958722Z", + "UpdatedAt": "2017-07-20T13:55:28.678958722Z", + "Spec": { + "Name": "mysql-passwd", + "Labels": { + "some.label": "some.value" + }, + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + }, + { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt", + "Labels": { + "foo": "bar" + } + } + } + ], + "items": { + "$ref": "#/components/schemas/Secret" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets/create": { + "post": { + "tags": [ + "Secret" + ], + "summary": "Create a secret", + "operationId": "SecretCreate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SecretSpec" + }, + { + "type": "object", + "example": { + "Name": "app-key.crt", + "Labels": { + "foo": "bar" + }, + "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==", + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + } + ] + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/secrets/{id}": { + "get": { + "tags": [ + "Secret" + ], + "summary": "Inspect a secret", + "operationId": "SecretInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the secret", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Secret" + }, + "example": { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt", + "Labels": { + "foo": "bar" + }, + "Driver": { + "Name": "secret-bucket", + "Options": { + "OptionA": "value for driver option A", + "OptionB": "value for driver option B" + } + } + } + } + } + } + }, + "404": { + "description": "secret not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Secret" + ], + "summary": "Delete a secret", + "operationId": "SecretDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the secret", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "secret not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/secrets/{id}/update": { + "post": { + "tags": [ + "Secret" + ], + "summary": "Update a Secret", + "operationId": "SecretUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the secret", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the secret object being updated. This is\nrequired to avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "The spec of the secret to update. Currently, only the Labels field\ncan be updated. All other fields must remain unchanged from the\n[SecretInspect endpoint](#operation/SecretInspect) response values.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SecretSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/SecretSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such secret", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/configs": { + "get": { + "tags": [ + "Config" + ], + "summary": "List configs", + "operationId": "ConfigList", + "parameters": [ + { + "name": "filters", + "in": "query", + "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the configs list.\n\nAvailable filters:\n\n- `id=`\n- `label= or label==value`\n- `name=`\n- `names=`\n", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "type": "array", + "example": [ + { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "server.conf" + } + } + ], + "items": { + "$ref": "#/components/schemas/Config" + } + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/configs/create": { + "post": { + "tags": [ + "Config" + ], + "summary": "Create a config", + "operationId": "ConfigCreate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ConfigSpec" + }, + { + "type": "object", + "example": { + "Name": "server.conf", + "Labels": { + "foo": "bar" + }, + "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + } + } + ] + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdResponse" + } + } + } + }, + "409": { + "description": "name conflicts with an existing object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/configs/{id}": { + "get": { + "tags": [ + "Config" + ], + "summary": "Inspect a config", + "operationId": "ConfigInspect", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the config", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "no error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Config" + }, + "example": { + "ID": "ktnbjxoalbkvbvedmg1urrz8h", + "Version": { + "Index": 11 + }, + "CreatedAt": "2016-11-05T01:20:17.327670065Z", + "UpdatedAt": "2016-11-05T01:20:17.327670065Z", + "Spec": { + "Name": "app-dev.crt" + } + } + } + } + }, + "404": { + "description": "config not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Config" + ], + "summary": "Delete a config", + "operationId": "ConfigDelete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "ID of the config", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "no error", + "content": {} + }, + "404": { + "description": "config not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/configs/{id}/update": { + "post": { + "tags": [ + "Config" + ], + "summary": "Update a Config", + "operationId": "ConfigUpdate", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID or name of the config", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "query", + "description": "The version number of the config object being updated. This is\nrequired to avoid conflicting writes.\n", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "The spec of the config to update. Currently, only the Labels field\ncan be updated. All other fields must remain unchanged from the\n[ConfigInspect endpoint](#operation/ConfigInspect) response values.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigSpec" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ConfigSpec" + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "no error", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "no such config", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "node is not part of a swarm", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/distribution/{name}/json": { + "get": { + "tags": [ + "Distribution" + ], + "summary": "Get image information from the registry", + "description": "Return image digest and platform information by contacting the registry.\n", + "operationId": "DistributionInspect", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Image name or id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "descriptor and platform information", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DistributionInspect" + } + } + } + }, + "401": { + "description": "Failed authentication or no image found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "example": { + "message": "No such image: someimage (tag: latest)" + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/session": { + "post": { + "tags": [ + "Session" + ], + "summary": "Initialize interactive session", + "description": "Start a new interactive session with a server. Session allows server to\ncall back to the client for advanced capabilities.\n\n### Hijacking\n\nThis endpoint hijacks the HTTP connection to HTTP2 transport that allows\nthe client to expose gPRC services on that connection.\n\nFor example, the client sends this request to upgrade the connection:\n\n```\nPOST /session HTTP/1.1\nUpgrade: h2c\nConnection: Upgrade\n```\n\nThe Docker daemon responds with a `101 UPGRADED` response follow with\nthe raw stream:\n\n```\nHTTP/1.1 101 UPGRADED\nConnection: Upgrade\nUpgrade: h2c\n```\n", + "operationId": "Session", + "responses": { + "101": { + "description": "no error, hijacking successful", + "content": {} + }, + "400": { + "description": "bad parameter", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "server error", + "content": { + "application/vnd.docker.raw-stream": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Port": { + "required": [ + "PrivatePort", + "Type" + ], + "type": "object", + "properties": { + "IP": { + "type": "string", + "description": "Host IP address that the container's port is mapped to", + "format": "ip-address" + }, + "PrivatePort": { + "type": "integer", + "description": "Port on the container", + "format": "uint16", + "nullable": false + }, + "PublicPort": { + "type": "integer", + "description": "Port exposed on the host", + "format": "uint16" + }, + "Type": { + "type": "string", + "nullable": false, + "enum": [ + "tcp", + "udp", + "sctp" + ] + } + }, + "description": "An open port on a container", + "example": { + "PrivatePort": 8080, + "PublicPort": 80, + "Type": "tcp" + } + }, + "MountPoint": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "description": "The mount type:\n\n- `bind` a mount of a file or directory from the host into the container.\n- `volume` a docker volume with the given `Name`.\n- `tmpfs` a `tmpfs`.\n- `npipe` a named pipe from the host into the container.\n- `cluster` a Swarm cluster volume\n", + "example": "volume", + "enum": [ + "bind", + "volume", + "tmpfs", + "npipe", + "cluster" + ] + }, + "Name": { + "type": "string", + "description": "Name is the name reference to the underlying data defined by `Source`\ne.g., the volume name.\n", + "example": "myvolume" + }, + "Source": { + "type": "string", + "description": "Source location of the mount.\n\nFor volumes, this contains the storage location of the volume (within\n`/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains\nthe source (host) part of the bind-mount. For `tmpfs` mount points, this\nfield is empty.\n", + "example": "/var/lib/docker/volumes/myvolume/_data" + }, + "Destination": { + "type": "string", + "description": "Destination is the path relative to the container root (`/`) where\nthe `Source` is mounted inside the container.\n", + "example": "/usr/share/nginx/html/" + }, + "Driver": { + "type": "string", + "description": "Driver is the volume driver used to create the volume (if it is a volume).\n", + "example": "local" + }, + "Mode": { + "type": "string", + "description": "Mode is a comma separated list of options supplied by the user when\ncreating the bind/volume mount.\n\nThe default is platform-specific (`\"z\"` on Linux, empty on Windows).\n", + "example": "z" + }, + "RW": { + "type": "boolean", + "description": "Whether the mount is mounted writable (read-write).\n", + "example": true + }, + "Propagation": { + "type": "string", + "description": "Propagation describes how mounts are propagated from the host into the\nmount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt)\nfor details. This field is not used on Windows.\n", + "example": "" + } + }, + "description": "MountPoint represents a mount point configuration inside the container.\nThis is used for reporting the mountpoints in use by a container.\n" + }, + "DeviceMapping": { + "type": "object", + "properties": { + "PathOnHost": { + "type": "string" + }, + "PathInContainer": { + "type": "string" + }, + "CgroupPermissions": { + "type": "string" + } + }, + "description": "A device mapping between the host and container", + "example": { + "PathOnHost": "/dev/deviceName", + "PathInContainer": "/dev/deviceName", + "CgroupPermissions": "mrw" + } + }, + "DeviceRequest": { + "type": "object", + "properties": { + "Driver": { + "type": "string", + "example": "nvidia" + }, + "Count": { + "type": "integer", + "example": -1 + }, + "DeviceIDs": { + "type": "array", + "example": [ + "0", + "1", + "GPU-fef8089b-4820-abfc-e83e-94318197576e" + ], + "items": { + "type": "string" + } + }, + "Capabilities": { + "type": "array", + "description": "A list of capabilities; an OR list of AND lists of capabilities.\n", + "example": [ + [ + "gpu", + "nvidia", + "compute" + ] + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver-specific options, specified as a key/value pairs. These options\nare passed directly to the driver.\n" + } + }, + "description": "A request for devices to be sent to device drivers" + }, + "ThrottleDevice": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Device path" + }, + "Rate": { + "minimum": 0, + "type": "integer", + "description": "Rate", + "format": "int64" + } + } + }, + "Mount": { + "type": "object", + "properties": { + "Target": { + "type": "string", + "description": "Container path." + }, + "Source": { + "type": "string", + "description": "Mount source (e.g. a volume name, a host path)." + }, + "Type": { + "type": "string", + "description": "The mount type. Available types:\n\n- `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container.\n- `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.\n- `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs.\n- `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container.\n- `cluster` a Swarm cluster volume\n", + "enum": [ + "bind", + "volume", + "tmpfs", + "npipe", + "cluster" + ] + }, + "ReadOnly": { + "type": "boolean", + "description": "Whether the mount should be read-only." + }, + "Consistency": { + "type": "string", + "description": "The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`." + }, + "BindOptions": { + "type": "object", + "properties": { + "Propagation": { + "type": "string", + "description": "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.", + "enum": [ + "private", + "rprivate", + "shared", + "rshared", + "slave", + "rslave" + ] + }, + "NonRecursive": { + "type": "boolean", + "description": "Disable recursive bind mount.", + "default": false + }, + "CreateMountpoint": { + "type": "boolean", + "description": "Create mount point on host if missing", + "default": false + }, + "ReadOnlyNonRecursive": { + "type": "boolean", + "description": "Make the mount non-recursively read-only, but still leave the mount recursive\n(unless NonRecursive is set to `true` in conjunction).\n\nAddded in v1.44, before that version all read-only mounts were\nnon-recursive by default. To match the previous behaviour this\nwill default to `true` for clients on versions prior to v1.44.\n", + "default": false + }, + "ReadOnlyForceRecursive": { + "type": "boolean", + "description": "Raise an error if the mount cannot be made recursively read-only.", + "default": false + } + }, + "description": "Optional configuration for the `bind` type." + }, + "VolumeOptions": { + "type": "object", + "properties": { + "NoCopy": { + "type": "boolean", + "description": "Populate volume with data from the target.", + "default": false + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "DriverConfig": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the driver to use to create the volume." + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "key/value map of driver specific options." + } + }, + "description": "Map of driver specific options" + }, + "Subpath": { + "type": "string", + "description": "Source path inside the volume. Must be relative without any back traversals.", + "example": "dir-inside-volume/subdirectory" + } + }, + "description": "Optional configuration for the `volume` type." + }, + "TmpfsOptions": { + "type": "object", + "properties": { + "SizeBytes": { + "type": "integer", + "description": "The size for the tmpfs mount in bytes.", + "format": "int64" + }, + "Mode": { + "type": "integer", + "description": "The permission mode for the tmpfs mount in an integer." + } + }, + "description": "Optional configuration for the `tmpfs` type." + } + } + }, + "RestartPolicy": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "- Empty string means not to restart\n- `no` Do not automatically restart\n- `always` Always restart\n- `unless-stopped` Restart always except when the user has manually stopped the container\n- `on-failure` Restart only when the container exit code is non-zero\n", + "enum": [ + "", + "no", + "always", + "unless-stopped", + "on-failure" + ] + }, + "MaximumRetryCount": { + "type": "integer", + "description": "If `on-failure` is used, the number of times to retry before giving up.\n" + } + }, + "description": "The behavior to apply when the container exits. The default is not to\nrestart.\n\nAn ever increasing delay (double the previous delay, starting at 100ms) is\nadded before each restart to prevent flooding the server.\n" + }, + "Resources": { + "type": "object", + "properties": { + "CpuShares": { + "type": "integer", + "description": "An integer value representing this container's relative CPU weight\nversus other containers.\n" + }, + "Memory": { + "type": "integer", + "description": "Memory limit in bytes.", + "format": "int64", + "default": 0 + }, + "CgroupParent": { + "type": "string", + "description": "Path to `cgroups` under which the container's `cgroup` is created. If\nthe path is not absolute, the path is considered to be relative to the\n`cgroups` path of the init process. Cgroups are created if they do not\nalready exist.\n" + }, + "BlkioWeight": { + "maximum": 1000, + "minimum": 0, + "type": "integer", + "description": "Block IO weight (relative weight)." + }, + "BlkioWeightDevice": { + "type": "array", + "description": "Block IO weight (relative device weight) in the form:\n\n```\n[{\"Path\": \"device_path\", \"Weight\": weight}]\n```\n", + "items": { + "type": "object", + "properties": { + "Path": { + "type": "string" + }, + "Weight": { + "minimum": 0, + "type": "integer" + } + } + } + }, + "BlkioDeviceReadBps": { + "type": "array", + "description": "Limit read rate (bytes per second) from a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceWriteBps": { + "type": "array", + "description": "Limit write rate (bytes per second) to a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceReadIOps": { + "type": "array", + "description": "Limit read rate (IO per second) from a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "BlkioDeviceWriteIOps": { + "type": "array", + "description": "Limit write rate (IO per second) to a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n", + "items": { + "$ref": "#/components/schemas/ThrottleDevice" + } + }, + "CpuPeriod": { + "type": "integer", + "description": "The length of a CPU period in microseconds.", + "format": "int64" + }, + "CpuQuota": { + "type": "integer", + "description": "Microseconds of CPU time that the container can get in a CPU period.\n", + "format": "int64" + }, + "CpuRealtimePeriod": { + "type": "integer", + "description": "The length of a CPU real-time period in microseconds. Set to 0 to\nallocate no time allocated to real-time tasks.\n", + "format": "int64" + }, + "CpuRealtimeRuntime": { + "type": "integer", + "description": "The length of a CPU real-time runtime in microseconds. Set to 0 to\nallocate no time allocated to real-time tasks.\n", + "format": "int64" + }, + "CpusetCpus": { + "type": "string", + "description": "CPUs in which to allow execution (e.g., `0-3`, `0,1`).\n", + "example": "0-3" + }, + "CpusetMems": { + "type": "string", + "description": "Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only\neffective on NUMA systems.\n" + }, + "Devices": { + "type": "array", + "description": "A list of devices to add to the container.", + "items": { + "$ref": "#/components/schemas/DeviceMapping" + } + }, + "DeviceCgroupRules": { + "type": "array", + "description": "a list of cgroup rules to apply to the container", + "items": { + "type": "string", + "example": "c 13:* rwm" + } + }, + "DeviceRequests": { + "type": "array", + "description": "A list of requests for devices to be sent to device drivers.\n", + "items": { + "$ref": "#/components/schemas/DeviceRequest" + } + }, + "KernelMemoryTCP": { + "type": "integer", + "description": "Hard limit for kernel TCP buffer memory (in bytes). Depending on the\nOCI runtime in use, this option may be ignored. It is no longer supported\nby the default (runc) runtime.\n\nThis field is omitted when empty.\n", + "format": "int64" + }, + "MemoryReservation": { + "type": "integer", + "description": "Memory soft limit in bytes.", + "format": "int64" + }, + "MemorySwap": { + "type": "integer", + "description": "Total memory limit (memory + swap). Set as `-1` to enable unlimited\nswap.\n", + "format": "int64" + }, + "MemorySwappiness": { + "maximum": 100, + "minimum": 0, + "type": "integer", + "description": "Tune a container's memory swappiness behavior. Accepts an integer\nbetween 0 and 100.\n", + "format": "int64" + }, + "NanoCpus": { + "type": "integer", + "description": "CPU quota in units of 10-9 CPUs.", + "format": "int64" + }, + "OomKillDisable": { + "type": "boolean", + "description": "Disable OOM Killer for the container." + }, + "Init": { + "type": "boolean", + "description": "Run an init inside the container that forwards signals and reaps\nprocesses. This field is omitted if empty, and the default (as\nconfigured on the daemon) is used.\n", + "nullable": true + }, + "PidsLimit": { + "type": "integer", + "description": "Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null`\nto not change.\n", + "format": "int64", + "nullable": true + }, + "Ulimits": { + "type": "array", + "description": "A list of resource limits to set in the container. For example:\n\n```\n{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}\n```\n", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of ulimit" + }, + "Soft": { + "type": "integer", + "description": "Soft limit" + }, + "Hard": { + "type": "integer", + "description": "Hard limit" + } + } + } + }, + "CpuCount": { + "type": "integer", + "description": "The number of usable CPUs (Windows only).\n\nOn Windows Server containers, the processor resource controls are\nmutually exclusive. The order of precedence is `CPUCount` first, then\n`CPUShares`, and `CPUPercent` last.\n", + "format": "int64" + }, + "CpuPercent": { + "type": "integer", + "description": "The usable percentage of the available CPUs (Windows only).\n\nOn Windows Server containers, the processor resource controls are\nmutually exclusive. The order of precedence is `CPUCount` first, then\n`CPUShares`, and `CPUPercent` last.\n", + "format": "int64" + }, + "IOMaximumIOps": { + "type": "integer", + "description": "Maximum IOps for the container system drive (Windows only)", + "format": "int64" + }, + "IOMaximumBandwidth": { + "type": "integer", + "description": "Maximum IO in bytes per second for the container system drive\n(Windows only).\n", + "format": "int64" + } + }, + "description": "A container's resources (cgroups config, ulimits, etc)" + }, + "Limit": { + "type": "object", + "properties": { + "NanoCPUs": { + "type": "integer", + "format": "int64", + "example": 4000000000 + }, + "MemoryBytes": { + "type": "integer", + "format": "int64", + "example": 8272408576 + }, + "Pids": { + "type": "integer", + "description": "Limits the maximum number of PIDs in the container. Set `0` for unlimited.\n", + "format": "int64", + "example": 100, + "default": 0 + } + }, + "description": "An object describing a limit on resources which can be requested by a task.\n" + }, + "ResourceObject": { + "type": "object", + "properties": { + "NanoCPUs": { + "type": "integer", + "format": "int64", + "example": 4000000000 + }, + "MemoryBytes": { + "type": "integer", + "format": "int64", + "example": 8272408576 + }, + "GenericResources": { + "$ref": "#/components/schemas/GenericResources" + } + }, + "description": "An object describing the resources which can be advertised by a node and\nrequested by a task.\n" + }, + "GenericResources": { + "type": "array", + "description": "User-defined resources can be either Integer resources (e.g, `SSD=3`) or\nString resources (e.g, `GPU=UUID1`).\n", + "example": [ + { + "DiscreteResourceSpec": { + "Kind": "SSD", + "Value": 3 + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID1" + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID2" + } + } + ], + "items": { + "type": "object", + "properties": { + "NamedResourceSpec": { + "type": "object", + "properties": { + "Kind": { + "type": "string" + }, + "Value": { + "type": "string" + } + } + }, + "DiscreteResourceSpec": { + "type": "object", + "properties": { + "Kind": { + "type": "string" + }, + "Value": { + "type": "integer", + "format": "int64" + } + } + } + } + } + }, + "HealthConfig": { + "type": "object", + "properties": { + "Test": { + "type": "array", + "description": "The test to perform. Possible values are:\n\n- `[]` inherit healthcheck from image or parent image\n- `[\"NONE\"]` disable healthcheck\n- `[\"CMD\", args...]` exec arguments directly\n- `[\"CMD-SHELL\", command]` run command with system's default shell\n", + "items": { + "type": "string" + } + }, + "Interval": { + "type": "integer", + "description": "The time to wait between checks in nanoseconds. It should be 0 or at\nleast 1000000 (1 ms). 0 means inherit.\n", + "format": "int64" + }, + "Timeout": { + "type": "integer", + "description": "The time to wait before considering the check to have hung. It should\nbe 0 or at least 1000000 (1 ms). 0 means inherit.\n", + "format": "int64" + }, + "Retries": { + "type": "integer", + "description": "The number of consecutive failures needed to consider a container as\nunhealthy. 0 means inherit.\n" + }, + "StartPeriod": { + "type": "integer", + "description": "Start period for the container to initialize before starting\nhealth-retries countdown in nanoseconds. It should be 0 or at least\n1000000 (1 ms). 0 means inherit.\n", + "format": "int64" + }, + "StartInterval": { + "type": "integer", + "description": "The time to wait between checks in nanoseconds during the start period.\nIt should be 0 or at least 1000000 (1 ms). 0 means inherit.\n", + "format": "int64" + } + }, + "description": "A test to perform to check that the container is healthy." + }, + "Health": { + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "Status is one of `none`, `starting`, `healthy` or `unhealthy`\n\n- \"none\" Indicates there is no healthcheck\n- \"starting\" Starting indicates that the container is not yet ready\n- \"healthy\" Healthy indicates that the container is running correctly\n- \"unhealthy\" Unhealthy indicates that the container has a problem\n", + "example": "healthy", + "enum": [ + "none", + "starting", + "healthy", + "unhealthy" + ] + }, + "FailingStreak": { + "type": "integer", + "description": "FailingStreak is the number of consecutive failures", + "example": 0 + }, + "Log": { + "type": "array", + "description": "Log contains the last few results (oldest first)\n", + "items": { + "$ref": "#/components/schemas/HealthcheckResult" + } + } + }, + "description": "Health stores information about the container's healthcheck results.\n", + "nullable": true, + "x-nullable": true + }, + "HealthcheckResult": { + "type": "object", + "properties": { + "Start": { + "type": "string", + "description": "Date and time at which this check started in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "date-time", + "example": "2020-01-04T10:44:24.496525531Z" + }, + "End": { + "type": "string", + "description": "Date and time at which this check ended in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2020-01-04T10:45:21.364524523Z" + }, + "ExitCode": { + "type": "integer", + "description": "ExitCode meanings:\n\n- `0` healthy\n- `1` unhealthy\n- `2` reserved (considered unhealthy)\n- other values: error running probe\n", + "example": 0 + }, + "Output": { + "type": "string", + "description": "Output from last check" + } + }, + "description": "HealthcheckResult stores information about a single run of a healthcheck probe\n", + "nullable": true, + "x-nullable": true + }, + "HostConfig": { + "description": "Container configuration that depends on the host we are running on", + "allOf": [ + { + "$ref": "#/components/schemas/Resources" + }, + { + "type": "object", + "properties": { + "Binds": { + "type": "array", + "description": "A list of volume bindings for this container. Each volume binding\nis a string in one of these forms:\n\n- `host-src:container-dest[:options]` to bind-mount a host path\n into the container. Both `host-src`, and `container-dest` must\n be an _absolute_ path.\n- `volume-name:container-dest[:options]` to bind-mount a volume\n managed by a volume driver into the container. `container-dest`\n must be an _absolute_ path.\n\n`options` is an optional, comma-delimited list of:\n\n- `nocopy` disables automatic copying of data from the container\n path to the volume. The `nocopy` flag only applies to named volumes.\n- `[ro|rw]` mounts a volume read-only or read-write, respectively.\n If omitted or set to `rw`, volumes are mounted read-write.\n- `[z|Z]` applies SELinux labels to allow or deny multiple containers\n to read and write to the same volume.\n - `z`: a _shared_ content label is applied to the content. This\n label indicates that multiple containers can share the volume\n content, for both reading and writing.\n - `Z`: a _private unshared_ label is applied to the content.\n This label indicates that only the current container can use\n a private volume. Labeling systems such as SELinux require\n proper labels to be placed on volume content that is mounted\n into a container. Without a label, the security system can\n prevent a container's processes from using the content. By\n default, the labels set by the host operating system are not\n modified.\n- `[[r]shared|[r]slave|[r]private]` specifies mount\n [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt).\n This only applies to bind-mounted volumes, not internal volumes\n or named volumes. Mount propagation requires the source mount\n point (the location where the source directory is mounted in the\n host operating system) to have the correct propagation properties.\n For shared volumes, the source mount point must be set to `shared`.\n For slave volumes, the mount must be set to either `shared` or\n `slave`.\n", + "items": { + "type": "string" + } + }, + "ContainerIDFile": { + "type": "string", + "description": "Path to a file where the container ID is written" + }, + "LogConfig": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "enum": [ + "json-file", + "syslog", + "journald", + "gelf", + "fluentd", + "awslogs", + "splunk", + "etwlogs", + "none" + ] + }, + "Config": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "The logging configuration for this container" + }, + "NetworkMode": { + "type": "string", + "description": "Network mode to use for this container. Supported standard values\nare: `bridge`, `host`, `none`, and `container:`. Any\nother value is taken as a custom network's name to which this\ncontainer should connect to.\n" + }, + "PortBindings": { + "$ref": "#/components/schemas/PortMap" + }, + "RestartPolicy": { + "$ref": "#/components/schemas/RestartPolicy" + }, + "AutoRemove": { + "type": "boolean", + "description": "Automatically remove the container when the container's process\nexits. This has no effect if `RestartPolicy` is set.\n" + }, + "VolumeDriver": { + "type": "string", + "description": "Driver that this container uses to mount volumes." + }, + "VolumesFrom": { + "type": "array", + "description": "A list of volumes to inherit from another container, specified in\nthe form `[:]`.\n", + "items": { + "type": "string" + } + }, + "Mounts": { + "type": "array", + "description": "Specification for mounts to be added to the container.\n", + "items": { + "$ref": "#/components/schemas/Mount" + } + }, + "ConsoleSize": { + "maxItems": 2, + "minItems": 2, + "type": "array", + "description": "Initial console size, as an `[height, width]` array.\n", + "nullable": true, + "items": { + "minimum": 0, + "type": "integer" + } + }, + "Annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Arbitrary non-identifying metadata attached to container and\nprovided to the runtime when the container is started.\n" + }, + "CapAdd": { + "type": "array", + "description": "A list of kernel capabilities to add to the container. Conflicts\nwith option 'Capabilities'.\n", + "items": { + "type": "string" + } + }, + "CapDrop": { + "type": "array", + "description": "A list of kernel capabilities to drop from the container. Conflicts\nwith option 'Capabilities'.\n", + "items": { + "type": "string" + } + }, + "CgroupnsMode": { + "type": "string", + "description": "cgroup namespace mode for the container. Possible values are:\n\n- `\"private\"`: the container runs in its own private cgroup namespace\n- `\"host\"`: use the host system's cgroup namespace\n\nIf not specified, the daemon default is used, which can either be `\"private\"`\nor `\"host\"`, depending on daemon version, kernel support and configuration.\n", + "enum": [ + "private", + "host" + ] + }, + "Dns": { + "type": "array", + "description": "A list of DNS servers for the container to use.", + "items": { + "type": "string" + } + }, + "DnsOptions": { + "type": "array", + "description": "A list of DNS options.", + "items": { + "type": "string" + } + }, + "DnsSearch": { + "type": "array", + "description": "A list of DNS search domains.", + "items": { + "type": "string" + } + }, + "ExtraHosts": { + "type": "array", + "description": "A list of hostnames/IP mappings to add to the container's `/etc/hosts`\nfile. Specified in the form `[\"hostname:IP\"]`.\n", + "items": { + "type": "string" + } + }, + "GroupAdd": { + "type": "array", + "description": "A list of additional groups that the container process will run as.\n", + "items": { + "type": "string" + } + }, + "IpcMode": { + "type": "string", + "description": "IPC sharing mode for the container. Possible values are:\n\n- `\"none\"`: own private IPC namespace, with /dev/shm not mounted\n- `\"private\"`: own private IPC namespace\n- `\"shareable\"`: own private IPC namespace, with a possibility to share it with other containers\n- `\"container:\"`: join another (shareable) container's IPC namespace\n- `\"host\"`: use the host system's IPC namespace\n\nIf not specified, daemon default is used, which can either be `\"private\"`\nor `\"shareable\"`, depending on daemon version and configuration.\n" + }, + "Cgroup": { + "type": "string", + "description": "Cgroup to use for the container." + }, + "Links": { + "type": "array", + "description": "A list of links for the container in the form `container_name:alias`.\n", + "items": { + "type": "string" + } + }, + "OomScoreAdj": { + "type": "integer", + "description": "An integer value containing the score given to the container in\norder to tune OOM killer preferences.\n", + "example": 500 + }, + "PidMode": { + "type": "string", + "description": "Set the PID (Process) Namespace mode for the container. It can be\neither:\n\n- `\"container:\"`: joins another container's PID namespace\n- `\"host\"`: use the host's PID namespace inside the container\n" + }, + "Privileged": { + "type": "boolean", + "description": "Gives the container full access to the host." + }, + "PublishAllPorts": { + "type": "boolean", + "description": "Allocates an ephemeral host port for all of a container's\nexposed ports.\n\nPorts are de-allocated when the container stops and allocated when\nthe container starts. The allocated port might be changed when\nrestarting the container.\n\nThe port is selected from the ephemeral port range that depends on\nthe kernel. For example, on Linux the range is defined by\n`/proc/sys/net/ipv4/ip_local_port_range`.\n" + }, + "ReadonlyRootfs": { + "type": "boolean", + "description": "Mount the container's root filesystem as read only." + }, + "SecurityOpt": { + "type": "array", + "description": "A list of string values to customize labels for MLS systems, such\nas SELinux.\n", + "items": { + "type": "string" + } + }, + "StorageOpt": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Storage driver options for this container, in the form `{\"size\": \"120G\"}`.\n" + }, + "Tmpfs": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of container directories which should be replaced by tmpfs\nmounts, and their corresponding mount options. For example:\n\n```\n{ \"/run\": \"rw,noexec,nosuid,size=65536k\" }\n```\n" + }, + "UTSMode": { + "type": "string", + "description": "UTS namespace to use for the container." + }, + "UsernsMode": { + "type": "string", + "description": "Sets the usernamespace mode for the container when usernamespace\nremapping option is enabled.\n" + }, + "ShmSize": { + "minimum": 0, + "type": "integer", + "description": "Size of `/dev/shm` in bytes. If omitted, the system uses 64MB.\n", + "format": "int64" + }, + "Sysctls": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A list of kernel parameters (sysctls) to set in the container.\nFor example:\n\n```\n{\"net.ipv4.ip_forward\": \"1\"}\n```\n" + }, + "Runtime": { + "type": "string", + "description": "Runtime to use with this container." + }, + "Isolation": { + "type": "string", + "description": "Isolation technology of the container. (Windows only)\n", + "enum": [ + "default", + "process", + "hyperv" + ] + }, + "MaskedPaths": { + "type": "array", + "description": "The list of paths to be masked inside the container (this overrides\nthe default set of paths).\n", + "items": { + "type": "string" + } + }, + "ReadonlyPaths": { + "type": "array", + "description": "The list of paths to be set as read-only inside the container\n(this overrides the default set of paths).\n", + "items": { + "type": "string" + } + } + } + } + ] + }, + "ContainerConfig": { + "type": "object", + "properties": { + "Hostname": { + "type": "string", + "description": "The hostname to use for the container, as a valid RFC 1123 hostname.\n", + "example": "439f4e91bd1d" + }, + "Domainname": { + "type": "string", + "description": "The domain name to use for the container.\n" + }, + "User": { + "type": "string", + "description": "The user that commands are run as inside the container." + }, + "AttachStdin": { + "type": "boolean", + "description": "Whether to attach to `stdin`.", + "default": false + }, + "AttachStdout": { + "type": "boolean", + "description": "Whether to attach to `stdout`.", + "default": true + }, + "AttachStderr": { + "type": "boolean", + "description": "Whether to attach to `stderr`.", + "default": true + }, + "ExposedPorts": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "An object mapping ports to an empty object in the form:\n\n`{\"/\": {}}`\n", + "nullable": true, + "example": { + "80/tcp": {}, + "443/tcp": {} + } + }, + "Tty": { + "type": "boolean", + "description": "Attach standard streams to a TTY, including `stdin` if it is not closed.\n", + "default": false + }, + "OpenStdin": { + "type": "boolean", + "description": "Open `stdin`", + "default": false + }, + "StdinOnce": { + "type": "boolean", + "description": "Close `stdin` after one attached client disconnects", + "default": false + }, + "Env": { + "type": "array", + "description": "A list of environment variables to set inside the container in the\nform `[\"VAR=value\", ...]`. A variable without `=` is removed from the\nenvironment, rather than to have an empty value.\n", + "example": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "items": { + "type": "string" + } + }, + "Cmd": { + "type": "array", + "description": "Command to run specified as a string or an array of strings.\n", + "example": [ + "/bin/sh" + ], + "items": { + "type": "string" + } + }, + "Healthcheck": { + "$ref": "#/components/schemas/HealthConfig" + }, + "ArgsEscaped": { + "type": "boolean", + "description": "Command is already escaped (Windows only)", + "nullable": true, + "example": false, + "default": false + }, + "Image": { + "type": "string", + "description": "The name (or reference) of the image to use when creating the container,\nor which was used when the container was created.\n", + "example": "example-image:1.0" + }, + "Volumes": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "An object mapping mount point paths inside the container to empty\nobjects.\n" + }, + "WorkingDir": { + "type": "string", + "description": "The working directory for commands to run in.", + "example": "/public/" + }, + "Entrypoint": { + "type": "array", + "description": "The entry point for the container as a string or an array of strings.\n\nIf the array consists of exactly one empty string (`[\"\"]`) then the\nentry point is reset to system default (i.e., the entry point used by\ndocker when there is no `ENTRYPOINT` instruction in the `Dockerfile`).\n", + "example": [], + "items": { + "type": "string" + } + }, + "NetworkDisabled": { + "type": "boolean", + "description": "Disable networking for the container.", + "nullable": true + }, + "MacAddress": { + "type": "string", + "description": "MAC address of the container.\n\nDeprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead.\n", + "nullable": true + }, + "OnBuild": { + "type": "array", + "description": "`ONBUILD` metadata that were defined in the image's `Dockerfile`.\n", + "nullable": true, + "example": [], + "items": { + "type": "string" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "StopSignal": { + "type": "string", + "description": "Signal to stop a container as a string or unsigned integer.\n", + "nullable": true, + "example": "SIGTERM" + }, + "StopTimeout": { + "type": "integer", + "description": "Timeout to stop a container in seconds.", + "nullable": true + }, + "Shell": { + "type": "array", + "description": "Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell.\n", + "nullable": true, + "example": [ + "/bin/sh", + "-c" + ], + "items": { + "type": "string" + } + } + }, + "description": "Configuration for a container that is portable between hosts.\n\nWhen used as `ContainerConfig` field in an image, `ContainerConfig` is an\noptional field containing the configuration of the container that was last\ncommitted when creating the image.\n\nPrevious versions of Docker builder used this field to store build cache,\nand it is not in active use anymore.\n" + }, + "NetworkingConfig": { + "type": "object", + "properties": { + "EndpointsConfig": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + }, + "description": "A mapping of network name to endpoint configuration for that network.\nThe endpoint configuration can be left empty to connect to that\nnetwork with no particular endpoint configuration.\n" + } + }, + "description": "NetworkingConfig represents the container's networking configuration for\neach of its interfaces.\nIt is used for the networking configs specified in the `docker create`\nand `docker network connect` commands.\n", + "example": { + "EndpointsConfig": { + "isolated_nw": { + "IPAMConfig": { + "IPv4Address": "172.20.30.33", + "IPv6Address": "2001:db8:abcd::3033", + "LinkLocalIPs": [ + "169.254.34.68", + "fe80::3468" + ] + }, + "MacAddress": "02:42:ac:12:05:02", + "Links": [ + "container_1", + "container_2" + ], + "Aliases": [ + "server_x", + "server_y" + ] + }, + "database_nw": {} + } + } + }, + "NetworkSettings": { + "type": "object", + "properties": { + "Bridge": { + "type": "string", + "description": "Name of the default bridge interface when dockerd's --bridge flag is set.\n", + "example": "docker0" + }, + "SandboxID": { + "type": "string", + "description": "SandboxID uniquely represents a container's network stack.", + "example": "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3" + }, + "HairpinMode": { + "type": "boolean", + "description": "Indicates if hairpin NAT should be enabled on the virtual interface.\n\nDeprecated: This field is never set and will be removed in a future release.\n", + "example": false + }, + "LinkLocalIPv6Address": { + "type": "string", + "description": "IPv6 unicast address using the link-local prefix.\n\nDeprecated: This field is never set and will be removed in a future release.\n", + "example": "" + }, + "LinkLocalIPv6PrefixLen": { + "type": "integer", + "description": "Prefix length of the IPv6 unicast address.\n\nDeprecated: This field is never set and will be removed in a future release.\n" + }, + "Ports": { + "$ref": "#/components/schemas/PortMap" + }, + "SandboxKey": { + "type": "string", + "description": "SandboxKey is the full path of the netns handle", + "example": "/var/run/docker/netns/8ab54b426c38" + }, + "SecondaryIPAddresses": { + "type": "array", + "description": "Deprecated: This field is never set and will be removed in a future release.", + "nullable": true, + "items": { + "$ref": "#/components/schemas/Address" + } + }, + "SecondaryIPv6Addresses": { + "type": "array", + "description": "Deprecated: This field is never set and will be removed in a future release.", + "nullable": true, + "items": { + "$ref": "#/components/schemas/Address" + } + }, + "EndpointID": { + "type": "string", + "description": "EndpointID uniquely represents a service endpoint in a Sandbox.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + }, + "Gateway": { + "type": "string", + "description": "Gateway address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "172.17.0.1" + }, + "GlobalIPv6Address": { + "type": "string", + "description": "Global IPv6 address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "2001:db8::5689" + }, + "GlobalIPv6PrefixLen": { + "type": "integer", + "description": "Mask length of the global IPv6 address.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": 64 + }, + "IPAddress": { + "type": "string", + "description": "IPv4 address for the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "172.17.0.4" + }, + "IPPrefixLen": { + "type": "integer", + "description": "Mask length of the IPv4 address.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": 16 + }, + "IPv6Gateway": { + "type": "string", + "description": "IPv6 gateway address for this network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "2001:db8:2::100" + }, + "MacAddress": { + "type": "string", + "description": "MAC address for the container on the default \"bridge\" network.\n\n


\n\n> **Deprecated**: This field is only propagated when attached to the\n> default \"bridge\" network. Use the information from the \"bridge\"\n> network inside the `Networks` map instead, which contains the same\n> information. This field was deprecated in Docker 1.9 and is scheduled\n> to be removed in Docker 17.12.0\n", + "example": "02:42:ac:11:00:04" + }, + "Networks": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + }, + "description": "Information about all networks that the container is connected to.\n" + } + }, + "description": "NetworkSettings exposes the network settings in the API" + }, + "Address": { + "type": "object", + "properties": { + "Addr": { + "type": "string", + "description": "IP address." + }, + "PrefixLen": { + "type": "integer", + "description": "Mask length of the IP address." + } + }, + "description": "Address represents an IPv4 or IPv6 IP address." + }, + "PortMap": { + "type": "object", + "additionalProperties": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/PortBinding" + } + }, + "description": "PortMap describes the mapping of container ports to host ports, using the\ncontainer's port-number and protocol as key in the format `/`,\nfor example, `80/udp`.\n\nIf a container's port is mapped for multiple protocols, separate entries\nare added to the mapping table.\n", + "example": { + "443/tcp": [ + { + "HostIp": "127.0.0.1", + "HostPort": "4443" + } + ], + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "80" + }, + { + "HostIp": "0.0.0.0", + "HostPort": "8080" + } + ], + "80/udp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "80" + } + ], + "53/udp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "53" + } + ] + } + }, + "PortBinding": { + "type": "object", + "properties": { + "HostIp": { + "type": "string", + "description": "Host IP address that the container's port is mapped to.", + "example": "127.0.0.1" + }, + "HostPort": { + "type": "string", + "description": "Host port number that the container's port is mapped to.", + "example": "4443" + } + }, + "description": "PortBinding represents a binding between a host IP address and a host\nport.\n" + }, + "GraphDriverData": { + "required": [ + "Data", + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the storage driver.", + "nullable": false, + "example": "overlay2" + }, + "Data": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Low-level storage metadata, provided as key/value pairs.\n\nThis information is driver-specific, and depends on the storage-driver\nin use, and should be used for informational purposes only.\n", + "nullable": false, + "example": { + "MergedDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/merged", + "UpperDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/diff", + "WorkDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/work" + } + } + }, + "description": "Information about the storage driver used to store the container's and\nimage's filesystem.\n" + }, + "FilesystemChange": { + "required": [ + "Kind", + "Path" + ], + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Path to file or directory that has changed.\n", + "nullable": false + }, + "Kind": { + "$ref": "#/components/schemas/ChangeType" + } + }, + "description": "Change in the container's filesystem.\n" + }, + "ChangeType": { + "type": "integer", + "description": "Kind of change\n\nCan be one of:\n\n- `0`: Modified (\"C\")\n- `1`: Added (\"A\")\n- `2`: Deleted (\"D\")\n", + "format": "uint8", + "nullable": false, + "enum": [ + 0, + 1, + 2 + ], + "x-nullable": false + }, + "ImageInspect": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "ID is the content-addressable ID of an image.\n\nThis identifier is a content-addressable digest calculated from the\nimage's configuration (which includes the digests of layers used by\nthe image).\n\nNote that this digest differs from the `RepoDigests` below, which\nholds digests of image manifests that reference the image.\n", + "nullable": false, + "example": "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + }, + "RepoTags": { + "type": "array", + "description": "List of image names/tags in the local image cache that reference this\nimage.\n\nMultiple image tags can refer to the same image, and this list may be\nempty if no tags reference the image, in which case the image is\n\"untagged\", in which case it can still be referenced by its ID.\n", + "example": [ + "example:1.0", + "example:latest", + "example:stable", + "internal.registry.example.com:5000/example:1.0" + ], + "items": { + "type": "string" + } + }, + "RepoDigests": { + "type": "array", + "description": "List of content-addressable digests of locally available image manifests\nthat the image is referenced from. Multiple manifests can refer to the\nsame image.\n\nThese digests are usually only available if the image was either pulled\nfrom a registry, or if the image was pushed to a registry, which is when\nthe manifest is generated and its digest calculated.\n", + "example": [ + "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", + "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + ], + "items": { + "type": "string" + } + }, + "Parent": { + "type": "string", + "description": "ID of the parent image.\n\nDepending on how the image was created, this field may be empty and\nis only set for images that were built/created locally. This field\nis empty if the image was pulled from an image registry.\n", + "nullable": false, + "example": "" + }, + "Comment": { + "type": "string", + "description": "Optional message that was set when committing or importing the image.\n", + "nullable": false, + "example": "" + }, + "Created": { + "type": "string", + "description": "Date and time at which the image was created, formatted in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n\nThis information is only available if present in the image,\nand omitted otherwise.\n", + "format": "dateTime", + "nullable": true, + "example": "2022-02-04T21:20:12.497794809Z" + }, + "Container": { + "type": "string", + "description": "The ID of the container that was used to create the image.\n\nDepending on how the image was created, this field may be empty.\n\n**Deprecated**: this field is kept for backward compatibility, but\nwill be removed in API v1.45.\n", + "example": "65974bc86f1770ae4bff79f651ebdbce166ae9aada632ee3fa9af3a264911735" + }, + "ContainerConfig": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "DockerVersion": { + "type": "string", + "description": "The version of Docker that was used to build the image.\n\nDepending on how the image was created, this field may be empty.\n", + "nullable": false, + "example": "20.10.7" + }, + "Author": { + "type": "string", + "description": "Name of the author that was specified when committing the image, or as\nspecified through MAINTAINER (deprecated) in the Dockerfile.\n", + "nullable": false, + "example": "" + }, + "Config": { + "$ref": "#/components/schemas/ContainerConfig" + }, + "Architecture": { + "type": "string", + "description": "Hardware CPU architecture that the image runs on.\n", + "nullable": false, + "example": "arm" + }, + "Variant": { + "type": "string", + "description": "CPU architecture variant (presently ARM-only).\n", + "nullable": true, + "example": "v7" + }, + "Os": { + "type": "string", + "description": "Operating System the image is built to run on.\n", + "nullable": false, + "example": "linux" + }, + "OsVersion": { + "type": "string", + "description": "Operating System version the image is built to run on (especially\nfor Windows).\n", + "nullable": true, + "example": "" + }, + "Size": { + "type": "integer", + "description": "Total size of the image including all layers it is composed of.\n", + "format": "int64", + "nullable": false, + "example": 1239828 + }, + "VirtualSize": { + "type": "integer", + "description": "Total size of the image including all layers it is composed of.\n\nDeprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead.\n", + "format": "int64", + "example": 1239828 + }, + "GraphDriver": { + "$ref": "#/components/schemas/GraphDriverData" + }, + "RootFS": { + "required": [ + "Type" + ], + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": false, + "example": "layers" + }, + "Layers": { + "type": "array", + "example": [ + "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6", + "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" + ], + "items": { + "type": "string" + } + } + }, + "description": "Information about the image's RootFS, including the layer IDs.\n" + }, + "Metadata": { + "type": "object", + "properties": { + "LastTagTime": { + "type": "string", + "description": "Date and time at which the image was last tagged in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n\nThis information is only available if the image was tagged locally,\nand omitted otherwise.\n", + "format": "dateTime", + "nullable": true, + "example": "2022-02-28T14:40:02.623929178Z" + } + }, + "description": "Additional metadata of the image in the local cache. This information\nis local to the daemon, and not part of the image itself.\n" + } + }, + "description": "Information about an image in the local image cache.\n" + }, + "ImageSummary": { + "required": [ + "Containers", + "Created", + "Id", + "Labels", + "ParentId", + "RepoDigests", + "RepoTags", + "SharedSize", + "Size" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "ID is the content-addressable ID of an image.\n\nThis identifier is a content-addressable digest calculated from the\nimage's configuration (which includes the digests of layers used by\nthe image).\n\nNote that this digest differs from the `RepoDigests` below, which\nholds digests of image manifests that reference the image.\n", + "nullable": false, + "example": "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + }, + "ParentId": { + "type": "string", + "description": "ID of the parent image.\n\nDepending on how the image was created, this field may be empty and\nis only set for images that were built/created locally. This field\nis empty if the image was pulled from an image registry.\n", + "nullable": false, + "example": "" + }, + "RepoTags": { + "type": "array", + "description": "List of image names/tags in the local image cache that reference this\nimage.\n\nMultiple image tags can refer to the same image, and this list may be\nempty if no tags reference the image, in which case the image is\n\"untagged\", in which case it can still be referenced by its ID.\n", + "nullable": false, + "example": [ + "example:1.0", + "example:latest", + "example:stable", + "internal.registry.example.com:5000/example:1.0" + ], + "items": { + "type": "string" + } + }, + "RepoDigests": { + "type": "array", + "description": "List of content-addressable digests of locally available image manifests\nthat the image is referenced from. Multiple manifests can refer to the\nsame image.\n\nThese digests are usually only available if the image was either pulled\nfrom a registry, or if the image was pushed to a registry, which is when\nthe manifest is generated and its digest calculated.\n", + "nullable": false, + "example": [ + "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", + "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + ], + "items": { + "type": "string" + } + }, + "Created": { + "type": "integer", + "description": "Date and time at which the image was created as a Unix timestamp\n(number of seconds sinds EPOCH).\n", + "nullable": false, + "example": 1644009612 + }, + "Size": { + "type": "integer", + "description": "Total size of the image including all layers it is composed of.\n", + "format": "int64", + "nullable": false, + "example": 172064416 + }, + "SharedSize": { + "type": "integer", + "description": "Total size of image layers that are shared between this image and other\nimages.\n\nThis size is not calculated by default. `-1` indicates that the value\nhas not been set / calculated.\n", + "format": "int64", + "nullable": false, + "example": 1239828 + }, + "VirtualSize": { + "type": "integer", + "description": "Total size of the image including all layers it is composed of.\n\nDeprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead.", + "format": "int64", + "example": 172064416 + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "nullable": false, + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "Containers": { + "type": "integer", + "description": "Number of containers using this image. Includes both stopped and running\ncontainers.\n\nThis size is not calculated by default, and depends on which API endpoint\nis used. `-1` indicates that the value has not been set / calculated.\n", + "nullable": false, + "example": 2 + } + }, + "x-go-name": "Summary" + }, + "AuthConfig": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "email": { + "type": "string" + }, + "serveraddress": { + "type": "string" + } + }, + "example": { + "username": "hannibal", + "password": "xxxx", + "serveraddress": "https://index.docker.io/v1/" + } + }, + "ProcessConfig": { + "type": "object", + "properties": { + "privileged": { + "type": "boolean" + }, + "user": { + "type": "string" + }, + "tty": { + "type": "boolean" + }, + "entrypoint": { + "type": "string" + }, + "arguments": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Volume": { + "required": [ + "Driver", + "Labels", + "Mountpoint", + "Name", + "Options", + "Scope" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the volume.", + "nullable": false, + "example": "tardis" + }, + "Driver": { + "type": "string", + "description": "Name of the volume driver used by the volume.", + "nullable": false, + "example": "custom" + }, + "Mountpoint": { + "type": "string", + "description": "Mount path of the volume on the host.", + "nullable": false, + "example": "/var/lib/docker/volumes/tardis" + }, + "CreatedAt": { + "type": "string", + "description": "Date/Time the volume was created.", + "format": "dateTime", + "example": "2016-06-07T20:31:11.853781916Z" + }, + "Status": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": {} + }, + "description": "Low-level details about the volume, provided by the volume driver.\nDetails are returned as a map with key/value pairs:\n`{\"key\":\"value\",\"key2\":\"value2\"}`.\n\nThe `Status` field is optional, and is omitted if the volume driver\ndoes not support this feature.\n", + "example": { + "hello": "world" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "nullable": false, + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "Scope": { + "type": "string", + "description": "The level at which the volume exists. Either `global` for cluster-wide,\nor `local` for machine level.\n", + "nullable": false, + "example": "local", + "default": "local", + "enum": [ + "local", + "global" + ] + }, + "ClusterVolume": { + "$ref": "#/components/schemas/ClusterVolume" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The driver specific options used when creating the volume.\n", + "example": { + "device": "tmpfs", + "o": "size=100m,uid=1000", + "type": "tmpfs" + } + }, + "UsageData": { + "required": [ + "RefCount", + "Size" + ], + "type": "object", + "properties": { + "Size": { + "type": "integer", + "description": "Amount of disk space used by the volume (in bytes). This information\nis only available for volumes created with the `\"local\"` volume\ndriver. For volumes created with other volume drivers, this field\nis set to `-1` (\"not available\")\n", + "format": "int64", + "nullable": false, + "default": -1 + }, + "RefCount": { + "type": "integer", + "description": "The number of containers referencing this volume. This field\nis set to `-1` if the reference-count is not available.\n", + "format": "int64", + "nullable": false, + "default": -1 + } + }, + "description": "Usage details about the volume. This information is used by the\n`GET /system/df` endpoint, and omitted in other endpoints.\n", + "nullable": true, + "x-go-name": "UsageData" + } + } + }, + "VolumeCreateOptions": { + "title": "VolumeConfig", + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The new volume's name. If not specified, Docker generates a name.\n", + "nullable": false, + "example": "tardis" + }, + "Driver": { + "type": "string", + "description": "Name of the volume driver to use.", + "nullable": false, + "example": "custom", + "default": "local" + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A mapping of driver options and values. These options are\npassed directly to the driver and are driver specific.\n", + "example": { + "device": "tmpfs", + "o": "size=100m,uid=1000", + "type": "tmpfs" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "ClusterVolumeSpec": { + "$ref": "#/components/schemas/ClusterVolumeSpec" + } + }, + "description": "Volume configuration", + "x-go-name": "CreateOptions" + }, + "VolumeListResponse": { + "title": "VolumeListResponse", + "type": "object", + "properties": { + "Volumes": { + "type": "array", + "description": "List of volumes", + "items": { + "$ref": "#/components/schemas/Volume" + } + }, + "Warnings": { + "type": "array", + "description": "Warnings that occurred when fetching the list of volumes.\n", + "example": [], + "items": { + "type": "string" + } + } + }, + "description": "Volume list response", + "x-go-name": "ListResponse" + }, + "Network": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Id": { + "type": "string" + }, + "Created": { + "type": "string", + "format": "dateTime" + }, + "Scope": { + "type": "string" + }, + "Driver": { + "type": "string" + }, + "EnableIPv6": { + "type": "boolean" + }, + "IPAM": { + "$ref": "#/components/schemas/IPAM" + }, + "Internal": { + "type": "boolean" + }, + "Attachable": { + "type": "boolean" + }, + "Ingress": { + "type": "boolean" + }, + "Containers": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/NetworkContainer" + } + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "example": { + "Name": "net01", + "Id": "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99", + "Created": "2016-10-19T04:33:30.360899459Z", + "Scope": "local", + "Driver": "bridge", + "EnableIPv6": false, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.19.0.0/16", + "Gateway": "172.19.0.1" + } + ], + "Options": { + "foo": "bar" + } + }, + "Internal": false, + "Attachable": false, + "Ingress": false, + "Containers": { + "19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c": { + "Name": "test", + "EndpointID": "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a", + "MacAddress": "02:42:ac:13:00:02", + "IPv4Address": "172.19.0.2/16", + "IPv6Address": "" + } + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + }, + "IPAM": { + "type": "object", + "properties": { + "Driver": { + "type": "string", + "description": "Name of the IPAM driver to use.", + "default": "default" + }, + "Config": { + "type": "array", + "description": "List of IPAM configuration options, specified as a map:\n\n```\n{\"Subnet\": , \"IPRange\": , \"Gateway\": , \"AuxAddress\": }\n```\n", + "items": { + "$ref": "#/components/schemas/IPAMConfig" + } + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver-specific options, specified as a map." + } + } + }, + "IPAMConfig": { + "type": "object", + "properties": { + "Subnet": { + "type": "string" + }, + "IPRange": { + "type": "string" + }, + "Gateway": { + "type": "string" + }, + "AuxiliaryAddresses": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "NetworkContainer": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "EndpointID": { + "type": "string" + }, + "MacAddress": { + "type": "string" + }, + "IPv4Address": { + "type": "string" + }, + "IPv6Address": { + "type": "string" + } + } + }, + "BuildInfo": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "stream": { + "type": "string" + }, + "error": { + "type": "string" + }, + "errorDetail": { + "$ref": "#/components/schemas/ErrorDetail" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + }, + "aux": { + "$ref": "#/components/schemas/ImageID" + } + } + }, + "BuildCache": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Unique ID of the build cache record.\n", + "example": "ndlpt0hhvkqcdfkputsk4cq9c" + }, + "Parent": { + "type": "string", + "description": "ID of the parent build cache record.\n\n> **Deprecated**: This field is deprecated, and omitted if empty.\n", + "nullable": true, + "example": "" + }, + "Parents": { + "type": "array", + "description": "List of parent build cache record IDs.\n", + "nullable": true, + "example": [ + "hw53o5aio51xtltp5xjp8v7fx" + ], + "items": { + "type": "string" + } + }, + "Type": { + "type": "string", + "description": "Cache record type.\n", + "example": "regular", + "enum": [ + "internal", + "frontend", + "source.local", + "source.git.checkout", + "exec.cachemount", + "regular" + ] + }, + "Description": { + "type": "string", + "description": "Description of the build-step that produced the build cache.\n", + "example": "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache" + }, + "InUse": { + "type": "boolean", + "description": "Indicates if the build cache is in use.\n", + "example": false + }, + "Shared": { + "type": "boolean", + "description": "Indicates if the build cache is shared.\n", + "example": true + }, + "Size": { + "type": "integer", + "description": "Amount of disk space used by the build cache (in bytes).\n", + "example": 51 + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the build cache was created in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "LastUsedAt": { + "type": "string", + "description": "Date and time at which the build cache was last used in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "nullable": true, + "example": "2017-08-09T07:09:37.632105588Z" + }, + "UsageCount": { + "type": "integer", + "example": 26 + } + }, + "description": "BuildCache contains information about a build cache record.\n" + }, + "ImageID": { + "type": "object", + "properties": { + "ID": { + "type": "string" + } + }, + "description": "Image ID or Digest", + "example": { + "ID": "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" + } + }, + "CreateImageInfo": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "error": { + "type": "string" + }, + "errorDetail": { + "$ref": "#/components/schemas/ErrorDetail" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + } + } + }, + "PushImageInfo": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "status": { + "type": "string" + }, + "progress": { + "type": "string" + }, + "progressDetail": { + "$ref": "#/components/schemas/ProgressDetail" + } + } + }, + "ErrorDetail": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + }, + "ProgressDetail": { + "type": "object", + "properties": { + "current": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "ErrorResponse": { + "required": [ + "message" + ], + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "The error message.", + "nullable": false + } + }, + "description": "Represents an error.", + "example": { + "message": "Something went wrong." + } + }, + "IdResponse": { + "required": [ + "Id" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The id of the newly created object.", + "nullable": false + } + }, + "description": "Response to an API call that returns just an Id" + }, + "EndpointSettings": { + "type": "object", + "properties": { + "IPAMConfig": { + "$ref": "#/components/schemas/EndpointIPAMConfig" + }, + "Links": { + "type": "array", + "example": [ + "container_1", + "container_2" + ], + "items": { + "type": "string" + } + }, + "MacAddress": { + "type": "string", + "description": "MAC address for the endpoint on this network. The network driver might ignore this parameter.\n", + "example": "02:42:ac:11:00:04" + }, + "Aliases": { + "type": "array", + "example": [ + "server_x", + "server_y" + ], + "items": { + "type": "string" + } + }, + "NetworkID": { + "type": "string", + "description": "Unique ID of the network.\n", + "example": "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a" + }, + "EndpointID": { + "type": "string", + "description": "Unique ID for the service endpoint in a Sandbox.\n", + "example": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + }, + "Gateway": { + "type": "string", + "description": "Gateway address for this network.\n", + "example": "172.17.0.1" + }, + "IPAddress": { + "type": "string", + "description": "IPv4 address.\n", + "example": "172.17.0.4" + }, + "IPPrefixLen": { + "type": "integer", + "description": "Mask length of the IPv4 address.\n", + "example": 16 + }, + "IPv6Gateway": { + "type": "string", + "description": "IPv6 gateway address.\n", + "example": "2001:db8:2::100" + }, + "GlobalIPv6Address": { + "type": "string", + "description": "Global IPv6 address.\n", + "example": "2001:db8::5689" + }, + "GlobalIPv6PrefixLen": { + "type": "integer", + "description": "Mask length of the global IPv6 address.\n", + "format": "int64", + "example": 64 + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "DriverOpts is a mapping of driver options and values. These options\nare passed directly to the driver and are driver specific.\n", + "nullable": true, + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "DNSNames": { + "type": "array", + "description": "List of all DNS names an endpoint has on a specific network. This\nlist is based on the container name, network aliases, container short\nID, and hostname.\n\nThese DNS names are non-fully qualified but can contain several dots.\nYou can get fully qualified DNS names by appending `.`.\nFor instance, if container name is `my.ctr` and the network is named\n`testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be\n`my.ctr.testnet`.\n", + "example": [ + "foobar", + "server_x", + "server_y", + "my.ctr" + ], + "items": { + "type": "string" + } + } + }, + "description": "Configuration for a network endpoint." + }, + "EndpointIPAMConfig": { + "type": "object", + "properties": { + "IPv4Address": { + "type": "string", + "example": "172.20.30.33" + }, + "IPv6Address": { + "type": "string", + "example": "2001:db8:abcd::3033" + }, + "LinkLocalIPs": { + "type": "array", + "example": [ + "169.254.34.68", + "fe80::3468" + ], + "items": { + "type": "string" + } + } + }, + "description": "EndpointIPAMConfig represents an endpoint's IPAM configuration.\n", + "nullable": true, + "x-nullable": true + }, + "PluginMount": { + "required": [ + "Description", + "Destination", + "Name", + "Options", + "Settable", + "Source", + "Type" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false, + "example": "some-mount" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "This is a mount that's used by the plugin." + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Source": { + "type": "string", + "example": "/var/lib/docker/plugins/" + }, + "Destination": { + "type": "string", + "nullable": false, + "example": "/mnt/state" + }, + "Type": { + "type": "string", + "nullable": false, + "example": "bind" + }, + "Options": { + "type": "array", + "example": [ + "rbind", + "rw" + ], + "items": { + "type": "string" + } + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginDevice": { + "required": [ + "Description", + "Name", + "Path", + "Settable" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false + }, + "Description": { + "type": "string", + "nullable": false + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Path": { + "type": "string", + "example": "/dev/fuse" + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginEnv": { + "required": [ + "Description", + "Name", + "Settable", + "Value" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false + }, + "Description": { + "type": "string", + "nullable": false + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Value": { + "type": "string" + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginInterfaceType": { + "required": [ + "Capability", + "Prefix", + "Version" + ], + "type": "object", + "properties": { + "Prefix": { + "type": "string", + "nullable": false + }, + "Capability": { + "type": "string", + "nullable": false + }, + "Version": { + "type": "string", + "nullable": false + } + }, + "nullable": false, + "x-nullable": false + }, + "PluginPrivilege": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "example": "network" + }, + "Description": { + "type": "string" + }, + "Value": { + "type": "array", + "example": [ + "host" + ], + "items": { + "type": "string" + } + } + }, + "description": "Describes a permission the user has to accept upon installing\nthe plugin.\n", + "x-go-name": "PluginPrivilege" + }, + "Plugin": { + "required": [ + "Config", + "Enabled", + "Name", + "Settings" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "example": "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" + }, + "Name": { + "type": "string", + "nullable": false, + "example": "tiborvass/sample-volume-plugin" + }, + "Enabled": { + "type": "boolean", + "description": "True if the plugin is running. False if the plugin is not running, only installed.", + "nullable": false, + "example": true + }, + "Settings": { + "required": [ + "Args", + "Devices", + "Env", + "Mounts" + ], + "type": "object", + "properties": { + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginMount" + } + }, + "Env": { + "type": "array", + "example": [ + "DEBUG=0" + ], + "items": { + "type": "string" + } + }, + "Args": { + "type": "array", + "items": { + "type": "string" + } + }, + "Devices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginDevice" + } + } + }, + "description": "Settings that can be modified by users.", + "nullable": false + }, + "PluginReference": { + "type": "string", + "description": "plugin remote reference used to push/pull the plugin", + "nullable": false, + "example": "localhost:5000/tiborvass/sample-volume-plugin:latest" + }, + "Config": { + "required": [ + "Args", + "Description", + "Documentation", + "Entrypoint", + "Env", + "Interface", + "IpcHost", + "Linux", + "Mounts", + "Network", + "PidHost", + "PropagatedMount", + "WorkDir" + ], + "type": "object", + "properties": { + "DockerVersion": { + "type": "string", + "description": "Docker Version used to create the plugin", + "nullable": false, + "example": "17.06.0-ce" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "A sample volume plugin for Docker" + }, + "Documentation": { + "type": "string", + "nullable": false, + "example": "https://docs.docker.com/engine/extend/plugins/" + }, + "Interface": { + "required": [ + "Socket", + "Types" + ], + "type": "object", + "properties": { + "Types": { + "type": "array", + "example": [ + "docker.volumedriver/1.0" + ], + "items": { + "$ref": "#/components/schemas/PluginInterfaceType" + } + }, + "Socket": { + "type": "string", + "nullable": false, + "example": "plugins.sock" + }, + "ProtocolScheme": { + "type": "string", + "description": "Protocol to use for clients connecting to the plugin.", + "example": "some.protocol/v1.0", + "enum": [ + "", + "moby.plugins.http/v1" + ] + } + }, + "description": "The interface between Docker and the plugin", + "nullable": false + }, + "Entrypoint": { + "type": "array", + "example": [ + "/usr/bin/sample-volume-plugin", + "/data" + ], + "items": { + "type": "string" + } + }, + "WorkDir": { + "type": "string", + "nullable": false, + "example": "/bin/" + }, + "User": { + "type": "object", + "properties": { + "UID": { + "type": "integer", + "format": "uint32", + "example": 1000 + }, + "GID": { + "type": "integer", + "format": "uint32", + "example": 1000 + } + }, + "nullable": false + }, + "Network": { + "required": [ + "Type" + ], + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": false, + "example": "host" + } + }, + "nullable": false + }, + "Linux": { + "required": [ + "AllowAllDevices", + "Capabilities", + "Devices" + ], + "type": "object", + "properties": { + "Capabilities": { + "type": "array", + "example": [ + "CAP_SYS_ADMIN", + "CAP_SYSLOG" + ], + "items": { + "type": "string" + } + }, + "AllowAllDevices": { + "type": "boolean", + "nullable": false, + "example": false + }, + "Devices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginDevice" + } + } + }, + "nullable": false + }, + "PropagatedMount": { + "type": "string", + "nullable": false, + "example": "/mnt/volumes" + }, + "IpcHost": { + "type": "boolean", + "nullable": false, + "example": false + }, + "PidHost": { + "type": "boolean", + "nullable": false, + "example": false + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginMount" + } + }, + "Env": { + "type": "array", + "example": [ + { + "Name": "DEBUG", + "Description": "If set, prints debug messages", + "Value": "0" + } + ], + "items": { + "$ref": "#/components/schemas/PluginEnv" + } + }, + "Args": { + "required": [ + "Description", + "Name", + "Settable", + "Value" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": false, + "example": "args" + }, + "Description": { + "type": "string", + "nullable": false, + "example": "command line arguments" + }, + "Settable": { + "type": "array", + "items": { + "type": "string" + } + }, + "Value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "nullable": false + }, + "rootfs": { + "type": "object", + "properties": { + "type": { + "type": "string", + "example": "layers" + }, + "diff_ids": { + "type": "array", + "example": [ + "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887", + "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" + ], + "items": { + "type": "string" + } + } + } + } + }, + "description": "The config of a plugin.", + "nullable": false + } + }, + "description": "A plugin for the Engine API" + }, + "ObjectVersion": { + "type": "object", + "properties": { + "Index": { + "type": "integer", + "format": "uint64", + "example": 373531 + } + }, + "description": "The version number of the object such as node, service, etc. This is needed\nto avoid conflicting writes. The client must send the version number along\nwith the modified specification when updating these objects.\n\nThis approach ensures safe concurrency and determinism in that the change\non the object may not be applied if the version number has changed from the\nlast read. In other words, if two update requests specify the same base\nversion, only one of the requests can succeed. As a result, two separate\nupdate requests that happen at the same time will not unintentionally\noverwrite each other.\n" + }, + "NodeSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name for the node.", + "example": "my-node" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Role": { + "type": "string", + "description": "Role of the node.", + "example": "manager", + "enum": [ + "worker", + "manager" + ] + }, + "Availability": { + "type": "string", + "description": "Availability of the node.", + "example": "active", + "enum": [ + "active", + "pause", + "drain" + ] + } + }, + "example": { + "Availability": "active", + "Name": "node-name", + "Role": "manager", + "Labels": { + "foo": "bar" + } + } + }, + "Node": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "example": "24ifsmvkjbyhk" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the node was added to the swarm in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "UpdatedAt": { + "type": "string", + "description": "Date and time at which the node was last updated in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2017-08-09T07:09:37.632105588Z" + }, + "Spec": { + "$ref": "#/components/schemas/NodeSpec" + }, + "Description": { + "$ref": "#/components/schemas/NodeDescription" + }, + "Status": { + "$ref": "#/components/schemas/NodeStatus" + }, + "ManagerStatus": { + "$ref": "#/components/schemas/ManagerStatus" + } + } + }, + "NodeDescription": { + "type": "object", + "properties": { + "Hostname": { + "type": "string", + "example": "bf3067039e47" + }, + "Platform": { + "$ref": "#/components/schemas/Platform" + }, + "Resources": { + "$ref": "#/components/schemas/ResourceObject" + }, + "Engine": { + "$ref": "#/components/schemas/EngineDescription" + }, + "TLSInfo": { + "$ref": "#/components/schemas/TLSInfo" + } + }, + "description": "NodeDescription encapsulates the properties of the Node as reported by the\nagent.\n" + }, + "Platform": { + "type": "object", + "properties": { + "Architecture": { + "type": "string", + "description": "Architecture represents the hardware architecture (for example,\n`x86_64`).\n", + "example": "x86_64" + }, + "OS": { + "type": "string", + "description": "OS represents the Operating System (for example, `linux` or `windows`).\n", + "example": "linux" + } + }, + "description": "Platform represents the platform (Arch/OS).\n" + }, + "EngineDescription": { + "type": "object", + "properties": { + "EngineVersion": { + "type": "string", + "example": "17.06.0" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "example": { + "foo": "bar" + } + }, + "Plugins": { + "type": "array", + "example": [ + { + "Type": "Log", + "Name": "awslogs" + }, + { + "Type": "Log", + "Name": "fluentd" + }, + { + "Type": "Log", + "Name": "gcplogs" + }, + { + "Type": "Log", + "Name": "gelf" + }, + { + "Type": "Log", + "Name": "journald" + }, + { + "Type": "Log", + "Name": "json-file" + }, + { + "Type": "Log", + "Name": "splunk" + }, + { + "Type": "Log", + "Name": "syslog" + }, + { + "Type": "Network", + "Name": "bridge" + }, + { + "Type": "Network", + "Name": "host" + }, + { + "Type": "Network", + "Name": "ipvlan" + }, + { + "Type": "Network", + "Name": "macvlan" + }, + { + "Type": "Network", + "Name": "null" + }, + { + "Type": "Network", + "Name": "overlay" + }, + { + "Type": "Volume", + "Name": "local" + }, + { + "Type": "Volume", + "Name": "localhost:5000/vieux/sshfs:latest" + }, + { + "Type": "Volume", + "Name": "vieux/sshfs:latest" + } + ], + "items": { + "type": "object", + "properties": { + "Type": { + "type": "string" + }, + "Name": { + "type": "string" + } + } + } + } + }, + "description": "EngineDescription provides information about an engine." + }, + "TLSInfo": { + "type": "object", + "properties": { + "TrustRoot": { + "type": "string", + "description": "The root CA certificate(s) that are used to validate leaf TLS\ncertificates.\n" + }, + "CertIssuerSubject": { + "type": "string", + "description": "The base64-url-safe-encoded raw subject bytes of the issuer." + }, + "CertIssuerPublicKey": { + "type": "string", + "description": "The base64-url-safe-encoded raw public key bytes of the issuer.\n" + } + }, + "description": "Information about the issuer of leaf TLS certificates and the trusted root\nCA certificate.\n", + "example": { + "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0\nMzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf\n3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO\nPQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz\npxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H\n-----END CERTIFICATE-----\n", + "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh", + "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A==" + } + }, + "NodeStatus": { + "type": "object", + "properties": { + "State": { + "$ref": "#/components/schemas/NodeState" + }, + "Message": { + "type": "string", + "example": "" + }, + "Addr": { + "type": "string", + "description": "IP address of the node.", + "example": "172.17.0.2" + } + }, + "description": "NodeStatus represents the status of a node.\n\nIt provides the current status of the node, as seen by the manager.\n" + }, + "NodeState": { + "type": "string", + "description": "NodeState represents the state of a node.", + "example": "ready", + "enum": [ + "unknown", + "down", + "ready", + "disconnected" + ] + }, + "ManagerStatus": { + "type": "object", + "properties": { + "Leader": { + "type": "boolean", + "example": true, + "default": false + }, + "Reachability": { + "$ref": "#/components/schemas/Reachability" + }, + "Addr": { + "type": "string", + "description": "The IP address and port at which the manager is reachable.\n", + "example": "10.0.0.46:2377" + } + }, + "description": "ManagerStatus represents the status of a manager.\n\nIt provides the current status of a node's manager component, if the node\nis a manager.\n", + "nullable": true, + "x-nullable": true + }, + "Reachability": { + "type": "string", + "description": "Reachability represents the reachability of a node.", + "example": "reachable", + "enum": [ + "unknown", + "unreachable", + "reachable" + ] + }, + "SwarmSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the swarm.", + "example": "default" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.corp.type": "production", + "com.example.corp.department": "engineering" + } + }, + "Orchestration": { + "type": "object", + "properties": { + "TaskHistoryRetentionLimit": { + "type": "integer", + "description": "The number of historic tasks to keep per instance or node. If\nnegative, never remove completed or failed tasks.\n", + "format": "int64", + "example": 10 + } + }, + "description": "Orchestration configuration.", + "nullable": true + }, + "Raft": { + "type": "object", + "properties": { + "SnapshotInterval": { + "type": "integer", + "description": "The number of log entries between snapshots.", + "format": "uint64", + "example": 10000 + }, + "KeepOldSnapshots": { + "type": "integer", + "description": "The number of snapshots to keep beyond the current snapshot.\n", + "format": "uint64" + }, + "LogEntriesForSlowFollowers": { + "type": "integer", + "description": "The number of log entries to keep around to sync up slow followers\nafter a snapshot is created.\n", + "format": "uint64", + "example": 500 + }, + "ElectionTick": { + "type": "integer", + "description": "The number of ticks that a follower will wait for a message from\nthe leader before becoming a candidate and starting an election.\n`ElectionTick` must be greater than `HeartbeatTick`.\n\nA tick currently defaults to one second, so these translate\ndirectly to seconds currently, but this is NOT guaranteed.\n", + "example": 3 + }, + "HeartbeatTick": { + "type": "integer", + "description": "The number of ticks between heartbeats. Every HeartbeatTick ticks,\nthe leader will send a heartbeat to the followers.\n\nA tick currently defaults to one second, so these translate\ndirectly to seconds currently, but this is NOT guaranteed.\n", + "example": 1 + } + }, + "description": "Raft configuration." + }, + "Dispatcher": { + "type": "object", + "properties": { + "HeartbeatPeriod": { + "type": "integer", + "description": "The delay for an agent to send a heartbeat to the dispatcher.\n", + "format": "int64", + "example": 5000000000 + } + }, + "description": "Dispatcher configuration.", + "nullable": true + }, + "CAConfig": { + "type": "object", + "properties": { + "NodeCertExpiry": { + "type": "integer", + "description": "The duration node certificates are issued for.", + "format": "int64", + "example": 7776000000000000 + }, + "ExternalCAs": { + "type": "array", + "description": "Configuration for forwarding signing requests to an external\ncertificate authority.\n", + "items": { + "type": "object", + "properties": { + "Protocol": { + "type": "string", + "description": "Protocol for communication with the external CA (currently\nonly `cfssl` is supported).\n", + "default": "cfssl", + "enum": [ + "cfssl" + ] + }, + "URL": { + "type": "string", + "description": "URL where certificate signing requests should be sent.\n" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "An object with key/value pairs that are interpreted as\nprotocol-specific options for the external CA driver.\n" + }, + "CACert": { + "type": "string", + "description": "The root CA certificate (in PEM format) this external CA uses\nto issue TLS certificates (assumed to be to the current swarm\nroot CA certificate if not provided).\n" + } + } + } + }, + "SigningCACert": { + "type": "string", + "description": "The desired signing CA certificate for all swarm node TLS leaf\ncertificates, in PEM format.\n" + }, + "SigningCAKey": { + "type": "string", + "description": "The desired signing CA key for all swarm node TLS leaf certificates,\nin PEM format.\n" + }, + "ForceRotate": { + "type": "integer", + "description": "An integer whose purpose is to force swarm to generate a new\nsigning CA certificate and key, if none have been specified in\n`SigningCACert` and `SigningCAKey`\n", + "format": "uint64" + } + }, + "description": "CA configuration.", + "nullable": true + }, + "EncryptionConfig": { + "type": "object", + "properties": { + "AutoLockManagers": { + "type": "boolean", + "description": "If set, generate a key and use it to lock data stored on the\nmanagers.\n", + "example": false + } + }, + "description": "Parameters related to encryption-at-rest." + }, + "TaskDefaults": { + "type": "object", + "properties": { + "LogDriver": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The log driver to use as a default for new tasks.\n", + "example": "json-file" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver-specific options for the selectd log driver, specified\nas key/value pairs.\n", + "example": { + "max-file": "10", + "max-size": "100m" + } + } + }, + "description": "The log driver to use for tasks created in the orchestrator if\nunspecified by a service.\n\nUpdating this value only affects new tasks. Existing tasks continue\nto use their previously configured log driver until recreated.\n" + } + }, + "description": "Defaults for creating tasks in this cluster." + } + }, + "description": "User modifiable swarm configuration." + }, + "ClusterInfo": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the swarm.", + "example": "abajmipo7b4xz5ip2nrla6b11" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "description": "Date and time at which the swarm was initialised in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2016-08-18T10:44:24.496525531Z" + }, + "UpdatedAt": { + "type": "string", + "description": "Date and time at which the swarm was last updated in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "format": "dateTime", + "example": "2017-08-09T07:09:37.632105588Z" + }, + "Spec": { + "$ref": "#/components/schemas/SwarmSpec" + }, + "TLSInfo": { + "$ref": "#/components/schemas/TLSInfo" + }, + "RootRotationInProgress": { + "type": "boolean", + "description": "Whether there is currently a root CA rotation in progress for the swarm\n", + "example": false + }, + "DataPathPort": { + "type": "integer", + "description": "DataPathPort specifies the data path port number for data traffic.\nAcceptable port range is 1024 to 49151.\nIf no port is set or is set to 0, the default port (4789) is used.\n", + "format": "uint32", + "example": 4789 + }, + "DefaultAddrPool": { + "type": "array", + "description": "Default Address Pool specifies default subnet pools for global scope\nnetworks.\n", + "items": { + "type": "string", + "format": "CIDR", + "example": "" + } + }, + "SubnetSize": { + "maximum": 29, + "type": "integer", + "description": "SubnetSize specifies the subnet size of the networks created from the\ndefault subnet pool.\n", + "format": "uint32", + "example": 24 + } + }, + "description": "ClusterInfo represents information about the swarm as is returned by the\n\"/info\" endpoint. Join-tokens are not included.\n", + "nullable": true, + "x-nullable": true + }, + "JoinTokens": { + "type": "object", + "properties": { + "Worker": { + "type": "string", + "description": "The token workers can use to join the swarm.\n", + "example": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx" + }, + "Manager": { + "type": "string", + "description": "The token managers can use to join the swarm.\n", + "example": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + } + }, + "description": "JoinTokens contains the tokens workers and managers need to join the swarm.\n" + }, + "Swarm": { + "allOf": [ + { + "$ref": "#/components/schemas/ClusterInfo" + }, + { + "type": "object", + "properties": { + "JoinTokens": { + "$ref": "#/components/schemas/JoinTokens" + } + } + } + ] + }, + "TaskSpec": { + "type": "object", + "properties": { + "PluginSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The name or 'alias' to use for the plugin." + }, + "Remote": { + "type": "string", + "description": "The plugin image reference to use." + }, + "Disabled": { + "type": "boolean", + "description": "Disable the plugin once scheduled." + }, + "PluginPrivilege": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginPrivilege" + } + } + }, + "description": "Plugin spec for the service. *(Experimental release only.)*\n\n


\n\n> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n> mutually exclusive. PluginSpec is only used when the Runtime field\n> is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n> field is set to `attachment`.\n" + }, + "ContainerSpec": { + "type": "object", + "properties": { + "Image": { + "type": "string", + "description": "The image name to use for the container" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value data." + }, + "Command": { + "type": "array", + "description": "The command to be run in the image.", + "items": { + "type": "string" + } + }, + "Args": { + "type": "array", + "description": "Arguments to the command.", + "items": { + "type": "string" + } + }, + "Hostname": { + "type": "string", + "description": "The hostname to use for the container, as a valid\n[RFC 1123](https://tools.ietf.org/html/rfc1123) hostname.\n" + }, + "Env": { + "type": "array", + "description": "A list of environment variables in the form `VAR=value`.\n", + "items": { + "type": "string" + } + }, + "Dir": { + "type": "string", + "description": "The working directory for commands to run in." + }, + "User": { + "type": "string", + "description": "The user inside the container." + }, + "Groups": { + "type": "array", + "description": "A list of additional groups that the container process will run as.\n", + "items": { + "type": "string" + } + }, + "Privileges": { + "type": "object", + "properties": { + "CredentialSpec": { + "type": "object", + "properties": { + "Config": { + "type": "string", + "description": "Load credential spec from a Swarm Config with the given ID.\nThe specified config must also be present in the Configs\nfield with the Runtime property set.\n\n


\n\n\n> **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n> and `CredentialSpec.Config` are mutually exclusive.\n", + "example": "0bt9dmxjvjiqermk6xrop3ekq" + }, + "File": { + "type": "string", + "description": "Load credential spec from this file. The file is read by\nthe daemon, and must be present in the `CredentialSpecs`\nsubdirectory in the docker data directory, which defaults\nto `C:\\ProgramData\\Docker\\` on Windows.\n\nFor example, specifying `spec.json` loads\n`C:\\ProgramData\\Docker\\CredentialSpecs\\spec.json`.\n\n


\n\n> **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n> and `CredentialSpec.Config` are mutually exclusive.\n", + "example": "spec.json" + }, + "Registry": { + "type": "string", + "description": "Load credential spec from this value in the Windows\nregistry. The specified registry value must be located in:\n\n`HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Virtualization\\Containers\\CredentialSpecs`\n\n


\n\n\n> **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n> and `CredentialSpec.Config` are mutually exclusive.\n" + } + }, + "description": "CredentialSpec for managed service account (Windows only)" + }, + "SELinuxContext": { + "type": "object", + "properties": { + "Disable": { + "type": "boolean", + "description": "Disable SELinux" + }, + "User": { + "type": "string", + "description": "SELinux user label" + }, + "Role": { + "type": "string", + "description": "SELinux role label" + }, + "Type": { + "type": "string", + "description": "SELinux type label" + }, + "Level": { + "type": "string", + "description": "SELinux level label" + } + }, + "description": "SELinux labels of the container" + }, + "Seccomp": { + "type": "object", + "properties": { + "Mode": { + "type": "string", + "enum": [ + "default", + "unconfined", + "custom" + ] + }, + "Profile": { + "type": "string", + "description": "The custom seccomp profile as a json object" + } + }, + "description": "Options for configuring seccomp on the container" + }, + "AppArmor": { + "type": "object", + "properties": { + "Mode": { + "type": "string", + "enum": [ + "default", + "disabled" + ] + } + }, + "description": "Options for configuring AppArmor on the container" + }, + "NoNewPrivileges": { + "type": "boolean", + "description": "Configuration of the no_new_privs bit in the container" + } + }, + "description": "Security options for the container" + }, + "TTY": { + "type": "boolean", + "description": "Whether a pseudo-TTY should be allocated." + }, + "OpenStdin": { + "type": "boolean", + "description": "Open `stdin`" + }, + "ReadOnly": { + "type": "boolean", + "description": "Mount the container's root filesystem as read only." + }, + "Mounts": { + "type": "array", + "description": "Specification for mounts to be added to containers created as part\nof the service.\n", + "items": { + "$ref": "#/components/schemas/Mount" + } + }, + "StopSignal": { + "type": "string", + "description": "Signal to stop the container." + }, + "StopGracePeriod": { + "type": "integer", + "description": "Amount of time to wait for the container to terminate before\nforcefully killing it.\n", + "format": "int64" + }, + "HealthCheck": { + "$ref": "#/components/schemas/HealthConfig" + }, + "Hosts": { + "type": "array", + "description": "A list of hostname/IP mappings to add to the container's `hosts`\nfile. The format of extra hosts is specified in the\n[hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html)\nman page:\n\n IP_address canonical_hostname [aliases...]\n", + "items": { + "type": "string" + } + }, + "DNSConfig": { + "type": "object", + "properties": { + "Nameservers": { + "type": "array", + "description": "The IP addresses of the name servers.", + "items": { + "type": "string" + } + }, + "Search": { + "type": "array", + "description": "A search list for host-name lookup.", + "items": { + "type": "string" + } + }, + "Options": { + "type": "array", + "description": "A list of internal resolver variables to be modified (e.g.,\n`debug`, `ndots:3`, etc.).\n", + "items": { + "type": "string" + } + } + }, + "description": "Specification for DNS related configurations in resolver configuration\nfile (`resolv.conf`).\n" + }, + "Secrets": { + "type": "array", + "description": "Secrets contains references to zero or more secrets that will be\nexposed to the service.\n", + "items": { + "type": "object", + "properties": { + "File": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name represents the final filename in the filesystem.\n" + }, + "UID": { + "type": "string", + "description": "UID represents the file UID." + }, + "GID": { + "type": "string", + "description": "GID represents the file GID." + }, + "Mode": { + "type": "integer", + "description": "Mode represents the FileMode of the file.", + "format": "uint32" + } + }, + "description": "File represents a specific target that is backed by a file.\n" + }, + "SecretID": { + "type": "string", + "description": "SecretID represents the ID of the specific secret that we're\nreferencing.\n" + }, + "SecretName": { + "type": "string", + "description": "SecretName is the name of the secret that this references,\nbut this is just provided for lookup/display purposes. The\nsecret in the reference will be identified by its ID.\n" + } + } + } + }, + "Configs": { + "type": "array", + "description": "Configs contains references to zero or more configs that will be\nexposed to the service.\n", + "items": { + "type": "object", + "properties": { + "File": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name represents the final filename in the filesystem.\n" + }, + "UID": { + "type": "string", + "description": "UID represents the file UID." + }, + "GID": { + "type": "string", + "description": "GID represents the file GID." + }, + "Mode": { + "type": "integer", + "description": "Mode represents the FileMode of the file.", + "format": "uint32" + } + }, + "description": "File represents a specific target that is backed by a file.\n\n


\n\n> **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive\n" + }, + "Runtime": { + "type": "object", + "properties": {}, + "description": "Runtime represents a target that is not mounted into the\ncontainer but is used by the task\n\n


\n\n> **Note**: `Configs.File` and `Configs.Runtime` are mutually\n> exclusive\n" + }, + "ConfigID": { + "type": "string", + "description": "ConfigID represents the ID of the specific config that we're\nreferencing.\n" + }, + "ConfigName": { + "type": "string", + "description": "ConfigName is the name of the config that this references,\nbut this is just provided for lookup/display purposes. The\nconfig in the reference will be identified by its ID.\n" + } + } + } + }, + "Isolation": { + "type": "string", + "description": "Isolation technology of the containers running the service.\n(Windows only)\n", + "enum": [ + "default", + "process", + "hyperv" + ] + }, + "Init": { + "type": "boolean", + "description": "Run an init inside the container that forwards signals and reaps\nprocesses. This field is omitted if empty, and the default (as\nconfigured on the daemon) is used.\n", + "nullable": true + }, + "Sysctls": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Set kernel namedspaced parameters (sysctls) in the container.\nThe Sysctls option on services accepts the same sysctls as the\nare supported on containers. Note that while the same sysctls are\nsupported, no guarantees or checks are made about their\nsuitability for a clustered environment, and it's up to the user\nto determine whether a given sysctl will work properly in a\nService.\n" + }, + "CapabilityAdd": { + "type": "array", + "description": "A list of kernel capabilities to add to the default set\nfor the container.\n", + "example": [ + "CAP_NET_RAW", + "CAP_SYS_ADMIN", + "CAP_SYS_CHROOT", + "CAP_SYSLOG" + ], + "items": { + "type": "string" + } + }, + "CapabilityDrop": { + "type": "array", + "description": "A list of kernel capabilities to drop from the default set\nfor the container.\n", + "example": [ + "CAP_NET_RAW" + ], + "items": { + "type": "string" + } + }, + "Ulimits": { + "type": "array", + "description": "A list of resource limits to set in the container. For example: `{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}`\"\n", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of ulimit" + }, + "Soft": { + "type": "integer", + "description": "Soft limit" + }, + "Hard": { + "type": "integer", + "description": "Hard limit" + } + } + } + } + }, + "description": "Container spec for the service.\n\n


\n\n> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n> mutually exclusive. PluginSpec is only used when the Runtime field\n> is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n> field is set to `attachment`.\n" + }, + "NetworkAttachmentSpec": { + "type": "object", + "properties": { + "ContainerID": { + "type": "string", + "description": "ID of the container represented by this task" + } + }, + "description": "Read-only spec type for non-swarm containers attached to swarm overlay\nnetworks.\n\n


\n\n> **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n> mutually exclusive. PluginSpec is only used when the Runtime field\n> is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n> field is set to `attachment`.\n" + }, + "Resources": { + "type": "object", + "properties": { + "Limits": { + "$ref": "#/components/schemas/Limit" + }, + "Reservations": { + "$ref": "#/components/schemas/ResourceObject" + } + }, + "description": "Resource requirements which apply to each individual container created\nas part of the service.\n" + }, + "RestartPolicy": { + "type": "object", + "properties": { + "Condition": { + "type": "string", + "description": "Condition for restart.", + "enum": [ + "none", + "on-failure", + "any" + ] + }, + "Delay": { + "type": "integer", + "description": "Delay between restart attempts.", + "format": "int64" + }, + "MaxAttempts": { + "type": "integer", + "description": "Maximum attempts to restart a given container before giving up\n(default value is 0, which is ignored).\n", + "format": "int64", + "default": 0 + }, + "Window": { + "type": "integer", + "description": "Windows is the time window used to evaluate the restart policy\n(default value is 0, which is unbounded).\n", + "format": "int64", + "default": 0 + } + }, + "description": "Specification for the restart policy which applies to containers\ncreated as part of this service.\n" + }, + "Placement": { + "type": "object", + "properties": { + "Constraints": { + "type": "array", + "description": "An array of constraint expressions to limit the set of nodes where\na task can be scheduled. Constraint expressions can either use a\n_match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find\nnodes that satisfy every expression (AND match). Constraints can\nmatch node or Docker Engine labels as follows:\n\nnode attribute | matches | example\n---------------------|--------------------------------|-----------------------------------------------\n`node.id` | Node ID | `node.id==2ivku8v2gvtg4`\n`node.hostname` | Node hostname | `node.hostname!=node-2`\n`node.role` | Node role (`manager`/`worker`) | `node.role==manager`\n`node.platform.os` | Node operating system | `node.platform.os==windows`\n`node.platform.arch` | Node architecture | `node.platform.arch==x86_64`\n`node.labels` | User-defined node labels | `node.labels.security==high`\n`engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-14.04`\n\n`engine.labels` apply to Docker Engine labels like operating system,\ndrivers, etc. Swarm administrators add `node.labels` for operational\npurposes by using the [`node update endpoint`](#operation/NodeUpdate).\n", + "example": [ + "node.hostname!=node3.corp.example.com", + "node.role!=manager", + "node.labels.type==production", + "node.platform.os==linux", + "node.platform.arch==x86_64" + ], + "items": { + "type": "string" + } + }, + "Preferences": { + "type": "array", + "description": "Preferences provide a way to make the scheduler aware of factors\nsuch as topology. They are provided in order from highest to\nlowest precedence.\n", + "example": [ + { + "Spread": { + "SpreadDescriptor": "node.labels.datacenter" + } + }, + { + "Spread": { + "SpreadDescriptor": "node.labels.rack" + } + } + ], + "items": { + "type": "object", + "properties": { + "Spread": { + "type": "object", + "properties": { + "SpreadDescriptor": { + "type": "string", + "description": "label descriptor, such as `engine.labels.az`.\n" + } + } + } + } + } + }, + "MaxReplicas": { + "type": "integer", + "description": "Maximum number of replicas for per node (default value is 0, which\nis unlimited)\n", + "format": "int64", + "default": 0 + }, + "Platforms": { + "type": "array", + "description": "Platforms stores all the platforms that the service's image can\nrun on. This field is used in the platform filter for scheduling.\nIf empty, then the platform filter is off, meaning there are no\nscheduling restrictions.\n", + "items": { + "$ref": "#/components/schemas/Platform" + } + } + } + }, + "ForceUpdate": { + "type": "integer", + "description": "A counter that triggers an update even if no relevant parameters have\nbeen changed.\n" + }, + "Runtime": { + "type": "string", + "description": "Runtime is the type of runtime specified for the task executor.\n" + }, + "Networks": { + "type": "array", + "description": "Specifies which networks the service should attach to.", + "items": { + "$ref": "#/components/schemas/NetworkAttachmentConfig" + } + }, + "LogDriver": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "Specifies the log driver to use for tasks created from this spec. If\nnot present, the default one for the swarm will be used, finally\nfalling back to the engine default if not specified.\n" + } + }, + "description": "User modifiable task configuration." + }, + "TaskState": { + "type": "string", + "enum": [ + "new", + "allocated", + "pending", + "assigned", + "accepted", + "preparing", + "ready", + "starting", + "running", + "complete", + "shutdown", + "failed", + "rejected", + "remove", + "orphaned" + ] + }, + "ContainerStatus": { + "type": "object", + "properties": { + "ContainerID": { + "type": "string" + }, + "PID": { + "type": "integer" + }, + "ExitCode": { + "type": "integer" + } + }, + "description": "represents the status of a container." + }, + "PortStatus": { + "type": "object", + "properties": { + "Ports": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EndpointPortConfig" + } + } + }, + "description": "represents the port status of a task's host ports whose service has published host ports" + }, + "TaskStatus": { + "type": "object", + "properties": { + "Timestamp": { + "type": "string", + "format": "dateTime" + }, + "State": { + "$ref": "#/components/schemas/TaskState" + }, + "Message": { + "type": "string" + }, + "Err": { + "type": "string" + }, + "ContainerStatus": { + "$ref": "#/components/schemas/ContainerStatus" + }, + "PortStatus": { + "$ref": "#/components/schemas/PortStatus" + } + }, + "description": "represents the status of a task." + }, + "Task": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the task." + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Name": { + "type": "string", + "description": "Name of the task." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Spec": { + "$ref": "#/components/schemas/TaskSpec" + }, + "ServiceID": { + "type": "string", + "description": "The ID of the service this task is part of." + }, + "Slot": { + "type": "integer" + }, + "NodeID": { + "type": "string", + "description": "The ID of the node that this task is on." + }, + "AssignedGenericResources": { + "$ref": "#/components/schemas/GenericResources" + }, + "Status": { + "$ref": "#/components/schemas/TaskStatus" + }, + "DesiredState": { + "$ref": "#/components/schemas/TaskState" + }, + "JobIteration": { + "$ref": "#/components/schemas/ObjectVersion" + } + }, + "example": { + "ID": "0kzzo1i0y4jz6027t0k7aezc7", + "Version": { + "Index": 71 + }, + "CreatedAt": "2016-06-07T21:07:31.171892745Z", + "UpdatedAt": "2016-06-07T21:07:31.376370513Z", + "Spec": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Slot": 1, + "NodeID": "60gvrl6tm78dmak4yl7srz94v", + "Status": { + "Timestamp": "2016-06-07T21:07:31.290032978Z", + "State": "running", + "Message": "started", + "ContainerStatus": { + "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035", + "PID": 677 + } + }, + "DesiredState": "running", + "NetworksAttachments": [ + { + "Network": { + "ID": "4qvuz4ko70xaltuqbt8956gd1", + "Version": { + "Index": 18 + }, + "CreatedAt": "2016-06-07T20:31:11.912919752Z", + "UpdatedAt": "2016-06-07T21:07:29.955277358Z", + "Spec": { + "Name": "ingress", + "Labels": { + "com.docker.swarm.internal": "true" + }, + "DriverConfiguration": {}, + "IPAMOptions": { + "Driver": {}, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "DriverState": { + "Name": "overlay", + "Options": { + "com.docker.network.driver.overlay.vxlanid_list": "256" + } + }, + "IPAMOptions": { + "Driver": { + "Name": "default" + }, + "Configs": [ + { + "Subnet": "10.255.0.0/16", + "Gateway": "10.255.0.1" + } + ] + } + }, + "Addresses": [ + "10.255.0.10/16" + ] + } + ], + "AssignedGenericResources": [ + { + "DiscreteResourceSpec": { + "Kind": "SSD", + "Value": 3 + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID1" + } + }, + { + "NamedResourceSpec": { + "Kind": "GPU", + "Value": "UUID2" + } + } + ] + } + }, + "ServiceSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the service." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "TaskTemplate": { + "$ref": "#/components/schemas/TaskSpec" + }, + "Mode": { + "type": "object", + "properties": { + "Replicated": { + "type": "object", + "properties": { + "Replicas": { + "type": "integer", + "format": "int64" + } + } + }, + "Global": { + "type": "object", + "properties": {} + }, + "ReplicatedJob": { + "type": "object", + "properties": { + "MaxConcurrent": { + "type": "integer", + "description": "The maximum number of replicas to run simultaneously.\n", + "format": "int64", + "default": 1 + }, + "TotalCompletions": { + "type": "integer", + "description": "The total number of replicas desired to reach the Completed\nstate. If unset, will default to the value of `MaxConcurrent`\n", + "format": "int64" + } + }, + "description": "The mode used for services with a finite number of tasks that run\nto a completed state.\n" + }, + "GlobalJob": { + "type": "object", + "properties": {}, + "description": "The mode used for services which run a task to the completed state\non each valid node.\n" + } + }, + "description": "Scheduling mode for the service." + }, + "UpdateConfig": { + "type": "object", + "properties": { + "Parallelism": { + "type": "integer", + "description": "Maximum number of tasks to be updated in one iteration (0 means\nunlimited parallelism).\n", + "format": "int64" + }, + "Delay": { + "type": "integer", + "description": "Amount of time between updates, in nanoseconds.", + "format": "int64" + }, + "FailureAction": { + "type": "string", + "description": "Action to take if an updated task fails to run, or stops running\nduring the update.\n", + "enum": [ + "continue", + "pause", + "rollback" + ] + }, + "Monitor": { + "type": "integer", + "description": "Amount of time to monitor each updated task for failures, in\nnanoseconds.\n", + "format": "int64" + }, + "MaxFailureRatio": { + "type": "number", + "description": "The fraction of tasks that may fail during an update before the\nfailure action is invoked, specified as a floating point number\nbetween 0 and 1.\n" + }, + "Order": { + "type": "string", + "description": "The order of operations when rolling out an updated task. Either\nthe old task is shut down before the new task is started, or the\nnew task is started before the old task is shut down.\n", + "enum": [ + "stop-first", + "start-first" + ] + } + }, + "description": "Specification for the update strategy of the service." + }, + "RollbackConfig": { + "type": "object", + "properties": { + "Parallelism": { + "type": "integer", + "description": "Maximum number of tasks to be rolled back in one iteration (0 means\nunlimited parallelism).\n", + "format": "int64" + }, + "Delay": { + "type": "integer", + "description": "Amount of time between rollback iterations, in nanoseconds.\n", + "format": "int64" + }, + "FailureAction": { + "type": "string", + "description": "Action to take if an rolled back task fails to run, or stops\nrunning during the rollback.\n", + "enum": [ + "continue", + "pause" + ] + }, + "Monitor": { + "type": "integer", + "description": "Amount of time to monitor each rolled back task for failures, in\nnanoseconds.\n", + "format": "int64" + }, + "MaxFailureRatio": { + "type": "number", + "description": "The fraction of tasks that may fail during a rollback before the\nfailure action is invoked, specified as a floating point number\nbetween 0 and 1.\n" + }, + "Order": { + "type": "string", + "description": "The order of operations when rolling back a task. Either the old\ntask is shut down before the new task is started, or the new task\nis started before the old task is shut down.\n", + "enum": [ + "stop-first", + "start-first" + ] + } + }, + "description": "Specification for the rollback strategy of the service." + }, + "Networks": { + "type": "array", + "description": "Specifies which networks the service should attach to.\n\nDeprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead.\n", + "items": { + "$ref": "#/components/schemas/NetworkAttachmentConfig" + } + }, + "EndpointSpec": { + "$ref": "#/components/schemas/EndpointSpec" + } + }, + "description": "User modifiable configuration for a service." + }, + "EndpointPortConfig": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Protocol": { + "type": "string", + "enum": [ + "tcp", + "udp", + "sctp" + ] + }, + "TargetPort": { + "type": "integer", + "description": "The port inside the container." + }, + "PublishedPort": { + "type": "integer", + "description": "The port on the swarm hosts." + }, + "PublishMode": { + "type": "string", + "description": "The mode in which port is published.\n\n


\n\n- \"ingress\" makes the target port accessible on every node,\n regardless of whether there is a task for the service running on\n that node or not.\n- \"host\" bypasses the routing mesh and publish the port directly on\n the swarm node where that service is running.\n", + "example": "ingress", + "default": "ingress", + "enum": [ + "ingress", + "host" + ] + } + } + }, + "EndpointSpec": { + "type": "object", + "properties": { + "Mode": { + "type": "string", + "description": "The mode of resolution to use for internal load balancing between tasks.\n", + "default": "vip", + "enum": [ + "vip", + "dnsrr" + ] + }, + "Ports": { + "type": "array", + "description": "List of exposed ports that this service is accessible on from the\noutside. Ports can only be provided if `vip` resolution mode is used.\n", + "items": { + "$ref": "#/components/schemas/EndpointPortConfig" + } + } + }, + "description": "Properties that can be configured to access and load balance a service." + }, + "Service": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Spec": { + "$ref": "#/components/schemas/ServiceSpec" + }, + "Endpoint": { + "type": "object", + "properties": { + "Spec": { + "$ref": "#/components/schemas/EndpointSpec" + }, + "Ports": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EndpointPortConfig" + } + }, + "VirtualIPs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "NetworkID": { + "type": "string" + }, + "Addr": { + "type": "string" + } + } + } + } + } + }, + "UpdateStatus": { + "type": "object", + "properties": { + "State": { + "type": "string", + "enum": [ + "updating", + "paused", + "completed" + ] + }, + "StartedAt": { + "type": "string", + "format": "dateTime" + }, + "CompletedAt": { + "type": "string", + "format": "dateTime" + }, + "Message": { + "type": "string" + } + }, + "description": "The status of a service update." + }, + "ServiceStatus": { + "type": "object", + "properties": { + "RunningTasks": { + "type": "integer", + "description": "The number of tasks for the service currently in the Running state.\n", + "format": "uint64", + "example": 7 + }, + "DesiredTasks": { + "type": "integer", + "description": "The number of tasks for the service desired to be running.\nFor replicated services, this is the replica count from the\nservice spec. For global services, this is computed by taking\ncount of all tasks for the service with a Desired State other\nthan Shutdown.\n", + "format": "uint64", + "example": 10 + }, + "CompletedTasks": { + "type": "integer", + "description": "The number of tasks for a job that are in the Completed state.\nThis field must be cross-referenced with the service type, as the\nvalue of 0 may mean the service is not in a job mode, or it may\nmean the job-mode service has no tasks yet Completed.\n", + "format": "uint64" + } + }, + "description": "The status of the service's tasks. Provided only when requested as\npart of a ServiceList operation.\n" + }, + "JobStatus": { + "type": "object", + "properties": { + "JobIteration": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "LastExecution": { + "type": "string", + "description": "The last time, as observed by the server, that this job was\nstarted.\n", + "format": "dateTime" + } + }, + "description": "The status of the service when it is in one of ReplicatedJob or\nGlobalJob modes. Absent on Replicated and Global mode services. The\nJobIteration is an ObjectVersion, but unlike the Service's version,\ndoes not need to be sent with an update request.\n" + } + }, + "example": { + "ID": "9mnpnzenvg8p8tdbtq4wvbkcz", + "Version": { + "Index": 19 + }, + "CreatedAt": "2016-06-07T21:05:51.880065305Z", + "UpdatedAt": "2016-06-07T21:07:29.962229872Z", + "Spec": { + "Name": "hopeful_cori", + "TaskTemplate": { + "ContainerSpec": { + "Image": "redis" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {}, + "ForceUpdate": 0 + }, + "Mode": { + "Replicated": { + "Replicas": 1 + } + }, + "UpdateConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "RollbackConfig": { + "Parallelism": 1, + "Delay": 1000000000, + "FailureAction": "pause", + "Monitor": 15000000000, + "MaxFailureRatio": 0.15 + }, + "EndpointSpec": { + "Mode": "vip", + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ] + } + }, + "Endpoint": { + "Spec": { + "Mode": "vip", + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ] + }, + "Ports": [ + { + "Protocol": "tcp", + "TargetPort": 6379, + "PublishedPort": 30001 + } + ], + "VirtualIPs": [ + { + "NetworkID": "4qvuz4ko70xaltuqbt8956gd1", + "Addr": "10.255.0.2/16" + }, + { + "NetworkID": "4qvuz4ko70xaltuqbt8956gd1", + "Addr": "10.255.0.3/16" + } + ] + } + } + }, + "ImageDeleteResponseItem": { + "type": "object", + "properties": { + "Untagged": { + "type": "string", + "description": "The image ID of an image that was untagged" + }, + "Deleted": { + "type": "string", + "description": "The image ID of an image that was deleted" + } + }, + "x-go-name": "DeleteResponse" + }, + "ServiceCreateResponse": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the created service.", + "nullable": false, + "example": "ak7w3gjqoa3kuz8xcpnyy0pvl" + }, + "Warnings": { + "type": "array", + "description": "Optional warning message.\n\nFIXME(thaJeztah): this should have \"omitempty\" in the generated type.\n", + "nullable": true, + "example": [ + "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + ], + "items": { + "type": "string" + } + } + }, + "description": "contains the information returned to a client on the\ncreation of a new service.\n" + }, + "ServiceUpdateResponse": { + "type": "object", + "properties": { + "Warnings": { + "type": "array", + "description": "Optional warning messages", + "items": { + "type": "string" + } + } + }, + "example": { + "Warnings": [ + "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + ] + } + }, + "ContainerSummary": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of this container", + "x-go-name": "ID" + }, + "Names": { + "type": "array", + "description": "The names that this container has been given", + "items": { + "type": "string" + } + }, + "Image": { + "type": "string", + "description": "The name of the image used when creating this container" + }, + "ImageID": { + "type": "string", + "description": "The ID of the image that this container was created from" + }, + "Command": { + "type": "string", + "description": "Command to run when starting the container" + }, + "Created": { + "type": "integer", + "description": "When the container was created", + "format": "int64" + }, + "Ports": { + "type": "array", + "description": "The ports exposed by this container", + "items": { + "$ref": "#/components/schemas/Port" + } + }, + "SizeRw": { + "type": "integer", + "description": "The size of files that have been created or changed by this container", + "format": "int64" + }, + "SizeRootFs": { + "type": "integer", + "description": "The total size of all the files in this container", + "format": "int64" + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "State": { + "type": "string", + "description": "The state of this container (e.g. `Exited`)" + }, + "Status": { + "type": "string", + "description": "Additional human-readable status of this container (e.g. `Exit 0`)" + }, + "HostConfig": { + "type": "object", + "properties": { + "NetworkMode": { + "type": "string" + } + } + }, + "NetworkSettings": { + "type": "object", + "properties": { + "Networks": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/EndpointSettings" + } + } + }, + "description": "A summary of the container's network settings" + }, + "Mounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MountPoint" + } + } + } + }, + "Driver": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the driver.", + "nullable": false, + "example": "some-driver" + }, + "Options": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Key/value map of driver-specific options.", + "nullable": false, + "example": { + "OptionA": "value for driver-specific option A", + "OptionB": "value for driver-specific option B" + } + } + }, + "description": "Driver represents a driver (network, logging, secrets)." + }, + "SecretSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "User-defined name of the secret." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata.", + "example": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + }, + "Data": { + "type": "string", + "description": "Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5))\ndata to store as secret.\n\nThis field is only used to _create_ a secret, and is not returned by\nother endpoints.\n", + "example": "" + }, + "Driver": { + "$ref": "#/components/schemas/Driver" + }, + "Templating": { + "$ref": "#/components/schemas/Driver" + } + } + }, + "Secret": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "example": "blt1owaxmitz71s9v5zh81zun" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime", + "example": "2017-07-20T13:55:28.678958722Z" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime", + "example": "2017-07-20T13:55:28.678958722Z" + }, + "Spec": { + "$ref": "#/components/schemas/SecretSpec" + } + } + }, + "ConfigSpec": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "User-defined name of the config." + }, + "Labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "User-defined key/value metadata." + }, + "Data": { + "type": "string", + "description": "Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5))\nconfig data.\n" + }, + "Templating": { + "$ref": "#/components/schemas/Driver" + } + } + }, + "Config": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Spec": { + "$ref": "#/components/schemas/ConfigSpec" + } + } + }, + "ContainerState": { + "type": "object", + "properties": { + "Status": { + "type": "string", + "description": "String representation of the container state. Can be one of \"created\",\n\"running\", \"paused\", \"restarting\", \"removing\", \"exited\", or \"dead\".\n", + "example": "running", + "enum": [ + "created", + "running", + "paused", + "restarting", + "removing", + "exited", + "dead" + ] + }, + "Running": { + "type": "boolean", + "description": "Whether this container is running.\n\nNote that a running container can be _paused_. The `Running` and `Paused`\nbooleans are not mutually exclusive:\n\nWhen pausing a container (on Linux), the freezer cgroup is used to suspend\nall processes in the container. Freezing the process requires the process to\nbe running. As a result, paused containers are both `Running` _and_ `Paused`.\n\nUse the `Status` field instead to determine if a container's state is \"running\".\n", + "example": true + }, + "Paused": { + "type": "boolean", + "description": "Whether this container is paused.", + "example": false + }, + "Restarting": { + "type": "boolean", + "description": "Whether this container is restarting.", + "example": false + }, + "OOMKilled": { + "type": "boolean", + "description": "Whether a process within this container has been killed because it ran\nout of memory since the container was last started.\n", + "example": false + }, + "Dead": { + "type": "boolean", + "example": false + }, + "Pid": { + "type": "integer", + "description": "The process ID of this container", + "example": 1234 + }, + "ExitCode": { + "type": "integer", + "description": "The last exit code of this container", + "example": 0 + }, + "Error": { + "type": "string" + }, + "StartedAt": { + "type": "string", + "description": "The time when this container was last started.", + "example": "2020-01-06T09:06:59.461876391Z" + }, + "FinishedAt": { + "type": "string", + "description": "The time when this container last exited.", + "example": "2020-01-06T09:07:59.461876391Z" + }, + "Health": { + "$ref": "#/components/schemas/Health" + } + }, + "description": "ContainerState stores container's running state. It's part of ContainerJSONBase\nand will be returned by the \"inspect\" command.\n", + "nullable": true, + "x-nullable": true + }, + "ContainerCreateResponse": { + "title": "ContainerCreateResponse", + "required": [ + "Id", + "Warnings" + ], + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The ID of the created container", + "nullable": false, + "example": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + }, + "Warnings": { + "type": "array", + "description": "Warnings encountered when creating the container", + "nullable": false, + "example": [], + "items": { + "type": "string" + } + } + }, + "description": "OK response to ContainerCreate operation", + "x-go-name": "CreateResponse" + }, + "ContainerWaitResponse": { + "title": "ContainerWaitResponse", + "required": [ + "StatusCode" + ], + "type": "object", + "properties": { + "StatusCode": { + "type": "integer", + "description": "Exit code of the container", + "format": "int64", + "nullable": false + }, + "Error": { + "$ref": "#/components/schemas/ContainerWaitExitError" + } + }, + "description": "OK response to ContainerWait operation", + "x-go-name": "WaitResponse" + }, + "ContainerWaitExitError": { + "type": "object", + "properties": { + "Message": { + "type": "string", + "description": "Details of an error" + } + }, + "description": "container waiting error, if any", + "x-go-name": "WaitExitError" + }, + "SystemVersion": { + "type": "object", + "properties": { + "Platform": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string" + } + } + }, + "Components": { + "type": "array", + "description": "Information about system components\n", + "items": { + "required": [ + "Name", + "Version" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the component\n", + "example": "Engine" + }, + "Version": { + "type": "string", + "description": "Version of the component\n", + "nullable": false, + "example": "19.03.12" + }, + "Details": { + "type": "object", + "properties": {}, + "description": "Key/value pairs of strings with additional information about the\ncomponent. These values are intended for informational purposes\nonly, and their content is not defined, and not part of the API\nspecification.\n\nThese messages can be printed by the client as information to the user.\n", + "nullable": true + } + }, + "x-go-name": "ComponentVersion" + } + }, + "Version": { + "type": "string", + "description": "The version of the daemon", + "example": "19.03.12" + }, + "ApiVersion": { + "type": "string", + "description": "The default (and highest) API version that is supported by the daemon\n", + "example": "1.40" + }, + "MinAPIVersion": { + "type": "string", + "description": "The minimum API version that is supported by the daemon\n", + "example": "1.12" + }, + "GitCommit": { + "type": "string", + "description": "The Git commit of the source code that was used to build the daemon\n", + "example": "48a66213fe" + }, + "GoVersion": { + "type": "string", + "description": "The version Go used to compile the daemon, and the version of the Go\nruntime in use.\n", + "example": "go1.13.14" + }, + "Os": { + "type": "string", + "description": "The operating system that the daemon is running on (\"linux\" or \"windows\")\n", + "example": "linux" + }, + "Arch": { + "type": "string", + "description": "The architecture that the daemon is running on\n", + "example": "amd64" + }, + "KernelVersion": { + "type": "string", + "description": "The kernel version (`uname -r`) that the daemon is running on.\n\nThis field is omitted when empty.\n", + "example": "4.19.76-linuxkit" + }, + "Experimental": { + "type": "boolean", + "description": "Indicates if the daemon is started with experimental features enabled.\n\nThis field is omitted when empty / false.\n", + "example": true + }, + "BuildTime": { + "type": "string", + "description": "The date and time that the daemon was compiled.\n", + "example": "2020-06-22T15:49:27.000000000+00:00" + } + }, + "description": "Response of Engine API: GET \"/version\"\n" + }, + "SystemInfo": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Unique identifier of the daemon.\n\n


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


\n\n> **Note**: The information returned in this field, including the\n> formatting of values and labels, should not be considered stable,\n> and may change without notice.\n", + "example": [ + [ + "Backing Filesystem", + "extfs" + ], + [ + "Supports d_type", + "true" + ], + [ + "Native Overlay Diff", + "true" + ] + ], + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "DockerRootDir": { + "type": "string", + "description": "Root directory of persistent Docker state.\n\nDefaults to `/var/lib/docker` on Linux, and `C:\\ProgramData\\docker`\non Windows.\n", + "example": "/var/lib/docker" + }, + "Plugins": { + "$ref": "#/components/schemas/PluginsInfo" + }, + "MemoryLimit": { + "type": "boolean", + "description": "Indicates if the host has memory limit support enabled.", + "example": true + }, + "SwapLimit": { + "type": "boolean", + "description": "Indicates if the host has memory swap limit support enabled.", + "example": true + }, + "KernelMemoryTCP": { + "type": "boolean", + "description": "Indicates if the host has kernel memory TCP limit support enabled. This\nfield is omitted if not supported.\n\nKernel memory TCP limits are not supported when using cgroups v2, which\ndoes not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup.\n", + "example": true + }, + "CpuCfsPeriod": { + "type": "boolean", + "description": "Indicates if CPU CFS(Completely Fair Scheduler) period is supported by\nthe host.\n", + "example": true + }, + "CpuCfsQuota": { + "type": "boolean", + "description": "Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by\nthe host.\n", + "example": true + }, + "CPUShares": { + "type": "boolean", + "description": "Indicates if CPU Shares limiting is supported by the host.\n", + "example": true + }, + "CPUSet": { + "type": "boolean", + "description": "Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host.\n\nSee [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt)\n", + "example": true + }, + "PidsLimit": { + "type": "boolean", + "description": "Indicates if the host kernel has PID limit support enabled.", + "example": true + }, + "OomKillDisable": { + "type": "boolean", + "description": "Indicates if OOM killer disable is supported on the host." + }, + "IPv4Forwarding": { + "type": "boolean", + "description": "Indicates IPv4 forwarding is enabled.", + "example": true + }, + "BridgeNfIptables": { + "type": "boolean", + "description": "Indicates if `bridge-nf-call-iptables` is available on the host.", + "example": true + }, + "BridgeNfIp6tables": { + "type": "boolean", + "description": "Indicates if `bridge-nf-call-ip6tables` is available on the host.", + "example": true + }, + "Debug": { + "type": "boolean", + "description": "Indicates if the daemon is running in debug-mode / with debug-level\nlogging enabled.\n", + "example": true + }, + "NFd": { + "type": "integer", + "description": "The total number of file Descriptors in use by the daemon process.\n\nThis information is only returned if debug-mode is enabled.\n", + "example": 64 + }, + "NGoroutines": { + "type": "integer", + "description": "The number of goroutines that currently exist.\n\nThis information is only returned if debug-mode is enabled.\n", + "example": 174 + }, + "SystemTime": { + "type": "string", + "description": "Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt)\nformat with nano-seconds.\n", + "example": "2017-08-08T20:28:29.06202363Z" + }, + "LoggingDriver": { + "type": "string", + "description": "The logging driver to use as a default for new containers.\n" + }, + "CgroupDriver": { + "type": "string", + "description": "The driver to use for managing cgroups.\n", + "example": "cgroupfs", + "default": "cgroupfs", + "enum": [ + "cgroupfs", + "systemd", + "none" + ] + }, + "CgroupVersion": { + "type": "string", + "description": "The version of the cgroup.\n", + "example": "1", + "default": "1", + "enum": [ + "1", + "2" + ] + }, + "NEventsListener": { + "type": "integer", + "description": "Number of event listeners subscribed.", + "example": 30 + }, + "KernelVersion": { + "type": "string", + "description": "Kernel version of the host.\n\nOn Linux, this information obtained from `uname`. On Windows this\ninformation is queried from the HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\\nregistry value, for example _\"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)\"_.\n", + "example": "4.9.38-moby" + }, + "OperatingSystem": { + "type": "string", + "description": "Name of the host's operating system, for example: \"Ubuntu 16.04.2 LTS\"\nor \"Windows Server 2016 Datacenter\"\n", + "example": "Alpine Linux v3.5" + }, + "OSVersion": { + "type": "string", + "description": "Version of the host's operating system\n\n


\n\n> **Note**: The information returned in this field, including its\n> very existence, and the formatting of values, should not be considered\n> stable, and may change without notice.\n", + "example": "16.04" + }, + "OSType": { + "type": "string", + "description": "Generic type of the operating system of the host, as returned by the\nGo runtime (`GOOS`).\n\nCurrently returned values are \"linux\" and \"windows\". A full list of\npossible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment).\n", + "example": "linux" + }, + "Architecture": { + "type": "string", + "description": "Hardware architecture of the host, as returned by the Go runtime\n(`GOARCH`).\n\nA full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment).\n", + "example": "x86_64" + }, + "NCPU": { + "type": "integer", + "description": "The number of logical CPUs usable by the daemon.\n\nThe number of available CPUs is checked by querying the operating\nsystem when the daemon starts. Changes to operating system CPU\nallocation after the daemon is started are not reflected.\n", + "example": 4 + }, + "MemTotal": { + "type": "integer", + "description": "Total amount of physical memory available on the host, in bytes.\n", + "format": "int64", + "example": 2095882240 + }, + "IndexServerAddress": { + "type": "string", + "description": "Address / URL of the index server that is used for image search,\nand as a default for user authentication for Docker Hub and Docker Cloud.\n", + "example": "https://index.docker.io/v1/", + "default": "https://index.docker.io/v1/" + }, + "RegistryConfig": { + "$ref": "#/components/schemas/RegistryServiceConfig" + }, + "GenericResources": { + "$ref": "#/components/schemas/GenericResources" + }, + "HttpProxy": { + "type": "string", + "description": "HTTP-proxy configured for the daemon. This value is obtained from the\n[`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable.\nCredentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL\nare masked in the API response.\n\nContainers do not automatically inherit this configuration.\n", + "example": "http://xxxxx:xxxxx@proxy.corp.example.com:8080" + }, + "HttpsProxy": { + "type": "string", + "description": "HTTPS-proxy configured for the daemon. This value is obtained from the\n[`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable.\nCredentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL\nare masked in the API response.\n\nContainers do not automatically inherit this configuration.\n", + "example": "https://xxxxx:xxxxx@proxy.corp.example.com:4443" + }, + "NoProxy": { + "type": "string", + "description": "Comma-separated list of domain extensions for which no proxy should be\nused. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html)\nenvironment variable.\n\nContainers do not automatically inherit this configuration.\n", + "example": "*.local, 169.254/16" + }, + "Name": { + "type": "string", + "description": "Hostname of the host.", + "example": "node5.corp.example.com" + }, + "Labels": { + "type": "array", + "description": "User-defined labels (key/value metadata) as set on the daemon.\n\n


\n\n> **Note**: When part of a Swarm, nodes can both have _daemon_ labels,\n> set through the daemon configuration, and _node_ labels, set from a\n> manager node in the Swarm. Node labels are not included in this\n> field. Node labels can be retrieved using the `/nodes/(id)` endpoint\n> on a manager node in the Swarm.\n", + "example": [ + "storage=ssd", + "production" + ], + "items": { + "type": "string" + } + }, + "ExperimentalBuild": { + "type": "boolean", + "description": "Indicates if experimental features are enabled on the daemon.\n", + "example": true + }, + "ServerVersion": { + "type": "string", + "description": "Version string of the daemon.\n", + "example": "24.0.2" + }, + "Runtimes": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Runtime" + }, + "description": "List of [OCI compliant](https://github.com/opencontainers/runtime-spec)\nruntimes configured on the daemon. Keys hold the \"name\" used to\nreference the runtime.\n\nThe Docker daemon relies on an OCI compliant runtime (invoked via the\n`containerd` daemon) as its interface to the Linux kernel namespaces,\ncgroups, and SELinux.\n\nThe default runtime is `runc`, and automatically configured. Additional\nruntimes can be configured by the user and will be listed here.\n", + "example": { + "runc": { + "path": "runc" + }, + "runc-master": { + "path": "/go/bin/runc" + }, + "custom": { + "path": "/usr/local/bin/my-oci-runtime", + "runtimeArgs": [ + "--debug", + "--systemd-cgroup=false" + ] + } + } + }, + "DefaultRuntime": { + "type": "string", + "description": "Name of the default OCI runtime that is used when starting containers.\n\nThe default can be overridden per-container at create time.\n", + "example": "runc", + "default": "runc" + }, + "Swarm": { + "$ref": "#/components/schemas/SwarmInfo" + }, + "LiveRestoreEnabled": { + "type": "boolean", + "description": "Indicates if live restore is enabled.\n\nIf enabled, containers are kept running when the daemon is shutdown\nor upon daemon start if running containers are detected.\n", + "example": false, + "default": false + }, + "Isolation": { + "type": "string", + "description": "Represents the isolation technology to use as a default for containers.\nThe supported values are platform-specific.\n\nIf no isolation value is specified on daemon start, on Windows client,\nthe default is `hyperv`, and on Windows server, the default is `process`.\n\nThis option is currently not used on other platforms.\n", + "default": "default", + "enum": [ + "default", + "hyperv", + "process" + ] + }, + "InitBinary": { + "type": "string", + "description": "Name and, optional, path of the `docker-init` binary.\n\nIf the path is omitted, the daemon searches the host's `$PATH` for the\nbinary and uses the first result.\n", + "example": "docker-init" + }, + "ContainerdCommit": { + "$ref": "#/components/schemas/Commit" + }, + "RuncCommit": { + "$ref": "#/components/schemas/Commit" + }, + "InitCommit": { + "$ref": "#/components/schemas/Commit" + }, + "SecurityOptions": { + "type": "array", + "description": "List of security features that are enabled on the daemon, such as\napparmor, seccomp, SELinux, user-namespaces (userns), rootless and\nno-new-privileges.\n\nAdditional configuration options for each security feature may\nbe present, and are included as a comma-separated list of key/value\npairs.\n", + "example": [ + "name=apparmor", + "name=seccomp,profile=default", + "name=selinux", + "name=userns", + "name=rootless" + ], + "items": { + "type": "string" + } + }, + "ProductLicense": { + "type": "string", + "description": "Reports a summary of the product license on the daemon.\n\nIf a commercial license has been applied to the daemon, information\nsuch as number of nodes, and expiration are included.\n", + "example": "Community Engine" + }, + "DefaultAddressPools": { + "type": "array", + "description": "List of custom default address pools for local networks, which can be\nspecified in the daemon.json file or dockerd option.\n\nExample: a Base \"10.10.0.0/16\" with Size 24 will define the set of 256\n10.10.[0-255].0/24 address pools.\n", + "items": { + "type": "object", + "properties": { + "Base": { + "type": "string", + "description": "The network address in CIDR format", + "example": "10.10.0.0/16" + }, + "Size": { + "type": "integer", + "description": "The network pool size", + "example": 24 + } + } + } + }, + "Warnings": { + "type": "array", + "description": "List of warnings / informational messages about missing features, or\nissues related to the daemon configuration.\n\nThese messages can be printed by the client as information to the user.\n", + "example": [ + "WARNING: No memory limit support", + "WARNING: bridge-nf-call-iptables is disabled", + "WARNING: bridge-nf-call-ip6tables is disabled" + ], + "items": { + "type": "string" + } + }, + "CDISpecDirs": { + "type": "array", + "description": "List of directories where (Container Device Interface) CDI\nspecifications are located.\n\nThese specifications define vendor-specific modifications to an OCI\nruntime specification for a container being created.\n\nAn empty list indicates that CDI device injection is disabled.\n\nNote that since using CDI device injection requires the daemon to have\nexperimental enabled. For non-experimental daemons an empty list will\nalways be returned.\n", + "example": [ + "/etc/cdi", + "/var/run/cdi" + ], + "items": { + "type": "string" + } + } + } + }, + "PluginsInfo": { + "type": "object", + "properties": { + "Volume": { + "type": "array", + "description": "Names of available volume-drivers, and network-driver plugins.", + "example": [ + "local" + ], + "items": { + "type": "string" + } + }, + "Network": { + "type": "array", + "description": "Names of available network-drivers, and network-driver plugins.", + "example": [ + "bridge", + "host", + "ipvlan", + "macvlan", + "null", + "overlay" + ], + "items": { + "type": "string" + } + }, + "Authorization": { + "type": "array", + "description": "Names of available authorization plugins.", + "example": [ + "img-authz-plugin", + "hbm" + ], + "items": { + "type": "string" + } + }, + "Log": { + "type": "array", + "description": "Names of available logging-drivers, and logging-driver plugins.", + "example": [ + "awslogs", + "fluentd", + "gcplogs", + "gelf", + "journald", + "json-file", + "splunk", + "syslog" + ], + "items": { + "type": "string" + } + } + }, + "description": "Available plugins per type.\n\n


\n\n> **Note**: Only unmanaged (V1) plugins are included in this list.\n> V1 plugins are \"lazily\" loaded, and are not returned in this list\n> if there is no resource using the plugin.\n" + }, + "RegistryServiceConfig": { + "type": "object", + "properties": { + "AllowNondistributableArtifactsCIDRs": { + "type": "array", + "description": "List of IP ranges to which nondistributable artifacts can be pushed,\nusing the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632).\n\nSome images (for example, Windows base images) contain artifacts\nwhose distribution is restricted by license. When these images are\npushed to a registry, restricted artifacts are not included.\n\nThis configuration override this behavior, and enables the daemon to\npush nondistributable artifacts to all registries whose resolved IP\naddress is within the subnet described by the CIDR syntax.\n\nThis option is useful when pushing images containing\nnondistributable artifacts to a registry on an air-gapped network so\nhosts on that network can pull the images without connecting to\nanother server.\n\n> **Warning**: Nondistributable artifacts typically have restrictions\n> on how and where they can be distributed and shared. Only use this\n> feature to push artifacts to private registries and ensure that you\n> are in compliance with any terms that cover redistributing\n> nondistributable artifacts.\n", + "example": [ + "::1/128", + "127.0.0.0/8" + ], + "items": { + "type": "string" + } + }, + "AllowNondistributableArtifactsHostnames": { + "type": "array", + "description": "List of registry hostnames to which nondistributable artifacts can be\npushed, using the format `[:]` or `[:]`.\n\nSome images (for example, Windows base images) contain artifacts\nwhose distribution is restricted by license. When these images are\npushed to a registry, restricted artifacts are not included.\n\nThis configuration override this behavior for the specified\nregistries.\n\nThis option is useful when pushing images containing\nnondistributable artifacts to a registry on an air-gapped network so\nhosts on that network can pull the images without connecting to\nanother server.\n\n> **Warning**: Nondistributable artifacts typically have restrictions\n> on how and where they can be distributed and shared. Only use this\n> feature to push artifacts to private registries and ensure that you\n> are in compliance with any terms that cover redistributing\n> nondistributable artifacts.\n", + "example": [ + "registry.internal.corp.example.com:3000", + "[2001:db8:a0b:12f0::1]:443" + ], + "items": { + "type": "string" + } + }, + "InsecureRegistryCIDRs": { + "type": "array", + "description": "List of IP ranges of insecure registries, using the CIDR syntax\n([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries\naccept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates\nfrom unknown CAs) communication.\n\nBy default, local registries (`127.0.0.0/8`) are configured as\ninsecure. All other registries are secure. Communicating with an\ninsecure registry is not possible if the daemon assumes that registry\nis secure.\n\nThis configuration override this behavior, insecure communication with\nregistries whose resolved IP address is within the subnet described by\nthe CIDR syntax.\n\nRegistries can also be marked insecure by hostname. Those registries\nare listed under `IndexConfigs` and have their `Secure` field set to\n`false`.\n\n> **Warning**: Using this option can be useful when running a local\n> registry, but introduces security vulnerabilities. This option\n> should therefore ONLY be used for testing purposes. For increased\n> security, users should add their CA to their system's list of trusted\n> CAs instead of enabling this option.\n", + "example": [ + "::1/128", + "127.0.0.0/8" + ], + "items": { + "type": "string" + } + }, + "IndexConfigs": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/IndexInfo" + }, + "example": { + "127.0.0.1:5000": { + "Name": "127.0.0.1:5000", + "Mirrors": [], + "Secure": false, + "Official": false + }, + "[2001:db8:a0b:12f0::1]:80": { + "Name": "[2001:db8:a0b:12f0::1]:80", + "Mirrors": [], + "Secure": false, + "Official": false + }, + "docker.io": { + "Name": "docker.io", + "Mirrors": [ + "https://hub-mirror.corp.example.com:5000/" + ], + "Secure": true, + "Official": true + }, + "registry.internal.corp.example.com:3000": { + "Name": "registry.internal.corp.example.com:3000", + "Mirrors": [], + "Secure": false, + "Official": false + } + } + }, + "Mirrors": { + "type": "array", + "description": "List of registry URLs that act as a mirror for the official\n(`docker.io`) registry.\n", + "example": [ + "https://hub-mirror.corp.example.com:5000/", + "https://[2001:db8:a0b:12f0::1]/" + ], + "items": { + "type": "string" + } + } + }, + "description": "RegistryServiceConfig stores daemon registry services configuration.\n", + "nullable": true, + "x-nullable": true + }, + "IndexInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the registry, such as \"docker.io\".\n", + "example": "docker.io" + }, + "Mirrors": { + "type": "array", + "description": "List of mirrors, expressed as URIs.\n", + "example": [ + "https://hub-mirror.corp.example.com:5000/", + "https://registry-2.docker.io/", + "https://registry-3.docker.io/" + ], + "items": { + "type": "string" + } + }, + "Secure": { + "type": "boolean", + "description": "Indicates if the registry is part of the list of insecure\nregistries.\n\nIf `false`, the registry is insecure. Insecure registries accept\nun-encrypted (HTTP) and/or untrusted (HTTPS with certificates from\nunknown CAs) communication.\n\n> **Warning**: Insecure registries can be useful when running a local\n> registry. However, because its use creates security vulnerabilities\n> it should ONLY be enabled for testing purposes. For increased\n> security, users should add their CA to their system's list of\n> trusted CAs instead of enabling this option.\n", + "example": true + }, + "Official": { + "type": "boolean", + "description": "Indicates whether this is an official registry (i.e., Docker Hub / docker.io)\n", + "example": true + } + }, + "description": "IndexInfo contains information about a registry.", + "nullable": true, + "x-nullable": true + }, + "Runtime": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "Name and, optional, path, of the OCI executable binary.\n\nIf the path is omitted, the daemon searches the host's `$PATH` for the\nbinary and uses the first result.\n", + "example": "/usr/local/bin/my-oci-runtime" + }, + "runtimeArgs": { + "type": "array", + "description": "List of command-line arguments to pass to the runtime when invoked.\n", + "nullable": true, + "example": [ + "--debug", + "--systemd-cgroup=false" + ], + "items": { + "type": "string" + } + }, + "status": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Information specific to the runtime.\n\nWhile this API specification does not define data provided by runtimes,\nthe following well-known properties may be provided by runtimes:\n\n`org.opencontainers.runtime-spec.features`: features structure as defined\nin the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md),\nin a JSON string representation.\n\n


\n\n> **Note**: The information returned in this field, including the\n> formatting of values and labels, should not be considered stable,\n> and may change without notice.\n", + "nullable": true, + "example": { + "org.opencontainers.runtime-spec.features": "{\"ociVersionMin\":\"1.0.0\",\"ociVersionMax\":\"1.1.0\",\"...\":\"...\"}" + } + } + }, + "description": "Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec)\nruntime.\n\nThe runtime is invoked by the daemon via the `containerd` daemon. OCI\nruntimes act as an interface to the Linux kernel namespaces, cgroups,\nand SELinux.\n" + }, + "Commit": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Actual commit ID of external tool.", + "example": "cfb82a876ecc11b5ca0977d1733adbe58599088a" + }, + "Expected": { + "type": "string", + "description": "Commit ID of external tool expected by dockerd as set at build time.\n", + "example": "2d41c047c83e09a6d61d464906feb2a2f3c52aa4" + } + }, + "description": "Commit holds the Git-commit (SHA1) that a binary was built from, as\nreported in the version-string of external tools, such as `containerd`,\nor `runC`.\n" + }, + "SwarmInfo": { + "type": "object", + "properties": { + "NodeID": { + "type": "string", + "description": "Unique identifier of for this node in the swarm.", + "example": "k67qz4598weg5unwwffg6z1m1", + "default": "" + }, + "NodeAddr": { + "type": "string", + "description": "IP address at which this node can be reached by other nodes in the\nswarm.\n", + "example": "10.0.0.46", + "default": "" + }, + "LocalNodeState": { + "$ref": "#/components/schemas/LocalNodeState" + }, + "ControlAvailable": { + "type": "boolean", + "example": true, + "default": false + }, + "Error": { + "type": "string", + "default": "" + }, + "RemoteManagers": { + "type": "array", + "description": "List of ID's and addresses of other managers in the swarm.\n", + "nullable": true, + "example": [ + { + "NodeID": "71izy0goik036k48jg985xnds", + "Addr": "10.0.0.158:2377" + }, + { + "NodeID": "79y6h1o4gv8n120drcprv5nmc", + "Addr": "10.0.0.159:2377" + }, + { + "NodeID": "k67qz4598weg5unwwffg6z1m1", + "Addr": "10.0.0.46:2377" + } + ], + "items": { + "$ref": "#/components/schemas/PeerNode" + } + }, + "Nodes": { + "type": "integer", + "description": "Total number of nodes in the swarm.", + "nullable": true, + "example": 4 + }, + "Managers": { + "type": "integer", + "description": "Total number of managers in the swarm.", + "nullable": true, + "example": 3 + }, + "Cluster": { + "$ref": "#/components/schemas/ClusterInfo" + } + }, + "description": "Represents generic information about swarm.\n" + }, + "LocalNodeState": { + "type": "string", + "description": "Current local status of this node.", + "example": "active", + "default": "", + "enum": [ + "", + "inactive", + "pending", + "active", + "error", + "locked" + ] + }, + "PeerNode": { + "type": "object", + "properties": { + "NodeID": { + "type": "string", + "description": "Unique identifier of for this node in the swarm." + }, + "Addr": { + "type": "string", + "description": "IP address and ports at which this node can be reached.\n" + } + }, + "description": "Represents a peer-node in the swarm" + }, + "NetworkAttachmentConfig": { + "type": "object", + "properties": { + "Target": { + "type": "string", + "description": "The target network for attachment. Must be a network name or ID.\n" + }, + "Aliases": { + "type": "array", + "description": "Discoverable alternate names for the service on this network.\n", + "items": { + "type": "string" + } + }, + "DriverOpts": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Driver attachment options for the network target.\n" + } + }, + "description": "Specifies how a service should be attached to a particular network.\n" + }, + "EventActor": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The ID of the object emitting the event", + "example": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + }, + "Attributes": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Various key/value attributes of the object, depending on its type.\n", + "example": { + "com.example.some-label": "some-label-value", + "image": "alpine:latest", + "name": "my-container" + } + } + }, + "description": "Actor describes something that generates events, like a container, network,\nor a volume.\n" + }, + "EventMessage": { + "title": "SystemEventsResponse", + "type": "object", + "properties": { + "Type": { + "type": "string", + "description": "The type of object emitting the event", + "example": "container", + "enum": [ + "builder", + "config", + "container", + "daemon", + "image", + "network", + "node", + "plugin", + "secret", + "service", + "volume" + ] + }, + "Action": { + "type": "string", + "description": "The type of event", + "example": "create" + }, + "Actor": { + "$ref": "#/components/schemas/EventActor" + }, + "scope": { + "type": "string", + "description": "Scope of the event. Engine events are `local` scope. Cluster (Swarm)\nevents are `swarm` scope.\n", + "enum": [ + "local", + "swarm" + ] + }, + "time": { + "type": "integer", + "description": "Timestamp of event", + "format": "int64", + "example": 1629574695 + }, + "timeNano": { + "type": "integer", + "description": "Timestamp of event, with nanosecond accuracy", + "format": "int64", + "example": 1629574695515050000 + } + }, + "description": "EventMessage represents the information an event contains.\n" + }, + "OCIDescriptor": { + "type": "object", + "properties": { + "mediaType": { + "type": "string", + "description": "The media type of the object this schema refers to.\n", + "example": "application/vnd.docker.distribution.manifest.v2+json" + }, + "digest": { + "type": "string", + "description": "The digest of the targeted content.\n", + "example": "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96" + }, + "size": { + "type": "integer", + "description": "The size in bytes of the blob.\n", + "format": "int64", + "example": 3987495 + } + }, + "description": "A descriptor struct containing digest, media type, and size, as defined in\nthe [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md).\n", + "x-go-name": "Descriptor" + }, + "OCIPlatform": { + "type": "object", + "properties": { + "architecture": { + "type": "string", + "description": "The CPU architecture, for example `amd64` or `ppc64`.\n", + "example": "arm" + }, + "os": { + "type": "string", + "description": "The operating system, for example `linux` or `windows`.\n", + "example": "windows" + }, + "os.version": { + "type": "string", + "description": "Optional field specifying the operating system version, for example on\nWindows `10.0.19041.1165`.\n", + "example": "10.0.19041.1165" + }, + "os.features": { + "type": "array", + "description": "Optional field specifying an array of strings, each listing a required\nOS feature (for example on Windows `win32k`).\n", + "example": [ + "win32k" + ], + "items": { + "type": "string" + } + }, + "variant": { + "type": "string", + "description": "Optional field specifying a variant of the CPU, for example `v7` to\nspecify ARMv7 when architecture is `arm`.\n", + "example": "v7" + } + }, + "description": "Describes the platform which the image in the manifest runs on, as defined\nin the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md).\n", + "x-go-name": "Platform" + }, + "DistributionInspect": { + "title": "DistributionInspectResponse", + "required": [ + "Descriptor", + "Platforms" + ], + "type": "object", + "properties": { + "Descriptor": { + "$ref": "#/components/schemas/OCIDescriptor" + }, + "Platforms": { + "type": "array", + "description": "An array containing all platforms supported by the image.\n", + "items": { + "$ref": "#/components/schemas/OCIPlatform" + } + } + }, + "description": "Describes the result obtained from contacting the registry to retrieve\nimage metadata.\n", + "x-go-name": "DistributionInspect" + }, + "ClusterVolume": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "The Swarm ID of this volume. Because cluster volumes are Swarm\nobjects, they have an ID, unlike non-cluster volumes. This ID can\nbe used to refer to the Volume instead of the name.\n" + }, + "Version": { + "$ref": "#/components/schemas/ObjectVersion" + }, + "CreatedAt": { + "type": "string", + "format": "dateTime" + }, + "UpdatedAt": { + "type": "string", + "format": "dateTime" + }, + "Spec": { + "$ref": "#/components/schemas/ClusterVolumeSpec" + }, + "Info": { + "type": "object", + "properties": { + "CapacityBytes": { + "type": "integer", + "description": "The capacity of the volume in bytes. A value of 0 indicates that\nthe capacity is unknown.\n", + "format": "int64" + }, + "VolumeContext": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of strings to strings returned from the storage plugin when\nthe volume is created.\n" + }, + "VolumeID": { + "type": "string", + "description": "The ID of the volume as returned by the CSI storage plugin. This\nis distinct from the volume's ID as provided by Docker. This ID\nis never used by the user when communicating with Docker to refer\nto this volume. If the ID is blank, then the Volume has not been\nsuccessfully created in the plugin yet.\n" + }, + "AccessibleTopology": { + "type": "array", + "description": "The topology this volume is actually accessible from.\n", + "items": { + "$ref": "#/components/schemas/Topology" + } + } + }, + "description": "Information about the global status of the volume.\n" + }, + "PublishStatus": { + "type": "array", + "description": "The status of the volume as it pertains to its publishing and use on\nspecific nodes\n", + "items": { + "type": "object", + "properties": { + "NodeID": { + "type": "string", + "description": "The ID of the Swarm node the volume is published on.\n" + }, + "State": { + "type": "string", + "description": "The published state of the volume.\n* `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed.\n* `published` The volume is published successfully to the node.\n* `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so.\n* `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller.\n", + "enum": [ + "pending-publish", + "published", + "pending-node-unpublish", + "pending-controller-unpublish" + ] + }, + "PublishContext": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of strings to strings returned by the CSI controller\nplugin when a volume is published.\n" + } + } + } + } + }, + "description": "Options and information specific to, and only present on, Swarm CSI\ncluster volumes.\n" + }, + "ClusterVolumeSpec": { + "type": "object", + "properties": { + "Group": { + "type": "string", + "description": "Group defines the volume group of this volume. Volumes belonging to\nthe same group can be referred to by group name when creating\nServices. Referring to a volume by group instructs Swarm to treat\nvolumes in that group interchangeably for the purpose of scheduling.\nVolumes with an empty string for a group technically all belong to\nthe same, emptystring group.\n" + }, + "AccessMode": { + "type": "object", + "properties": { + "Scope": { + "type": "string", + "description": "The set of nodes this volume can be used on at one time.\n- `single` The volume may only be scheduled to one node at a time.\n- `multi` the volume may be scheduled to any supported number of nodes at a time.\n", + "nullable": false, + "default": "single", + "enum": [ + "single", + "multi" + ] + }, + "Sharing": { + "type": "string", + "description": "The number and way that different tasks can use this volume\nat one time.\n- `none` The volume may only be used by one task at a time.\n- `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly\n- `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write.\n- `all` The volume may have any number of readers and writers.\n", + "nullable": false, + "default": "none", + "enum": [ + "none", + "readonly", + "onewriter", + "all" + ] + }, + "MountVolume": { + "type": "object", + "properties": {}, + "description": "Options for using this volume as a Mount-type volume.\n\n Either MountVolume or BlockVolume, but not both, must be\n present.\n properties:\n FsType:\n type: \"string\"\n description: |\n Specifies the filesystem type for the mount volume.\n Optional.\n MountFlags:\n type: \"array\"\n description: |\n Flags to pass when mounting the volume. Optional.\n items:\n type: \"string\"\nBlockVolume:\n type: \"object\"\n description: |\n Options for using this volume as a Block-type volume.\n Intentionally empty.\n" + }, + "Secrets": { + "type": "array", + "description": "Swarm Secrets that are passed to the CSI storage plugin when\noperating on this volume.\n", + "items": { + "type": "object", + "properties": { + "Key": { + "type": "string", + "description": "Key is the name of the key of the key-value pair passed to\nthe plugin.\n" + }, + "Secret": { + "type": "string", + "description": "Secret is the swarm Secret object from which to read data.\nThis can be a Secret name or ID. The Secret data is\nretrieved by swarm and used as the value of the key-value\npair passed to the plugin.\n" + } + }, + "description": "One cluster volume secret entry. Defines a key-value pair that\nis passed to the plugin.\n" + } + }, + "AccessibilityRequirements": { + "type": "object", + "properties": { + "Requisite": { + "type": "array", + "description": "A list of required topologies, at least one of which the\nvolume must be accessible from.\n", + "items": { + "$ref": "#/components/schemas/Topology" + } + }, + "Preferred": { + "type": "array", + "description": "A list of topologies that the volume should attempt to be\nprovisioned in.\n", + "items": { + "$ref": "#/components/schemas/Topology" + } + } + }, + "description": "Requirements for the accessible topology of the volume. These\nfields are optional. For an in-depth description of what these\nfields mean, see the CSI specification.\n" + }, + "CapacityRange": { + "type": "object", + "properties": { + "RequiredBytes": { + "type": "integer", + "description": "The volume must be at least this big. The value of 0\nindicates an unspecified minimum\n", + "format": "int64" + }, + "LimitBytes": { + "type": "integer", + "description": "The volume must not be bigger than this. The value of 0\nindicates an unspecified maximum.\n", + "format": "int64" + } + }, + "description": "The desired capacity that the volume should be created with. If\nempty, the plugin will decide the capacity.\n" + }, + "Availability": { + "type": "string", + "description": "The availability of the volume for use in tasks.\n- `active` The volume is fully available for scheduling on the cluster\n- `pause` No new workloads should use the volume, but existing workloads are not stopped.\n- `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started.\n", + "nullable": false, + "default": "active", + "enum": [ + "active", + "pause", + "drain" + ] + } + }, + "description": "Defines how the volume is used by tasks.\n" + } + }, + "description": "Cluster-specific options used to create the volume.\n" + }, + "Topology": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A map of topological domains to topological segments. For in depth\ndetails, see documentation for the Topology object in the CSI\nspecification.\n" + } + } + } +} diff --git a/src/Client.php b/src/Client.php index 322a543a..73a045a6 100644 --- a/src/Client.php +++ b/src/Client.php @@ -2,62 +2,96 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API; -class Client extends \Jane\OpenApiRuntime\Client\Psr7HttplugClient +class Client extends Runtime\Client\Client { /** - * Returns a list of containers. For details on the format, see [the inspect endpoint](#operation/ContainerInspect). - - Note that it uses a different, smaller representation of a container than inspecting a single container. For example, - the list of linked containers is not propagated . - + * Returns a list of containers. For details on the format, see the + * [inspect endpoint](#operation/ContainerInspect). + * + * Note that it uses a different, smaller representation of a container + * than inspecting a single container. For example, the list of linked + * containers is not propagated . * * @param array $queryParameters { * - * @var bool $all Return all containers. By default, only running containers are shown - * @var int $limit return this number of most recently created containers, including non-running ones - * @var bool $size return the size of container as fields `SizeRw` and `SizeRootFs` - * @var string $filters Filters to process on the container list, encoded as JSON (a `map[string][]string`). For example, `{"status": ["paused"]}` will only return paused containers. Available filters: - + * @var bool $all Return all containers. By default, only running containers are shown. + * @var int $limit return this number of most recently created containers, including + * non-running ones + * @var bool $size return the size of container as fields `SizeRw` and `SizeRootFs` + * @var string $filters Filters to process on the container list, encoded as JSON (a + * `map[string][]string`). For example, `{"status": ["paused"]}` will + * only return paused containers. + * + * Available filters: + * + * - `ancestor`=(`[:]`, ``, or ``) + * - `before`=(`` or ``) + * - `expose`=(`[/]`|`/[]`) + * - `exited=` containers with exit code of `` + * - `health`=(`starting`|`healthy`|`unhealthy`|`none`) + * - `id=` a container's ID + * - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) + * - `is-task=`(`true`|`false`) + * - `label=key` or `label="key=value"` of a container label + * - `name=` a container's name + * - `network`=(`` or ``) + * - `publish`=(`[/]`|`/[]`) + * - `since`=(`` or ``) + * - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) + * - `volume`=(`` or ``) + * * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ContainerListBadRequestException - * @throws \Docker\API\Exception\ContainerListInternalServerErrorException + * @throws Exception\ContainerListBadRequestException + * @throws Exception\ContainerListInternalServerErrorException * - * @return null|\Docker\API\Model\ContainerSummaryItem[]|\Psr\Http\Message\ResponseInterface + * @return Model\ContainerSummary[]|\Psr\Http\Message\ResponseInterface|null */ public function containerList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerList($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerList($queryParameters), $fetch); } /** - * @param \Docker\API\Model\ContainersCreatePostBody $body Container to create - * @param array $queryParameters { + * @param array $queryParameters { + * + * @var string $name Assign the specified name to the container. Must match + * `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`. + * @var string $platform Platform in the format `os[/arch[/variant]]` used for image lookup. + * + * When specified, the daemon checks if the requested image is present + * in the local image cache with the given OS and Architecture, and + * otherwise returns a `404` status. + * + * If the option is not set, the host's native OS and Architecture are + * used to look up the image in the image cache. However, if no platform + * is passed and the given image does exist in the local image cache, + * but its OS or architecture does not match, the container is created + * with the available image, and a warning is added to the `Warnings` + * field in the response, for example; + * + * WARNING: The requested image's platform (linux/arm64/v8) does not + * match the detected host platform (linux/amd64) and no + * specific platform was requested * - * @var string $name Assign the specified name to the container. Must match `/?[a-zA-Z0-9_-]+`. * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ContainerCreateBadRequestException - * @throws \Docker\API\Exception\ContainerCreateNotFoundException - * @throws \Docker\API\Exception\ContainerCreateConflictException - * @throws \Docker\API\Exception\ContainerCreateInternalServerErrorException + * @throws Exception\ContainerCreateBadRequestException + * @throws Exception\ContainerCreateNotFoundException + * @throws Exception\ContainerCreateConflictException + * @throws Exception\ContainerCreateInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersCreatePostResponse201|\Psr\Http\Message\ResponseInterface + * @return Model\ContainerCreateResponse|\Psr\Http\Message\ResponseInterface|null */ - public function containerCreate(\Docker\API\Model\ContainersCreatePostBody $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function containerCreate(?Model\ContainersCreatePostBody $requestBody = null, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerCreate($body, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerCreate($requestBody, $queryParameters), $fetch); } /** @@ -66,440 +100,506 @@ public function containerCreate(\Docker\API\Model\ContainersCreatePostBody $body * @param string $id ID or name of the container * @param array $queryParameters { * - * @var bool $size Return the size of container as fields `SizeRw` and `SizeRootFs` - * } + * @var bool $size Return the size of container as fields `SizeRw` and `SizeRootFs` + * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ContainerInspectNotFoundException - * @throws \Docker\API\Exception\ContainerInspectInternalServerErrorException + * @throws Exception\ContainerInspectNotFoundException + * @throws Exception\ContainerInspectInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersIdJsonGetResponse200|\Psr\Http\Message\ResponseInterface + * @return Model\ContainersIdJsonGetResponse200|\Psr\Http\Message\ResponseInterface|null */ public function containerInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerInspect($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerInspect($id, $queryParameters), $fetch); } /** - * On Unix systems, this is done by running the `ps` command. This endpoint is not supported on Windows. + * On Unix systems, this is done by running the `ps` command. This endpoint + * is not supported on Windows. * * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $ps_args The arguments to pass to `ps`. For example, `aux` - * } + * @var string $ps_args The arguments to pass to `ps`. For example, `aux` + * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ContainerTopNotFoundException - * @throws \Docker\API\Exception\ContainerTopInternalServerErrorException + * @throws Exception\ContainerTopNotFoundException + * @throws Exception\ContainerTopInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersIdTopGetResponse200|\Psr\Http\Message\ResponseInterface + * @return Model\ContainersIdTopGetJsonResponse200|\Psr\Http\Message\ResponseInterface|null */ - public function containerTop(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function containerTop(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerTop($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerTop($id, $queryParameters, $accept), $fetch); } /** * Get `stdout` and `stderr` logs from a container. - - Note: This endpoint works only for containers with the `json-file` or `journald` logging driver. - + * + * Note: This endpoint works only for containers with the `json-file` or + * `journald` logging driver. * * @param string $id ID or name of the container * @param array $queryParameters { * - * @var bool $follow return the logs as a stream - - * @var bool $stdout Return logs from `stdout` - * @var bool $stderr Return logs from `stderr` - * @var int $since Only return logs since this time, as a UNIX timestamp - * @var int $until Only return logs before this time, as a UNIX timestamp - * @var bool $timestamps Add timestamps to every log line - * @var string $tail Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines. + * @var bool $follow keep connection after returning logs + * @var bool $stdout Return logs from `stdout` + * @var bool $stderr Return logs from `stderr` + * @var int $since Only return logs since this time, as a UNIX timestamp + * @var int $until Only return logs before this time, as a UNIX timestamp + * @var bool $timestamps Add timestamps to every log line + * @var string $tail Only return this number of log lines from the end of the logs. + * Specify as an integer or `all` to output all log lines. + * * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/vnd.docker.raw-stream|application/vnd.docker.multiplexed-stream|application/json * - * @throws \Docker\API\Exception\ContainerLogsNotFoundException - * @throws \Docker\API\Exception\ContainerLogsInternalServerErrorException + * @throws Exception\ContainerLogsNotFoundException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function containerLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function containerLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerLogs($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerLogs($id, $queryParameters, $accept), $fetch); } /** - * Returns which files in a container's filesystem have been added, deleted,. - or modified. The `Kind` of modification can be one of: - - - `0`: Modified - - `1`: Added - - `2`: Deleted - + * Returns which files in a container's filesystem have been added, deleted, + * or modified. The `Kind` of modification can be one of: + * + * - `0`: Modified ("C") + * - `1`: Added ("A") + * - `2`: Deleted ("D") * * @param string $id ID or name of the container * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ContainerChangesNotFoundException - * @throws \Docker\API\Exception\ContainerChangesInternalServerErrorException + * @throws Exception\ContainerChangesNotFoundException + * @throws Exception\ContainerChangesInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersIdChangesGetResponse200Item[]|\Psr\Http\Message\ResponseInterface + * @return Model\FilesystemChange[]|\Psr\Http\Message\ResponseInterface|null */ public function containerChanges(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerChanges($id), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerChanges($id), $fetch); } /** * Export the contents of a container as a tarball. * - * @param string $id ID or name of the container - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $id ID or name of the container + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/octet-stream|application/json * - * @throws \Docker\API\Exception\ContainerExportNotFoundException - * @throws \Docker\API\Exception\ContainerExportInternalServerErrorException + * @throws Exception\ContainerExportNotFoundException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function containerExport(string $id, string $fetch = self::FETCH_OBJECT) + public function containerExport(string $id, string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerExport($id), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerExport($id, $accept), $fetch); } /** - * This endpoint returns a live stream of a container’s resource usage. - statistics. - - The `precpu_stats` is the CPU statistic of last read, which is used - for calculating the CPU usage percentage. It is not the same as the - `cpu_stats` field. - - If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is - nil then for compatibility with older daemons the length of the - corresponding `cpu_usage.percpu_usage` array should be used. - + * This endpoint returns a live stream of a container’s resource usage + * statistics. + * + * The `precpu_stats` is the CPU statistic of the *previous* read, and is + * used to calculate the CPU usage percentage. It is not an exact copy + * of the `cpu_stats` field. + * + * If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is + * nil then for compatibility with older daemons the length of the + * corresponding `cpu_usage.percpu_usage` array should be used. + * + * On a cgroup v2 host, the following fields are not set + * `blkio_stats`: all fields other than `io_service_bytes_recursive` + * `cpu_stats`: `cpu_usage.percpu_usage` + * `memory_stats`: `max_usage` and `failcnt` + * Also, `memory_stats.stats` fields are incompatible with cgroup v1. + * + * To calculate the values shown by the `stats` command of the docker cli tool + * the following formulas can be used: + * used_memory = `memory_stats.usage - memory_stats.stats.cache` + * available_memory = `memory_stats.limit` + * Memory usage % = `(used_memory / available_memory) * 100.0` + * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` + * system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage` + * number_cpus = `lenght(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus` + * CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0` * * @param string $id ID or name of the container * @param array $queryParameters { * - * @var bool $stream Stream the output. If false, the stats will be output once and then it will disconnect. + * @var bool $stream Stream the output. If false, the stats will be output once and then + * it will disconnect. + * @var bool $one-shot Only get a single stat instead of waiting for 2 cycles. Must be used + * with `stream=false`. + * * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ContainerStatsNotFoundException - * @throws \Docker\API\Exception\ContainerStatsInternalServerErrorException + * @throws Exception\ContainerStatsNotFoundException + * @throws Exception\ContainerStatsInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ public function containerStats(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerStats($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerStats($id, $queryParameters), $fetch); } /** - * Resize the TTY for a container. You must restart the container for the resize to take effect. + * Resize the TTY for a container. * * @param string $id ID or name of the container * @param array $queryParameters { * - * @var int $h Height of the tty session in characters - * @var int $w Width of the tty session in characters - * } + * @var int $h Height of the TTY session in characters + * @var int $w Width of the TTY session in characters + * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header text/plain|application/json * - * @throws \Docker\API\Exception\ContainerResizeNotFoundException - * @throws \Docker\API\Exception\ContainerResizeInternalServerErrorException + * @throws Exception\ContainerResizeNotFoundException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function containerResize(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function containerResize(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerResize($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerResize($id, $queryParameters, $accept), $fetch); } /** * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $detachKeys Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + * @var string $detachKeys Override the key sequence for detaching a container. Format is a + * single character `[a-Z]` or `ctrl-` where `` is one + * of: `a-z`, `@`, `^`, `[`, `,` or `_`. + * * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ContainerStartNotFoundException - * @throws \Docker\API\Exception\ContainerStartInternalServerErrorException + * @throws Exception\ContainerStartNotFoundException + * @throws Exception\ContainerStartInternalServerErrorException * - * @return null|\Docker\API\Model\ErrorResponse|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function containerStart(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function containerStart(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerStart($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerStart($id, $queryParameters, $accept), $fetch); } /** * @param string $id ID or name of the container * @param array $queryParameters { * - * @var int $t Number of seconds to wait before killing the container - * } + * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`). + * @var int $t Number of seconds to wait before killing the container + * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ContainerStopNotFoundException - * @throws \Docker\API\Exception\ContainerStopInternalServerErrorException + * @throws Exception\ContainerStopNotFoundException + * @throws Exception\ContainerStopInternalServerErrorException * - * @return null|\Docker\API\Model\ErrorResponse|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function containerStop(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function containerStop(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerStop($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerStop($id, $queryParameters, $accept), $fetch); } /** * @param string $id ID or name of the container * @param array $queryParameters { * - * @var int $t Number of seconds to wait before killing the container - * } + * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`). + * @var int $t Number of seconds to wait before killing the container + * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ContainerRestartNotFoundException - * @throws \Docker\API\Exception\ContainerRestartInternalServerErrorException + * @throws Exception\ContainerRestartNotFoundException + * @throws Exception\ContainerRestartInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function containerRestart(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function containerRestart(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerRestart($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerRestart($id, $queryParameters, $accept), $fetch); } /** - * Send a POSIX signal to a container, defaulting to killing to the container. + * Send a POSIX signal to a container, defaulting to killing to the + * container. * * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`) + * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`). + * * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ContainerKillNotFoundException - * @throws \Docker\API\Exception\ContainerKillInternalServerErrorException + * @throws Exception\ContainerKillNotFoundException + * @throws Exception\ContainerKillConflictException + * @throws Exception\ContainerKillInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function containerKill(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function containerKill(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerKill($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerKill($id, $queryParameters, $accept), $fetch); } /** - * Change various configuration options of a container without having to recreate it. + * Change various configuration options of a container without having to + * recreate it. * - * @param string $id ID or name of the container - * @param \Docker\API\Model\ContainersIdUpdatePostBody $update - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $id ID or name of the container + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ContainerUpdateNotFoundException - * @throws \Docker\API\Exception\ContainerUpdateInternalServerErrorException + * @throws Exception\ContainerUpdateNotFoundException + * @throws Exception\ContainerUpdateInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersIdUpdatePostResponse200|\Psr\Http\Message\ResponseInterface + * @return Model\ContainersIdUpdatePostResponse200|\Psr\Http\Message\ResponseInterface|null */ - public function containerUpdate(string $id, \Docker\API\Model\ContainersIdUpdatePostBody $update, string $fetch = self::FETCH_OBJECT) + public function containerUpdate(string $id, ?Model\ContainersIdUpdatePostBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerUpdate($id, $update), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerUpdate($id, $requestBody), $fetch); } /** * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $name New name for the container - * } + * @var string $name New name for the container + * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ContainerRenameNotFoundException - * @throws \Docker\API\Exception\ContainerRenameConflictException - * @throws \Docker\API\Exception\ContainerRenameInternalServerErrorException + * @throws Exception\ContainerRenameNotFoundException + * @throws Exception\ContainerRenameConflictException + * @throws Exception\ContainerRenameInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function containerRename(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function containerRename(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerRename($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerRename($id, $queryParameters, $accept), $fetch); } /** - * Use the cgroups freezer to suspend all processes in a container. - - Traditionally, when suspending a process the `SIGSTOP` signal is used, which is observable by the process being suspended. With the cgroups freezer the process is unaware, and unable to capture, that it is being suspended, and subsequently resumed. - + * Use the freezer cgroup to suspend all processes in a container. * - * @param string $id ID or name of the container - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * Traditionally, when suspending a process the `SIGSTOP` signal is used, + * which is observable by the process being suspended. With the freezer + * cgroup the process is unaware, and unable to capture, that it is being + * suspended, and subsequently resumed. + * + * @param string $id ID or name of the container + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ContainerPauseNotFoundException - * @throws \Docker\API\Exception\ContainerPauseInternalServerErrorException + * @throws Exception\ContainerPauseNotFoundException + * @throws Exception\ContainerPauseInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function containerPause(string $id, string $fetch = self::FETCH_OBJECT) + public function containerPause(string $id, string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerPause($id), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerPause($id, $accept), $fetch); } /** * Resume a container which has been paused. * - * @param string $id ID or name of the container - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $id ID or name of the container + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ContainerUnpauseNotFoundException - * @throws \Docker\API\Exception\ContainerUnpauseInternalServerErrorException + * @throws Exception\ContainerUnpauseNotFoundException + * @throws Exception\ContainerUnpauseInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function containerUnpause(string $id, string $fetch = self::FETCH_OBJECT) + public function containerUnpause(string $id, string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerUnpause($id), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerUnpause($id, $accept), $fetch); } /** - * Attach to a container to read its output or send it input. You can attach to the same container multiple times and you can reattach to containers that have been detached. - - Either the `stream` or `logs` parameter must be `true` for this endpoint to do anything. - - See [the documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) for more details. - - ### Hijacking - - This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, and `stderr` on the same socket. - - This is the response from the daemon for an attach request: - - ``` - HTTP/1.1 200 OK - Content-Type: application/vnd.docker.raw-stream - - [STREAM] - ``` - - After the headers and two new lines, the TCP connection can now be used for raw, bidirectional communication between the client and server. - - To hint potential proxies about connection hijacking, the Docker client can also optionally send connection upgrade headers. - - For example, the client sends this request to upgrade the connection: - - ``` - POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 - Upgrade: tcp - Connection: Upgrade - ``` - - The Docker daemon will respond with a `101 UPGRADED` response, and will similarly follow with the raw stream: - - ``` - HTTP/1.1 101 UPGRADED - Content-Type: application/vnd.docker.raw-stream - Connection: Upgrade - Upgrade: tcp - - [STREAM] - ``` - - ### Stream format - - When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), the stream over the hijacked connected is multiplexed to separate out `stdout` and `stderr`. The stream consists of a series of frames, each containing a header and a payload. - - The header contains the information which the stream writes (`stdout` or `stderr`). It also contains the size of the associated frame encoded in the last four bytes (`uint32`). - - It is encoded on the first eight bytes like this: - - ```go - header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} - ``` - - `STREAM_TYPE` can be: - - - 0: `stdin` (is written on `stdout`) - - 1: `stdout` - - 2: `stderr` - - `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size encoded as big endian. - - Following the header is the payload, which is the specified number of bytes of `STREAM_TYPE`. - - The simplest way to implement this protocol is the following: - - 1. Read 8 bytes. - 2. Choose `stdout` or `stderr` depending on the first byte. - 3. Extract the frame size from the last four bytes. - 4. Read the extracted size and output it on the correct output. - 5. Goto 1. - - ### Stream format when using a TTY - - When the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate), the stream is not multiplexed. The data exchanged over the hijacked connection is simply the raw data from the process PTY and client's `stdin`. - + * Attach to a container to read its output or send it input. You can attach + * to the same container multiple times and you can reattach to containers + * that have been detached. + * + * Either the `stream` or `logs` parameter must be `true` for this endpoint + * to do anything. + * + * See the [documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) + * for more details. + * + * ### Hijacking + * + * This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, + * and `stderr` on the same socket. + * + * This is the response from the daemon for an attach request: + * + * ``` + * HTTP/1.1 200 OK + * Content-Type: application/vnd.docker.raw-stream + * + * [STREAM] + * ``` + * + * After the headers and two new lines, the TCP connection can now be used + * for raw, bidirectional communication between the client and server. + * + * To hint potential proxies about connection hijacking, the Docker client + * can also optionally send connection upgrade headers. + * + * For example, the client sends this request to upgrade the connection: + * + * ``` + * POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 + * Upgrade: tcp + * Connection: Upgrade + * ``` + * + * The Docker daemon will respond with a `101 UPGRADED` response, and will + * similarly follow with the raw stream: + * + * ``` + * HTTP/1.1 101 UPGRADED + * Content-Type: application/vnd.docker.raw-stream + * Connection: Upgrade + * Upgrade: tcp + * + * [STREAM] + * ``` + * + * ### Stream format + * + * When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), + * the HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream + * and the stream over the hijacked connected is multiplexed to separate out + * `stdout` and `stderr`. The stream consists of a series of frames, each + * containing a header and a payload. + * + * The header contains the information which the stream writes (`stdout` or + * `stderr`). It also contains the size of the associated frame encoded in + * the last four bytes (`uint32`). + * + * It is encoded on the first eight bytes like this: + * + * ```go + * header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + * ``` + * + * `STREAM_TYPE` can be: + * + * - 0: `stdin` (is written on `stdout`) + * - 1: `stdout` + * - 2: `stderr` + * + * `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size + * encoded as big endian. + * + * Following the header is the payload, which is the specified number of + * bytes of `STREAM_TYPE`. + * + * The simplest way to implement this protocol is the following: + * + * 1. Read 8 bytes. + * 2. Choose `stdout` or `stderr` depending on the first byte. + * 3. Extract the frame size from the last four bytes. + * 4. Read the extracted size and output it on the correct output. + * 5. Goto 1. + * + * ### Stream format when using a TTY + * + * When the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate), + * the stream is not multiplexed. The data exchanged over the hijacked + * connection is simply the raw data from the process PTY and client's + * `stdin`. * * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $detachKeys Override the key sequence for detaching a container.Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. - * @var bool $logs replay previous logs from the container - - * @var bool $stream Stream attached streams from the time the request was made onwards - * @var bool $stdin Attach to `stdin` - * @var bool $stdout Attach to `stdout` - * @var bool $stderr Attach to `stderr` - * } + * @var string $detachKeys Override the key sequence for detaching a container.Format is a single + * character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, + * `@`, `^`, `[`, `,` or `_`. + * @var bool $logs Replay previous logs from the container. * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * This is useful for attaching to a container that has started and you + * want to output everything since the container started. + * + * If `stream` is also enabled, once all the previous output has been + * returned, it will seamlessly transition into streaming current + * output. + * @var bool $stream stream attached streams from the time the request was made onwards + * @var bool $stdin Attach to `stdin` + * @var bool $stdout Attach to `stdout` + * @var bool $stderr Attach to `stderr` + * } * - * @throws \Docker\API\Exception\ContainerAttachBadRequestException - * @throws \Docker\API\Exception\ContainerAttachNotFoundException - * @throws \Docker\API\Exception\ContainerAttachInternalServerErrorException + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/vnd.docker.raw-stream|application/vnd.docker.multiplexed-stream|application/json * - * @return null|\Psr\Http\Message\ResponseInterface + * @throws Exception\ContainerAttachNotFoundException + * + * @return \Psr\Http\Message\ResponseInterface|null */ - public function containerAttach(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function containerAttach(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerAttach($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerAttach($id, $queryParameters, $accept), $fetch); } /** * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $detachKeys Override the key sequence for detaching a container.Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,`, or `_`. - * @var bool $logs Return logs - * @var bool $stream Return stream - * @var bool $stdin Attach to `stdin` - * @var bool $stdout Attach to `stdout` - * @var bool $stderr Attach to `stderr` - * } + * @var string $detachKeys Override the key sequence for detaching a container.Format is a single + * character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, + * `@`, `^`, `[`, `,`, or `_`. + * @var bool $logs Return logs + * @var bool $stream Return stream + * @var bool $stdin Attach to `stdin` + * @var bool $stdout Attach to `stdout` + * @var bool $stderr Attach to `stderr` + * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ContainerAttachWebsocketBadRequestException - * @throws \Docker\API\Exception\ContainerAttachWebsocketNotFoundException - * @throws \Docker\API\Exception\ContainerAttachWebsocketInternalServerErrorException + * @throws Exception\ContainerAttachWebsocketBadRequestException + * @throws Exception\ContainerAttachWebsocketNotFoundException + * @throws Exception\ContainerAttachWebsocketInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function containerAttachWebsocket(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function containerAttachWebsocket(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerAttachWebsocket($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerAttachWebsocket($id, $queryParameters, $accept), $fetch); } /** @@ -508,42 +608,47 @@ public function containerAttachWebsocket(string $id, array $queryParameters = [] * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $condition Wait until a container state reaches the given condition, either 'not-running' (default), 'next-exit', or 'removed'. + * @var string $condition Wait until a container state reaches the given condition. + * + * Defaults to `not-running` if omitted or empty. + * * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ContainerWaitNotFoundException - * @throws \Docker\API\Exception\ContainerWaitInternalServerErrorException + * @throws Exception\ContainerWaitBadRequestException + * @throws Exception\ContainerWaitNotFoundException + * @throws Exception\ContainerWaitInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersIdWaitPostResponse200|\Psr\Http\Message\ResponseInterface + * @return Model\ContainerWaitResponse|\Psr\Http\Message\ResponseInterface|null */ public function containerWait(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerWait($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerWait($id, $queryParameters), $fetch); } /** * @param string $id ID or name of the container * @param array $queryParameters { * - * @var bool $v remove the volumes associated with the container - * @var bool $force if the container is running, kill it before removing it - * @var bool $link Remove the specified link associated with the container. - * } + * @var bool $v remove anonymous volumes associated with the container + * @var bool $force if the container is running, kill it before removing it + * @var bool $link Remove the specified link associated with the container. + * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ContainerDeleteBadRequestException - * @throws \Docker\API\Exception\ContainerDeleteNotFoundException - * @throws \Docker\API\Exception\ContainerDeleteConflictException - * @throws \Docker\API\Exception\ContainerDeleteInternalServerErrorException + * @throws Exception\ContainerDeleteBadRequestException + * @throws Exception\ContainerDeleteNotFoundException + * @throws Exception\ContainerDeleteConflictException + * @throws Exception\ContainerDeleteInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function containerDelete(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function containerDelete(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerDelete($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerDelete($id, $queryParameters, $accept), $fetch); } /** @@ -552,84 +657,99 @@ public function containerDelete(string $id, array $queryParameters = [], string * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $path Resource in the container’s filesystem to archive. - * } + * @var string $path Resource in the container’s filesystem to archive. + * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/x-tar|application/json * - * @throws \Docker\API\Exception\ContainerArchiveBadRequestException - * @throws \Docker\API\Exception\ContainerArchiveNotFoundException - * @throws \Docker\API\Exception\ContainerArchiveInternalServerErrorException + * @throws Exception\ContainerArchiveNotFoundException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function containerArchive(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function containerArchive(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerArchive($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerArchive($id, $queryParameters, $accept), $fetch); } /** - * A response header `X-Docker-Container-Path-Stat` is return containing a base64 - encoded JSON object with some filesystem header information about the path. + * A response header `X-Docker-Container-Path-Stat` is returned, containing + * a base64 - encoded JSON object with some filesystem header information + * about the path. * * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $path Resource in the container’s filesystem to archive. - * } + * @var string $path Resource in the container’s filesystem to archive. + * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ContainerArchiveInfoBadRequestException - * @throws \Docker\API\Exception\ContainerArchiveInfoNotFoundException - * @throws \Docker\API\Exception\ContainerArchiveInfoInternalServerErrorException + * @throws Exception\ContainerArchiveInfoBadRequestException + * @throws Exception\ContainerArchiveInfoNotFoundException + * @throws Exception\ContainerArchiveInfoInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function containerArchiveInfo(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function containerArchiveInfo(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerArchiveInfo($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerArchiveInfo($id, $queryParameters, $accept), $fetch); } /** * Upload a tar archive to be extracted to a path in the filesystem of container id. + * `path` parameter is asserted to be a directory. If it exists as a file, 400 error + * will be returned with message "not a directory". * - * @param string $id ID or name of the container - * @param string $inputStream the input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz - * @param array $queryParameters { + * @param string $id ID or name of the container + * @param string|resource|\Psr\Http\Message\StreamInterface|null $requestBody + * @param array $queryParameters { + * + * @var string $path path to a directory in the container to extract the archive’s contents into + * @var string $noOverwriteDirNonDir if `1`, `true`, or `True` then it will be an error if unpacking the + * given content would cause an existing directory to be replaced with + * a non-directory and vice versa + * @var string $copyUIDGID If `1`, `true`, then it will copy UID/GID maps to the dest file or + * dir * - * @var string $path Path to a directory in the container to extract the archive’s contents into. - * @var string $noOverwriteDirNonDir If “1”, “true”, or “True” then it will be an error if unpacking the given content would cause an existing directory to be replaced with a non-directory and vice versa. * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\PutContainerArchiveBadRequestException - * @throws \Docker\API\Exception\PutContainerArchiveForbiddenException - * @throws \Docker\API\Exception\PutContainerArchiveNotFoundException - * @throws \Docker\API\Exception\PutContainerArchiveInternalServerErrorException + * @throws Exception\PutContainerArchiveBadRequestException + * @throws Exception\PutContainerArchiveForbiddenException + * @throws Exception\PutContainerArchiveNotFoundException + * @throws Exception\PutContainerArchiveInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function putContainerArchive(string $id, string $inputStream, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function putContainerArchive(string $id, $requestBody = null, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PutContainerArchive($id, $inputStream, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\PutContainerArchive($id, $requestBody, $queryParameters, $accept), $fetch); } /** * @param array $queryParameters { * - * @var string $filters filters to process on the prune list, encoded as JSON (a `map[string][]string`) - + * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + * + * Available filters: + * - `until=` Prune containers created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + * - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune containers with (or without, in case `label!=...` is used) the specified labels. + * * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ContainerPruneInternalServerErrorException + * @throws Exception\ContainerPruneInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersPrunePostResponse200|\Psr\Http\Message\ResponseInterface + * @return Model\ContainersPrunePostResponse200|\Psr\Http\Message\ResponseInterface|null */ public function containerPrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerPrune($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerPrune($queryParameters), $fetch); } /** @@ -637,118 +757,204 @@ public function containerPrune(array $queryParameters = [], string $fetch = self * * @param array $queryParameters { * - * @var bool $all Show all images. Only images from a final layer (no children) are shown by default. - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: - - * @var bool $digests Show digest information as a `RepoDigests` field on each image. - * } + * @var bool $all Show all images. Only images from a final layer (no children) are shown by default. + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + * process on the images list. + * + * Available filters: + * + * - `before`=(`[:]`, `` or ``) + * - `dangling=true` + * - `label=key` or `label="key=value"` of an image label + * - `reference`=(`[:]`) + * - `since`=(`[:]`, `` or ``) + * - `until=` + * @var bool $shared-size Compute and show shared size as a `SharedSize` field on each image + * @var bool $digests Show digest information as a `RepoDigests` field on each image. + * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ImageListInternalServerErrorException + * @throws Exception\ImageListInternalServerErrorException * - * @return null|\Docker\API\Model\ImageSummary[]|\Psr\Http\Message\ResponseInterface + * @return Model\ImageSummary[]|\Psr\Http\Message\ResponseInterface|null */ public function imageList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageList($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ImageList($queryParameters), $fetch); } /** * Build an image from a tar archive with a `Dockerfile` in it. - - The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/). - - The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. - - The build is canceled if the client drops the connection by quitting or being killed. - - * - * @param string|resource|\Psr\Http\Message\StreamInterface $inputStream a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz - * @param array $queryParameters { - * - * @var string $dockerfile Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`. - * @var string $t A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters. - * @var string $extrahosts Extra hosts to add to /etc/hosts - * @var string $remote A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball. - * @var bool $q suppress verbose build output - * @var bool $nocache do not use the cache when building the image - * @var string $cachefrom JSON array of images used for build cache resolution - * @var string $pull attempt to pull the image even if an older image exists locally - * @var bool $rm remove intermediate containers after a successful build - * @var bool $forcerm always remove intermediate containers, even upon failure - * @var int $memory set memory limit for build - * @var int $memswap Total memory (memory + swap). Set as `-1` to disable swap. - * @var int $cpushares CPU shares (relative weight) - * @var string $cpusetcpus CPUs in which to allow execution (e.g., `0-3`, `0,1`). - * @var int $cpuperiod the length of a CPU period in microseconds - * @var int $cpuquota microseconds of CPU time that the container can get in a CPU period - * @var string $buildargs JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values. [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg) - * @var int $shmsize Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB. - * @var bool $squash Squash the resulting images layers into a single layer. *(Experimental release only.)* - * @var string $labels arbitrary key/value labels to set on the image, as a JSON map of string pairs - * @var string $networkmode Sets the networking mode for the run commands during build. Supported standard values are: `bridge`, `host`, `none`, and `container:`. Any other value is taken as a custom network's name to which this container should connect to. - * @var string $platform Platform in the format os[/arch[/variant]] + * + * The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/). + * + * The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. + * + * The build is canceled if the client drops the connection by quitting or being killed. + * + * @param string|resource|\Psr\Http\Message\StreamInterface|null $requestBody + * @param array $queryParameters { + * + * @var string $dockerfile Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`. + * @var string $t A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters. + * @var string $extrahosts Extra hosts to add to /etc/hosts + * @var string $remote A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball. + * @var bool $q suppress verbose build output + * @var bool $nocache do not use the cache when building the image + * @var string $cachefrom JSON array of images used for build cache resolution + * @var string $pull attempt to pull the image even if an older image exists locally + * @var bool $rm remove intermediate containers after a successful build + * @var bool $forcerm always remove intermediate containers, even upon failure + * @var int $memory set memory limit for build + * @var int $memswap Total memory (memory + swap). Set as `-1` to disable swap. + * @var int $cpushares CPU shares (relative weight) + * @var string $cpusetcpus CPUs in which to allow execution (e.g., `0-3`, `0,1`). + * @var int $cpuperiod the length of a CPU period in microseconds + * @var int $cpuquota microseconds of CPU time that the container can get in a CPU period + * @var string $buildargs JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values. + * + * For example, the build arg `FOO=bar` would become `{"FOO":"bar"}` in JSON. This would result in the query parameter `buildargs={"FOO":"bar"}`. Note that `{"FOO":"bar"}` should be URI component encoded. + * + * [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg) + * @var int $shmsize Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB. + * @var bool $squash Squash the resulting images layers into a single layer. *(Experimental release only.)* + * @var string $labels arbitrary key/value labels to set on the image, as a JSON map of string pairs + * @var string $networkmode Sets the networking mode for the run commands during build. Supported + * standard values are: `bridge`, `host`, `none`, and `container:`. + * Any other value is taken as a custom network's name or ID to which this + * container should connect to. + * @var string $platform Platform in the format os[/arch[/variant]] + * @var string $target Target build stage + * @var string $outputs BuildKit output configuration + * @var string $version Version of the builder backend to use. + * + * - `1` is the first generation classic (deprecated) builder in the Docker daemon (default) + * - `2` is [BuildKit](https://github.com/moby/buildkit) + * * } * * @param array $headerParameters { * - * @var string $Content-type - * @var string $X-Registry-Config This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to - + * @var string $Content-type + * @var string $X-Registry-Config This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to. + * + * The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example: + * + * ``` + * { + * "docker.example.com": { + * "username": "janedoe", + * "password": "hunter2" + * }, + * "https://index.docker.io/v1/": { + * "username": "mobydock", + * "password": "conta1n3rize14" * } + * } + * ``` + * + * Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a `https://` prefix and a `/v1/` suffix even though Docker will prefer to use the v2 registry API. + * + * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ImageBuildBadRequestException - * @throws \Docker\API\Exception\ImageBuildInternalServerErrorException + * @throws Exception\ImageBuildBadRequestException + * @throws Exception\ImageBuildInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function imageBuild($inputStream, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function imageBuild($requestBody = null, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageBuild($inputStream, $queryParameters, $headerParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ImageBuild($requestBody, $queryParameters, $headerParameters), $fetch); } /** + * @param array $queryParameters { + * + * @var int $keep-storage Amount of disk space in bytes to keep for cache + * @var bool $all Remove all types of build cache + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + * process on the list of build cache objects. + * + * Available filters: + * + * - `until=` remove cache older than ``. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time. + * - `id=` + * - `parent=` + * - `type=` + * - `description=` + * - `inuse` + * - `shared` + * - `private` + * + * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\BuildPruneInternalServerErrorException + * @throws Exception\BuildPruneInternalServerErrorException * - * @return null|\Docker\API\Model\BuildPrunePostResponse200|\Psr\Http\Message\ResponseInterface + * @return Model\BuildPrunePostResponse200|\Psr\Http\Message\ResponseInterface|null */ - public function buildPrune(string $fetch = self::FETCH_OBJECT) + public function buildPrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\BuildPrune(), $fetch); + return $this->executeEndpoint(new Endpoint\BuildPrune($queryParameters), $fetch); } /** - * Create an image by either pulling it from a registry or importing it. + * Pull or import an image. * - * @param string $inputImage Image content if the value `-` has been specified in fromSrc query parameter - * @param array $queryParameters { + * @param array $queryParameters { + * + * @var string $fromImage Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed. + * @var string $fromSrc Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image. + * @var string $repo Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image. + * @var string $tag Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled. + * @var string $message set commit message for imported image + * @var array $changes Apply `Dockerfile` instructions to the image that is created, + * for example: `changes=ENV DEBUG=true`. + * Note that `ENV DEBUG=true` should be URI component encoded. + * + * Supported `Dockerfile` instructions: + * `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` + * @var string $platform Platform in the format os[/arch[/variant]]. + * + * When used in combination with the `fromImage` option, the daemon checks + * if the given image is present in the local image cache with the given + * OS and Architecture, and otherwise attempts to pull the image. If the + * option is not set, the host's native OS and Architecture are used. + * If the given image does not exist in the local image cache, the daemon + * attempts to pull the image with the host's native OS and Architecture. + * If the given image does exists in the local image cache, but its OS or + * architecture does not match, a warning is produced. + * + * When used with the `fromSrc` option to import an image from an archive, + * this option sets the platform information for the imported image. If + * the option is not set, the host's native OS and Architecture are used + * for the imported image. * - * @var string $fromImage Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed. - * @var string $fromSrc Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image. - * @var string $repo Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image. - * @var string $tag Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled. - * @var string $platform Platform in the format os[/arch[/variant]] * } * * @param array $headerParameters { * - * @var string $X-Registry-Auth A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication) + * @var string $X-Registry-Auth A base64url-encoded auth configuration. + * + * Refer to the [authentication section](#section/Authentication) for + * details. + * * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ImageCreateNotFoundException - * @throws \Docker\API\Exception\ImageCreateInternalServerErrorException + * @throws Exception\ImageCreateNotFoundException + * @throws Exception\ImageCreateInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function imageCreate(string $inputImage, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function imageCreate(?string $requestBody = null, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageCreate($inputImage, $queryParameters, $headerParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ImageCreate($requestBody, $queryParameters, $headerParameters), $fetch); } /** @@ -757,14 +963,14 @@ public function imageCreate(string $inputImage, array $queryParameters = [], arr * @param string $name Image name or id * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ImageInspectNotFoundException - * @throws \Docker\API\Exception\ImageInspectInternalServerErrorException + * @throws Exception\ImageInspectNotFoundException + * @throws Exception\ImageInspectInternalServerErrorException * - * @return null|\Docker\API\Model\Image|\Psr\Http\Message\ResponseInterface + * @return Model\ImageInspect|\Psr\Http\Message\ResponseInterface|null */ public function imageInspect(string $name, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageInspect($name), $fetch); + return $this->executeEndpoint(new Endpoint\ImageInspect($name), $fetch); } /** @@ -773,45 +979,51 @@ public function imageInspect(string $name, string $fetch = self::FETCH_OBJECT) * @param string $name Image name or ID * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ImageHistoryNotFoundException - * @throws \Docker\API\Exception\ImageHistoryInternalServerErrorException + * @throws Exception\ImageHistoryNotFoundException + * @throws Exception\ImageHistoryInternalServerErrorException * - * @return null|\Docker\API\Model\ImagesNameHistoryGetResponse200Item[]|\Psr\Http\Message\ResponseInterface + * @return Model\ImagesNameHistoryGetResponse200Item[]|\Psr\Http\Message\ResponseInterface|null */ public function imageHistory(string $name, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageHistory($name), $fetch); + return $this->executeEndpoint(new Endpoint\ImageHistory($name), $fetch); } /** * Push an image to a registry. - - If you wish to push an image on to a private registry, that image must already have a tag which references the registry. For example, `registry.example.com/myimage:latest`. - - The push is cancelled if the HTTP connection is closed. - + * + * If you wish to push an image on to a private registry, that image must + * already have a tag which references the registry. For example, + * `registry.example.com/myimage:latest`. + * + * The push is cancelled if the HTTP connection is closed. * * @param string $name image name or ID * @param array $queryParameters { * - * @var string $tag The tag to associate with the image on the registry. - * } + * @var string $tag The tag to associate with the image on the registry. + * } * * @param array $headerParameters { * - * @var string $X-Registry-Auth A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication) + * @var string $X-Registry-Auth A base64url-encoded auth configuration. + * + * Refer to the [authentication section](#section/Authentication) for + * details. + * * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ImagePushNotFoundException - * @throws \Docker\API\Exception\ImagePushInternalServerErrorException + * @throws Exception\ImagePushNotFoundException + * @throws Exception\ImagePushInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function imagePush(string $name, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function imagePush(string $name, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImagePush($name, $queryParameters, $headerParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ImagePush($name, $queryParameters, $headerParameters, $accept), $fetch); } /** @@ -820,50 +1032,50 @@ public function imagePush(string $name, array $queryParameters = [], array $head * @param string $name image name or ID to tag * @param array $queryParameters { * - * @var string $repo The repository to tag in. For example, `someuser/someimage`. - * @var string $tag The name of the new tag. - * } + * @var string $repo The repository to tag in. For example, `someuser/someimage`. + * @var string $tag The name of the new tag. + * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ImageTagBadRequestException - * @throws \Docker\API\Exception\ImageTagNotFoundException - * @throws \Docker\API\Exception\ImageTagConflictException - * @throws \Docker\API\Exception\ImageTagInternalServerErrorException + * @throws Exception\ImageTagBadRequestException + * @throws Exception\ImageTagNotFoundException + * @throws Exception\ImageTagConflictException + * @throws Exception\ImageTagInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function imageTag(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function imageTag(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageTag($name, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ImageTag($name, $queryParameters, $accept), $fetch); } /** - * Remove an image, along with any untagged parent images that were. - referenced by that image. - - Images can't be removed if they have descendant images, are being - used by a running container or are being used by a build. - + * Remove an image, along with any untagged parent images that were + * referenced by that image. + * + * Images can't be removed if they have descendant images, are being + * used by a running container or are being used by a build. * * @param string $name Image name or ID * @param array $queryParameters { * - * @var bool $force Remove the image even if it is being used by stopped containers or has other tags - * @var bool $noprune Do not delete untagged parent images - * } + * @var bool $force Remove the image even if it is being used by stopped containers or has other tags + * @var bool $noprune Do not delete untagged parent images + * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ImageDeleteNotFoundException - * @throws \Docker\API\Exception\ImageDeleteConflictException - * @throws \Docker\API\Exception\ImageDeleteInternalServerErrorException + * @throws Exception\ImageDeleteNotFoundException + * @throws Exception\ImageDeleteConflictException + * @throws Exception\ImageDeleteInternalServerErrorException * - * @return null|\Docker\API\Model\ImageDeleteResponseItem[]|\Psr\Http\Message\ResponseInterface + * @return Model\ImageDeleteResponseItem[]|\Psr\Http\Message\ResponseInterface|null */ public function imageDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageDelete($name, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ImageDelete($name, $queryParameters), $fetch); } /** @@ -871,311 +1083,351 @@ public function imageDelete(string $name, array $queryParameters = [], string $f * * @param array $queryParameters { * - * @var string $term Term to search - * @var int $limit Maximum number of results to return - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: - + * @var string $term Term to search + * @var int $limit Maximum number of results to return + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: + * + * - `is-official=(true|false)` + * - `stars=` Matches images that has at least 'number' stars. + * * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ImageSearchInternalServerErrorException + * @throws Exception\ImageSearchInternalServerErrorException * - * @return null|\Docker\API\Model\ImagesSearchGetResponse200Item[]|\Psr\Http\Message\ResponseInterface + * @return Model\ImagesSearchGetResponse200Item[]|\Psr\Http\Message\ResponseInterface|null */ public function imageSearch(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageSearch($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ImageSearch($queryParameters), $fetch); } /** * @param array $queryParameters { * - * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: - - - `dangling=` When set to `true` (or `1`), prune only - unused *and* untagged images. When set to `false` + * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: + * + * - `dangling=` When set to `true` (or `1`), prune only + * unused *and* untagged images. When set to `false` + * (or `0`), all unused images are pruned. + * - `until=` Prune images created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + * - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune images with (or without, in case `label!=...` is used) the specified labels. + * * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ImagePruneInternalServerErrorException + * @throws Exception\ImagePruneInternalServerErrorException * - * @return null|\Docker\API\Model\ImagesPrunePostResponse200|\Psr\Http\Message\ResponseInterface + * @return Model\ImagesPrunePostResponse200|\Psr\Http\Message\ResponseInterface|null */ public function imagePrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImagePrune($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ImagePrune($queryParameters), $fetch); } /** - * Validate credentials for a registry and, if available, get an identity token for accessing the registry without password. + * Validate credentials for a registry and, if available, get an identity + * token for accessing the registry without password. * - * @param \Docker\API\Model\AuthConfig $authConfig Authentication to check - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\SystemAuthInternalServerErrorException + * @throws Exception\SystemAuthUnauthorizedException + * @throws Exception\SystemAuthInternalServerErrorException * - * @return null|\Docker\API\Model\AuthPostResponse200|\Psr\Http\Message\ResponseInterface + * @return Model\AuthPostResponse200|\Psr\Http\Message\ResponseInterface|null */ - public function systemAuth(\Docker\API\Model\AuthConfig $authConfig, string $fetch = self::FETCH_OBJECT) + public function systemAuth(?Model\AuthConfig $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SystemAuth($authConfig), $fetch); + return $this->executeEndpoint(new Endpoint\SystemAuth($requestBody), $fetch); } /** * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\SystemInfoInternalServerErrorException + * @throws Exception\SystemInfoInternalServerErrorException * - * @return null|\Docker\API\Model\SystemInfo|\Psr\Http\Message\ResponseInterface + * @return Model\SystemInfo|\Psr\Http\Message\ResponseInterface|null */ public function systemInfo(string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SystemInfo(), $fetch); + return $this->executeEndpoint(new Endpoint\SystemInfo(), $fetch); } /** * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\SystemVersionInternalServerErrorException + * @throws Exception\SystemVersionInternalServerErrorException * - * @return null|\Docker\API\Model\VersionGetResponse200|\Psr\Http\Message\ResponseInterface + * @return Model\SystemVersion|\Psr\Http\Message\ResponseInterface|null */ public function systemVersion(string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SystemVersion(), $fetch); + return $this->executeEndpoint(new Endpoint\SystemVersion(), $fetch); } /** * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\SystemPingInternalServerErrorException - * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ public function systemPing(string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SystemPing(), $fetch); + return $this->executeEndpoint(new Endpoint\SystemPing(), $fetch); } /** - * @param \Docker\API\Model\ContainerConfig $containerConfig The container configuration - * @param array $queryParameters { + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @var string $container The ID or name of the container to commit - * @var string $repo Repository name for the created image - * @var string $tag Tag name for the create image - * @var string $comment Commit message - * @var string $author Author of the image (e.g., `John Hannibal Smith `) - * @var bool $pause Whether to pause the container before committing - * @var string $changes `Dockerfile` instructions to apply while committing - * } + * @return \Psr\Http\Message\ResponseInterface|null + */ + public function systemPingHead(string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new Endpoint\SystemPingHead(), $fetch); + } + + /** + * @param array $queryParameters { + * + * @var string $container The ID or name of the container to commit + * @var string $repo Repository name for the created image + * @var string $tag Tag name for the create image + * @var string $comment Commit message + * @var string $author Author of the image (e.g., `John Hannibal Smith `) + * @var bool $pause Whether to pause the container before committing + * @var string $changes `Dockerfile` instructions to apply while committing + * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ImageCommitNotFoundException - * @throws \Docker\API\Exception\ImageCommitInternalServerErrorException + * @throws Exception\ImageCommitNotFoundException + * @throws Exception\ImageCommitInternalServerErrorException * - * @return null|\Docker\API\Model\IdResponse|\Psr\Http\Message\ResponseInterface + * @return Model\IdResponse|\Psr\Http\Message\ResponseInterface|null */ - public function imageCommit(\Docker\API\Model\ContainerConfig $containerConfig, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function imageCommit(?Model\ContainerConfig $requestBody = null, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageCommit($containerConfig, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ImageCommit($requestBody, $queryParameters), $fetch); } /** * Stream real-time events from the server. - - Various objects within Docker report events when something happens to them. - - Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, and `update` - - Images report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, and `untag` - - Volumes report these events: `create`, `mount`, `unmount`, and `destroy` - - Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, and `remove` - - The Docker daemon reports these events: `reload` - - Services report these events: `create`, `update`, and `remove` - - Nodes report these events: `create`, `update`, and `remove` - - Secrets report these events: `create`, `update`, and `remove` - - Configs report these events: `create`, `update`, and `remove` - + * + * Various objects within Docker report events when something happens to them. + * + * Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune` + * + * Images report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune` + * + * Volumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune` + * + * Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune` + * + * The Docker daemon reports these events: `reload` + * + * Services report these events: `create`, `update`, and `remove` + * + * Nodes report these events: `create`, `update`, and `remove` + * + * Secrets report these events: `create`, `update`, and `remove` + * + * Configs report these events: `create`, `update`, and `remove` + * + * The Builder reports `prune` events * * @param array $queryParameters { * - * @var string $since show events created since this timestamp then stream new events - * @var string $until show events created until this timestamp then stop streaming - * @var string $filters A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: - + * @var string $since show events created since this timestamp then stream new events + * @var string $until show events created until this timestamp then stop streaming + * @var string $filters A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: + * + * - `config=` config name or ID + * - `container=` container name or ID + * - `daemon=` daemon name or ID + * - `event=` event type + * - `image=` image name or ID + * - `label=` image or container label + * - `network=` network name or ID + * - `node=` node ID + * - `plugin`= plugin name or ID + * - `scope`= local or swarm + * - `secret=` secret name or ID + * - `service=` service name or ID + * - `type=` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config` + * - `volume=` volume name + * * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\SystemEventsBadRequestException - * @throws \Docker\API\Exception\SystemEventsInternalServerErrorException + * @throws Exception\SystemEventsBadRequestException + * @throws Exception\SystemEventsInternalServerErrorException * - * @return null|\Docker\API\Model\EventsGetResponse200|\Psr\Http\Message\ResponseInterface + * @return Model\EventMessage|\Psr\Http\Message\ResponseInterface|null */ public function systemEvents(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SystemEvents($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\SystemEvents($queryParameters), $fetch); } /** - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $queryParameters { + * + * @var array $type Object types, for which to compute and return data. + * } * - * @throws \Docker\API\Exception\SystemDataUsageInternalServerErrorException + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @return null|\Docker\API\Model\SystemDfGetResponse200|\Psr\Http\Message\ResponseInterface + * @throws Exception\SystemDataUsageInternalServerErrorException + * + * @return Model\SystemDfGetJsonResponse200|\Psr\Http\Message\ResponseInterface|null */ - public function systemDataUsage(string $fetch = self::FETCH_OBJECT) + public function systemDataUsage(array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SystemDataUsage(), $fetch); + return $this->executeEndpoint(new Endpoint\SystemDataUsage($queryParameters, $accept), $fetch); } /** * Get a tarball containing all images and metadata for a repository. - - If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced. - - ### Image tarball format - - An image tarball contains one directory per image layer (named using its long ID), each containing these files: - - - `VERSION`: currently `1.0` - the file format version - - `json`: detailed layer information, similar to `docker inspect layer_id` - - `layer.tar`: A tarfile containing the filesystem changes in this layer - - The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions. - - If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs. - - ```json - { - "hello-world": { - "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" - } - } - ``` - + * + * If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced. + * + * ### Image tarball format + * + * An image tarball contains one directory per image layer (named using its long ID), each containing these files: + * + * - `VERSION`: currently `1.0` - the file format version + * - `json`: detailed layer information, similar to `docker inspect layer_id` + * - `layer.tar`: A tarfile containing the filesystem changes in this layer + * + * The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions. + * + * If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs. + * + * ```json + * { + * "hello-world": { + * "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" + * } + * } + * ``` * * @param string $name Image name or ID * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ImageGetInternalServerErrorException - * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ public function imageGet(string $name, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageGet($name), $fetch); + return $this->executeEndpoint(new Endpoint\ImageGet($name), $fetch); } /** - * Get a tarball containing all images and metadata for several image repositories. - - For each value of the `names` parameter: if it is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned; if it is an image ID, similarly only that image (and its parents) are returned and there would be no names referenced in the 'repositories' file for this image ID. - - For details on the format, see [the export image endpoint](#operation/ImageGet). - + * Get a tarball containing all images and metadata for several image + * repositories. + * + * For each value of the `names` parameter: if it is a specific name and + * tag (e.g. `ubuntu:latest`), then only that image (and its parents) are + * returned; if it is an image ID, similarly only that image (and its parents) + * are returned and there would be no names referenced in the 'repositories' + * file for this image ID. + * + * For details on the format, see the [export image endpoint](#operation/ImageGet). * * @param array $queryParameters { * - * @var array $names Image names to filter by - * } + * @var array $names Image names to filter by + * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ImageGetAllInternalServerErrorException - * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ public function imageGetAll(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageGetAll($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ImageGetAll($queryParameters), $fetch); } /** * Load a set of images and tags into a repository. - - For details on the format, see [the export image endpoint](#operation/ImageGet). - * - * @param string|resource|\Psr\Http\Message\StreamInterface $imagesTarball Tar archive containing images - * @param array $queryParameters { + * For details on the format, see the [export image endpoint](#operation/ImageGet). * - * @var bool $quiet Suppress progress details during load. - * } + * @param string|resource|\Psr\Http\Message\StreamInterface|null $requestBody + * @param array $queryParameters { + * + * @var bool $quiet Suppress progress details during load. + * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ImageLoadInternalServerErrorException + * @throws Exception\ImageLoadInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function imageLoad($imagesTarball, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function imageLoad($requestBody = null, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ImageLoad($imagesTarball, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ImageLoad($requestBody, $queryParameters), $fetch); } /** * Run a command inside a running container. * - * @param string $id ID or name of container - * @param \Docker\API\Model\ContainersIdExecPostBody $execConfig Exec configuration - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $id ID or name of container + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ContainerExecNotFoundException - * @throws \Docker\API\Exception\ContainerExecConflictException - * @throws \Docker\API\Exception\ContainerExecInternalServerErrorException + * @throws Exception\ContainerExecNotFoundException + * @throws Exception\ContainerExecConflictException + * @throws Exception\ContainerExecInternalServerErrorException * - * @return null|\Docker\API\Model\IdResponse|\Psr\Http\Message\ResponseInterface + * @return Model\IdResponse|\Psr\Http\Message\ResponseInterface|null */ - public function containerExec(string $id, \Docker\API\Model\ContainersIdExecPostBody $execConfig, string $fetch = self::FETCH_OBJECT) + public function containerExec(string $id, ?Model\ContainersIdExecPostBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ContainerExec($id, $execConfig), $fetch); + return $this->executeEndpoint(new Endpoint\ContainerExec($id, $requestBody), $fetch); } /** - * Starts a previously set up exec instance. If detach is true, this endpoint returns immediately after starting the command. Otherwise, it sets up an interactive session with the command. - * - * @param string $id Exec instance ID - * @param \Docker\API\Model\ExecIdStartPostBody $execStartConfig - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * 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. * - * @throws \Docker\API\Exception\ExecStartNotFoundException - * @throws \Docker\API\Exception\ExecStartConflictException + * @param string $id Exec instance ID + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/vnd.docker.raw-stream|application/vnd.docker.multiplexed-stream * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function execStart(string $id, \Docker\API\Model\ExecIdStartPostBody $execStartConfig, string $fetch = self::FETCH_OBJECT) + public function execStart(string $id, ?Model\ExecIdStartPostBody $requestBody = null, string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ExecStart($id, $execStartConfig), $fetch); + return $this->executeEndpoint(new Endpoint\ExecStart($id, $requestBody, $accept), $fetch); } /** - * Resize the TTY session used by an exec instance. This endpoint only works if `tty` was specified as part of creating and starting the exec instance. + * Resize the TTY session used by an exec instance. This endpoint only works + * if `tty` was specified as part of creating and starting the exec instance. * * @param string $id Exec instance ID * @param array $queryParameters { * - * @var int $h Height of the TTY session in characters - * @var int $w Width of the TTY session in characters - * } + * @var int $h Height of the TTY session in characters + * @var int $w Width of the TTY session in characters + * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ExecResizeNotFoundException + * @throws Exception\ExecResizeBadRequestException + * @throws Exception\ExecResizeNotFoundException + * @throws Exception\ExecResizeInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function execResize(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function execResize(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ExecResize($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ExecResize($id, $queryParameters, $accept), $fetch); } /** @@ -1184,43 +1436,54 @@ public function execResize(string $id, array $queryParameters = [], string $fetc * @param string $id Exec instance ID * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ExecInspectNotFoundException - * @throws \Docker\API\Exception\ExecInspectInternalServerErrorException + * @throws Exception\ExecInspectNotFoundException + * @throws Exception\ExecInspectInternalServerErrorException * - * @return null|\Docker\API\Model\ExecIdJsonGetResponse200|\Psr\Http\Message\ResponseInterface + * @return Model\ExecIdJsonGetResponse200|\Psr\Http\Message\ResponseInterface|null */ public function execInspect(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ExecInspect($id), $fetch); + return $this->executeEndpoint(new Endpoint\ExecInspect($id), $fetch); } /** * @param array $queryParameters { * - * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to + * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to + * process on the volumes list. Available filters: + * + * - `dangling=` When set to `true` (or `1`), returns all + * volumes that are not in use by a container. When set to `false` + * (or `0`), only volumes that are in use by one or more + * containers are returned. + * - `driver=` Matches volumes based on their driver. + * - `label=` or `label=:` Matches volumes based on + * the presence of a `label` alone or a `label` and a value. + * - `name=` Matches all or part of a volume name. + * * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\VolumeListInternalServerErrorException + * @throws Exception\VolumeListInternalServerErrorException * - * @return null|\Docker\API\Model\VolumesGetResponse200|\Psr\Http\Message\ResponseInterface + * @return Model\VolumeListResponse|\Psr\Http\Message\ResponseInterface|null */ public function volumeList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\VolumeList($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\VolumeList($queryParameters), $fetch); } /** - * @param \Docker\API\Model\VolumesCreatePostBody $volumeConfig Volume configuration - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\VolumeCreateInternalServerErrorException + * @throws Exception\VolumeCreateInternalServerErrorException * - * @return null|\Docker\API\Model\Volume|\Psr\Http\Message\ResponseInterface + * @return Model\Volume|\Psr\Http\Message\ResponseInterface|null */ - public function volumeCreate(\Docker\API\Model\VolumesCreatePostBody $volumeConfig, string $fetch = self::FETCH_OBJECT) + public function volumeCreate(?Model\VolumeCreateOptions $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\VolumeCreate($volumeConfig), $fetch); + return $this->executeEndpoint(new Endpoint\VolumeCreate($requestBody), $fetch); } /** @@ -1229,173 +1492,228 @@ public function volumeCreate(\Docker\API\Model\VolumesCreatePostBody $volumeConf * @param string $name Volume name or ID * @param array $queryParameters { * - * @var bool $force Force the removal of the volume - * } + * @var bool $force Force the removal of the volume + * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\VolumeDeleteNotFoundException - * @throws \Docker\API\Exception\VolumeDeleteConflictException - * @throws \Docker\API\Exception\VolumeDeleteInternalServerErrorException + * @throws Exception\VolumeDeleteNotFoundException + * @throws Exception\VolumeDeleteConflictException + * @throws Exception\VolumeDeleteInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function volumeDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function volumeDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\VolumeDelete($name, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\VolumeDelete($name, $queryParameters, $accept), $fetch); } /** * @param string $name Volume name or ID * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\VolumeInspectNotFoundException - * @throws \Docker\API\Exception\VolumeInspectInternalServerErrorException + * @throws Exception\VolumeInspectNotFoundException + * @throws Exception\VolumeInspectInternalServerErrorException * - * @return null|\Docker\API\Model\Volume|\Psr\Http\Message\ResponseInterface + * @return Model\Volume|\Psr\Http\Message\ResponseInterface|null */ public function volumeInspect(string $name, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\VolumeInspect($name), $fetch); + return $this->executeEndpoint(new Endpoint\VolumeInspect($name), $fetch); } /** - * @param array $queryParameters { + * @param string $name The name or ID of the volume + * @param array $queryParameters { + * + * @var int $version The version number of the volume being updated. This is required to + * avoid conflicting writes. Found in the volume's `ClusterVolume` + * field. + * + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @throws Exception\VolumeUpdateBadRequestException + * @throws Exception\VolumeUpdateNotFoundException + * @throws Exception\VolumeUpdateInternalServerErrorException + * @throws Exception\VolumeUpdateServiceUnavailableException * - * @var string $filters filters to process on the prune list, encoded as JSON (a `map[string][]string`) + * @return \Psr\Http\Message\ResponseInterface|null + */ + public function volumeUpdate(string $name, ?Model\VolumesNamePutBody $requestBody = null, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new Endpoint\VolumeUpdate($name, $requestBody, $queryParameters), $fetch); + } + /** + * @param array $queryParameters { + * + * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + * + * Available filters: + * - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels. + * - `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes. + * * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\VolumePruneInternalServerErrorException + * @throws Exception\VolumePruneInternalServerErrorException * - * @return null|\Docker\API\Model\VolumesPrunePostResponse200|\Psr\Http\Message\ResponseInterface + * @return Model\VolumesPrunePostResponse200|\Psr\Http\Message\ResponseInterface|null */ public function volumePrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\VolumePrune($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\VolumePrune($queryParameters), $fetch); } /** - * Returns a list of networks. For details on the format, see [the network inspect endpoint](#operation/NetworkInspect). - - Note that it uses a different, smaller representation of a network than inspecting a single network. For example, - the list of containers attached to the network is not propagated in API versions 1.28 and up. - + * Returns a list of networks. For details on the format, see the + * [network inspect endpoint](#operation/NetworkInspect). + * + * Note that it uses a different, smaller representation of a network than + * inspecting a single network. For example, the list of containers attached + * to the network is not propagated in API versions 1.28 and up. * * @param array $queryParameters { * - * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to process on the networks list. Available filters: - + * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to process + * on the networks list. + * + * Available filters: + * + * - `dangling=` When set to `true` (or `1`), returns all + * networks that are not in use by a container. When set to `false` + * (or `0`), only networks that are in use by one or more + * containers are returned. + * - `driver=` Matches a network's driver. + * - `id=` Matches all or part of a network ID. + * - `label=` or `label==` of a network label. + * - `name=` Matches all or part of a network name. + * - `scope=["swarm"|"global"|"local"]` Filters networks by scope (`swarm`, `global`, or `local`). + * - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. + * * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\NetworkListInternalServerErrorException + * @throws Exception\NetworkListInternalServerErrorException * - * @return null|\Docker\API\Model\Network[]|\Psr\Http\Message\ResponseInterface + * @return Model\Network[]|\Psr\Http\Message\ResponseInterface|null */ public function networkList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkList($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\NetworkList($queryParameters), $fetch); } /** - * @param string $id Network ID or name - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $id Network ID or name + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\NetworkDeleteForbiddenException - * @throws \Docker\API\Exception\NetworkDeleteNotFoundException - * @throws \Docker\API\Exception\NetworkDeleteInternalServerErrorException + * @throws Exception\NetworkDeleteForbiddenException + * @throws Exception\NetworkDeleteNotFoundException + * @throws Exception\NetworkDeleteInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function networkDelete(string $id, string $fetch = self::FETCH_OBJECT) + public function networkDelete(string $id, string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkDelete($id), $fetch); + return $this->executeEndpoint(new Endpoint\NetworkDelete($id, $accept), $fetch); } /** * @param string $id Network ID or name * @param array $queryParameters { * - * @var bool $verbose Detailed inspect output for troubleshooting - * @var string $scope Filter the network by scope (swarm, global, or local) - * } + * @var bool $verbose Detailed inspect output for troubleshooting + * @var string $scope Filter the network by scope (swarm, global, or local) + * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\NetworkInspectNotFoundException - * @throws \Docker\API\Exception\NetworkInspectInternalServerErrorException + * @throws Exception\NetworkInspectNotFoundException + * @throws Exception\NetworkInspectInternalServerErrorException * - * @return null|\Docker\API\Model\Network|\Psr\Http\Message\ResponseInterface + * @return Model\Network|\Psr\Http\Message\ResponseInterface|null */ public function networkInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkInspect($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\NetworkInspect($id, $queryParameters), $fetch); } /** - * @param \Docker\API\Model\NetworksCreatePostBody $networkConfig Network configuration - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\NetworkCreateForbiddenException - * @throws \Docker\API\Exception\NetworkCreateNotFoundException - * @throws \Docker\API\Exception\NetworkCreateInternalServerErrorException + * @throws Exception\NetworkCreateBadRequestException + * @throws Exception\NetworkCreateForbiddenException + * @throws Exception\NetworkCreateNotFoundException + * @throws Exception\NetworkCreateInternalServerErrorException * - * @return null|\Docker\API\Model\NetworksCreatePostResponse201|\Psr\Http\Message\ResponseInterface + * @return Model\NetworksCreatePostResponse201|\Psr\Http\Message\ResponseInterface|null */ - public function networkCreate(\Docker\API\Model\NetworksCreatePostBody $networkConfig, string $fetch = self::FETCH_OBJECT) + public function networkCreate(?Model\NetworksCreatePostBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkCreate($networkConfig), $fetch); + return $this->executeEndpoint(new Endpoint\NetworkCreate($requestBody), $fetch); } /** - * @param string $id Network ID or name - * @param \Docker\API\Model\NetworksIdConnectPostBody $container - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * The network must be either a local-scoped network or a swarm-scoped network with the `attachable` option set. A network cannot be re-attached to a running container. + * + * @param string $id Network ID or name + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\NetworkConnectForbiddenException - * @throws \Docker\API\Exception\NetworkConnectNotFoundException - * @throws \Docker\API\Exception\NetworkConnectInternalServerErrorException + * @throws Exception\NetworkConnectBadRequestException + * @throws Exception\NetworkConnectForbiddenException + * @throws Exception\NetworkConnectNotFoundException + * @throws Exception\NetworkConnectInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function networkConnect(string $id, \Docker\API\Model\NetworksIdConnectPostBody $container, string $fetch = self::FETCH_OBJECT) + public function networkConnect(string $id, ?Model\NetworksIdConnectPostBody $requestBody = null, string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkConnect($id, $container), $fetch); + return $this->executeEndpoint(new Endpoint\NetworkConnect($id, $requestBody, $accept), $fetch); } /** - * @param string $id Network ID or name - * @param \Docker\API\Model\NetworksIdDisconnectPostBody $container - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $id Network ID or name + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\NetworkDisconnectForbiddenException - * @throws \Docker\API\Exception\NetworkDisconnectNotFoundException - * @throws \Docker\API\Exception\NetworkDisconnectInternalServerErrorException + * @throws Exception\NetworkDisconnectForbiddenException + * @throws Exception\NetworkDisconnectNotFoundException + * @throws Exception\NetworkDisconnectInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function networkDisconnect(string $id, \Docker\API\Model\NetworksIdDisconnectPostBody $container, string $fetch = self::FETCH_OBJECT) + public function networkDisconnect(string $id, ?Model\NetworksIdDisconnectPostBody $requestBody = null, string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkDisconnect($id, $container), $fetch); + return $this->executeEndpoint(new Endpoint\NetworkDisconnect($id, $requestBody, $accept), $fetch); } /** * @param array $queryParameters { * - * @var string $filters filters to process on the prune list, encoded as JSON (a `map[string][]string`) - + * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + * + * Available filters: + * - `until=` Prune networks created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + * - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune networks with (or without, in case `label!=...` is used) the specified labels. + * * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\NetworkPruneInternalServerErrorException + * @throws Exception\NetworkPruneInternalServerErrorException * - * @return null|\Docker\API\Model\NetworksPrunePostResponse200|\Psr\Http\Message\ResponseInterface + * @return Model\NetworksPrunePostResponse200|\Psr\Http\Message\ResponseInterface|null */ public function networkPrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NetworkPrune($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\NetworkPrune($queryParameters), $fetch); } /** @@ -1403,767 +1721,894 @@ public function networkPrune(array $queryParameters = [], string $fetch = self:: * * @param array $queryParameters { * - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the plugin list. Available filters: - + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + * process on the plugin list. + * + * Available filters: + * + * - `capability=` + * - `enable=|` + * * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\PluginListInternalServerErrorException + * @throws Exception\PluginListInternalServerErrorException * - * @return null|\Docker\API\Model\Plugin[]|\Psr\Http\Message\ResponseInterface + * @return Model\Plugin[]|\Psr\Http\Message\ResponseInterface|null */ public function pluginList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginList($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\PluginList($queryParameters), $fetch); } /** * @param array $queryParameters { * - * @var string $remote The name of the plugin. The `:latest` tag is optional, and is the default if omitted. + * @var string $remote The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. + * * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\GetPluginPrivilegesInternalServerErrorException + * @throws Exception\GetPluginPrivilegesInternalServerErrorException * - * @return null|\Docker\API\Model\PluginsPrivilegesGetResponse200Item[]|\Psr\Http\Message\ResponseInterface + * @return Model\PluginPrivilege[]|\Psr\Http\Message\ResponseInterface|null */ - public function getPluginPrivileges(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function getPluginPrivileges(array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\GetPluginPrivileges($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\GetPluginPrivileges($queryParameters, $accept), $fetch); } /** - * Pulls and installs a plugin. After the plugin is installed, it can be enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable). - + * Pulls and installs a plugin. After the plugin is installed, it can be + * enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable). * - * @param array $body - * @param array $queryParameters { + * @param Model\PluginPrivilege[]|null $requestBody + * @param array $queryParameters { + * + * @var string $remote Remote reference for plugin to install. + * + * The `:latest` tag is optional, and is used as the default if omitted. + * @var string $name Local name for the pulled plugin. + * + * The `:latest` tag is optional, and is used as the default if omitted. * - * @var string $remote remote reference for plugin to install - - * @var string $name local name for the pulled plugin - - The `:latest` tag is optional, and is used as the default if omitted. - * } * * @param array $headerParameters { * - * @var string $X-Registry-Auth A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication) + * @var string $X-Registry-Auth A base64url-encoded auth configuration to use when pulling a plugin + * from a registry. + * + * Refer to the [authentication section](#section/Authentication) for + * details. + * * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\PluginPullInternalServerErrorException + * @throws Exception\PluginPullInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function pluginPull(array $body, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function pluginPull(?array $requestBody = null, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginPull($body, $queryParameters, $headerParameters), $fetch); + return $this->executeEndpoint(new Endpoint\PluginPull($requestBody, $queryParameters, $headerParameters), $fetch); } /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\PluginInspectNotFoundException - * @throws \Docker\API\Exception\PluginInspectInternalServerErrorException + * @throws Exception\PluginInspectNotFoundException + * @throws Exception\PluginInspectInternalServerErrorException * - * @return null|\Docker\API\Model\Plugin|\Psr\Http\Message\ResponseInterface + * @return Model\Plugin|\Psr\Http\Message\ResponseInterface|null */ - public function pluginInspect(string $name, string $fetch = self::FETCH_OBJECT) + public function pluginInspect(string $name, string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginInspect($name), $fetch); + return $this->executeEndpoint(new Endpoint\PluginInspect($name, $accept), $fetch); } /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. * @param array $queryParameters { * - * @var bool $force Disable the plugin before removing. This may result in issues if the plugin is in use by a container. + * @var bool $force Disable the plugin before removing. This may result in issues if the + * plugin is in use by a container. + * * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\PluginDeleteNotFoundException - * @throws \Docker\API\Exception\PluginDeleteInternalServerErrorException + * @throws Exception\PluginDeleteNotFoundException + * @throws Exception\PluginDeleteInternalServerErrorException * - * @return null|\Docker\API\Model\Plugin|\Psr\Http\Message\ResponseInterface + * @return Model\Plugin|\Psr\Http\Message\ResponseInterface|null */ - public function pluginDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function pluginDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginDelete($name, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\PluginDelete($name, $queryParameters, $accept), $fetch); } /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. * @param array $queryParameters { * - * @var int $timeout Set the HTTP client timeout (in seconds) - * } + * @var int $timeout Set the HTTP client timeout (in seconds) + * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\PluginEnableNotFoundException - * @throws \Docker\API\Exception\PluginEnableInternalServerErrorException + * @throws Exception\PluginEnableNotFoundException + * @throws Exception\PluginEnableInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function pluginEnable(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function pluginEnable(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginEnable($name, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\PluginEnable($name, $queryParameters, $accept), $fetch); } /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. + * @param array $queryParameters { * - * @throws \Docker\API\Exception\PluginDisableNotFoundException - * @throws \Docker\API\Exception\PluginDisableInternalServerErrorException + * @var bool $force Force disable a plugin even if still in use. * - * @return null|\Psr\Http\Message\ResponseInterface + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain + * + * @throws Exception\PluginDisableNotFoundException + * @throws Exception\PluginDisableInternalServerErrorException + * + * @return \Psr\Http\Message\ResponseInterface|null */ - public function pluginDisable(string $name, string $fetch = self::FETCH_OBJECT) + public function pluginDisable(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginDisable($name), $fetch); + return $this->executeEndpoint(new Endpoint\PluginDisable($name, $queryParameters, $accept), $fetch); } /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. - * @param array $body - * @param array $queryParameters { + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. + * @param Model\PluginPrivilege[]|null $requestBody + * @param array $queryParameters { + * + * @var string $remote Remote reference to upgrade to. + * + * The `:latest` tag is optional, and is used as the default if omitted. * - * @var string $remote remote reference to upgrade to - - The `:latest` tag is optional, and is used as the default if omitted. - * } * * @param array $headerParameters { * - * @var string $X-Registry-Auth A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication) + * @var string $X-Registry-Auth A base64url-encoded auth configuration to use when pulling a plugin + * from a registry. + * + * Refer to the [authentication section](#section/Authentication) for + * details. + * * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\PluginUpgradeNotFoundException - * @throws \Docker\API\Exception\PluginUpgradeInternalServerErrorException + * @throws Exception\PluginUpgradeNotFoundException + * @throws Exception\PluginUpgradeInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function pluginUpgrade(string $name, array $body, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function pluginUpgrade(string $name, ?array $requestBody = null, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginUpgrade($name, $body, $queryParameters, $headerParameters), $fetch); + return $this->executeEndpoint(new Endpoint\PluginUpgrade($name, $requestBody, $queryParameters, $headerParameters, $accept), $fetch); } /** - * @param string|resource|\Psr\Http\Message\StreamInterface $tarContext Path to tar containing plugin rootfs and manifest - * @param array $queryParameters { + * @param string|resource|\Psr\Http\Message\StreamInterface|null $requestBody + * @param array $queryParameters { + * + * @var string $name The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. * - * @var string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\PluginCreateInternalServerErrorException + * @throws Exception\PluginCreateInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function pluginCreate($tarContext, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function pluginCreate($requestBody = null, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginCreate($tarContext, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\PluginCreate($requestBody, $queryParameters, $accept), $fetch); } /** * Push a plugin to the registry. * - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\PluginPushNotFoundException - * @throws \Docker\API\Exception\PluginPushInternalServerErrorException + * @throws Exception\PluginPushNotFoundException + * @throws Exception\PluginPushInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function pluginPush(string $name, string $fetch = self::FETCH_OBJECT) + public function pluginPush(string $name, string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginPush($name), $fetch); + return $this->executeEndpoint(new Endpoint\PluginPush($name, $accept), $fetch); } /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. - * @param array $body - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. + * @param array[]|null $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\PluginSetNotFoundException - * @throws \Docker\API\Exception\PluginSetInternalServerErrorException + * @throws Exception\PluginSetNotFoundException + * @throws Exception\PluginSetInternalServerErrorException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function pluginSet(string $name, array $body, string $fetch = self::FETCH_OBJECT) + public function pluginSet(string $name, ?array $requestBody = null, string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\PluginSet($name, $body), $fetch); + return $this->executeEndpoint(new Endpoint\PluginSet($name, $requestBody, $accept), $fetch); } /** * @param array $queryParameters { * - * @var string $filters filters to process on the nodes list, encoded as JSON (a `map[string][]string`) - + * @var string $filters Filters to process on the nodes list, encoded as JSON (a `map[string][]string`). + * + * Available filters: + * - `id=` + * - `label=` + * - `membership=`(`accepted`|`pending`)` + * - `name=` + * - `node.label=` + * - `role=`(`manager`|`worker`)` + * * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\NodeListInternalServerErrorException - * @throws \Docker\API\Exception\NodeListServiceUnavailableException + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @return null|\Docker\API\Model\Node[]|\Psr\Http\Message\ResponseInterface + * @throws Exception\NodeListInternalServerErrorException + * @throws Exception\NodeListServiceUnavailableException + * + * @return Model\Node[]|\Psr\Http\Message\ResponseInterface|null */ - public function nodeList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function nodeList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NodeList($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\NodeList($queryParameters, $accept), $fetch); } /** * @param string $id The ID or name of the node * @param array $queryParameters { * - * @var bool $force Force remove a node from the swarm - * } + * @var bool $force Force remove a node from the swarm + * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\NodeDeleteNotFoundException - * @throws \Docker\API\Exception\NodeDeleteInternalServerErrorException - * @throws \Docker\API\Exception\NodeDeleteServiceUnavailableException + * @throws Exception\NodeDeleteNotFoundException + * @throws Exception\NodeDeleteInternalServerErrorException + * @throws Exception\NodeDeleteServiceUnavailableException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function nodeDelete(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function nodeDelete(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NodeDelete($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\NodeDelete($id, $queryParameters, $accept), $fetch); } /** - * @param string $id The ID or name of the node - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $id The ID or name of the node + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\NodeInspectNotFoundException - * @throws \Docker\API\Exception\NodeInspectInternalServerErrorException - * @throws \Docker\API\Exception\NodeInspectServiceUnavailableException + * @throws Exception\NodeInspectNotFoundException + * @throws Exception\NodeInspectInternalServerErrorException + * @throws Exception\NodeInspectServiceUnavailableException * - * @return null|\Docker\API\Model\Node|\Psr\Http\Message\ResponseInterface + * @return Model\Node|\Psr\Http\Message\ResponseInterface|null */ - public function nodeInspect(string $id, string $fetch = self::FETCH_OBJECT) + public function nodeInspect(string $id, string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NodeInspect($id), $fetch); + return $this->executeEndpoint(new Endpoint\NodeInspect($id, $accept), $fetch); } /** - * @param string $id The ID of the node - * @param \Docker\API\Model\NodeSpec $body - * @param array $queryParameters { + * @param string $id The ID of the node + * @param array $queryParameters { + * + * @var int $version The version number of the node object being updated. This is required + * to avoid conflicting writes. * - * @var int $version The version number of the node object being updated. This is required to avoid conflicting writes. * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\NodeUpdateBadRequestException - * @throws \Docker\API\Exception\NodeUpdateNotFoundException - * @throws \Docker\API\Exception\NodeUpdateInternalServerErrorException - * @throws \Docker\API\Exception\NodeUpdateServiceUnavailableException + * @throws Exception\NodeUpdateBadRequestException + * @throws Exception\NodeUpdateNotFoundException + * @throws Exception\NodeUpdateInternalServerErrorException + * @throws Exception\NodeUpdateServiceUnavailableException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function nodeUpdate(string $id, \Docker\API\Model\NodeSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function nodeUpdate(string $id, ?Model\NodeSpec $requestBody = null, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\NodeUpdate($id, $body, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\NodeUpdate($id, $requestBody, $queryParameters, $accept), $fetch); } /** - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\SwarmInspectNotFoundException - * @throws \Docker\API\Exception\SwarmInspectInternalServerErrorException - * @throws \Docker\API\Exception\SwarmInspectServiceUnavailableException + * @throws Exception\SwarmInspectNotFoundException + * @throws Exception\SwarmInspectInternalServerErrorException + * @throws Exception\SwarmInspectServiceUnavailableException * - * @return null|\Docker\API\Model\Swarm|\Psr\Http\Message\ResponseInterface + * @return Model\Swarm|\Psr\Http\Message\ResponseInterface|null */ - public function swarmInspect(string $fetch = self::FETCH_OBJECT) + public function swarmInspect(string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmInspect(), $fetch); + return $this->executeEndpoint(new Endpoint\SwarmInspect($accept), $fetch); } /** - * @param \Docker\API\Model\SwarmInitPostBody $body - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\SwarmInitBadRequestException - * @throws \Docker\API\Exception\SwarmInitInternalServerErrorException - * @throws \Docker\API\Exception\SwarmInitServiceUnavailableException + * @throws Exception\SwarmInitBadRequestException + * @throws Exception\SwarmInitInternalServerErrorException + * @throws Exception\SwarmInitServiceUnavailableException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function swarmInit(\Docker\API\Model\SwarmInitPostBody $body, string $fetch = self::FETCH_OBJECT) + public function swarmInit(?Model\SwarmInitPostBody $requestBody = null, string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmInit($body), $fetch); + return $this->executeEndpoint(new Endpoint\SwarmInit($requestBody, $accept), $fetch); } /** - * @param \Docker\API\Model\SwarmJoinPostBody $body - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\SwarmJoinBadRequestException - * @throws \Docker\API\Exception\SwarmJoinInternalServerErrorException - * @throws \Docker\API\Exception\SwarmJoinServiceUnavailableException + * @throws Exception\SwarmJoinBadRequestException + * @throws Exception\SwarmJoinInternalServerErrorException + * @throws Exception\SwarmJoinServiceUnavailableException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function swarmJoin(\Docker\API\Model\SwarmJoinPostBody $body, string $fetch = self::FETCH_OBJECT) + public function swarmJoin(?Model\SwarmJoinPostBody $requestBody = null, string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmJoin($body), $fetch); + return $this->executeEndpoint(new Endpoint\SwarmJoin($requestBody, $accept), $fetch); } /** * @param array $queryParameters { * - * @var bool $force Force leave swarm, even if this is the last manager or that it will break the cluster. + * @var bool $force Force leave swarm, even if this is the last manager or that it will + * break the cluster. + * * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\SwarmLeaveInternalServerErrorException - * @throws \Docker\API\Exception\SwarmLeaveServiceUnavailableException + * @throws Exception\SwarmLeaveInternalServerErrorException + * @throws Exception\SwarmLeaveServiceUnavailableException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function swarmLeave(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function swarmLeave(array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmLeave($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\SwarmLeave($queryParameters, $accept), $fetch); } /** - * @param \Docker\API\Model\SwarmSpec $body - * @param array $queryParameters { + * @param array $queryParameters { * - * @var int $version The version number of the swarm object being updated. This is required to avoid conflicting writes. - * @var bool $rotateWorkerToken rotate the worker join token - * @var bool $rotateManagerToken rotate the manager join token - * @var bool $rotateManagerUnlockKey Rotate the manager unlock key. - * } + * @var int $version The version number of the swarm object being updated. This is + * required to avoid conflicting writes. + * @var bool $rotateWorkerToken rotate the worker join token + * @var bool $rotateManagerToken rotate the manager join token + * @var bool $rotateManagerUnlockKey Rotate the manager unlock key. + * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\SwarmUpdateBadRequestException - * @throws \Docker\API\Exception\SwarmUpdateInternalServerErrorException - * @throws \Docker\API\Exception\SwarmUpdateServiceUnavailableException + * @throws Exception\SwarmUpdateBadRequestException + * @throws Exception\SwarmUpdateInternalServerErrorException + * @throws Exception\SwarmUpdateServiceUnavailableException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function swarmUpdate(\Docker\API\Model\SwarmSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function swarmUpdate(?Model\SwarmSpec $requestBody = null, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmUpdate($body, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\SwarmUpdate($requestBody, $queryParameters, $accept), $fetch); } /** - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\SwarmUnlockkeyInternalServerErrorException - * @throws \Docker\API\Exception\SwarmUnlockkeyServiceUnavailableException + * @throws Exception\SwarmUnlockkeyInternalServerErrorException + * @throws Exception\SwarmUnlockkeyServiceUnavailableException * - * @return null|\Docker\API\Model\SwarmUnlockkeyGetResponse200|\Psr\Http\Message\ResponseInterface + * @return Model\SwarmUnlockkeyGetJsonResponse200|\Psr\Http\Message\ResponseInterface|null */ - public function swarmUnlockkey(string $fetch = self::FETCH_OBJECT) + public function swarmUnlockkey(string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmUnlockkey(), $fetch); + return $this->executeEndpoint(new Endpoint\SwarmUnlockkey($accept), $fetch); } /** - * @param \Docker\API\Model\SwarmUnlockPostBody $body - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\SwarmUnlockInternalServerErrorException - * @throws \Docker\API\Exception\SwarmUnlockServiceUnavailableException + * @throws Exception\SwarmUnlockInternalServerErrorException + * @throws Exception\SwarmUnlockServiceUnavailableException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function swarmUnlock(\Docker\API\Model\SwarmUnlockPostBody $body, string $fetch = self::FETCH_OBJECT) + public function swarmUnlock(?Model\SwarmUnlockPostBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SwarmUnlock($body), $fetch); + return $this->executeEndpoint(new Endpoint\SwarmUnlock($requestBody), $fetch); } /** * @param array $queryParameters { * - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the services list. Available filters: - + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + * process on the services list. + * + * Available filters: + * + * - `id=` + * - `label=` + * - `mode=["replicated"|"global"]` + * - `name=` + * @var bool $status Include service status, with count of running and desired tasks. + * * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ServiceListInternalServerErrorException - * @throws \Docker\API\Exception\ServiceListServiceUnavailableException + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain + * + * @throws Exception\ServiceListInternalServerErrorException + * @throws Exception\ServiceListServiceUnavailableException * - * @return null|\Docker\API\Model\Service[]|\Psr\Http\Message\ResponseInterface + * @return Model\Service[]|\Psr\Http\Message\ResponseInterface|null */ - public function serviceList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function serviceList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ServiceList($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ServiceList($queryParameters, $accept), $fetch); } /** - * @param \Docker\API\Model\ServicesCreatePostBody $body - * @param array $headerParameters { + * @param array $headerParameters { + * + * @var string $X-Registry-Auth A base64url-encoded auth configuration for pulling from private + * registries. + * + * Refer to the [authentication section](#section/Authentication) for + * details. * - * @var string $X-Registry-Auth A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ServiceCreateBadRequestException - * @throws \Docker\API\Exception\ServiceCreateForbiddenException - * @throws \Docker\API\Exception\ServiceCreateConflictException - * @throws \Docker\API\Exception\ServiceCreateInternalServerErrorException - * @throws \Docker\API\Exception\ServiceCreateServiceUnavailableException + * @throws Exception\ServiceCreateBadRequestException + * @throws Exception\ServiceCreateForbiddenException + * @throws Exception\ServiceCreateConflictException + * @throws Exception\ServiceCreateInternalServerErrorException + * @throws Exception\ServiceCreateServiceUnavailableException * - * @return null|\Docker\API\Model\ServicesCreatePostResponse201|\Psr\Http\Message\ResponseInterface + * @return Model\ServiceCreateResponse|\Psr\Http\Message\ResponseInterface|null */ - public function serviceCreate(\Docker\API\Model\ServicesCreatePostBody $body, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function serviceCreate(?Model\ServicesCreatePostBody $requestBody = null, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ServiceCreate($body, $headerParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ServiceCreate($requestBody, $headerParameters), $fetch); } /** - * @param string $id ID or name of service - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $id ID or name of service + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ServiceDeleteNotFoundException - * @throws \Docker\API\Exception\ServiceDeleteInternalServerErrorException - * @throws \Docker\API\Exception\ServiceDeleteServiceUnavailableException + * @throws Exception\ServiceDeleteNotFoundException + * @throws Exception\ServiceDeleteInternalServerErrorException + * @throws Exception\ServiceDeleteServiceUnavailableException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function serviceDelete(string $id, string $fetch = self::FETCH_OBJECT) + public function serviceDelete(string $id, string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ServiceDelete($id), $fetch); + return $this->executeEndpoint(new Endpoint\ServiceDelete($id, $accept), $fetch); } /** * @param string $id ID or name of service * @param array $queryParameters { * - * @var bool $insertDefaults Fill empty fields with default values. - * } + * @var bool $insertDefaults Fill empty fields with default values. + * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ServiceInspectNotFoundException - * @throws \Docker\API\Exception\ServiceInspectInternalServerErrorException - * @throws \Docker\API\Exception\ServiceInspectServiceUnavailableException + * @throws Exception\ServiceInspectNotFoundException + * @throws Exception\ServiceInspectInternalServerErrorException + * @throws Exception\ServiceInspectServiceUnavailableException * - * @return null|\Docker\API\Model\Service|\Psr\Http\Message\ResponseInterface + * @return Model\Service|\Psr\Http\Message\ResponseInterface|null */ - public function serviceInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function serviceInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ServiceInspect($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ServiceInspect($id, $queryParameters, $accept), $fetch); } /** - * @param string $id ID or name of service - * @param \Docker\API\Model\ServicesIdUpdatePostBody $body - * @param array $queryParameters { + * @param string $id ID or name of service + * @param array $queryParameters { + * + * @var int $version The version number of the service object being updated. This is + * required to avoid conflicting writes. + * This version number should be the value as currently set on the + * service *before* the update. You can find the current version by + * calling `GET /services/{id}` + * @var string $registryAuthFrom if the `X-Registry-Auth` header is not specified, this parameter + * indicates where to find registry authorization credentials + * @var string $rollback Set to this parameter to `previous` to cause a server-side rollback + * to the previous service spec. The supplied spec will be ignored in + * this case. * - * @var int $version The version number of the service object being updated. This is required to avoid conflicting writes. - * @var string $registryAuthFrom If the X-Registry-Auth header is not specified, this parameter indicates where to find registry authorization credentials. The valid values are `spec` and `previous-spec`. - * @var string $rollback Set to this parameter to `previous` to cause a server-side rollback to the previous service spec. The supplied spec will be ignored in this case. * } * * @param array $headerParameters { * - * @var string $X-Registry-Auth A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication) + * @var string $X-Registry-Auth A base64url-encoded auth configuration for pulling from private + * registries. + * + * Refer to the [authentication section](#section/Authentication) for + * details. + * * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ServiceUpdateBadRequestException - * @throws \Docker\API\Exception\ServiceUpdateNotFoundException - * @throws \Docker\API\Exception\ServiceUpdateInternalServerErrorException - * @throws \Docker\API\Exception\ServiceUpdateServiceUnavailableException + * @throws Exception\ServiceUpdateBadRequestException + * @throws Exception\ServiceUpdateNotFoundException + * @throws Exception\ServiceUpdateInternalServerErrorException + * @throws Exception\ServiceUpdateServiceUnavailableException * - * @return null|\Docker\API\Model\ServiceUpdateResponse|\Psr\Http\Message\ResponseInterface + * @return Model\ServiceUpdateResponse|\Psr\Http\Message\ResponseInterface|null */ - public function serviceUpdate(string $id, \Docker\API\Model\ServicesIdUpdatePostBody $body, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function serviceUpdate(string $id, ?Model\ServicesIdUpdatePostBody $requestBody = null, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ServiceUpdate($id, $body, $queryParameters, $headerParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ServiceUpdate($id, $requestBody, $queryParameters, $headerParameters), $fetch); } /** - * Get `stdout` and `stderr` logs from a service. - - **Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers. - + * Get `stdout` and `stderr` logs from a service. See also + * [`/containers/{id}/logs`](#operation/ContainerLogs). + * + **Note**: This endpoint works only for services with the `local`, + * `json-file` or `journald` logging drivers. * * @param string $id ID or name of the service * @param array $queryParameters { * - * @var bool $details show service context and extra details provided to logs - * @var bool $follow return the logs as a stream - - * @var bool $stdout Return logs from `stdout` - * @var bool $stderr Return logs from `stderr` - * @var int $since Only return logs since this time, as a UNIX timestamp - * @var bool $timestamps Add timestamps to every log line - * @var string $tail Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines. + * @var bool $details show service context and extra details provided to logs + * @var bool $follow keep connection after returning logs + * @var bool $stdout Return logs from `stdout` + * @var bool $stderr Return logs from `stderr` + * @var int $since Only return logs since this time, as a UNIX timestamp + * @var bool $timestamps Add timestamps to every log line + * @var string $tail Only return this number of log lines from the end of the logs. + * Specify as an integer or `all` to output all log lines. + * * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/vnd.docker.raw-stream|application/vnd.docker.multiplexed-stream|application/json * - * @throws \Docker\API\Exception\ServiceLogsNotFoundException - * @throws \Docker\API\Exception\ServiceLogsInternalServerErrorException - * @throws \Docker\API\Exception\ServiceLogsServiceUnavailableException + * @throws Exception\ServiceLogsNotFoundException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function serviceLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function serviceLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ServiceLogs($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ServiceLogs($id, $queryParameters, $accept), $fetch); } /** * @param array $queryParameters { * - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the tasks list. Available filters: - + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + * process on the tasks list. + * + * Available filters: + * + * - `desired-state=(running | shutdown | accepted)` + * - `id=` + * - `label=key` or `label="key=value"` + * - `name=` + * - `node=` + * - `service=` + * * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\TaskListInternalServerErrorException - * @throws \Docker\API\Exception\TaskListServiceUnavailableException + * @throws Exception\TaskListInternalServerErrorException + * @throws Exception\TaskListServiceUnavailableException * - * @return null|\Docker\API\Model\Task[]|\Psr\Http\Message\ResponseInterface + * @return Model\Task[]|\Psr\Http\Message\ResponseInterface|null */ public function taskList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\TaskList($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\TaskList($queryParameters), $fetch); } /** * @param string $id ID of the task * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\TaskInspectNotFoundException - * @throws \Docker\API\Exception\TaskInspectInternalServerErrorException - * @throws \Docker\API\Exception\TaskInspectServiceUnavailableException + * @throws Exception\TaskInspectNotFoundException + * @throws Exception\TaskInspectInternalServerErrorException + * @throws Exception\TaskInspectServiceUnavailableException * - * @return null|\Docker\API\Model\Task|\Psr\Http\Message\ResponseInterface + * @return Model\Task|\Psr\Http\Message\ResponseInterface|null */ public function taskInspect(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\TaskInspect($id), $fetch); + return $this->executeEndpoint(new Endpoint\TaskInspect($id), $fetch); } /** * Get `stdout` and `stderr` logs from a task. - - **Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers. - + * See also [`/containers/{id}/logs`](#operation/ContainerLogs). + * + **Note**: This endpoint works only for services with the `local`, + * `json-file` or `journald` logging drivers. * * @param string $id ID of the task * @param array $queryParameters { * - * @var bool $details show task context and extra details provided to logs - * @var bool $follow return the logs as a stream - - * @var bool $stdout Return logs from `stdout` - * @var bool $stderr Return logs from `stderr` - * @var int $since Only return logs since this time, as a UNIX timestamp - * @var bool $timestamps Add timestamps to every log line - * @var string $tail Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines. + * @var bool $details show task context and extra details provided to logs + * @var bool $follow keep connection after returning logs + * @var bool $stdout Return logs from `stdout` + * @var bool $stderr Return logs from `stderr` + * @var int $since Only return logs since this time, as a UNIX timestamp + * @var bool $timestamps Add timestamps to every log line + * @var string $tail Only return this number of log lines from the end of the logs. + * Specify as an integer or `all` to output all log lines. + * * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/vnd.docker.raw-stream|application/vnd.docker.multiplexed-stream|application/json * - * @throws \Docker\API\Exception\TaskLogsNotFoundException - * @throws \Docker\API\Exception\TaskLogsInternalServerErrorException - * @throws \Docker\API\Exception\TaskLogsServiceUnavailableException + * @throws Exception\TaskLogsNotFoundException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function taskLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function taskLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\TaskLogs($id, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\TaskLogs($id, $queryParameters, $accept), $fetch); } /** * @param array $queryParameters { * - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the secrets list. Available filters: - + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + * process on the secrets list. + * + * Available filters: + * + * - `id=` + * - `label= or label==value` + * - `name=` + * - `names=` + * * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\SecretListInternalServerErrorException - * @throws \Docker\API\Exception\SecretListServiceUnavailableException + * @throws Exception\SecretListInternalServerErrorException + * @throws Exception\SecretListServiceUnavailableException * - * @return null|\Docker\API\Model\Secret[]|\Psr\Http\Message\ResponseInterface + * @return Model\Secret[]|\Psr\Http\Message\ResponseInterface|null */ public function secretList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SecretList($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\SecretList($queryParameters), $fetch); } /** - * @param \Docker\API\Model\SecretsCreatePostBody $body - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\SecretCreateConflictException - * @throws \Docker\API\Exception\SecretCreateInternalServerErrorException - * @throws \Docker\API\Exception\SecretCreateServiceUnavailableException + * @throws Exception\SecretCreateConflictException + * @throws Exception\SecretCreateInternalServerErrorException + * @throws Exception\SecretCreateServiceUnavailableException * - * @return null|\Docker\API\Model\IdResponse|\Psr\Http\Message\ResponseInterface + * @return Model\IdResponse|\Psr\Http\Message\ResponseInterface|null */ - public function secretCreate(\Docker\API\Model\SecretsCreatePostBody $body, string $fetch = self::FETCH_OBJECT) + public function secretCreate(?Model\SecretsCreatePostBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SecretCreate($body), $fetch); + return $this->executeEndpoint(new Endpoint\SecretCreate($requestBody), $fetch); } /** * @param string $id ID of the secret * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\SecretDeleteNotFoundException - * @throws \Docker\API\Exception\SecretDeleteInternalServerErrorException - * @throws \Docker\API\Exception\SecretDeleteServiceUnavailableException + * @throws Exception\SecretDeleteNotFoundException + * @throws Exception\SecretDeleteInternalServerErrorException + * @throws Exception\SecretDeleteServiceUnavailableException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ public function secretDelete(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SecretDelete($id), $fetch); + return $this->executeEndpoint(new Endpoint\SecretDelete($id), $fetch); } /** * @param string $id ID of the secret * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\SecretInspectNotFoundException - * @throws \Docker\API\Exception\SecretInspectInternalServerErrorException - * @throws \Docker\API\Exception\SecretInspectServiceUnavailableException + * @throws Exception\SecretInspectNotFoundException + * @throws Exception\SecretInspectInternalServerErrorException + * @throws Exception\SecretInspectServiceUnavailableException * - * @return null|\Docker\API\Model\Secret|\Psr\Http\Message\ResponseInterface + * @return Model\Secret|\Psr\Http\Message\ResponseInterface|null */ public function secretInspect(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SecretInspect($id), $fetch); + return $this->executeEndpoint(new Endpoint\SecretInspect($id), $fetch); } /** - * @param string $id The ID or name of the secret - * @param \Docker\API\Model\SecretSpec $body The spec of the secret to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the [SecretInspect endpoint](#operation/SecretInspect) response values. - * @param array $queryParameters { + * @param string $id The ID or name of the secret + * @param array $queryParameters { + * + * @var int $version The version number of the secret object being updated. This is + * required to avoid conflicting writes. * - * @var int $version The version number of the secret object being updated. This is required to avoid conflicting writes. * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\SecretUpdateBadRequestException - * @throws \Docker\API\Exception\SecretUpdateNotFoundException - * @throws \Docker\API\Exception\SecretUpdateInternalServerErrorException - * @throws \Docker\API\Exception\SecretUpdateServiceUnavailableException + * @throws Exception\SecretUpdateBadRequestException + * @throws Exception\SecretUpdateNotFoundException + * @throws Exception\SecretUpdateInternalServerErrorException + * @throws Exception\SecretUpdateServiceUnavailableException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function secretUpdate(string $id, \Docker\API\Model\SecretSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function secretUpdate(string $id, ?Model\SecretSpec $requestBody = null, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\SecretUpdate($id, $body, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\SecretUpdate($id, $requestBody, $queryParameters, $accept), $fetch); } /** * @param array $queryParameters { * - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the configs list. Available filters: - + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + * process on the configs list. + * + * Available filters: + * + * - `id=` + * - `label= or label==value` + * - `name=` + * - `names=` + * * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ConfigListInternalServerErrorException - * @throws \Docker\API\Exception\ConfigListServiceUnavailableException + * @throws Exception\ConfigListInternalServerErrorException + * @throws Exception\ConfigListServiceUnavailableException * - * @return null|\Docker\API\Model\Config[]|\Psr\Http\Message\ResponseInterface + * @return Model\Config[]|\Psr\Http\Message\ResponseInterface|null */ public function configList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ConfigList($queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ConfigList($queryParameters), $fetch); } /** - * @param \Docker\API\Model\ConfigsCreatePostBody $body - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ConfigCreateConflictException - * @throws \Docker\API\Exception\ConfigCreateInternalServerErrorException - * @throws \Docker\API\Exception\ConfigCreateServiceUnavailableException + * @throws Exception\ConfigCreateConflictException + * @throws Exception\ConfigCreateInternalServerErrorException + * @throws Exception\ConfigCreateServiceUnavailableException * - * @return null|\Docker\API\Model\IdResponse|\Psr\Http\Message\ResponseInterface + * @return Model\IdResponse|\Psr\Http\Message\ResponseInterface|null */ - public function configCreate(\Docker\API\Model\ConfigsCreatePostBody $body, string $fetch = self::FETCH_OBJECT) + public function configCreate(?Model\ConfigsCreatePostBody $requestBody = null, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ConfigCreate($body), $fetch); + return $this->executeEndpoint(new Endpoint\ConfigCreate($requestBody), $fetch); } /** * @param string $id ID of the config * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ConfigDeleteNotFoundException - * @throws \Docker\API\Exception\ConfigDeleteInternalServerErrorException - * @throws \Docker\API\Exception\ConfigDeleteServiceUnavailableException + * @throws Exception\ConfigDeleteNotFoundException + * @throws Exception\ConfigDeleteInternalServerErrorException + * @throws Exception\ConfigDeleteServiceUnavailableException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ public function configDelete(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ConfigDelete($id), $fetch); + return $this->executeEndpoint(new Endpoint\ConfigDelete($id), $fetch); } /** * @param string $id ID of the config * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\ConfigInspectNotFoundException - * @throws \Docker\API\Exception\ConfigInspectInternalServerErrorException - * @throws \Docker\API\Exception\ConfigInspectServiceUnavailableException + * @throws Exception\ConfigInspectNotFoundException + * @throws Exception\ConfigInspectInternalServerErrorException + * @throws Exception\ConfigInspectServiceUnavailableException * - * @return null|\Docker\API\Model\Config|\Psr\Http\Message\ResponseInterface + * @return Model\Config|\Psr\Http\Message\ResponseInterface|null */ public function configInspect(string $id, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ConfigInspect($id), $fetch); + return $this->executeEndpoint(new Endpoint\ConfigInspect($id), $fetch); } /** - * @param string $id The ID or name of the config - * @param \Docker\API\Model\ConfigSpec $body The spec of the config to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the [ConfigInspect endpoint](#operation/ConfigInspect) response values. - * @param array $queryParameters { + * @param string $id The ID or name of the config + * @param array $queryParameters { + * + * @var int $version The version number of the config object being updated. This is + * required to avoid conflicting writes. * - * @var int $version The version number of the config object being updated. This is required to avoid conflicting writes. * } * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param array $accept Accept content header application/json|text/plain * - * @throws \Docker\API\Exception\ConfigUpdateBadRequestException - * @throws \Docker\API\Exception\ConfigUpdateNotFoundException - * @throws \Docker\API\Exception\ConfigUpdateInternalServerErrorException - * @throws \Docker\API\Exception\ConfigUpdateServiceUnavailableException + * @throws Exception\ConfigUpdateBadRequestException + * @throws Exception\ConfigUpdateNotFoundException + * @throws Exception\ConfigUpdateInternalServerErrorException + * @throws Exception\ConfigUpdateServiceUnavailableException * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ - public function configUpdate(string $id, \Docker\API\Model\ConfigSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) + public function configUpdate(string $id, ?Model\ConfigSpec $requestBody = null, array $queryParameters = [], string $fetch = self::FETCH_OBJECT, array $accept = []) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\ConfigUpdate($id, $body, $queryParameters), $fetch); + return $this->executeEndpoint(new Endpoint\ConfigUpdate($id, $requestBody, $queryParameters, $accept), $fetch); } /** @@ -2172,42 +2617,46 @@ public function configUpdate(string $id, \Docker\API\Model\ConfigSpec $body, arr * @param string $name Image name or id * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\DistributionInspectUnauthorizedException - * @throws \Docker\API\Exception\DistributionInspectInternalServerErrorException + * @throws Exception\DistributionInspectUnauthorizedException + * @throws Exception\DistributionInspectInternalServerErrorException * - * @return null|\Docker\API\Model\DistributionNameJsonGetResponse200|\Psr\Http\Message\ResponseInterface + * @return Model\DistributionInspect|\Psr\Http\Message\ResponseInterface|null */ public function distributionInspect(string $name, string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\DistributionInspect($name), $fetch); + return $this->executeEndpoint(new Endpoint\DistributionInspect($name), $fetch); } /** * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @throws \Docker\API\Exception\SessionBadRequestException - * @throws \Docker\API\Exception\SessionInternalServerErrorException - * - * @return null|\Psr\Http\Message\ResponseInterface + * @return \Psr\Http\Message\ResponseInterface|null */ public function session(string $fetch = self::FETCH_OBJECT) { - return $this->executePsr7Endpoint(new \Docker\API\Endpoint\Session(), $fetch); + return $this->executeEndpoint(new Endpoint\Session(), $fetch); } - public static function create($httpClient = null) + public static function create($httpClient = null, array $additionalPlugins = [], array $additionalNormalizers = []) { if (null === $httpClient) { - $httpClient = \Http\Discovery\HttpClientDiscovery::find(); + $httpClient = \Http\Discovery\Psr18ClientDiscovery::find(); $plugins = []; - $uri = \Http\Discovery\UriFactoryDiscovery::find()->createUri('v1.36'); + $uri = \Http\Discovery\Psr17FactoryDiscovery::findUriFactory()->createUri('/v1.45'); $plugins[] = new \Http\Client\Common\Plugin\AddPathPlugin($uri); + if (\count($additionalPlugins) > 0) { + $plugins = array_merge($plugins, $additionalPlugins); + } $httpClient = new \Http\Client\Common\PluginClient($httpClient, $plugins); } - $messageFactory = \Http\Discovery\MessageFactoryDiscovery::find(); - $streamFactory = \Http\Discovery\StreamFactoryDiscovery::find(); - $serializer = new \Symfony\Component\Serializer\Serializer(\Docker\API\Normalizer\NormalizerFactory::create(), [new \Symfony\Component\Serializer\Encoder\JsonEncoder(new \Symfony\Component\Serializer\Encoder\JsonEncode(), new \Symfony\Component\Serializer\Encoder\JsonDecode())]); + $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); + $streamFactory = \Http\Discovery\Psr17FactoryDiscovery::findStreamFactory(); + $normalizers = [new \Symfony\Component\Serializer\Normalizer\ArrayDenormalizer(), new Normalizer\JaneObjectNormalizer()]; + if (\count($additionalNormalizers) > 0) { + $normalizers = array_merge($normalizers, $additionalNormalizers); + } + $serializer = new \Symfony\Component\Serializer\Serializer($normalizers, [new \Symfony\Component\Serializer\Encoder\JsonEncoder(new \Symfony\Component\Serializer\Encoder\JsonEncode(), new \Symfony\Component\Serializer\Encoder\JsonDecode(['json_decode_associative' => true]))]); - return new static($httpClient, $messageFactory, $serializer, $streamFactory); + return new static($httpClient, $requestFactory, $serializer, $streamFactory); } } diff --git a/src/ClientAsync.php b/src/ClientAsync.php deleted file mode 100644 index 8ae78372..00000000 --- a/src/ClientAsync.php +++ /dev/null @@ -1,2207 +0,0 @@ - - */ - public function containerList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerList($queryParameters), $fetch); - } - - /** - * @param \Docker\API\Model\ContainersCreatePostBody $body Container to create - * @param array $queryParameters { - * - * @var string $name Assign the specified name to the container. Must match `/?[a-zA-Z0-9_-]+`. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerCreateBadRequestException - * @throws \Docker\API\Exception\ContainerCreateNotFoundException - * @throws \Docker\API\Exception\ContainerCreateConflictException - * @throws \Docker\API\Exception\ContainerCreateInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerCreate(\Docker\API\Model\ContainersCreatePostBody $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerCreate($body, $queryParameters), $fetch); - } - - /** - * Return low-level information about a container. - * - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var bool $size Return the size of container as fields `SizeRw` and `SizeRootFs` - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerInspectNotFoundException - * @throws \Docker\API\Exception\ContainerInspectInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerInspect($id, $queryParameters), $fetch); - } - - /** - * On Unix systems, this is done by running the `ps` command. This endpoint is not supported on Windows. - * - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var string $ps_args The arguments to pass to `ps`. For example, `aux` - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerTopNotFoundException - * @throws \Docker\API\Exception\ContainerTopInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerTop(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerTop($id, $queryParameters), $fetch); - } - - /** - * Get `stdout` and `stderr` logs from a container. - - Note: This endpoint works only for containers with the `json-file` or `journald` logging driver. - - * - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var bool $follow return the logs as a stream - - * @var bool $stdout Return logs from `stdout` - * @var bool $stderr Return logs from `stderr` - * @var int $since Only return logs since this time, as a UNIX timestamp - * @var int $until Only return logs before this time, as a UNIX timestamp - * @var bool $timestamps Add timestamps to every log line - * @var string $tail Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerLogsNotFoundException - * @throws \Docker\API\Exception\ContainerLogsInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerLogs($id, $queryParameters), $fetch); - } - - /** - * Returns which files in a container's filesystem have been added, deleted,. - or modified. The `Kind` of modification can be one of: - - - `0`: Modified - - `1`: Added - - `2`: Deleted - - * - * @param string $id ID or name of the container - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerChangesNotFoundException - * @throws \Docker\API\Exception\ContainerChangesInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerChanges(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerChanges($id), $fetch); - } - - /** - * Export the contents of a container as a tarball. - * - * @param string $id ID or name of the container - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerExportNotFoundException - * @throws \Docker\API\Exception\ContainerExportInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerExport(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerExport($id), $fetch); - } - - /** - * This endpoint returns a live stream of a container’s resource usage. - statistics. - - The `precpu_stats` is the CPU statistic of last read, which is used - for calculating the CPU usage percentage. It is not the same as the - `cpu_stats` field. - - If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is - nil then for compatibility with older daemons the length of the - corresponding `cpu_usage.percpu_usage` array should be used. - - * - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var bool $stream Stream the output. If false, the stats will be output once and then it will disconnect. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerStatsNotFoundException - * @throws \Docker\API\Exception\ContainerStatsInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerStats(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerStats($id, $queryParameters), $fetch); - } - - /** - * Resize the TTY for a container. You must restart the container for the resize to take effect. - * - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var int $h Height of the tty session in characters - * @var int $w Width of the tty session in characters - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerResizeNotFoundException - * @throws \Docker\API\Exception\ContainerResizeInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerResize(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerResize($id, $queryParameters), $fetch); - } - - /** - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var string $detachKeys Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerStartNotFoundException - * @throws \Docker\API\Exception\ContainerStartInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerStart(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerStart($id, $queryParameters), $fetch); - } - - /** - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var int $t Number of seconds to wait before killing the container - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerStopNotFoundException - * @throws \Docker\API\Exception\ContainerStopInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerStop(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerStop($id, $queryParameters), $fetch); - } - - /** - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var int $t Number of seconds to wait before killing the container - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerRestartNotFoundException - * @throws \Docker\API\Exception\ContainerRestartInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerRestart(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerRestart($id, $queryParameters), $fetch); - } - - /** - * Send a POSIX signal to a container, defaulting to killing to the container. - * - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`) - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerKillNotFoundException - * @throws \Docker\API\Exception\ContainerKillInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerKill(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerKill($id, $queryParameters), $fetch); - } - - /** - * Change various configuration options of a container without having to recreate it. - * - * @param string $id ID or name of the container - * @param \Docker\API\Model\ContainersIdUpdatePostBody $update - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerUpdateNotFoundException - * @throws \Docker\API\Exception\ContainerUpdateInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerUpdate(string $id, \Docker\API\Model\ContainersIdUpdatePostBody $update, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerUpdate($id, $update), $fetch); - } - - /** - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var string $name New name for the container - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerRenameNotFoundException - * @throws \Docker\API\Exception\ContainerRenameConflictException - * @throws \Docker\API\Exception\ContainerRenameInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerRename(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerRename($id, $queryParameters), $fetch); - } - - /** - * Use the cgroups freezer to suspend all processes in a container. - - Traditionally, when suspending a process the `SIGSTOP` signal is used, which is observable by the process being suspended. With the cgroups freezer the process is unaware, and unable to capture, that it is being suspended, and subsequently resumed. - - * - * @param string $id ID or name of the container - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerPauseNotFoundException - * @throws \Docker\API\Exception\ContainerPauseInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerPause(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerPause($id), $fetch); - } - - /** - * Resume a container which has been paused. - * - * @param string $id ID or name of the container - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerUnpauseNotFoundException - * @throws \Docker\API\Exception\ContainerUnpauseInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerUnpause(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerUnpause($id), $fetch); - } - - /** - * Attach to a container to read its output or send it input. You can attach to the same container multiple times and you can reattach to containers that have been detached. - - Either the `stream` or `logs` parameter must be `true` for this endpoint to do anything. - - See [the documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) for more details. - - ### Hijacking - - This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, and `stderr` on the same socket. - - This is the response from the daemon for an attach request: - - ``` - HTTP/1.1 200 OK - Content-Type: application/vnd.docker.raw-stream - - [STREAM] - ``` - - After the headers and two new lines, the TCP connection can now be used for raw, bidirectional communication between the client and server. - - To hint potential proxies about connection hijacking, the Docker client can also optionally send connection upgrade headers. - - For example, the client sends this request to upgrade the connection: - - ``` - POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 - Upgrade: tcp - Connection: Upgrade - ``` - - The Docker daemon will respond with a `101 UPGRADED` response, and will similarly follow with the raw stream: - - ``` - HTTP/1.1 101 UPGRADED - Content-Type: application/vnd.docker.raw-stream - Connection: Upgrade - Upgrade: tcp - - [STREAM] - ``` - - ### Stream format - - When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), the stream over the hijacked connected is multiplexed to separate out `stdout` and `stderr`. The stream consists of a series of frames, each containing a header and a payload. - - The header contains the information which the stream writes (`stdout` or `stderr`). It also contains the size of the associated frame encoded in the last four bytes (`uint32`). - - It is encoded on the first eight bytes like this: - - ```go - header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} - ``` - - `STREAM_TYPE` can be: - - - 0: `stdin` (is written on `stdout`) - - 1: `stdout` - - 2: `stderr` - - `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size encoded as big endian. - - Following the header is the payload, which is the specified number of bytes of `STREAM_TYPE`. - - The simplest way to implement this protocol is the following: - - 1. Read 8 bytes. - 2. Choose `stdout` or `stderr` depending on the first byte. - 3. Extract the frame size from the last four bytes. - 4. Read the extracted size and output it on the correct output. - 5. Goto 1. - - ### Stream format when using a TTY - - When the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate), the stream is not multiplexed. The data exchanged over the hijacked connection is simply the raw data from the process PTY and client's `stdin`. - - * - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var string $detachKeys Override the key sequence for detaching a container.Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. - * @var bool $logs replay previous logs from the container - - * @var bool $stream Stream attached streams from the time the request was made onwards - * @var bool $stdin Attach to `stdin` - * @var bool $stdout Attach to `stdout` - * @var bool $stderr Attach to `stderr` - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerAttachBadRequestException - * @throws \Docker\API\Exception\ContainerAttachNotFoundException - * @throws \Docker\API\Exception\ContainerAttachInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerAttach(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerAttach($id, $queryParameters), $fetch); - } - - /** - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var string $detachKeys Override the key sequence for detaching a container.Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,`, or `_`. - * @var bool $logs Return logs - * @var bool $stream Return stream - * @var bool $stdin Attach to `stdin` - * @var bool $stdout Attach to `stdout` - * @var bool $stderr Attach to `stderr` - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerAttachWebsocketBadRequestException - * @throws \Docker\API\Exception\ContainerAttachWebsocketNotFoundException - * @throws \Docker\API\Exception\ContainerAttachWebsocketInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerAttachWebsocket(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerAttachWebsocket($id, $queryParameters), $fetch); - } - - /** - * Block until a container stops, then returns the exit code. - * - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var string $condition Wait until a container state reaches the given condition, either 'not-running' (default), 'next-exit', or 'removed'. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerWaitNotFoundException - * @throws \Docker\API\Exception\ContainerWaitInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerWait(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerWait($id, $queryParameters), $fetch); - } - - /** - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var bool $v remove the volumes associated with the container - * @var bool $force if the container is running, kill it before removing it - * @var bool $link Remove the specified link associated with the container. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerDeleteBadRequestException - * @throws \Docker\API\Exception\ContainerDeleteNotFoundException - * @throws \Docker\API\Exception\ContainerDeleteConflictException - * @throws \Docker\API\Exception\ContainerDeleteInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerDelete(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerDelete($id, $queryParameters), $fetch); - } - - /** - * Get a tar archive of a resource in the filesystem of container id. - * - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var string $path Resource in the container’s filesystem to archive. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerArchiveBadRequestException - * @throws \Docker\API\Exception\ContainerArchiveNotFoundException - * @throws \Docker\API\Exception\ContainerArchiveInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerArchive(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerArchive($id, $queryParameters), $fetch); - } - - /** - * A response header `X-Docker-Container-Path-Stat` is return containing a base64 - encoded JSON object with some filesystem header information about the path. - * - * @param string $id ID or name of the container - * @param array $queryParameters { - * - * @var string $path Resource in the container’s filesystem to archive. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerArchiveInfoBadRequestException - * @throws \Docker\API\Exception\ContainerArchiveInfoNotFoundException - * @throws \Docker\API\Exception\ContainerArchiveInfoInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerArchiveInfo(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerArchiveInfo($id, $queryParameters), $fetch); - } - - /** - * Upload a tar archive to be extracted to a path in the filesystem of container id. - * - * @param string $id ID or name of the container - * @param string $inputStream the input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz - * @param array $queryParameters { - * - * @var string $path Path to a directory in the container to extract the archive’s contents into. - * @var string $noOverwriteDirNonDir If “1”, “true”, or “True” then it will be an error if unpacking the given content would cause an existing directory to be replaced with a non-directory and vice versa. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\PutContainerArchiveBadRequestException - * @throws \Docker\API\Exception\PutContainerArchiveForbiddenException - * @throws \Docker\API\Exception\PutContainerArchiveNotFoundException - * @throws \Docker\API\Exception\PutContainerArchiveInternalServerErrorException - * - * @return \Amp\Promise - */ - public function putContainerArchive(string $id, string $inputStream, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\PutContainerArchive($id, $inputStream, $queryParameters), $fetch); - } - - /** - * @param array $queryParameters { - * - * @var string $filters filters to process on the prune list, encoded as JSON (a `map[string][]string`) - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerPruneInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerPrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerPrune($queryParameters), $fetch); - } - - /** - * Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image. - * - * @param array $queryParameters { - * - * @var bool $all Show all images. Only images from a final layer (no children) are shown by default. - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: - - * @var bool $digests Show digest information as a `RepoDigests` field on each image. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImageListInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imageList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ImageList($queryParameters), $fetch); - } - - /** - * Build an image from a tar archive with a `Dockerfile` in it. - - The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/). - - The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. - - The build is canceled if the client drops the connection by quitting or being killed. - - * - * @param string|resource|\Psr\Http\Message\StreamInterface $inputStream a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz - * @param array $queryParameters { - * - * @var string $dockerfile Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`. - * @var string $t A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters. - * @var string $extrahosts Extra hosts to add to /etc/hosts - * @var string $remote A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball. - * @var bool $q suppress verbose build output - * @var bool $nocache do not use the cache when building the image - * @var string $cachefrom JSON array of images used for build cache resolution - * @var string $pull attempt to pull the image even if an older image exists locally - * @var bool $rm remove intermediate containers after a successful build - * @var bool $forcerm always remove intermediate containers, even upon failure - * @var int $memory set memory limit for build - * @var int $memswap Total memory (memory + swap). Set as `-1` to disable swap. - * @var int $cpushares CPU shares (relative weight) - * @var string $cpusetcpus CPUs in which to allow execution (e.g., `0-3`, `0,1`). - * @var int $cpuperiod the length of a CPU period in microseconds - * @var int $cpuquota microseconds of CPU time that the container can get in a CPU period - * @var string $buildargs JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values. [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg) - * @var int $shmsize Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB. - * @var bool $squash Squash the resulting images layers into a single layer. *(Experimental release only.)* - * @var string $labels arbitrary key/value labels to set on the image, as a JSON map of string pairs - * @var string $networkmode Sets the networking mode for the run commands during build. Supported standard values are: `bridge`, `host`, `none`, and `container:`. Any other value is taken as a custom network's name to which this container should connect to. - * @var string $platform Platform in the format os[/arch[/variant]] - * } - * - * @param array $headerParameters { - * - * @var string $Content-type - * @var string $X-Registry-Config This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImageBuildBadRequestException - * @throws \Docker\API\Exception\ImageBuildInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imageBuild($inputStream, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ImageBuild($inputStream, $queryParameters, $headerParameters), $fetch); - } - - /** - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\BuildPruneInternalServerErrorException - * - * @return \Amp\Promise - */ - public function buildPrune(string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\BuildPrune(), $fetch); - } - - /** - * Create an image by either pulling it from a registry or importing it. - * - * @param string $inputImage Image content if the value `-` has been specified in fromSrc query parameter - * @param array $queryParameters { - * - * @var string $fromImage Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed. - * @var string $fromSrc Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image. - * @var string $repo Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image. - * @var string $tag Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled. - * @var string $platform Platform in the format os[/arch[/variant]] - * } - * - * @param array $headerParameters { - * - * @var string $X-Registry-Auth A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication) - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImageCreateNotFoundException - * @throws \Docker\API\Exception\ImageCreateInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imageCreate(string $inputImage, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ImageCreate($inputImage, $queryParameters, $headerParameters), $fetch); - } - - /** - * Return low-level information about an image. - * - * @param string $name Image name or id - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImageInspectNotFoundException - * @throws \Docker\API\Exception\ImageInspectInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imageInspect(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ImageInspect($name), $fetch); - } - - /** - * Return parent layers of an image. - * - * @param string $name Image name or ID - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImageHistoryNotFoundException - * @throws \Docker\API\Exception\ImageHistoryInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imageHistory(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ImageHistory($name), $fetch); - } - - /** - * Push an image to a registry. - - If you wish to push an image on to a private registry, that image must already have a tag which references the registry. For example, `registry.example.com/myimage:latest`. - - The push is cancelled if the HTTP connection is closed. - - * - * @param string $name image name or ID - * @param array $queryParameters { - * - * @var string $tag The tag to associate with the image on the registry. - * } - * - * @param array $headerParameters { - * - * @var string $X-Registry-Auth A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication) - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImagePushNotFoundException - * @throws \Docker\API\Exception\ImagePushInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imagePush(string $name, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ImagePush($name, $queryParameters, $headerParameters), $fetch); - } - - /** - * Tag an image so that it becomes part of a repository. - * - * @param string $name image name or ID to tag - * @param array $queryParameters { - * - * @var string $repo The repository to tag in. For example, `someuser/someimage`. - * @var string $tag The name of the new tag. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImageTagBadRequestException - * @throws \Docker\API\Exception\ImageTagNotFoundException - * @throws \Docker\API\Exception\ImageTagConflictException - * @throws \Docker\API\Exception\ImageTagInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imageTag(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ImageTag($name, $queryParameters), $fetch); - } - - /** - * Remove an image, along with any untagged parent images that were. - referenced by that image. - - Images can't be removed if they have descendant images, are being - used by a running container or are being used by a build. - - * - * @param string $name Image name or ID - * @param array $queryParameters { - * - * @var bool $force Remove the image even if it is being used by stopped containers or has other tags - * @var bool $noprune Do not delete untagged parent images - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImageDeleteNotFoundException - * @throws \Docker\API\Exception\ImageDeleteConflictException - * @throws \Docker\API\Exception\ImageDeleteInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imageDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ImageDelete($name, $queryParameters), $fetch); - } - - /** - * Search for an image on Docker Hub. - * - * @param array $queryParameters { - * - * @var string $term Term to search - * @var int $limit Maximum number of results to return - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImageSearchInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imageSearch(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ImageSearch($queryParameters), $fetch); - } - - /** - * @param array $queryParameters { - * - * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: - - - `dangling=` When set to `true` (or `1`), prune only - unused *and* untagged images. When set to `false` - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImagePruneInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imagePrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ImagePrune($queryParameters), $fetch); - } - - /** - * Validate credentials for a registry and, if available, get an identity token for accessing the registry without password. - * - * @param \Docker\API\Model\AuthConfig $authConfig Authentication to check - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SystemAuthInternalServerErrorException - * - * @return \Amp\Promise - */ - public function systemAuth(\Docker\API\Model\AuthConfig $authConfig, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SystemAuth($authConfig), $fetch); - } - - /** - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SystemInfoInternalServerErrorException - * - * @return \Amp\Promise - */ - public function systemInfo(string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SystemInfo(), $fetch); - } - - /** - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SystemVersionInternalServerErrorException - * - * @return \Amp\Promise - */ - public function systemVersion(string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SystemVersion(), $fetch); - } - - /** - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SystemPingInternalServerErrorException - * - * @return \Amp\Promise - */ - public function systemPing(string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SystemPing(), $fetch); - } - - /** - * @param \Docker\API\Model\ContainerConfig $containerConfig The container configuration - * @param array $queryParameters { - * - * @var string $container The ID or name of the container to commit - * @var string $repo Repository name for the created image - * @var string $tag Tag name for the create image - * @var string $comment Commit message - * @var string $author Author of the image (e.g., `John Hannibal Smith `) - * @var bool $pause Whether to pause the container before committing - * @var string $changes `Dockerfile` instructions to apply while committing - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImageCommitNotFoundException - * @throws \Docker\API\Exception\ImageCommitInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imageCommit(\Docker\API\Model\ContainerConfig $containerConfig, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ImageCommit($containerConfig, $queryParameters), $fetch); - } - - /** - * Stream real-time events from the server. - - Various objects within Docker report events when something happens to them. - - Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, and `update` - - Images report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, and `untag` - - Volumes report these events: `create`, `mount`, `unmount`, and `destroy` - - Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, and `remove` - - The Docker daemon reports these events: `reload` - - Services report these events: `create`, `update`, and `remove` - - Nodes report these events: `create`, `update`, and `remove` - - Secrets report these events: `create`, `update`, and `remove` - - Configs report these events: `create`, `update`, and `remove` - - * - * @param array $queryParameters { - * - * @var string $since show events created since this timestamp then stream new events - * @var string $until show events created until this timestamp then stop streaming - * @var string $filters A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SystemEventsBadRequestException - * @throws \Docker\API\Exception\SystemEventsInternalServerErrorException - * - * @return \Amp\Promise - */ - public function systemEvents(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SystemEvents($queryParameters), $fetch); - } - - /** - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SystemDataUsageInternalServerErrorException - * - * @return \Amp\Promise - */ - public function systemDataUsage(string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SystemDataUsage(), $fetch); - } - - /** - * Get a tarball containing all images and metadata for a repository. - - If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced. - - ### Image tarball format - - An image tarball contains one directory per image layer (named using its long ID), each containing these files: - - - `VERSION`: currently `1.0` - the file format version - - `json`: detailed layer information, similar to `docker inspect layer_id` - - `layer.tar`: A tarfile containing the filesystem changes in this layer - - The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions. - - If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs. - - ```json - { - "hello-world": { - "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" - } - } - ``` - - * - * @param string $name Image name or ID - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImageGetInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imageGet(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ImageGet($name), $fetch); - } - - /** - * Get a tarball containing all images and metadata for several image repositories. - - For each value of the `names` parameter: if it is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned; if it is an image ID, similarly only that image (and its parents) are returned and there would be no names referenced in the 'repositories' file for this image ID. - - For details on the format, see [the export image endpoint](#operation/ImageGet). - - * - * @param array $queryParameters { - * - * @var array $names Image names to filter by - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImageGetAllInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imageGetAll(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ImageGetAll($queryParameters), $fetch); - } - - /** - * Load a set of images and tags into a repository. - - For details on the format, see [the export image endpoint](#operation/ImageGet). - - * - * @param string|resource|\Psr\Http\Message\StreamInterface $imagesTarball Tar archive containing images - * @param array $queryParameters { - * - * @var bool $quiet Suppress progress details during load. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ImageLoadInternalServerErrorException - * - * @return \Amp\Promise - */ - public function imageLoad($imagesTarball, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ImageLoad($imagesTarball, $queryParameters), $fetch); - } - - /** - * Run a command inside a running container. - * - * @param string $id ID or name of container - * @param \Docker\API\Model\ContainersIdExecPostBody $execConfig Exec configuration - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ContainerExecNotFoundException - * @throws \Docker\API\Exception\ContainerExecConflictException - * @throws \Docker\API\Exception\ContainerExecInternalServerErrorException - * - * @return \Amp\Promise - */ - public function containerExec(string $id, \Docker\API\Model\ContainersIdExecPostBody $execConfig, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ContainerExec($id, $execConfig), $fetch); - } - - /** - * Starts a previously set up exec instance. If detach is true, this endpoint returns immediately after starting the command. Otherwise, it sets up an interactive session with the command. - * - * @param string $id Exec instance ID - * @param \Docker\API\Model\ExecIdStartPostBody $execStartConfig - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ExecStartNotFoundException - * @throws \Docker\API\Exception\ExecStartConflictException - * - * @return \Amp\Promise - */ - public function execStart(string $id, \Docker\API\Model\ExecIdStartPostBody $execStartConfig, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ExecStart($id, $execStartConfig), $fetch); - } - - /** - * Resize the TTY session used by an exec instance. This endpoint only works if `tty` was specified as part of creating and starting the exec instance. - * - * @param string $id Exec instance ID - * @param array $queryParameters { - * - * @var int $h Height of the TTY session in characters - * @var int $w Width of the TTY session in characters - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ExecResizeNotFoundException - * - * @return \Amp\Promise - */ - public function execResize(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ExecResize($id, $queryParameters), $fetch); - } - - /** - * Return low-level information about an exec instance. - * - * @param string $id Exec instance ID - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ExecInspectNotFoundException - * @throws \Docker\API\Exception\ExecInspectInternalServerErrorException - * - * @return \Amp\Promise - */ - public function execInspect(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ExecInspect($id), $fetch); - } - - /** - * @param array $queryParameters { - * - * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\VolumeListInternalServerErrorException - * - * @return \Amp\Promise - */ - public function volumeList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\VolumeList($queryParameters), $fetch); - } - - /** - * @param \Docker\API\Model\VolumesCreatePostBody $volumeConfig Volume configuration - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\VolumeCreateInternalServerErrorException - * - * @return \Amp\Promise - */ - public function volumeCreate(\Docker\API\Model\VolumesCreatePostBody $volumeConfig, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\VolumeCreate($volumeConfig), $fetch); - } - - /** - * Instruct the driver to remove the volume. - * - * @param string $name Volume name or ID - * @param array $queryParameters { - * - * @var bool $force Force the removal of the volume - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\VolumeDeleteNotFoundException - * @throws \Docker\API\Exception\VolumeDeleteConflictException - * @throws \Docker\API\Exception\VolumeDeleteInternalServerErrorException - * - * @return \Amp\Promise - */ - public function volumeDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\VolumeDelete($name, $queryParameters), $fetch); - } - - /** - * @param string $name Volume name or ID - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\VolumeInspectNotFoundException - * @throws \Docker\API\Exception\VolumeInspectInternalServerErrorException - * - * @return \Amp\Promise - */ - public function volumeInspect(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\VolumeInspect($name), $fetch); - } - - /** - * @param array $queryParameters { - * - * @var string $filters filters to process on the prune list, encoded as JSON (a `map[string][]string`) - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\VolumePruneInternalServerErrorException - * - * @return \Amp\Promise - */ - public function volumePrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\VolumePrune($queryParameters), $fetch); - } - - /** - * Returns a list of networks. For details on the format, see [the network inspect endpoint](#operation/NetworkInspect). - - Note that it uses a different, smaller representation of a network than inspecting a single network. For example, - the list of containers attached to the network is not propagated in API versions 1.28 and up. - - * - * @param array $queryParameters { - * - * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to process on the networks list. Available filters: - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\NetworkListInternalServerErrorException - * - * @return \Amp\Promise - */ - public function networkList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\NetworkList($queryParameters), $fetch); - } - - /** - * @param string $id Network ID or name - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\NetworkDeleteForbiddenException - * @throws \Docker\API\Exception\NetworkDeleteNotFoundException - * @throws \Docker\API\Exception\NetworkDeleteInternalServerErrorException - * - * @return \Amp\Promise - */ - public function networkDelete(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\NetworkDelete($id), $fetch); - } - - /** - * @param string $id Network ID or name - * @param array $queryParameters { - * - * @var bool $verbose Detailed inspect output for troubleshooting - * @var string $scope Filter the network by scope (swarm, global, or local) - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\NetworkInspectNotFoundException - * @throws \Docker\API\Exception\NetworkInspectInternalServerErrorException - * - * @return \Amp\Promise - */ - public function networkInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\NetworkInspect($id, $queryParameters), $fetch); - } - - /** - * @param \Docker\API\Model\NetworksCreatePostBody $networkConfig Network configuration - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\NetworkCreateForbiddenException - * @throws \Docker\API\Exception\NetworkCreateNotFoundException - * @throws \Docker\API\Exception\NetworkCreateInternalServerErrorException - * - * @return \Amp\Promise - */ - public function networkCreate(\Docker\API\Model\NetworksCreatePostBody $networkConfig, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\NetworkCreate($networkConfig), $fetch); - } - - /** - * @param string $id Network ID or name - * @param \Docker\API\Model\NetworksIdConnectPostBody $container - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\NetworkConnectForbiddenException - * @throws \Docker\API\Exception\NetworkConnectNotFoundException - * @throws \Docker\API\Exception\NetworkConnectInternalServerErrorException - * - * @return \Amp\Promise - */ - public function networkConnect(string $id, \Docker\API\Model\NetworksIdConnectPostBody $container, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\NetworkConnect($id, $container), $fetch); - } - - /** - * @param string $id Network ID or name - * @param \Docker\API\Model\NetworksIdDisconnectPostBody $container - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\NetworkDisconnectForbiddenException - * @throws \Docker\API\Exception\NetworkDisconnectNotFoundException - * @throws \Docker\API\Exception\NetworkDisconnectInternalServerErrorException - * - * @return \Amp\Promise - */ - public function networkDisconnect(string $id, \Docker\API\Model\NetworksIdDisconnectPostBody $container, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\NetworkDisconnect($id, $container), $fetch); - } - - /** - * @param array $queryParameters { - * - * @var string $filters filters to process on the prune list, encoded as JSON (a `map[string][]string`) - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\NetworkPruneInternalServerErrorException - * - * @return \Amp\Promise - */ - public function networkPrune(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\NetworkPrune($queryParameters), $fetch); - } - - /** - * Returns information about installed plugins. - * - * @param array $queryParameters { - * - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the plugin list. Available filters: - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\PluginListInternalServerErrorException - * - * @return \Amp\Promise - */ - public function pluginList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\PluginList($queryParameters), $fetch); - } - - /** - * @param array $queryParameters { - * - * @var string $remote The name of the plugin. The `:latest` tag is optional, and is the default if omitted. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\GetPluginPrivilegesInternalServerErrorException - * - * @return \Amp\Promise - */ - public function getPluginPrivileges(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\GetPluginPrivileges($queryParameters), $fetch); - } - - /** - * Pulls and installs a plugin. After the plugin is installed, it can be enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable). - - * - * @param array $body - * @param array $queryParameters { - * - * @var string $remote remote reference for plugin to install - - * @var string $name local name for the pulled plugin - - The `:latest` tag is optional, and is used as the default if omitted. - - * } - * - * @param array $headerParameters { - * - * @var string $X-Registry-Auth A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication) - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\PluginPullInternalServerErrorException - * - * @return \Amp\Promise - */ - public function pluginPull(array $body, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\PluginPull($body, $queryParameters, $headerParameters), $fetch); - } - - /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\PluginInspectNotFoundException - * @throws \Docker\API\Exception\PluginInspectInternalServerErrorException - * - * @return \Amp\Promise - */ - public function pluginInspect(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\PluginInspect($name), $fetch); - } - - /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. - * @param array $queryParameters { - * - * @var bool $force Disable the plugin before removing. This may result in issues if the plugin is in use by a container. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\PluginDeleteNotFoundException - * @throws \Docker\API\Exception\PluginDeleteInternalServerErrorException - * - * @return \Amp\Promise - */ - public function pluginDelete(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\PluginDelete($name, $queryParameters), $fetch); - } - - /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. - * @param array $queryParameters { - * - * @var int $timeout Set the HTTP client timeout (in seconds) - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\PluginEnableNotFoundException - * @throws \Docker\API\Exception\PluginEnableInternalServerErrorException - * - * @return \Amp\Promise - */ - public function pluginEnable(string $name, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\PluginEnable($name, $queryParameters), $fetch); - } - - /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\PluginDisableNotFoundException - * @throws \Docker\API\Exception\PluginDisableInternalServerErrorException - * - * @return \Amp\Promise - */ - public function pluginDisable(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\PluginDisable($name), $fetch); - } - - /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. - * @param array $body - * @param array $queryParameters { - * - * @var string $remote remote reference to upgrade to - - The `:latest` tag is optional, and is used as the default if omitted. - - * } - * - * @param array $headerParameters { - * - * @var string $X-Registry-Auth A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication) - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\PluginUpgradeNotFoundException - * @throws \Docker\API\Exception\PluginUpgradeInternalServerErrorException - * - * @return \Amp\Promise - */ - public function pluginUpgrade(string $name, array $body, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\PluginUpgrade($name, $body, $queryParameters, $headerParameters), $fetch); - } - - /** - * @param string|resource|\Psr\Http\Message\StreamInterface $tarContext Path to tar containing plugin rootfs and manifest - * @param array $queryParameters { - * - * @var string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\PluginCreateInternalServerErrorException - * - * @return \Amp\Promise - */ - public function pluginCreate($tarContext, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\PluginCreate($tarContext, $queryParameters), $fetch); - } - - /** - * Push a plugin to the registry. - * - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\PluginPushNotFoundException - * @throws \Docker\API\Exception\PluginPushInternalServerErrorException - * - * @return \Amp\Promise - */ - public function pluginPush(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\PluginPush($name), $fetch); - } - - /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. - * @param array $body - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\PluginSetNotFoundException - * @throws \Docker\API\Exception\PluginSetInternalServerErrorException - * - * @return \Amp\Promise - */ - public function pluginSet(string $name, array $body, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\PluginSet($name, $body), $fetch); - } - - /** - * @param array $queryParameters { - * - * @var string $filters filters to process on the nodes list, encoded as JSON (a `map[string][]string`) - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\NodeListInternalServerErrorException - * @throws \Docker\API\Exception\NodeListServiceUnavailableException - * - * @return \Amp\Promise - */ - public function nodeList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\NodeList($queryParameters), $fetch); - } - - /** - * @param string $id The ID or name of the node - * @param array $queryParameters { - * - * @var bool $force Force remove a node from the swarm - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\NodeDeleteNotFoundException - * @throws \Docker\API\Exception\NodeDeleteInternalServerErrorException - * @throws \Docker\API\Exception\NodeDeleteServiceUnavailableException - * - * @return \Amp\Promise - */ - public function nodeDelete(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\NodeDelete($id, $queryParameters), $fetch); - } - - /** - * @param string $id The ID or name of the node - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\NodeInspectNotFoundException - * @throws \Docker\API\Exception\NodeInspectInternalServerErrorException - * @throws \Docker\API\Exception\NodeInspectServiceUnavailableException - * - * @return \Amp\Promise - */ - public function nodeInspect(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\NodeInspect($id), $fetch); - } - - /** - * @param string $id The ID of the node - * @param \Docker\API\Model\NodeSpec $body - * @param array $queryParameters { - * - * @var int $version The version number of the node object being updated. This is required to avoid conflicting writes. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\NodeUpdateBadRequestException - * @throws \Docker\API\Exception\NodeUpdateNotFoundException - * @throws \Docker\API\Exception\NodeUpdateInternalServerErrorException - * @throws \Docker\API\Exception\NodeUpdateServiceUnavailableException - * - * @return \Amp\Promise - */ - public function nodeUpdate(string $id, \Docker\API\Model\NodeSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\NodeUpdate($id, $body, $queryParameters), $fetch); - } - - /** - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SwarmInspectNotFoundException - * @throws \Docker\API\Exception\SwarmInspectInternalServerErrorException - * @throws \Docker\API\Exception\SwarmInspectServiceUnavailableException - * - * @return \Amp\Promise - */ - public function swarmInspect(string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SwarmInspect(), $fetch); - } - - /** - * @param \Docker\API\Model\SwarmInitPostBody $body - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SwarmInitBadRequestException - * @throws \Docker\API\Exception\SwarmInitInternalServerErrorException - * @throws \Docker\API\Exception\SwarmInitServiceUnavailableException - * - * @return \Amp\Promise - */ - public function swarmInit(\Docker\API\Model\SwarmInitPostBody $body, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SwarmInit($body), $fetch); - } - - /** - * @param \Docker\API\Model\SwarmJoinPostBody $body - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SwarmJoinBadRequestException - * @throws \Docker\API\Exception\SwarmJoinInternalServerErrorException - * @throws \Docker\API\Exception\SwarmJoinServiceUnavailableException - * - * @return \Amp\Promise - */ - public function swarmJoin(\Docker\API\Model\SwarmJoinPostBody $body, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SwarmJoin($body), $fetch); - } - - /** - * @param array $queryParameters { - * - * @var bool $force Force leave swarm, even if this is the last manager or that it will break the cluster. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SwarmLeaveInternalServerErrorException - * @throws \Docker\API\Exception\SwarmLeaveServiceUnavailableException - * - * @return \Amp\Promise - */ - public function swarmLeave(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SwarmLeave($queryParameters), $fetch); - } - - /** - * @param \Docker\API\Model\SwarmSpec $body - * @param array $queryParameters { - * - * @var int $version The version number of the swarm object being updated. This is required to avoid conflicting writes. - * @var bool $rotateWorkerToken rotate the worker join token - * @var bool $rotateManagerToken rotate the manager join token - * @var bool $rotateManagerUnlockKey Rotate the manager unlock key. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SwarmUpdateBadRequestException - * @throws \Docker\API\Exception\SwarmUpdateInternalServerErrorException - * @throws \Docker\API\Exception\SwarmUpdateServiceUnavailableException - * - * @return \Amp\Promise - */ - public function swarmUpdate(\Docker\API\Model\SwarmSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SwarmUpdate($body, $queryParameters), $fetch); - } - - /** - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SwarmUnlockkeyInternalServerErrorException - * @throws \Docker\API\Exception\SwarmUnlockkeyServiceUnavailableException - * - * @return \Amp\Promise - */ - public function swarmUnlockkey(string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SwarmUnlockkey(), $fetch); - } - - /** - * @param \Docker\API\Model\SwarmUnlockPostBody $body - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SwarmUnlockInternalServerErrorException - * @throws \Docker\API\Exception\SwarmUnlockServiceUnavailableException - * - * @return \Amp\Promise - */ - public function swarmUnlock(\Docker\API\Model\SwarmUnlockPostBody $body, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SwarmUnlock($body), $fetch); - } - - /** - * @param array $queryParameters { - * - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the services list. Available filters: - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ServiceListInternalServerErrorException - * @throws \Docker\API\Exception\ServiceListServiceUnavailableException - * - * @return \Amp\Promise - */ - public function serviceList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ServiceList($queryParameters), $fetch); - } - - /** - * @param \Docker\API\Model\ServicesCreatePostBody $body - * @param array $headerParameters { - * - * @var string $X-Registry-Auth A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication) - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ServiceCreateBadRequestException - * @throws \Docker\API\Exception\ServiceCreateForbiddenException - * @throws \Docker\API\Exception\ServiceCreateConflictException - * @throws \Docker\API\Exception\ServiceCreateInternalServerErrorException - * @throws \Docker\API\Exception\ServiceCreateServiceUnavailableException - * - * @return \Amp\Promise - */ - public function serviceCreate(\Docker\API\Model\ServicesCreatePostBody $body, array $headerParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ServiceCreate($body, $headerParameters), $fetch); - } - - /** - * @param string $id ID or name of service - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ServiceDeleteNotFoundException - * @throws \Docker\API\Exception\ServiceDeleteInternalServerErrorException - * @throws \Docker\API\Exception\ServiceDeleteServiceUnavailableException - * - * @return \Amp\Promise - */ - public function serviceDelete(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ServiceDelete($id), $fetch); - } - - /** - * @param string $id ID or name of service - * @param array $queryParameters { - * - * @var bool $insertDefaults Fill empty fields with default values. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ServiceInspectNotFoundException - * @throws \Docker\API\Exception\ServiceInspectInternalServerErrorException - * @throws \Docker\API\Exception\ServiceInspectServiceUnavailableException - * - * @return \Amp\Promise - */ - public function serviceInspect(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ServiceInspect($id, $queryParameters), $fetch); - } - - /** - * @param string $id ID or name of service - * @param \Docker\API\Model\ServicesIdUpdatePostBody $body - * @param array $queryParameters { - * - * @var int $version The version number of the service object being updated. This is required to avoid conflicting writes. - * @var string $registryAuthFrom If the X-Registry-Auth header is not specified, this parameter indicates where to find registry authorization credentials. The valid values are `spec` and `previous-spec`. - * @var string $rollback Set to this parameter to `previous` to cause a server-side rollback to the previous service spec. The supplied spec will be ignored in this case. - * } - * - * @param array $headerParameters { - * - * @var string $X-Registry-Auth A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication) - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ServiceUpdateBadRequestException - * @throws \Docker\API\Exception\ServiceUpdateNotFoundException - * @throws \Docker\API\Exception\ServiceUpdateInternalServerErrorException - * @throws \Docker\API\Exception\ServiceUpdateServiceUnavailableException - * - * @return \Amp\Promise - */ - public function serviceUpdate(string $id, \Docker\API\Model\ServicesIdUpdatePostBody $body, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ServiceUpdate($id, $body, $queryParameters, $headerParameters), $fetch); - } - - /** - * Get `stdout` and `stderr` logs from a service. - - **Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers. - - * - * @param string $id ID or name of the service - * @param array $queryParameters { - * - * @var bool $details show service context and extra details provided to logs - * @var bool $follow return the logs as a stream - - * @var bool $stdout Return logs from `stdout` - * @var bool $stderr Return logs from `stderr` - * @var int $since Only return logs since this time, as a UNIX timestamp - * @var bool $timestamps Add timestamps to every log line - * @var string $tail Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ServiceLogsNotFoundException - * @throws \Docker\API\Exception\ServiceLogsInternalServerErrorException - * @throws \Docker\API\Exception\ServiceLogsServiceUnavailableException - * - * @return \Amp\Promise - */ - public function serviceLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ServiceLogs($id, $queryParameters), $fetch); - } - - /** - * @param array $queryParameters { - * - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the tasks list. Available filters: - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\TaskListInternalServerErrorException - * @throws \Docker\API\Exception\TaskListServiceUnavailableException - * - * @return \Amp\Promise - */ - public function taskList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\TaskList($queryParameters), $fetch); - } - - /** - * @param string $id ID of the task - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\TaskInspectNotFoundException - * @throws \Docker\API\Exception\TaskInspectInternalServerErrorException - * @throws \Docker\API\Exception\TaskInspectServiceUnavailableException - * - * @return \Amp\Promise - */ - public function taskInspect(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\TaskInspect($id), $fetch); - } - - /** - * Get `stdout` and `stderr` logs from a task. - - **Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers. - - * - * @param string $id ID of the task - * @param array $queryParameters { - * - * @var bool $details show task context and extra details provided to logs - * @var bool $follow return the logs as a stream - - * @var bool $stdout Return logs from `stdout` - * @var bool $stderr Return logs from `stderr` - * @var int $since Only return logs since this time, as a UNIX timestamp - * @var bool $timestamps Add timestamps to every log line - * @var string $tail Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\TaskLogsNotFoundException - * @throws \Docker\API\Exception\TaskLogsInternalServerErrorException - * @throws \Docker\API\Exception\TaskLogsServiceUnavailableException - * - * @return \Amp\Promise - */ - public function taskLogs(string $id, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\TaskLogs($id, $queryParameters), $fetch); - } - - /** - * @param array $queryParameters { - * - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the secrets list. Available filters: - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SecretListInternalServerErrorException - * @throws \Docker\API\Exception\SecretListServiceUnavailableException - * - * @return \Amp\Promise - */ - public function secretList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SecretList($queryParameters), $fetch); - } - - /** - * @param \Docker\API\Model\SecretsCreatePostBody $body - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SecretCreateConflictException - * @throws \Docker\API\Exception\SecretCreateInternalServerErrorException - * @throws \Docker\API\Exception\SecretCreateServiceUnavailableException - * - * @return \Amp\Promise - */ - public function secretCreate(\Docker\API\Model\SecretsCreatePostBody $body, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SecretCreate($body), $fetch); - } - - /** - * @param string $id ID of the secret - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SecretDeleteNotFoundException - * @throws \Docker\API\Exception\SecretDeleteInternalServerErrorException - * @throws \Docker\API\Exception\SecretDeleteServiceUnavailableException - * - * @return \Amp\Promise - */ - public function secretDelete(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SecretDelete($id), $fetch); - } - - /** - * @param string $id ID of the secret - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SecretInspectNotFoundException - * @throws \Docker\API\Exception\SecretInspectInternalServerErrorException - * @throws \Docker\API\Exception\SecretInspectServiceUnavailableException - * - * @return \Amp\Promise - */ - public function secretInspect(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SecretInspect($id), $fetch); - } - - /** - * @param string $id The ID or name of the secret - * @param \Docker\API\Model\SecretSpec $body The spec of the secret to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the [SecretInspect endpoint](#operation/SecretInspect) response values. - * @param array $queryParameters { - * - * @var int $version The version number of the secret object being updated. This is required to avoid conflicting writes. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SecretUpdateBadRequestException - * @throws \Docker\API\Exception\SecretUpdateNotFoundException - * @throws \Docker\API\Exception\SecretUpdateInternalServerErrorException - * @throws \Docker\API\Exception\SecretUpdateServiceUnavailableException - * - * @return \Amp\Promise - */ - public function secretUpdate(string $id, \Docker\API\Model\SecretSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\SecretUpdate($id, $body, $queryParameters), $fetch); - } - - /** - * @param array $queryParameters { - * - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the configs list. Available filters: - - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ConfigListInternalServerErrorException - * @throws \Docker\API\Exception\ConfigListServiceUnavailableException - * - * @return \Amp\Promise - */ - public function configList(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ConfigList($queryParameters), $fetch); - } - - /** - * @param \Docker\API\Model\ConfigsCreatePostBody $body - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ConfigCreateConflictException - * @throws \Docker\API\Exception\ConfigCreateInternalServerErrorException - * @throws \Docker\API\Exception\ConfigCreateServiceUnavailableException - * - * @return \Amp\Promise - */ - public function configCreate(\Docker\API\Model\ConfigsCreatePostBody $body, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ConfigCreate($body), $fetch); - } - - /** - * @param string $id ID of the config - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ConfigDeleteNotFoundException - * @throws \Docker\API\Exception\ConfigDeleteInternalServerErrorException - * @throws \Docker\API\Exception\ConfigDeleteServiceUnavailableException - * - * @return \Amp\Promise - */ - public function configDelete(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ConfigDelete($id), $fetch); - } - - /** - * @param string $id ID of the config - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ConfigInspectNotFoundException - * @throws \Docker\API\Exception\ConfigInspectInternalServerErrorException - * @throws \Docker\API\Exception\ConfigInspectServiceUnavailableException - * - * @return \Amp\Promise - */ - public function configInspect(string $id, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ConfigInspect($id), $fetch); - } - - /** - * @param string $id The ID or name of the config - * @param \Docker\API\Model\ConfigSpec $body The spec of the config to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the [ConfigInspect endpoint](#operation/ConfigInspect) response values. - * @param array $queryParameters { - * - * @var int $version The version number of the config object being updated. This is required to avoid conflicting writes. - * } - * - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\ConfigUpdateBadRequestException - * @throws \Docker\API\Exception\ConfigUpdateNotFoundException - * @throws \Docker\API\Exception\ConfigUpdateInternalServerErrorException - * @throws \Docker\API\Exception\ConfigUpdateServiceUnavailableException - * - * @return \Amp\Promise - */ - public function configUpdate(string $id, \Docker\API\Model\ConfigSpec $body, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\ConfigUpdate($id, $body, $queryParameters), $fetch); - } - - /** - * Return image digest and platform information by contacting the registry. - * - * @param string $name Image name or id - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\DistributionInspectUnauthorizedException - * @throws \Docker\API\Exception\DistributionInspectInternalServerErrorException - * - * @return \Amp\Promise - */ - public function distributionInspect(string $name, string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\DistributionInspect($name), $fetch); - } - - /** - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @throws \Docker\API\Exception\SessionBadRequestException - * @throws \Docker\API\Exception\SessionInternalServerErrorException - * - * @return \Amp\Promise - */ - public function session(string $fetch = self::FETCH_OBJECT) - { - return $this->executeArtaxEndpoint(new \Docker\API\Endpoint\Session(), $fetch); - } - - public static function create($httpClient = null) - { - if (null === $httpClient) { - $httpClient = new \Amp\Artax\DefaultClient(); - } - $serializer = new \Symfony\Component\Serializer\Serializer(\Docker\API\Normalizer\NormalizerFactory::create(), [new \Symfony\Component\Serializer\Encoder\JsonEncoder(new \Symfony\Component\Serializer\Encoder\JsonEncode(), new \Symfony\Component\Serializer\Encoder\JsonDecode())]); - - return new static($httpClient, $serializer); - } -} diff --git a/src/Endpoint/BuildPrune.php b/src/Endpoint/BuildPrune.php index 84c6a8e9..42ff79e4 100644 --- a/src/Endpoint/BuildPrune.php +++ b/src/Endpoint/BuildPrune.php @@ -2,17 +2,37 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class BuildPrune extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class BuildPrune extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; + use \Docker\API\Runtime\Client\EndpointTrait; + + /** + * @param array $queryParameters { + * + * @var int $keep-storage Amount of disk space in bytes to keep for cache + * @var bool $all Remove all types of build cache + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + * process on the list of build cache objects. + * + * Available filters: + * + * - `until=` remove cache older than ``. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time. + * - `id=` + * - `parent=` + * - `type=` + * - `description=` + * - `inuse` + * - `shared` + * - `private` + * + * } + */ + public function __construct(array $queryParameters = []) + { + $this->queryParameters = $queryParameters; + } public function getMethod(): string { @@ -24,7 +44,7 @@ public function getUri(): string return '/build/prune'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -34,20 +54,38 @@ public function getExtraHeaders(): array return ['Accept' => ['application/json']]; } + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['keep-storage', 'all', 'filters']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('keep-storage', ['int']); + $optionsResolver->addAllowedTypes('all', ['bool']); + $optionsResolver->addAllowedTypes('filters', ['string']); + + return $optionsResolver; + } + /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\BuildPruneInternalServerErrorException * - * @return null|\Docker\API\Model\BuildPrunePostResponse200 + * @return \Docker\API\Model\BuildPrunePostResponse200|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\BuildPrunePostResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\BuildPrunePostResponse200', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\BuildPruneInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\BuildPruneInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ConfigCreate.php b/src/Endpoint/ConfigCreate.php index 9b067cb7..85fe1d9c 100644 --- a/src/Endpoint/ConfigCreate.php +++ b/src/Endpoint/ConfigCreate.php @@ -2,26 +2,17 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ConfigCreate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ConfigCreate extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - /** - * @param \Docker\API\Model\ConfigsCreatePostBody $body - */ - public function __construct(\Docker\API\Model\ConfigsCreatePostBody $body) + use \Docker\API\Runtime\Client\EndpointTrait; + + public function __construct(?\Docker\API\Model\ConfigsCreatePostBody $requestBody = null) { - $this->body = $body; + $this->body = $requestBody; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -32,9 +23,13 @@ public function getUri(): string return '/configs/create'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\ConfigsCreatePostBody) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + + return [[], null]; } public function getExtraHeaders(): array @@ -43,27 +38,32 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ConfigCreateConflictException * @throws \Docker\API\Exception\ConfigCreateInternalServerErrorException * @throws \Docker\API\Exception\ConfigCreateServiceUnavailableException * - * @return null|\Docker\API\Model\IdResponse + * @return \Docker\API\Model\IdResponse|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (201 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\IdResponse', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\IdResponse', 'json'); } - if (409 === $status) { - throw new \Docker\API\Exception\ConfigCreateConflictException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (409 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ConfigCreateConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ConfigCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ConfigCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\ConfigCreateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ConfigCreateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ConfigDelete.php b/src/Endpoint/ConfigDelete.php index f38822ca..fab8786a 100644 --- a/src/Endpoint/ConfigDelete.php +++ b/src/Endpoint/ConfigDelete.php @@ -2,16 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ConfigDelete extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ConfigDelete extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; /** @@ -22,8 +17,6 @@ public function __construct(string $id) $this->id = $id; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'DELETE'; @@ -34,7 +27,7 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/configs/{id}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -45,25 +38,31 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ConfigDeleteNotFoundException * @throws \Docker\API\Exception\ConfigDeleteInternalServerErrorException * @throws \Docker\API\Exception\ConfigDeleteServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (204 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\ConfigDeleteNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ConfigDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ConfigDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ConfigDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\ConfigDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ConfigDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ConfigInspect.php b/src/Endpoint/ConfigInspect.php index c9b66c27..55f69426 100644 --- a/src/Endpoint/ConfigInspect.php +++ b/src/Endpoint/ConfigInspect.php @@ -2,16 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ConfigInspect extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ConfigInspect extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; /** @@ -22,8 +17,6 @@ public function __construct(string $id) $this->id = $id; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -34,7 +27,7 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/configs/{id}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -45,27 +38,32 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ConfigInspectNotFoundException * @throws \Docker\API\Exception\ConfigInspectInternalServerErrorException * @throws \Docker\API\Exception\ConfigInspectServiceUnavailableException * - * @return null|\Docker\API\Model\Config + * @return \Docker\API\Model\Config|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Config', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Config', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\ConfigInspectNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ConfigInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ConfigInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ConfigInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\ConfigInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ConfigInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ConfigList.php b/src/Endpoint/ConfigList.php index c3d77a78..fff29cf9 100644 --- a/src/Endpoint/ConfigList.php +++ b/src/Endpoint/ConfigList.php @@ -2,26 +2,25 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ConfigList extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ConfigList extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** * @param array $queryParameters { * - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the configs list. Available filters: - - - `id=` - - `label= or label==value` - - `name=` - - `names=` - + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + * process on the configs list. + * + * Available filters: + * + * - `id=` + * - `label= or label==value` + * - `name=` + * - `names=` + * * } */ public function __construct(array $queryParameters = []) @@ -29,8 +28,6 @@ public function __construct(array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -41,7 +38,7 @@ public function getUri(): string return '/configs'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -57,29 +54,34 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['filters']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('filters', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ConfigListInternalServerErrorException * @throws \Docker\API\Exception\ConfigListServiceUnavailableException * - * @return null|\Docker\API\Model\Config[] + * @return \Docker\API\Model\Config[]|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Config[]', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Config[]', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\ConfigListInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ConfigListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\ConfigListServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ConfigListServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ConfigUpdate.php b/src/Endpoint/ConfigUpdate.php index b0901cc6..d970667d 100644 --- a/src/Endpoint/ConfigUpdate.php +++ b/src/Endpoint/ConfigUpdate.php @@ -2,35 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ConfigUpdate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ConfigUpdate extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * @param string $id The ID or name of the config - * @param \Docker\API\Model\ConfigSpec $body The spec of the config to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the [ConfigInspect endpoint](#operation/ConfigInspect) response values. - * @param array $queryParameters { + * @param string $id The ID or name of the config + * @param array $queryParameters { + * + * @var int $version The version number of the config object being updated. This is + * required to avoid conflicting writes. * - * @var int $version The version number of the config object being updated. This is required to avoid conflicting writes. * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, \Docker\API\Model\ConfigSpec $body, array $queryParameters = []) + public function __construct(string $id, ?\Docker\API\Model\ConfigSpec $requestBody = null, array $queryParameters = [], array $accept = []) { $this->id = $id; - $this->body = $body; + $this->body = $requestBody; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -41,14 +39,25 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/configs/{id}/update'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\ConfigSpec) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + if ($this->body instanceof \Docker\API\Model\ConfigSpec) { + return [['Content-Type' => ['text/plain']], $this->body]; + } + + return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -57,35 +66,41 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['version']); $optionsResolver->setRequired(['version']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('version', ['int']); + $optionsResolver->addAllowedTypes('version', ['int']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ConfigUpdateBadRequestException * @throws \Docker\API\Exception\ConfigUpdateNotFoundException * @throws \Docker\API\Exception\ConfigUpdateInternalServerErrorException * @throws \Docker\API\Exception\ConfigUpdateServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (400 === $status) { - throw new \Docker\API\Exception\ConfigUpdateBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ConfigUpdateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (404 === $status) { - throw new \Docker\API\Exception\ConfigUpdateNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ConfigUpdateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ConfigUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ConfigUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\ConfigUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ConfigUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerArchive.php b/src/Endpoint/ContainerArchive.php index 5493836d..23a3c4b6 100644 --- a/src/Endpoint/ContainerArchive.php +++ b/src/Endpoint/ContainerArchive.php @@ -2,17 +2,13 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerArchive extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerArchive extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** * Get a tar archive of a resource in the filesystem of container id. @@ -20,17 +16,18 @@ class ContainerArchive extends \Jane\OpenApiRuntime\Client\BaseEndpoint implemen * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $path Resource in the container’s filesystem to archive. - * } + * @var string $path Resource in the container’s filesystem to archive. + * } + * + * @param array $accept Accept content header application/x-tar|application/json */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -41,14 +38,18 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/archive'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/x-tar', 'application/json']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -57,31 +58,33 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['path']); $optionsResolver->setRequired(['path']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('path', ['string']); + $optionsResolver->addAllowedTypes('path', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * - * @throws \Docker\API\Exception\ContainerArchiveBadRequestException * @throws \Docker\API\Exception\ContainerArchiveNotFoundException - * @throws \Docker\API\Exception\ContainerArchiveInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } if (400 === $status) { - throw new \Docker\API\Exception\ContainerArchiveBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ContainersIdArchiveGetResponse400', 'json')); } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerArchiveNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerArchiveNotFoundException($response); } if (500 === $status) { - throw new \Docker\API\Exception\ContainerArchiveInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerArchiveInfo.php b/src/Endpoint/ContainerArchiveInfo.php index b22b55bc..86d66370 100644 --- a/src/Endpoint/ContainerArchiveInfo.php +++ b/src/Endpoint/ContainerArchiveInfo.php @@ -2,35 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerArchiveInfo extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerArchiveInfo extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * A response header `X-Docker-Container-Path-Stat` is return containing a base64 - encoded JSON object with some filesystem header information about the path. + * A response header `X-Docker-Container-Path-Stat` is returned, containing + * a base64 - encoded JSON object with some filesystem header information + * about the path. * * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $path Resource in the container’s filesystem to archive. - * } + * @var string $path Resource in the container’s filesystem to archive. + * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'HEAD'; @@ -41,14 +40,18 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/archive'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -57,31 +60,37 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['path']); $optionsResolver->setRequired(['path']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('path', ['string']); + $optionsResolver->addAllowedTypes('path', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerArchiveInfoBadRequestException * @throws \Docker\API\Exception\ContainerArchiveInfoNotFoundException * @throws \Docker\API\Exception\ContainerArchiveInfoInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (400 === $status) { - throw new \Docker\API\Exception\ContainerArchiveInfoBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ContainersIdArchiveHeadResponse400', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerArchiveInfoBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerArchiveInfoNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerArchiveInfoNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerArchiveInfoInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerArchiveInfoInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerAttach.php b/src/Endpoint/ContainerAttach.php index 58cee509..a7b40bfb 100644 --- a/src/Endpoint/ContainerAttach.php +++ b/src/Endpoint/ContainerAttach.php @@ -2,116 +2,139 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerAttach extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerAttach extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * Attach to a container to read its output or send it input. You can attach to the same container multiple times and you can reattach to containers that have been detached. - - Either the `stream` or `logs` parameter must be `true` for this endpoint to do anything. - - See [the documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) for more details. - - ### Hijacking - - This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, and `stderr` on the same socket. - - This is the response from the daemon for an attach request: - - ``` - HTTP/1.1 200 OK - Content-Type: application/vnd.docker.raw-stream - - [STREAM] - ``` - - After the headers and two new lines, the TCP connection can now be used for raw, bidirectional communication between the client and server. - - To hint potential proxies about connection hijacking, the Docker client can also optionally send connection upgrade headers. - - For example, the client sends this request to upgrade the connection: - - ``` - POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 - Upgrade: tcp - Connection: Upgrade - ``` - - The Docker daemon will respond with a `101 UPGRADED` response, and will similarly follow with the raw stream: - - ``` - HTTP/1.1 101 UPGRADED - Content-Type: application/vnd.docker.raw-stream - Connection: Upgrade - Upgrade: tcp - - [STREAM] - ``` - - ### Stream format - - When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), the stream over the hijacked connected is multiplexed to separate out `stdout` and `stderr`. The stream consists of a series of frames, each containing a header and a payload. - - The header contains the information which the stream writes (`stdout` or `stderr`). It also contains the size of the associated frame encoded in the last four bytes (`uint32`). - - It is encoded on the first eight bytes like this: - - ```go - header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} - ``` - - `STREAM_TYPE` can be: - - - 0: `stdin` (is written on `stdout`) - - 1: `stdout` - - 2: `stderr` - - `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size encoded as big endian. - - Following the header is the payload, which is the specified number of bytes of `STREAM_TYPE`. - - The simplest way to implement this protocol is the following: - - 1. Read 8 bytes. - 2. Choose `stdout` or `stderr` depending on the first byte. - 3. Extract the frame size from the last four bytes. - 4. Read the extracted size and output it on the correct output. - 5. Goto 1. - - ### Stream format when using a TTY - - When the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate), the stream is not multiplexed. The data exchanged over the hijacked connection is simply the raw data from the process PTY and client's `stdin`. - + * Attach to a container to read its output or send it input. You can attach + * to the same container multiple times and you can reattach to containers + * that have been detached. + * + * Either the `stream` or `logs` parameter must be `true` for this endpoint + * to do anything. + * + * See the [documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) + * for more details. + * + * ### Hijacking + * + * This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, + * and `stderr` on the same socket. + * + * This is the response from the daemon for an attach request: + * + * ``` + * HTTP/1.1 200 OK + * Content-Type: application/vnd.docker.raw-stream + * + * [STREAM] + * ``` + * + * After the headers and two new lines, the TCP connection can now be used + * for raw, bidirectional communication between the client and server. + * + * To hint potential proxies about connection hijacking, the Docker client + * can also optionally send connection upgrade headers. + * + * For example, the client sends this request to upgrade the connection: + * + * ``` + * POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 + * Upgrade: tcp + * Connection: Upgrade + * ``` + * + * The Docker daemon will respond with a `101 UPGRADED` response, and will + * similarly follow with the raw stream: + * + * ``` + * HTTP/1.1 101 UPGRADED + * Content-Type: application/vnd.docker.raw-stream + * Connection: Upgrade + * Upgrade: tcp + * + * [STREAM] + * ``` + * + * ### Stream format + * + * When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), + * the HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream + * and the stream over the hijacked connected is multiplexed to separate out + * `stdout` and `stderr`. The stream consists of a series of frames, each + * containing a header and a payload. + * + * The header contains the information which the stream writes (`stdout` or + * `stderr`). It also contains the size of the associated frame encoded in + * the last four bytes (`uint32`). + * + * It is encoded on the first eight bytes like this: + * + * ```go + * header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + * ``` + * + * `STREAM_TYPE` can be: + * + * - 0: `stdin` (is written on `stdout`) + * - 1: `stdout` + * - 2: `stderr` + * + * `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size + * encoded as big endian. + * + * Following the header is the payload, which is the specified number of + * bytes of `STREAM_TYPE`. + * + * The simplest way to implement this protocol is the following: + * + * 1. Read 8 bytes. + * 2. Choose `stdout` or `stderr` depending on the first byte. + * 3. Extract the frame size from the last four bytes. + * 4. Read the extracted size and output it on the correct output. + * 5. Goto 1. + * + * ### Stream format when using a TTY + * + * When the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate), + * the stream is not multiplexed. The data exchanged over the hijacked + * connection is simply the raw data from the process PTY and client's + * `stdin`. * * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $detachKeys Override the key sequence for detaching a container.Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. - * @var bool $logs replay previous logs from the container - - * @var bool $stream Stream attached streams from the time the request was made onwards - * @var bool $stdin Attach to `stdin` - * @var bool $stdout Attach to `stdout` - * @var bool $stderr Attach to `stderr` - * } + * @var string $detachKeys Override the key sequence for detaching a container.Format is a single + * character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, + * `@`, `^`, `[`, `,` or `_`. + * @var bool $logs Replay previous logs from the container. + * + * This is useful for attaching to a container that has started and you + * want to output everything since the container started. + * + * If `stream` is also enabled, once all the previous output has been + * returned, it will seamlessly transition into streaming current + * output. + * @var bool $stream stream attached streams from the time the request was made onwards + * @var bool $stdin Attach to `stdin` + * @var bool $stdout Attach to `stdout` + * @var bool $stderr Attach to `stderr` + * } + * + * @param array $accept Accept content header application/vnd.docker.raw-stream|application/vnd.docker.multiplexed-stream|application/json */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -122,14 +145,18 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/attach'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/vnd.docker.raw-stream', 'application/vnd.docker.multiplexed-stream', 'application/json']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -138,39 +165,40 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['detachKeys', 'logs', 'stream', 'stdin', 'stdout', 'stderr']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['logs' => false, 'stream' => false, 'stdin' => false, 'stdout' => false, 'stderr' => false]); - $optionsResolver->setAllowedTypes('detachKeys', ['string']); - $optionsResolver->setAllowedTypes('logs', ['bool']); - $optionsResolver->setAllowedTypes('stream', ['bool']); - $optionsResolver->setAllowedTypes('stdin', ['bool']); - $optionsResolver->setAllowedTypes('stdout', ['bool']); - $optionsResolver->setAllowedTypes('stderr', ['bool']); + $optionsResolver->addAllowedTypes('detachKeys', ['string']); + $optionsResolver->addAllowedTypes('logs', ['bool']); + $optionsResolver->addAllowedTypes('stream', ['bool']); + $optionsResolver->addAllowedTypes('stdin', ['bool']); + $optionsResolver->addAllowedTypes('stdout', ['bool']); + $optionsResolver->addAllowedTypes('stderr', ['bool']); return $optionsResolver; } /** - * {@inheritdoc} - * - * @throws \Docker\API\Exception\ContainerAttachBadRequestException * @throws \Docker\API\Exception\ContainerAttachNotFoundException - * @throws \Docker\API\Exception\ContainerAttachInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (101 === $status) { - return null; } if (200 === $status) { - return null; } if (400 === $status) { - throw new \Docker\API\Exception\ContainerAttachBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerAttachNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerAttachNotFoundException($response); } if (500 === $status) { - throw new \Docker\API\Exception\ContainerAttachInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerAttachWebsocket.php b/src/Endpoint/ContainerAttachWebsocket.php index 9c110b74..136bd9d8 100644 --- a/src/Endpoint/ContainerAttachWebsocket.php +++ b/src/Endpoint/ContainerAttachWebsocket.php @@ -2,38 +2,37 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerAttachWebsocket extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerAttachWebsocket extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $detachKeys Override the key sequence for detaching a container.Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,`, or `_`. - * @var bool $logs Return logs - * @var bool $stream Return stream - * @var bool $stdin Attach to `stdin` - * @var bool $stdout Attach to `stdout` - * @var bool $stderr Attach to `stderr` - * } + * @var string $detachKeys Override the key sequence for detaching a container.Format is a single + * character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, + * `@`, `^`, `[`, `,`, or `_`. + * @var bool $logs Return logs + * @var bool $stream Return stream + * @var bool $stdin Attach to `stdin` + * @var bool $stdout Attach to `stdout` + * @var bool $stderr Attach to `stderr` + * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -44,14 +43,18 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/attach/ws'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -60,39 +63,44 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['detachKeys', 'logs', 'stream', 'stdin', 'stdout', 'stderr']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['logs' => false, 'stream' => false, 'stdin' => false, 'stdout' => false, 'stderr' => false]); - $optionsResolver->setAllowedTypes('detachKeys', ['string']); - $optionsResolver->setAllowedTypes('logs', ['bool']); - $optionsResolver->setAllowedTypes('stream', ['bool']); - $optionsResolver->setAllowedTypes('stdin', ['bool']); - $optionsResolver->setAllowedTypes('stdout', ['bool']); - $optionsResolver->setAllowedTypes('stderr', ['bool']); + $optionsResolver->addAllowedTypes('detachKeys', ['string']); + $optionsResolver->addAllowedTypes('logs', ['bool']); + $optionsResolver->addAllowedTypes('stream', ['bool']); + $optionsResolver->addAllowedTypes('stdin', ['bool']); + $optionsResolver->addAllowedTypes('stdout', ['bool']); + $optionsResolver->addAllowedTypes('stderr', ['bool']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerAttachWebsocketBadRequestException * @throws \Docker\API\Exception\ContainerAttachWebsocketNotFoundException * @throws \Docker\API\Exception\ContainerAttachWebsocketInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (101 === $status) { - return null; } if (200 === $status) { - return null; } - if (400 === $status) { - throw new \Docker\API\Exception\ContainerAttachWebsocketBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerAttachWebsocketBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerAttachWebsocketNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerAttachWebsocketNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerAttachWebsocketInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerAttachWebsocketInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerChanges.php b/src/Endpoint/ContainerChanges.php index 482ce93e..6c692ab0 100644 --- a/src/Endpoint/ContainerChanges.php +++ b/src/Endpoint/ContainerChanges.php @@ -2,26 +2,20 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerChanges extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerChanges extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; /** - * Returns which files in a container's filesystem have been added, deleted,. - or modified. The `Kind` of modification can be one of: - - - `0`: Modified - - `1`: Added - - `2`: Deleted - + * Returns which files in a container's filesystem have been added, deleted, + * or modified. The `Kind` of modification can be one of: + * + * - `0`: Modified ("C") + * - `1`: Added ("A") + * - `2`: Deleted ("D") * * @param string $id ID or name of the container */ @@ -30,8 +24,6 @@ public function __construct(string $id) $this->id = $id; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -42,7 +34,7 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/changes'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -53,23 +45,28 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerChangesNotFoundException * @throws \Docker\API\Exception\ContainerChangesInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersIdChangesGetResponse200Item[] + * @return \Docker\API\Model\FilesystemChange[]|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainersIdChangesGetResponse200Item[]', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\FilesystemChange[]', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerChangesNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerChangesNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerChangesInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerChangesInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerCreate.php b/src/Endpoint/ContainerCreate.php index c45860de..151a9803 100644 --- a/src/Endpoint/ContainerCreate.php +++ b/src/Endpoint/ContainerCreate.php @@ -2,31 +2,42 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerCreate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerCreate extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** - * @param \Docker\API\Model\ContainersCreatePostBody $body Container to create - * @param array $queryParameters { + * @param array $queryParameters { + * + * @var string $name Assign the specified name to the container. Must match + * `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`. + * @var string $platform Platform in the format `os[/arch[/variant]]` used for image lookup. + * + * When specified, the daemon checks if the requested image is present + * in the local image cache with the given OS and Architecture, and + * otherwise returns a `404` status. + * + * If the option is not set, the host's native OS and Architecture are + * used to look up the image in the image cache. However, if no platform + * is passed and the given image does exist in the local image cache, + * but its OS or architecture does not match, the container is created + * with the available image, and a warning is added to the `Warnings` + * field in the response, for example; + * + * WARNING: The requested image's platform (linux/arm64/v8) does not + * match the detected host platform (linux/amd64) and no + * specific platform was requested * - * @var string $name Assign the specified name to the container. Must match `/?[a-zA-Z0-9_-]+`. * } */ - public function __construct(\Docker\API\Model\ContainersCreatePostBody $body, array $queryParameters = []) + public function __construct(?\Docker\API\Model\ContainersCreatePostBody $requestBody = null, array $queryParameters = []) { - $this->body = $body; + $this->body = $requestBody; $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -37,9 +48,16 @@ public function getUri(): string return '/containers/create'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\ContainersCreatePostBody) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + if ($this->body instanceof \Docker\API\Model\ContainersCreatePostBody) { + return [['Content-Type' => ['application/octet-stream']], $this->body]; + } + + return [[], null]; } public function getExtraHeaders(): array @@ -50,40 +68,46 @@ public function getExtraHeaders(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['name']); + $optionsResolver->setDefined(['name', 'platform']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('name', ['string']); + $optionsResolver->addAllowedTypes('name', ['string']); + $optionsResolver->addAllowedTypes('platform', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerCreateBadRequestException * @throws \Docker\API\Exception\ContainerCreateNotFoundException * @throws \Docker\API\Exception\ContainerCreateConflictException * @throws \Docker\API\Exception\ContainerCreateInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersCreatePostResponse201 + * @return \Docker\API\Model\ContainerCreateResponse|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (201 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainersCreatePostResponse201', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\ContainerCreateResponse', 'json'); } - if (400 === $status) { - throw new \Docker\API\Exception\ContainerCreateBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerCreateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerCreateNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerCreateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (409 === $status) { - throw new \Docker\API\Exception\ContainerCreateConflictException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (409 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerCreateConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerDelete.php b/src/Endpoint/ContainerDelete.php index efcdb335..280bc5c8 100644 --- a/src/Endpoint/ContainerDelete.php +++ b/src/Endpoint/ContainerDelete.php @@ -2,35 +2,32 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerDelete extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerDelete extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** * @param string $id ID or name of the container * @param array $queryParameters { * - * @var bool $v remove the volumes associated with the container - * @var bool $force if the container is running, kill it before removing it - * @var bool $link Remove the specified link associated with the container. - * } + * @var bool $v remove anonymous volumes associated with the container + * @var bool $force if the container is running, kill it before removing it + * @var bool $link Remove the specified link associated with the container. + * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'DELETE'; @@ -41,14 +38,18 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -57,37 +58,43 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['v', 'force', 'link']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['v' => false, 'force' => false, 'link' => false]); - $optionsResolver->setAllowedTypes('v', ['bool']); - $optionsResolver->setAllowedTypes('force', ['bool']); - $optionsResolver->setAllowedTypes('link', ['bool']); + $optionsResolver->addAllowedTypes('v', ['bool']); + $optionsResolver->addAllowedTypes('force', ['bool']); + $optionsResolver->addAllowedTypes('link', ['bool']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerDeleteBadRequestException * @throws \Docker\API\Exception\ContainerDeleteNotFoundException * @throws \Docker\API\Exception\ContainerDeleteConflictException * @throws \Docker\API\Exception\ContainerDeleteInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (204 === $status) { - return null; } - if (400 === $status) { - throw new \Docker\API\Exception\ContainerDeleteBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerDeleteBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerDeleteNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (409 === $status) { - throw new \Docker\API\Exception\ContainerDeleteConflictException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (409 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerDeleteConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerExec.php b/src/Endpoint/ContainerExec.php index 5be5a86c..563051a3 100644 --- a/src/Endpoint/ContainerExec.php +++ b/src/Endpoint/ContainerExec.php @@ -2,32 +2,24 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerExec extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerExec extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; /** * Run a command inside a running container. * - * @param string $id ID or name of container - * @param \Docker\API\Model\ContainersIdExecPostBody $execConfig Exec configuration + * @param string $id ID or name of container */ - public function __construct(string $id, \Docker\API\Model\ContainersIdExecPostBody $execConfig) + public function __construct(string $id, ?\Docker\API\Model\ContainersIdExecPostBody $requestBody = null) { $this->id = $id; - $this->body = $execConfig; + $this->body = $requestBody; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -38,9 +30,13 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/exec'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\ContainersIdExecPostBody) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + + return [[], null]; } public function getExtraHeaders(): array @@ -49,27 +45,32 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerExecNotFoundException * @throws \Docker\API\Exception\ContainerExecConflictException * @throws \Docker\API\Exception\ContainerExecInternalServerErrorException * - * @return null|\Docker\API\Model\IdResponse + * @return \Docker\API\Model\IdResponse|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (201 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\IdResponse', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\IdResponse', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerExecNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerExecNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (409 === $status) { - throw new \Docker\API\Exception\ContainerExecConflictException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (409 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerExecConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerExecInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerExecInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerExport.php b/src/Endpoint/ContainerExport.php index 991925e4..51e57e0e 100644 --- a/src/Endpoint/ContainerExport.php +++ b/src/Endpoint/ContainerExport.php @@ -2,30 +2,26 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerExport extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerExport extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** * Export the contents of a container as a tarball. * - * @param string $id ID or name of the container + * @param string $id ID or name of the container + * @param array $accept Accept content header application/octet-stream|application/json */ - public function __construct(string $id) + public function __construct(string $id, array $accept = []) { $this->id = $id; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -36,32 +32,40 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/export'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/octet-stream', 'application/json']]; + } + + return $this->accept; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerExportNotFoundException - * @throws \Docker\API\Exception\ContainerExportInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerExportNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerExportNotFoundException($response); } if (500 === $status) { - throw new \Docker\API\Exception\ContainerExportInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerInspect.php b/src/Endpoint/ContainerInspect.php index ce173197..8b191af7 100644 --- a/src/Endpoint/ContainerInspect.php +++ b/src/Endpoint/ContainerInspect.php @@ -2,16 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerInspect extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerInspect extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; /** @@ -20,8 +15,8 @@ class ContainerInspect extends \Jane\OpenApiRuntime\Client\BaseEndpoint implemen * @param string $id ID or name of the container * @param array $queryParameters { * - * @var bool $size Return the size of container as fields `SizeRw` and `SizeRootFs` - * } + * @var bool $size Return the size of container as fields `SizeRw` and `SizeRootFs` + * } */ public function __construct(string $id, array $queryParameters = []) { @@ -29,8 +24,6 @@ public function __construct(string $id, array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -41,7 +34,7 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/json'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -57,29 +50,34 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['size']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['size' => false]); - $optionsResolver->setAllowedTypes('size', ['bool']); + $optionsResolver->addAllowedTypes('size', ['bool']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerInspectNotFoundException * @throws \Docker\API\Exception\ContainerInspectInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersIdJsonGetResponse200 + * @return \Docker\API\Model\ContainersIdJsonGetResponse200|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainersIdJsonGetResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\ContainersIdJsonGetResponse200', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerInspectNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerKill.php b/src/Endpoint/ContainerKill.php index d2f6dd53..bb2077eb 100644 --- a/src/Endpoint/ContainerKill.php +++ b/src/Endpoint/ContainerKill.php @@ -2,35 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerKill extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerKill extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * Send a POSIX signal to a container, defaulting to killing to the container. + * Send a POSIX signal to a container, defaulting to killing to the + * container. * * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`) + * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`). + * * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -41,14 +40,18 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/kill'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -57,27 +60,37 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['signal']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['signal' => 'SIGKILL']); - $optionsResolver->setAllowedTypes('signal', ['string']); + $optionsResolver->addAllowedTypes('signal', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerKillNotFoundException + * @throws \Docker\API\Exception\ContainerKillConflictException * @throws \Docker\API\Exception\ContainerKillInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (204 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerKillNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerKillNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if ((null === $contentType) === false && (409 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerKillConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerKillInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerKillInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerList.php b/src/Endpoint/ContainerList.php index c0ba2029..3a664e99 100644 --- a/src/Endpoint/ContainerList.php +++ b/src/Endpoint/ContainerList.php @@ -2,46 +2,48 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerList extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerList extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - /** - * Returns a list of containers. For details on the format, see [the inspect endpoint](#operation/ContainerInspect). - - Note that it uses a different, smaller representation of a container than inspecting a single container. For example, - the list of linked containers is not propagated . + use \Docker\API\Runtime\Client\EndpointTrait; + /** + * Returns a list of containers. For details on the format, see the + * [inspect endpoint](#operation/ContainerInspect). + * + * Note that it uses a different, smaller representation of a container + * than inspecting a single container. For example, the list of linked + * containers is not propagated . * * @param array $queryParameters { * - * @var bool $all Return all containers. By default, only running containers are shown - * @var int $limit return this number of most recently created containers, including non-running ones - * @var bool $size return the size of container as fields `SizeRw` and `SizeRootFs` - * @var string $filters Filters to process on the container list, encoded as JSON (a `map[string][]string`). For example, `{"status": ["paused"]}` will only return paused containers. Available filters: - - - `ancestor`=(`[:]`, ``, or ``) - - `before`=(`` or ``) - - `expose`=(`[/]`|`/[]`) - - `exited=` containers with exit code of `` - - `health`=(`starting`|`healthy`|`unhealthy`|`none`) - - `id=` a container's ID - - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) - - `is-task=`(`true`|`false`) - - `label=key` or `label="key=value"` of a container label - - `name=` a container's name - - `network`=(`` or ``) - - `publish`=(`[/]`|`/[]`) - - `since`=(`` or ``) - - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) - - `volume`=(`` or ``) - + * @var bool $all Return all containers. By default, only running containers are shown. + * @var int $limit return this number of most recently created containers, including + * non-running ones + * @var bool $size return the size of container as fields `SizeRw` and `SizeRootFs` + * @var string $filters Filters to process on the container list, encoded as JSON (a + * `map[string][]string`). For example, `{"status": ["paused"]}` will + * only return paused containers. + * + * Available filters: + * + * - `ancestor`=(`[:]`, ``, or ``) + * - `before`=(`` or ``) + * - `expose`=(`[/]`|`/[]`) + * - `exited=` containers with exit code of `` + * - `health`=(`starting`|`healthy`|`unhealthy`|`none`) + * - `id=` a container's ID + * - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) + * - `is-task=`(`true`|`false`) + * - `label=key` or `label="key=value"` of a container label + * - `name=` a container's name + * - `network`=(`` or ``) + * - `publish`=(`[/]`|`/[]`) + * - `since`=(`` or ``) + * - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) + * - `volume`=(`` or ``) + * * } */ public function __construct(array $queryParameters = []) @@ -49,8 +51,6 @@ public function __construct(array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -61,7 +61,7 @@ public function getUri(): string return '/containers/json'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -77,32 +77,37 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['all', 'limit', 'size', 'filters']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['all' => false, 'size' => false]); - $optionsResolver->setAllowedTypes('all', ['bool']); - $optionsResolver->setAllowedTypes('limit', ['int']); - $optionsResolver->setAllowedTypes('size', ['bool']); - $optionsResolver->setAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('all', ['bool']); + $optionsResolver->addAllowedTypes('limit', ['int']); + $optionsResolver->addAllowedTypes('size', ['bool']); + $optionsResolver->addAllowedTypes('filters', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerListBadRequestException * @throws \Docker\API\Exception\ContainerListInternalServerErrorException * - * @return null|\Docker\API\Model\ContainerSummaryItem[] + * @return \Docker\API\Model\ContainerSummary[]|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainerSummaryItem[]', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\ContainerSummary[]', 'json'); } - if (400 === $status) { - throw new \Docker\API\Exception\ContainerListBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerListBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerListInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerLogs.php b/src/Endpoint/ContainerLogs.php index 3417eb62..79152dad 100644 --- a/src/Endpoint/ContainerLogs.php +++ b/src/Endpoint/ContainerLogs.php @@ -2,45 +2,43 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerLogs extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerLogs extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** * Get `stdout` and `stderr` logs from a container. - - Note: This endpoint works only for containers with the `json-file` or `journald` logging driver. - + * + * Note: This endpoint works only for containers with the `json-file` or + * `journald` logging driver. * * @param string $id ID or name of the container * @param array $queryParameters { * - * @var bool $follow return the logs as a stream - - * @var bool $stdout Return logs from `stdout` - * @var bool $stderr Return logs from `stderr` - * @var int $since Only return logs since this time, as a UNIX timestamp - * @var int $until Only return logs before this time, as a UNIX timestamp - * @var bool $timestamps Add timestamps to every log line - * @var string $tail Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines. + * @var bool $follow keep connection after returning logs + * @var bool $stdout Return logs from `stdout` + * @var bool $stderr Return logs from `stderr` + * @var int $since Only return logs since this time, as a UNIX timestamp + * @var int $until Only return logs before this time, as a UNIX timestamp + * @var bool $timestamps Add timestamps to every log line + * @var string $tail Only return this number of log lines from the end of the logs. + * Specify as an integer or `all` to output all log lines. + * * } + * + * @param array $accept Accept content header application/vnd.docker.raw-stream|application/vnd.docker.multiplexed-stream|application/json */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -51,14 +49,18 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/logs'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/vnd.docker.raw-stream', 'application/vnd.docker.multiplexed-stream', 'application/json']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -67,36 +69,37 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['follow', 'stdout', 'stderr', 'since', 'until', 'timestamps', 'tail']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['follow' => false, 'stdout' => false, 'stderr' => false, 'since' => 0, 'until' => 0, 'timestamps' => false, 'tail' => 'all']); - $optionsResolver->setAllowedTypes('follow', ['bool']); - $optionsResolver->setAllowedTypes('stdout', ['bool']); - $optionsResolver->setAllowedTypes('stderr', ['bool']); - $optionsResolver->setAllowedTypes('since', ['int']); - $optionsResolver->setAllowedTypes('until', ['int']); - $optionsResolver->setAllowedTypes('timestamps', ['bool']); - $optionsResolver->setAllowedTypes('tail', ['string']); + $optionsResolver->addAllowedTypes('follow', ['bool']); + $optionsResolver->addAllowedTypes('stdout', ['bool']); + $optionsResolver->addAllowedTypes('stderr', ['bool']); + $optionsResolver->addAllowedTypes('since', ['int']); + $optionsResolver->addAllowedTypes('until', ['int']); + $optionsResolver->addAllowedTypes('timestamps', ['bool']); + $optionsResolver->addAllowedTypes('tail', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerLogsNotFoundException - * @throws \Docker\API\Exception\ContainerLogsInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (101 === $status) { - return json_decode($body); - } + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return json_decode($body); } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerLogsNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerLogsNotFoundException($response); } if (500 === $status) { - throw new \Docker\API\Exception\ContainerLogsInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerPause.php b/src/Endpoint/ContainerPause.php index df6d1a96..f7afb3d9 100644 --- a/src/Endpoint/ContainerPause.php +++ b/src/Endpoint/ContainerPause.php @@ -2,33 +2,31 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerPause extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerPause extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * Use the cgroups freezer to suspend all processes in a container. - - Traditionally, when suspending a process the `SIGSTOP` signal is used, which is observable by the process being suspended. With the cgroups freezer the process is unaware, and unable to capture, that it is being suspended, and subsequently resumed. - + * Use the freezer cgroup to suspend all processes in a container. * - * @param string $id ID or name of the container + * Traditionally, when suspending a process the `SIGSTOP` signal is used, + * which is observable by the process being suspended. With the freezer + * cgroup the process is unaware, and unable to capture, that it is being + * suspended, and subsequently resumed. + * + * @param string $id ID or name of the container + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id) + public function __construct(string $id, array $accept = []) { $this->id = $id; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -39,32 +37,42 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/pause'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerPauseNotFoundException * @throws \Docker\API\Exception\ContainerPauseInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (204 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerPauseNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerPauseNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerPauseInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerPauseInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerPrune.php b/src/Endpoint/ContainerPrune.php index 81077452..b2f1851f 100644 --- a/src/Endpoint/ContainerPrune.php +++ b/src/Endpoint/ContainerPrune.php @@ -2,25 +2,21 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerPrune extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerPrune extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** * @param array $queryParameters { * - * @var string $filters filters to process on the prune list, encoded as JSON (a `map[string][]string`) - - Available filters: - - `until=` Prune containers created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. - - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune containers with (or without, in case `label!=...` is used) the specified labels. - + * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + * + * Available filters: + * - `until=` Prune containers created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + * - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune containers with (or without, in case `label!=...` is used) the specified labels. + * * } */ public function __construct(array $queryParameters = []) @@ -28,8 +24,6 @@ public function __construct(array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -40,7 +34,7 @@ public function getUri(): string return '/containers/prune'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -56,25 +50,30 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['filters']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('filters', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerPruneInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersPrunePostResponse200 + * @return \Docker\API\Model\ContainersPrunePostResponse200|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainersPrunePostResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\ContainersPrunePostResponse200', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerPruneInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerPruneInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerRename.php b/src/Endpoint/ContainerRename.php index 35075301..2b41a510 100644 --- a/src/Endpoint/ContainerRename.php +++ b/src/Endpoint/ContainerRename.php @@ -2,33 +2,30 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerRename extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerRename extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $name New name for the container - * } + * @var string $name New name for the container + * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -39,14 +36,18 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/rename'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -55,31 +56,37 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['name']); $optionsResolver->setRequired(['name']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('name', ['string']); + $optionsResolver->addAllowedTypes('name', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerRenameNotFoundException * @throws \Docker\API\Exception\ContainerRenameConflictException * @throws \Docker\API\Exception\ContainerRenameInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (204 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerRenameNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerRenameNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (409 === $status) { - throw new \Docker\API\Exception\ContainerRenameConflictException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (409 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerRenameConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerRenameInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerRenameInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerResize.php b/src/Endpoint/ContainerResize.php index 4d7d09d0..e3c57d20 100644 --- a/src/Endpoint/ContainerResize.php +++ b/src/Endpoint/ContainerResize.php @@ -2,36 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerResize extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerResize extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * Resize the TTY for a container. You must restart the container for the resize to take effect. + * Resize the TTY for a container. * * @param string $id ID or name of the container * @param array $queryParameters { * - * @var int $h Height of the tty session in characters - * @var int $w Width of the tty session in characters - * } + * @var int $h Height of the TTY session in characters + * @var int $w Width of the TTY session in characters + * } + * + * @param array $accept Accept content header text/plain|application/json */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -42,14 +39,18 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/resize'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['text/plain', 'application/json']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -58,28 +59,32 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['h', 'w']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('h', ['int']); - $optionsResolver->setAllowedTypes('w', ['int']); + $optionsResolver->addAllowedTypes('h', ['int']); + $optionsResolver->addAllowedTypes('w', ['int']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerResizeNotFoundException - * @throws \Docker\API\Exception\ContainerResizeInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerResizeNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerResizeNotFoundException($response); } if (500 === $status) { - throw new \Docker\API\Exception\ContainerResizeInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerRestart.php b/src/Endpoint/ContainerRestart.php index dff828c1..2a7abaa6 100644 --- a/src/Endpoint/ContainerRestart.php +++ b/src/Endpoint/ContainerRestart.php @@ -2,33 +2,31 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerRestart extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerRestart extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** * @param string $id ID or name of the container * @param array $queryParameters { * - * @var int $t Number of seconds to wait before killing the container - * } + * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`). + * @var int $t Number of seconds to wait before killing the container + * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -39,43 +37,54 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/restart'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['t']); + $optionsResolver->setDefined(['signal', 't']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('t', ['int']); + $optionsResolver->addAllowedTypes('signal', ['string']); + $optionsResolver->addAllowedTypes('t', ['int']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerRestartNotFoundException * @throws \Docker\API\Exception\ContainerRestartInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (204 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerRestartNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerRestartNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerRestartInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerRestartInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerStart.php b/src/Endpoint/ContainerStart.php index f9e6adcf..fc9a7ce4 100644 --- a/src/Endpoint/ContainerStart.php +++ b/src/Endpoint/ContainerStart.php @@ -2,33 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerStart extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerStart extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $detachKeys Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + * @var string $detachKeys Override the key sequence for detaching a container. Format is a + * single character `[a-Z]` or `ctrl-` where `` is one + * of: `a-z`, `@`, `^`, `[`, `,` or `_`. + * * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -39,14 +39,18 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/start'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -55,32 +59,35 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['detachKeys']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('detachKeys', ['string']); + $optionsResolver->addAllowedTypes('detachKeys', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerStartNotFoundException * @throws \Docker\API\Exception\ContainerStartInternalServerErrorException * - * @return null|\Docker\API\Model\ErrorResponse + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (204 === $status) { - return null; } if (304 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerStartNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerStartNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerStartInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerStartInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerStats.php b/src/Endpoint/ContainerStats.php index dad2dd66..84b631d1 100644 --- a/src/Endpoint/ContainerStats.php +++ b/src/Endpoint/ContainerStats.php @@ -2,35 +2,49 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerStats extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerStats extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; /** - * This endpoint returns a live stream of a container’s resource usage. - statistics. - - The `precpu_stats` is the CPU statistic of last read, which is used - for calculating the CPU usage percentage. It is not the same as the - `cpu_stats` field. - - If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is - nil then for compatibility with older daemons the length of the - corresponding `cpu_usage.percpu_usage` array should be used. - + * This endpoint returns a live stream of a container’s resource usage + * statistics. + * + * The `precpu_stats` is the CPU statistic of the *previous* read, and is + * used to calculate the CPU usage percentage. It is not an exact copy + * of the `cpu_stats` field. + * + * If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is + * nil then for compatibility with older daemons the length of the + * corresponding `cpu_usage.percpu_usage` array should be used. + * + * On a cgroup v2 host, the following fields are not set + * `blkio_stats`: all fields other than `io_service_bytes_recursive` + * `cpu_stats`: `cpu_usage.percpu_usage` + * `memory_stats`: `max_usage` and `failcnt` + * Also, `memory_stats.stats` fields are incompatible with cgroup v1. + * + * To calculate the values shown by the `stats` command of the docker cli tool + * the following formulas can be used: + * used_memory = `memory_stats.usage - memory_stats.stats.cache` + * available_memory = `memory_stats.limit` + * Memory usage % = `(used_memory / available_memory) * 100.0` + * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` + * system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage` + * number_cpus = `lenght(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus` + * CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0` * * @param string $id ID or name of the container * @param array $queryParameters { * - * @var bool $stream Stream the output. If false, the stats will be output once and then it will disconnect. + * @var bool $stream Stream the output. If false, the stats will be output once and then + * it will disconnect. + * @var bool $one-shot Only get a single stat instead of waiting for 2 cycles. Must be used + * with `stream=false`. + * * } */ public function __construct(string $id, array $queryParameters = []) @@ -39,8 +53,6 @@ public function __construct(string $id, array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -51,7 +63,7 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/stats'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -64,30 +76,38 @@ public function getExtraHeaders(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['stream']); + $optionsResolver->setDefined(['stream', 'one-shot']); $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['stream' => true]); - $optionsResolver->setAllowedTypes('stream', ['bool']); + $optionsResolver->setDefaults(['stream' => true, 'one-shot' => false]); + $optionsResolver->addAllowedTypes('stream', ['bool']); + $optionsResolver->addAllowedTypes('one-shot', ['bool']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerStatsNotFoundException * @throws \Docker\API\Exception\ContainerStatsInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return json_decode($body); } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerStatsNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerStatsNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerStatsInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerStatsInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerStop.php b/src/Endpoint/ContainerStop.php index 4e555178..95f14baa 100644 --- a/src/Endpoint/ContainerStop.php +++ b/src/Endpoint/ContainerStop.php @@ -2,33 +2,31 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerStop extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerStop extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** * @param string $id ID or name of the container * @param array $queryParameters { * - * @var int $t Number of seconds to wait before killing the container - * } + * @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`). + * @var int $t Number of seconds to wait before killing the container + * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -39,48 +37,56 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/stop'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['t']); + $optionsResolver->setDefined(['signal', 't']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('t', ['int']); + $optionsResolver->addAllowedTypes('signal', ['string']); + $optionsResolver->addAllowedTypes('t', ['int']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerStopNotFoundException * @throws \Docker\API\Exception\ContainerStopInternalServerErrorException * - * @return null|\Docker\API\Model\ErrorResponse + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (204 === $status) { - return null; } if (304 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerStopNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerStopNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerStopInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerStopInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerTop.php b/src/Endpoint/ContainerTop.php index 8f96821f..51dc05c4 100644 --- a/src/Endpoint/ContainerTop.php +++ b/src/Endpoint/ContainerTop.php @@ -2,35 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerTop extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerTop extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * On Unix systems, this is done by running the `ps` command. This endpoint is not supported on Windows. + * On Unix systems, this is done by running the `ps` command. This endpoint + * is not supported on Windows. * * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $ps_args The arguments to pass to `ps`. For example, `aux` - * } + * @var string $ps_args The arguments to pass to `ps`. For example, `aux` + * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -41,14 +39,18 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/top'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -57,29 +59,34 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['ps_args']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['ps_args' => '-ef']); - $optionsResolver->setAllowedTypes('ps_args', ['string']); + $optionsResolver->addAllowedTypes('ps_args', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerTopNotFoundException * @throws \Docker\API\Exception\ContainerTopInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersIdTopGetResponse200 + * @return \Docker\API\Model\ContainersIdTopGetJsonResponse200|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainersIdTopGetResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\ContainersIdTopGetJsonResponse200', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerTopNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerTopNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerTopInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerTopInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerUnpause.php b/src/Endpoint/ContainerUnpause.php index ea206c97..ce6de1af 100644 --- a/src/Endpoint/ContainerUnpause.php +++ b/src/Endpoint/ContainerUnpause.php @@ -2,30 +2,26 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerUnpause extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerUnpause extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** * Resume a container which has been paused. * - * @param string $id ID or name of the container + * @param string $id ID or name of the container + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id) + public function __construct(string $id, array $accept = []) { $this->id = $id; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -36,32 +32,42 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/unpause'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerUnpauseNotFoundException * @throws \Docker\API\Exception\ContainerUnpauseInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (204 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerUnpauseNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerUnpauseNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerUnpauseInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerUnpauseInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerUpdate.php b/src/Endpoint/ContainerUpdate.php index a0373b83..30b4fb2d 100644 --- a/src/Endpoint/ContainerUpdate.php +++ b/src/Endpoint/ContainerUpdate.php @@ -2,32 +2,25 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerUpdate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerUpdate extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; /** - * Change various configuration options of a container without having to recreate it. + * Change various configuration options of a container without having to + * recreate it. * - * @param string $id ID or name of the container - * @param \Docker\API\Model\ContainersIdUpdatePostBody $update + * @param string $id ID or name of the container */ - public function __construct(string $id, \Docker\API\Model\ContainersIdUpdatePostBody $update) + public function __construct(string $id, ?\Docker\API\Model\ContainersIdUpdatePostBody $requestBody = null) { $this->id = $id; - $this->body = $update; + $this->body = $requestBody; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -38,9 +31,13 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/update'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\ContainersIdUpdatePostBody) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + + return [[], null]; } public function getExtraHeaders(): array @@ -49,23 +46,28 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ContainerUpdateNotFoundException * @throws \Docker\API\Exception\ContainerUpdateInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersIdUpdatePostResponse200 + * @return \Docker\API\Model\ContainersIdUpdatePostResponse200|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainersIdUpdatePostResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\ContainersIdUpdatePostResponse200', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerUpdateNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerUpdateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ContainerWait.php b/src/Endpoint/ContainerWait.php index 29d5f9cc..3bb7c34a 100644 --- a/src/Endpoint/ContainerWait.php +++ b/src/Endpoint/ContainerWait.php @@ -2,16 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ContainerWait extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ContainerWait extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; /** @@ -20,7 +15,10 @@ class ContainerWait extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements * @param string $id ID or name of the container * @param array $queryParameters { * - * @var string $condition Wait until a container state reaches the given condition, either 'not-running' (default), 'next-exit', or 'removed'. + * @var string $condition Wait until a container state reaches the given condition. + * + * Defaults to `not-running` if omitted or empty. + * * } */ public function __construct(string $id, array $queryParameters = []) @@ -29,8 +27,6 @@ public function __construct(string $id, array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -41,7 +37,7 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/wait'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -57,29 +53,38 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['condition']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['condition' => 'not-running']); - $optionsResolver->setAllowedTypes('condition', ['string']); + $optionsResolver->addAllowedTypes('condition', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * + * @throws \Docker\API\Exception\ContainerWaitBadRequestException * @throws \Docker\API\Exception\ContainerWaitNotFoundException * @throws \Docker\API\Exception\ContainerWaitInternalServerErrorException * - * @return null|\Docker\API\Model\ContainersIdWaitPostResponse200 + * @return \Docker\API\Model\ContainerWaitResponse|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainersIdWaitPostResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\ContainerWaitResponse', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\ContainerWaitNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerWaitBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ContainerWaitInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerWaitNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ContainerWaitInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + + public function getAuthenticationScopes(): array + { + return []; } } diff --git a/src/Endpoint/DistributionInspect.php b/src/Endpoint/DistributionInspect.php index 5c0449c0..35954e69 100644 --- a/src/Endpoint/DistributionInspect.php +++ b/src/Endpoint/DistributionInspect.php @@ -2,16 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class DistributionInspect extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class DistributionInspect extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $name; /** @@ -24,8 +19,6 @@ public function __construct(string $name) $this->name = $name; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -36,7 +29,7 @@ public function getUri(): string return str_replace(['{name}'], [$this->name], '/distribution/{name}/json'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -47,23 +40,28 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\DistributionInspectUnauthorizedException * @throws \Docker\API\Exception\DistributionInspectInternalServerErrorException * - * @return null|\Docker\API\Model\DistributionNameJsonGetResponse200 + * @return \Docker\API\Model\DistributionInspect|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\DistributionNameJsonGetResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\DistributionInspect', 'json'); } - if (401 === $status) { - throw new \Docker\API\Exception\DistributionInspectUnauthorizedException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (401 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\DistributionInspectUnauthorizedException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\DistributionInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\DistributionInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ExecInspect.php b/src/Endpoint/ExecInspect.php index ad074fc5..44f95cfb 100644 --- a/src/Endpoint/ExecInspect.php +++ b/src/Endpoint/ExecInspect.php @@ -2,16 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ExecInspect extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ExecInspect extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; /** @@ -24,8 +19,6 @@ public function __construct(string $id) $this->id = $id; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -36,7 +29,7 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/exec/{id}/json'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -47,23 +40,28 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ExecInspectNotFoundException * @throws \Docker\API\Exception\ExecInspectInternalServerErrorException * - * @return null|\Docker\API\Model\ExecIdJsonGetResponse200 + * @return \Docker\API\Model\ExecIdJsonGetResponse200|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ExecIdJsonGetResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\ExecIdJsonGetResponse200', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\ExecInspectNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ExecInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ExecInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ExecInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ExecResize.php b/src/Endpoint/ExecResize.php index 61c1d42d..9eec6788 100644 --- a/src/Endpoint/ExecResize.php +++ b/src/Endpoint/ExecResize.php @@ -2,36 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ExecResize extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ExecResize extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * 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. + * Resize the TTY session used by an exec instance. This endpoint only works + * if `tty` was specified as part of creating and starting the exec instance. * * @param string $id Exec instance ID * @param array $queryParameters { * - * @var int $h Height of the TTY session in characters - * @var int $w Width of the TTY session in characters - * } + * @var int $h Height of the TTY session in characters + * @var int $w Width of the TTY session in characters + * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -42,14 +40,18 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/exec/{id}/resize'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -58,24 +60,38 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['h', 'w']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('h', ['int']); - $optionsResolver->setAllowedTypes('w', ['int']); + $optionsResolver->addAllowedTypes('h', ['int']); + $optionsResolver->addAllowedTypes('w', ['int']); return $optionsResolver; } /** - * {@inheritdoc} - * + * @throws \Docker\API\Exception\ExecResizeBadRequestException * @throws \Docker\API\Exception\ExecResizeNotFoundException + * @throws \Docker\API\Exception\ExecResizeInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (201 === $status) { - return null; + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + } + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ExecResizeBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ExecResizeNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (404 === $status) { - throw new \Docker\API\Exception\ExecResizeNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ExecResizeInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ExecStart.php b/src/Endpoint/ExecStart.php index f3246d8b..d42f2619 100644 --- a/src/Endpoint/ExecStart.php +++ b/src/Endpoint/ExecStart.php @@ -2,32 +2,29 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ExecStart extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ExecStart extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * 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. + * Starts a previously set up exec instance. If detach is true, this endpoint + * returns immediately after starting the command. Otherwise, it sets up an + * interactive session with the command. * - * @param string $id Exec instance ID - * @param \Docker\API\Model\ExecIdStartPostBody $execStartConfig + * @param string $id Exec instance ID + * @param array $accept Accept content header application/vnd.docker.raw-stream|application/vnd.docker.multiplexed-stream */ - public function __construct(string $id, \Docker\API\Model\ExecIdStartPostBody $execStartConfig) + public function __construct(string $id, ?\Docker\API\Model\ExecIdStartPostBody $requestBody = null, array $accept = []) { $this->id = $id; - $this->body = $execStartConfig; + $this->body = $requestBody; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -38,32 +35,41 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/exec/{id}/start'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\ExecIdStartPostBody) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + + return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/vnd.docker.raw-stream', 'application/vnd.docker.multiplexed-stream']]; + } + + return $this->accept; } /** - * {@inheritdoc} - * - * @throws \Docker\API\Exception\ExecStartNotFoundException - * @throws \Docker\API\Exception\ExecStartConflictException + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } if (404 === $status) { - throw new \Docker\API\Exception\ExecStartNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } if (409 === $status) { - throw new \Docker\API\Exception\ExecStartConflictException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/GetPluginPrivileges.php b/src/Endpoint/GetPluginPrivileges.php index e88a1589..95f39e06 100644 --- a/src/Endpoint/GetPluginPrivileges.php +++ b/src/Endpoint/GetPluginPrivileges.php @@ -2,29 +2,29 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class GetPluginPrivileges extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class GetPluginPrivileges extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + protected $accept; + /** * @param array $queryParameters { * - * @var string $remote The name of the plugin. The `:latest` tag is optional, and is the default if omitted. + * @var string $remote The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. + * * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(array $queryParameters = []) + public function __construct(array $queryParameters = [], array $accept = []) { $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -35,14 +35,18 @@ public function getUri(): string return '/plugins/privileges'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -51,25 +55,30 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['remote']); $optionsResolver->setRequired(['remote']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('remote', ['string']); + $optionsResolver->addAllowedTypes('remote', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\GetPluginPrivilegesInternalServerErrorException * - * @return null|\Docker\API\Model\PluginsPrivilegesGetResponse200Item[] + * @return \Docker\API\Model\PluginPrivilege[]|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\PluginsPrivilegesGetResponse200Item[]', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\PluginPrivilege[]', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\GetPluginPrivilegesInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\GetPluginPrivilegesInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ImageBuild.php b/src/Endpoint/ImageBuild.php index c8311bea..fb4dcf42 100644 --- a/src/Endpoint/ImageBuild.php +++ b/src/Endpoint/ImageBuild.php @@ -2,86 +2,93 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ImageBuild extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ImageBuild extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** * Build an image from a tar archive with a `Dockerfile` in it. - - The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/). - - The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. - - The build is canceled if the client drops the connection by quitting or being killed. - * - * @param string|resource|\Psr\Http\Message\StreamInterface $inputStream a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz - * @param array $queryParameters { - * - * @var string $dockerfile Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`. - * @var string $t A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters. - * @var string $extrahosts Extra hosts to add to /etc/hosts - * @var string $remote A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball. - * @var bool $q suppress verbose build output - * @var bool $nocache do not use the cache when building the image - * @var string $cachefrom JSON array of images used for build cache resolution - * @var string $pull attempt to pull the image even if an older image exists locally - * @var bool $rm remove intermediate containers after a successful build - * @var bool $forcerm always remove intermediate containers, even upon failure - * @var int $memory set memory limit for build - * @var int $memswap Total memory (memory + swap). Set as `-1` to disable swap. - * @var int $cpushares CPU shares (relative weight) - * @var string $cpusetcpus CPUs in which to allow execution (e.g., `0-3`, `0,1`). - * @var int $cpuperiod the length of a CPU period in microseconds - * @var int $cpuquota microseconds of CPU time that the container can get in a CPU period - * @var string $buildargs JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values. [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg) - * @var int $shmsize Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB. - * @var bool $squash Squash the resulting images layers into a single layer. *(Experimental release only.)* - * @var string $labels arbitrary key/value labels to set on the image, as a JSON map of string pairs - * @var string $networkmode Sets the networking mode for the run commands during build. Supported standard values are: `bridge`, `host`, `none`, and `container:`. Any other value is taken as a custom network's name to which this container should connect to. - * @var string $platform Platform in the format os[/arch[/variant]] + * The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/). + * + * The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. + * + * The build is canceled if the client drops the connection by quitting or being killed. + * + * @param string|resource|\Psr\Http\Message\StreamInterface|null $requestBody + * @param array $queryParameters { + * + * @var string $dockerfile Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`. + * @var string $t A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters. + * @var string $extrahosts Extra hosts to add to /etc/hosts + * @var string $remote A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball. + * @var bool $q suppress verbose build output + * @var bool $nocache do not use the cache when building the image + * @var string $cachefrom JSON array of images used for build cache resolution + * @var string $pull attempt to pull the image even if an older image exists locally + * @var bool $rm remove intermediate containers after a successful build + * @var bool $forcerm always remove intermediate containers, even upon failure + * @var int $memory set memory limit for build + * @var int $memswap Total memory (memory + swap). Set as `-1` to disable swap. + * @var int $cpushares CPU shares (relative weight) + * @var string $cpusetcpus CPUs in which to allow execution (e.g., `0-3`, `0,1`). + * @var int $cpuperiod the length of a CPU period in microseconds + * @var int $cpuquota microseconds of CPU time that the container can get in a CPU period + * @var string $buildargs JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values. + * + * For example, the build arg `FOO=bar` would become `{"FOO":"bar"}` in JSON. This would result in the query parameter `buildargs={"FOO":"bar"}`. Note that `{"FOO":"bar"}` should be URI component encoded. + * + * [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg) + * @var int $shmsize Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB. + * @var bool $squash Squash the resulting images layers into a single layer. *(Experimental release only.)* + * @var string $labels arbitrary key/value labels to set on the image, as a JSON map of string pairs + * @var string $networkmode Sets the networking mode for the run commands during build. Supported + * standard values are: `bridge`, `host`, `none`, and `container:`. + * Any other value is taken as a custom network's name or ID to which this + * container should connect to. + * @var string $platform Platform in the format os[/arch[/variant]] + * @var string $target Target build stage + * @var string $outputs BuildKit output configuration + * @var string $version Version of the builder backend to use. + * + * - `1` is the first generation classic (deprecated) builder in the Docker daemon (default) + * - `2` is [BuildKit](https://github.com/moby/buildkit) + * * } * * @param array $headerParameters { * - * @var string $Content-type - * @var string $X-Registry-Config This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to - - The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example: - - ``` - { - "docker.example.com": { - "username": "janedoe", - "password": "hunter2" - }, - "https://index.docker.io/v1/": { - "username": "mobydock", - "password": "conta1n3rize14" - } - } - ``` - - Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a `https://` prefix and a `/v1/` suffix even though Docker will prefer to use the v2 registry API. - + * @var string $Content-type + * @var string $X-Registry-Config This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to. + * + * The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example: + * + * ``` + * { + * "docker.example.com": { + * "username": "janedoe", + * "password": "hunter2" + * }, + * "https://index.docker.io/v1/": { + * "username": "mobydock", + * "password": "conta1n3rize14" + * } + * } + * ``` + * + * Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a `https://` prefix and a `/v1/` suffix even though Docker will prefer to use the v2 registry API. + * * } */ - public function __construct($inputStream, array $queryParameters = [], array $headerParameters = []) + public function __construct($requestBody = null, array $queryParameters = [], array $headerParameters = []) { - $this->body = $inputStream; + $this->body = $requestBody; $this->queryParameters = $queryParameters; $this->headerParameters = $headerParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -92,9 +99,13 @@ public function getUri(): string return '/build'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return [[], $this->body]; + if (\is_string($this->body) || \is_resource($this->body) || $this->body instanceof \Psr\Http\Message\StreamInterface) { + return [['Content-Type' => ['application/octet-stream']], $this->body]; + } + + return [[], null]; } public function getExtraHeaders(): array @@ -105,31 +116,34 @@ public function getExtraHeaders(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['dockerfile', 't', 'extrahosts', 'remote', 'q', 'nocache', 'cachefrom', 'pull', 'rm', 'forcerm', 'memory', 'memswap', 'cpushares', 'cpusetcpus', 'cpuperiod', 'cpuquota', 'buildargs', 'shmsize', 'squash', 'labels', 'networkmode', 'platform']); + $optionsResolver->setDefined(['dockerfile', 't', 'extrahosts', 'remote', 'q', 'nocache', 'cachefrom', 'pull', 'rm', 'forcerm', 'memory', 'memswap', 'cpushares', 'cpusetcpus', 'cpuperiod', 'cpuquota', 'buildargs', 'shmsize', 'squash', 'labels', 'networkmode', 'platform', 'target', 'outputs', 'version']); $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['dockerfile' => 'Dockerfile', 'q' => false, 'nocache' => false, 'rm' => true, 'forcerm' => false, 'platform' => '']); - $optionsResolver->setAllowedTypes('dockerfile', ['string']); - $optionsResolver->setAllowedTypes('t', ['string']); - $optionsResolver->setAllowedTypes('extrahosts', ['string']); - $optionsResolver->setAllowedTypes('remote', ['string']); - $optionsResolver->setAllowedTypes('q', ['bool']); - $optionsResolver->setAllowedTypes('nocache', ['bool']); - $optionsResolver->setAllowedTypes('cachefrom', ['string']); - $optionsResolver->setAllowedTypes('pull', ['string']); - $optionsResolver->setAllowedTypes('rm', ['bool']); - $optionsResolver->setAllowedTypes('forcerm', ['bool']); - $optionsResolver->setAllowedTypes('memory', ['int']); - $optionsResolver->setAllowedTypes('memswap', ['int']); - $optionsResolver->setAllowedTypes('cpushares', ['int']); - $optionsResolver->setAllowedTypes('cpusetcpus', ['string']); - $optionsResolver->setAllowedTypes('cpuperiod', ['int']); - $optionsResolver->setAllowedTypes('cpuquota', ['int']); - $optionsResolver->setAllowedTypes('buildargs', ['string']); - $optionsResolver->setAllowedTypes('shmsize', ['int']); - $optionsResolver->setAllowedTypes('squash', ['bool']); - $optionsResolver->setAllowedTypes('labels', ['string']); - $optionsResolver->setAllowedTypes('networkmode', ['string']); - $optionsResolver->setAllowedTypes('platform', ['string']); + $optionsResolver->setDefaults(['dockerfile' => 'Dockerfile', 'q' => false, 'nocache' => false, 'rm' => true, 'forcerm' => false, 'version' => '1']); + $optionsResolver->addAllowedTypes('dockerfile', ['string']); + $optionsResolver->addAllowedTypes('t', ['string']); + $optionsResolver->addAllowedTypes('extrahosts', ['string']); + $optionsResolver->addAllowedTypes('remote', ['string']); + $optionsResolver->addAllowedTypes('q', ['bool']); + $optionsResolver->addAllowedTypes('nocache', ['bool']); + $optionsResolver->addAllowedTypes('cachefrom', ['string']); + $optionsResolver->addAllowedTypes('pull', ['string']); + $optionsResolver->addAllowedTypes('rm', ['bool']); + $optionsResolver->addAllowedTypes('forcerm', ['bool']); + $optionsResolver->addAllowedTypes('memory', ['int']); + $optionsResolver->addAllowedTypes('memswap', ['int']); + $optionsResolver->addAllowedTypes('cpushares', ['int']); + $optionsResolver->addAllowedTypes('cpusetcpus', ['string']); + $optionsResolver->addAllowedTypes('cpuperiod', ['int']); + $optionsResolver->addAllowedTypes('cpuquota', ['int']); + $optionsResolver->addAllowedTypes('buildargs', ['string']); + $optionsResolver->addAllowedTypes('shmsize', ['int']); + $optionsResolver->addAllowedTypes('squash', ['bool']); + $optionsResolver->addAllowedTypes('labels', ['string']); + $optionsResolver->addAllowedTypes('networkmode', ['string']); + $optionsResolver->addAllowedTypes('platform', ['string']); + $optionsResolver->addAllowedTypes('target', ['string']); + $optionsResolver->addAllowedTypes('outputs', ['string']); + $optionsResolver->addAllowedTypes('version', ['string']); return $optionsResolver; } @@ -140,28 +154,34 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv $optionsResolver->setDefined(['Content-type', 'X-Registry-Config']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['Content-type' => 'application/x-tar']); - $optionsResolver->setAllowedTypes('Content-type', ['string']); - $optionsResolver->setAllowedTypes('X-Registry-Config', ['string']); + $optionsResolver->addAllowedTypes('Content-type', ['string']); + $optionsResolver->addAllowedTypes('X-Registry-Config', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ImageBuildBadRequestException * @throws \Docker\API\Exception\ImageBuildInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (400 === $status) { - throw new \Docker\API\Exception\ImageBuildBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageBuildBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ImageBuildInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageBuildInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ImageCommit.php b/src/Endpoint/ImageCommit.php index 87dc1d45..673ebe21 100644 --- a/src/Endpoint/ImageCommit.php +++ b/src/Endpoint/ImageCommit.php @@ -2,37 +2,30 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ImageCommit extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ImageCommit extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** - * @param \Docker\API\Model\ContainerConfig $containerConfig The container configuration - * @param array $queryParameters { + * @param array $queryParameters { * - * @var string $container The ID or name of the container to commit - * @var string $repo Repository name for the created image - * @var string $tag Tag name for the create image - * @var string $comment Commit message - * @var string $author Author of the image (e.g., `John Hannibal Smith `) - * @var bool $pause Whether to pause the container before committing - * @var string $changes `Dockerfile` instructions to apply while committing - * } + * @var string $container The ID or name of the container to commit + * @var string $repo Repository name for the created image + * @var string $tag Tag name for the create image + * @var string $comment Commit message + * @var string $author Author of the image (e.g., `John Hannibal Smith `) + * @var bool $pause Whether to pause the container before committing + * @var string $changes `Dockerfile` instructions to apply while committing + * } */ - public function __construct(\Docker\API\Model\ContainerConfig $containerConfig, array $queryParameters = []) + public function __construct(?\Docker\API\Model\ContainerConfig $requestBody = null, array $queryParameters = []) { - $this->body = $containerConfig; + $this->body = $requestBody; $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -43,9 +36,13 @@ public function getUri(): string return '/commit'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\ContainerConfig) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + + return [[], null]; } public function getExtraHeaders(): array @@ -59,35 +56,40 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['container', 'repo', 'tag', 'comment', 'author', 'pause', 'changes']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['pause' => true]); - $optionsResolver->setAllowedTypes('container', ['string']); - $optionsResolver->setAllowedTypes('repo', ['string']); - $optionsResolver->setAllowedTypes('tag', ['string']); - $optionsResolver->setAllowedTypes('comment', ['string']); - $optionsResolver->setAllowedTypes('author', ['string']); - $optionsResolver->setAllowedTypes('pause', ['bool']); - $optionsResolver->setAllowedTypes('changes', ['string']); + $optionsResolver->addAllowedTypes('container', ['string']); + $optionsResolver->addAllowedTypes('repo', ['string']); + $optionsResolver->addAllowedTypes('tag', ['string']); + $optionsResolver->addAllowedTypes('comment', ['string']); + $optionsResolver->addAllowedTypes('author', ['string']); + $optionsResolver->addAllowedTypes('pause', ['bool']); + $optionsResolver->addAllowedTypes('changes', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ImageCommitNotFoundException * @throws \Docker\API\Exception\ImageCommitInternalServerErrorException * - * @return null|\Docker\API\Model\IdResponse + * @return \Docker\API\Model\IdResponse|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (201 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\IdResponse', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\IdResponse', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\ImageCommitNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageCommitNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ImageCommitInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageCommitInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ImageCreate.php b/src/Endpoint/ImageCreate.php index a221cc50..0328531f 100644 --- a/src/Endpoint/ImageCreate.php +++ b/src/Endpoint/ImageCreate.php @@ -2,43 +2,62 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ImageCreate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ImageCreate extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** - * Create an image by either pulling it from a registry or importing it. + * Pull or import an image. + * + * @param array $queryParameters { + * + * @var string $fromImage Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed. + * @var string $fromSrc Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image. + * @var string $repo Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image. + * @var string $tag Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled. + * @var string $message set commit message for imported image + * @var array $changes Apply `Dockerfile` instructions to the image that is created, + * for example: `changes=ENV DEBUG=true`. + * Note that `ENV DEBUG=true` should be URI component encoded. + * + * Supported `Dockerfile` instructions: + * `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` + * @var string $platform Platform in the format os[/arch[/variant]]. * - * @param string $inputImage Image content if the value `-` has been specified in fromSrc query parameter - * @param array $queryParameters { + * When used in combination with the `fromImage` option, the daemon checks + * if the given image is present in the local image cache with the given + * OS and Architecture, and otherwise attempts to pull the image. If the + * option is not set, the host's native OS and Architecture are used. + * If the given image does not exist in the local image cache, the daemon + * attempts to pull the image with the host's native OS and Architecture. + * If the given image does exists in the local image cache, but its OS or + * architecture does not match, a warning is produced. + * + * When used with the `fromSrc` option to import an image from an archive, + * this option sets the platform information for the imported image. If + * the option is not set, the host's native OS and Architecture are used + * for the imported image. * - * @var string $fromImage Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed. - * @var string $fromSrc Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image. - * @var string $repo Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image. - * @var string $tag Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled. - * @var string $platform Platform in the format os[/arch[/variant]] * } * * @param array $headerParameters { * - * @var string $X-Registry-Auth A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication) + * @var string $X-Registry-Auth A base64url-encoded auth configuration. + * + * Refer to the [authentication section](#section/Authentication) for + * details. + * * } */ - public function __construct(string $inputImage, array $queryParameters = [], array $headerParameters = []) + public function __construct(?string $requestBody = null, array $queryParameters = [], array $headerParameters = []) { - $this->body = $inputImage; + $this->body = $requestBody; $this->queryParameters = $queryParameters; $this->headerParameters = $headerParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -49,9 +68,16 @@ public function getUri(): string return '/images/create'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return [[], $this->body]; + if (\is_string($this->body)) { + return [['Content-Type' => ['text/plain']], $this->body]; + } + if (\is_string($this->body)) { + return [['Content-Type' => ['application/octet-stream']], $this->body]; + } + + return [[], null]; } public function getExtraHeaders(): array @@ -62,14 +88,16 @@ public function getExtraHeaders(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['fromImage', 'fromSrc', 'repo', 'tag', 'platform']); + $optionsResolver->setDefined(['fromImage', 'fromSrc', 'repo', 'tag', 'message', 'changes', 'platform']); $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['platform' => '']); - $optionsResolver->setAllowedTypes('fromImage', ['string']); - $optionsResolver->setAllowedTypes('fromSrc', ['string']); - $optionsResolver->setAllowedTypes('repo', ['string']); - $optionsResolver->setAllowedTypes('tag', ['string']); - $optionsResolver->setAllowedTypes('platform', ['string']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('fromImage', ['string']); + $optionsResolver->addAllowedTypes('fromSrc', ['string']); + $optionsResolver->addAllowedTypes('repo', ['string']); + $optionsResolver->addAllowedTypes('tag', ['string']); + $optionsResolver->addAllowedTypes('message', ['string']); + $optionsResolver->addAllowedTypes('changes', ['array']); + $optionsResolver->addAllowedTypes('platform', ['string']); return $optionsResolver; } @@ -80,27 +108,33 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv $optionsResolver->setDefined(['X-Registry-Auth']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('X-Registry-Auth', ['string']); + $optionsResolver->addAllowedTypes('X-Registry-Auth', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ImageCreateNotFoundException * @throws \Docker\API\Exception\ImageCreateInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\ImageCreateNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageCreateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ImageCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ImageDelete.php b/src/Endpoint/ImageDelete.php index 71aeee21..b1e4a5fb 100644 --- a/src/Endpoint/ImageDelete.php +++ b/src/Endpoint/ImageDelete.php @@ -2,32 +2,26 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ImageDelete extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ImageDelete extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $name; /** - * Remove an image, along with any untagged parent images that were. - referenced by that image. - - Images can't be removed if they have descendant images, are being - used by a running container or are being used by a build. - + * Remove an image, along with any untagged parent images that were + * referenced by that image. + * + * Images can't be removed if they have descendant images, are being + * used by a running container or are being used by a build. * * @param string $name Image name or ID * @param array $queryParameters { * - * @var bool $force Remove the image even if it is being used by stopped containers or has other tags - * @var bool $noprune Do not delete untagged parent images - * } + * @var bool $force Remove the image even if it is being used by stopped containers or has other tags + * @var bool $noprune Do not delete untagged parent images + * } */ public function __construct(string $name, array $queryParameters = []) { @@ -35,8 +29,6 @@ public function __construct(string $name, array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'DELETE'; @@ -47,7 +39,7 @@ public function getUri(): string return str_replace(['{name}'], [$this->name], '/images/{name}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -63,34 +55,39 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['force', 'noprune']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['force' => false, 'noprune' => false]); - $optionsResolver->setAllowedTypes('force', ['bool']); - $optionsResolver->setAllowedTypes('noprune', ['bool']); + $optionsResolver->addAllowedTypes('force', ['bool']); + $optionsResolver->addAllowedTypes('noprune', ['bool']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ImageDeleteNotFoundException * @throws \Docker\API\Exception\ImageDeleteConflictException * @throws \Docker\API\Exception\ImageDeleteInternalServerErrorException * - * @return null|\Docker\API\Model\ImageDeleteResponseItem[] + * @return \Docker\API\Model\ImageDeleteResponseItem[]|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ImageDeleteResponseItem[]', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\ImageDeleteResponseItem[]', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\ImageDeleteNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (409 === $status) { - throw new \Docker\API\Exception\ImageDeleteConflictException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (409 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageDeleteConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ImageDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ImageGet.php b/src/Endpoint/ImageGet.php index 2ce7c245..b6adfd64 100644 --- a/src/Endpoint/ImageGet.php +++ b/src/Endpoint/ImageGet.php @@ -2,43 +2,37 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ImageGet extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ImageGet extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $name; /** * Get a tarball containing all images and metadata for a repository. - - If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced. - - ### Image tarball format - - An image tarball contains one directory per image layer (named using its long ID), each containing these files: - - - `VERSION`: currently `1.0` - the file format version - - `json`: detailed layer information, similar to `docker inspect layer_id` - - `layer.tar`: A tarfile containing the filesystem changes in this layer - - The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions. - - If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs. - - ```json - { - "hello-world": { - "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" - } - } - ``` - + * + * If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced. + * + * ### Image tarball format + * + * An image tarball contains one directory per image layer (named using its long ID), each containing these files: + * + * - `VERSION`: currently `1.0` - the file format version + * - `json`: detailed layer information, similar to `docker inspect layer_id` + * - `layer.tar`: A tarfile containing the filesystem changes in this layer + * + * The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions. + * + * If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs. + * + * ```json + * { + * "hello-world": { + * "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" + * } + * } + * ``` * * @param string $name Image name or ID */ @@ -47,8 +41,6 @@ public function __construct(string $name) $this->name = $name; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -59,28 +51,31 @@ public function getUri(): string return str_replace(['{name}'], [$this->name], '/images/{name}/get'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + return ['Accept' => ['application/x-tar']]; } /** - * {@inheritdoc} - * - * @throws \Docker\API\Exception\ImageGetInternalServerErrorException + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return json_decode($body); } if (500 === $status) { - throw new \Docker\API\Exception\ImageGetInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ImageGetAll.php b/src/Endpoint/ImageGetAll.php index 5912131e..51bbd600 100644 --- a/src/Endpoint/ImageGetAll.php +++ b/src/Endpoint/ImageGetAll.php @@ -2,36 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ImageGetAll extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ImageGetAll extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - /** - * Get a tarball containing all images and metadata for several image repositories. - - For each value of the `names` parameter: if it is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned; if it is an image ID, similarly only that image (and its parents) are returned and there would be no names referenced in the 'repositories' file for this image ID. - - For details on the format, see [the export image endpoint](#operation/ImageGet). + use \Docker\API\Runtime\Client\EndpointTrait; + /** + * Get a tarball containing all images and metadata for several image + * repositories. + * + * For each value of the `names` parameter: if it is a specific name and + * tag (e.g. `ubuntu:latest`), then only that image (and its parents) are + * returned; if it is an image ID, similarly only that image (and its parents) + * are returned and there would be no names referenced in the 'repositories' + * file for this image ID. + * + * For details on the format, see the [export image endpoint](#operation/ImageGet). * * @param array $queryParameters { * - * @var array $names Image names to filter by - * } + * @var array $names Image names to filter by + * } */ public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -42,14 +40,14 @@ public function getUri(): string return '/images/get'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + return ['Accept' => ['application/x-tar']]; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -58,23 +56,26 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['names']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('names', ['array']); + $optionsResolver->addAllowedTypes('names', ['array']); return $optionsResolver; } /** - * {@inheritdoc} - * - * @throws \Docker\API\Exception\ImageGetAllInternalServerErrorException + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return json_decode($body); } if (500 === $status) { - throw new \Docker\API\Exception\ImageGetAllInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ImageHistory.php b/src/Endpoint/ImageHistory.php index c55e9050..7b79220a 100644 --- a/src/Endpoint/ImageHistory.php +++ b/src/Endpoint/ImageHistory.php @@ -2,16 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ImageHistory extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ImageHistory extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $name; /** @@ -24,8 +19,6 @@ public function __construct(string $name) $this->name = $name; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -36,7 +29,7 @@ public function getUri(): string return str_replace(['{name}'], [$this->name], '/images/{name}/history'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -47,23 +40,28 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ImageHistoryNotFoundException * @throws \Docker\API\Exception\ImageHistoryInternalServerErrorException * - * @return null|\Docker\API\Model\ImagesNameHistoryGetResponse200Item[] + * @return \Docker\API\Model\ImagesNameHistoryGetResponse200Item[]|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ImagesNameHistoryGetResponse200Item[]', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\ImagesNameHistoryGetResponse200Item[]', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\ImageHistoryNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageHistoryNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ImageHistoryInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageHistoryInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ImageInspect.php b/src/Endpoint/ImageInspect.php index a77652d8..39d4b291 100644 --- a/src/Endpoint/ImageInspect.php +++ b/src/Endpoint/ImageInspect.php @@ -2,16 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ImageInspect extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ImageInspect extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $name; /** @@ -24,8 +19,6 @@ public function __construct(string $name) $this->name = $name; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -36,7 +29,7 @@ public function getUri(): string return str_replace(['{name}'], [$this->name], '/images/{name}/json'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -47,23 +40,28 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ImageInspectNotFoundException * @throws \Docker\API\Exception\ImageInspectInternalServerErrorException * - * @return null|\Docker\API\Model\Image + * @return \Docker\API\Model\ImageInspect|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Image', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\ImageInspect', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\ImageInspectNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ImageInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ImageList.php b/src/Endpoint/ImageList.php index 88711b39..30dbe12f 100644 --- a/src/Endpoint/ImageList.php +++ b/src/Endpoint/ImageList.php @@ -2,34 +2,38 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ImageList extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ImageList extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** * Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image. * * @param array $queryParameters { * - * @var bool $all Show all images. Only images from a final layer (no children) are shown by default. - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: - - * @var bool $digests Show digest information as a `RepoDigests` field on each image. - * } + * @var bool $all Show all images. Only images from a final layer (no children) are shown by default. + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + * process on the images list. + * + * Available filters: + * + * - `before`=(`[:]`, `` or ``) + * - `dangling=true` + * - `label=key` or `label="key=value"` of an image label + * - `reference`=(`[:]`) + * - `since`=(`[:]`, `` or ``) + * - `until=` + * @var bool $shared-size Compute and show shared size as a `SharedSize` field on each image + * @var bool $digests Show digest information as a `RepoDigests` field on each image. + * } */ public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -40,7 +44,7 @@ public function getUri(): string return '/images/json'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -53,30 +57,36 @@ public function getExtraHeaders(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['all', 'filters', 'digests']); + $optionsResolver->setDefined(['all', 'filters', 'shared-size', 'digests']); $optionsResolver->setRequired([]); - $optionsResolver->setDefaults(['all' => false, 'digests' => false]); - $optionsResolver->setAllowedTypes('all', ['bool']); - $optionsResolver->setAllowedTypes('filters', ['string']); - $optionsResolver->setAllowedTypes('digests', ['bool']); + $optionsResolver->setDefaults(['all' => false, 'shared-size' => false, 'digests' => false]); + $optionsResolver->addAllowedTypes('all', ['bool']); + $optionsResolver->addAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('shared-size', ['bool']); + $optionsResolver->addAllowedTypes('digests', ['bool']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ImageListInternalServerErrorException * - * @return null|\Docker\API\Model\ImageSummary[] + * @return \Docker\API\Model\ImageSummary[]|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ImageSummary[]', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\ImageSummary[]', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\ImageListInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ImageLoad.php b/src/Endpoint/ImageLoad.php index 39ceed44..6c67c6a4 100644 --- a/src/Endpoint/ImageLoad.php +++ b/src/Endpoint/ImageLoad.php @@ -2,36 +2,29 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ImageLoad extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ImageLoad extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** * Load a set of images and tags into a repository. - - For details on the format, see [the export image endpoint](#operation/ImageGet). - * - * @param string|resource|\Psr\Http\Message\StreamInterface $imagesTarball Tar archive containing images - * @param array $queryParameters { + * For details on the format, see the [export image endpoint](#operation/ImageGet). * - * @var bool $quiet Suppress progress details during load. - * } + * @param string|resource|\Psr\Http\Message\StreamInterface|null $requestBody + * @param array $queryParameters { + * + * @var bool $quiet Suppress progress details during load. + * } */ - public function __construct($imagesTarball, array $queryParameters = []) + public function __construct($requestBody = null, array $queryParameters = []) { - $this->body = $imagesTarball; + $this->body = $requestBody; $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -42,9 +35,13 @@ public function getUri(): string return '/images/load'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return [[], $this->body]; + if (\is_string($this->body) || \is_resource($this->body) || $this->body instanceof \Psr\Http\Message\StreamInterface) { + return [['Content-Type' => ['application/x-tar']], $this->body]; + } + + return [[], null]; } public function getExtraHeaders(): array @@ -58,23 +55,29 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['quiet']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['quiet' => false]); - $optionsResolver->setAllowedTypes('quiet', ['bool']); + $optionsResolver->addAllowedTypes('quiet', ['bool']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ImageLoadInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (500 === $status) { - throw new \Docker\API\Exception\ImageLoadInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageLoadInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ImagePrune.php b/src/Endpoint/ImagePrune.php index 46826a1c..0332a23b 100644 --- a/src/Endpoint/ImagePrune.php +++ b/src/Endpoint/ImagePrune.php @@ -2,27 +2,23 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ImagePrune extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ImagePrune extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** * @param array $queryParameters { * - * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: - - - `dangling=` When set to `true` (or `1`), prune only - unused *and* untagged images. When set to `false` - (or `0`), all unused images are pruned. - - `until=` Prune images created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. - - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune images with (or without, in case `label!=...` is used) the specified labels. - + * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: + * + * - `dangling=` When set to `true` (or `1`), prune only + * unused *and* untagged images. When set to `false` + * (or `0`), all unused images are pruned. + * - `until=` Prune images created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + * - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune images with (or without, in case `label!=...` is used) the specified labels. + * * } */ public function __construct(array $queryParameters = []) @@ -30,8 +26,6 @@ public function __construct(array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -42,7 +36,7 @@ public function getUri(): string return '/images/prune'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -58,25 +52,30 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['filters']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('filters', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ImagePruneInternalServerErrorException * - * @return null|\Docker\API\Model\ImagesPrunePostResponse200 + * @return \Docker\API\Model\ImagesPrunePostResponse200|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ImagesPrunePostResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\ImagesPrunePostResponse200', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\ImagePruneInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImagePruneInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ImagePush.php b/src/Endpoint/ImagePush.php index 0dac31bc..de7f7b3c 100644 --- a/src/Endpoint/ImagePush.php +++ b/src/Endpoint/ImagePush.php @@ -2,46 +2,48 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ImagePush extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ImagePush extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $name; + protected $accept; /** * Push an image to a registry. - - If you wish to push an image on to a private registry, that image must already have a tag which references the registry. For example, `registry.example.com/myimage:latest`. - - The push is cancelled if the HTTP connection is closed. - + * + * If you wish to push an image on to a private registry, that image must + * already have a tag which references the registry. For example, + * `registry.example.com/myimage:latest`. + * + * The push is cancelled if the HTTP connection is closed. * * @param string $name image name or ID * @param array $queryParameters { * - * @var string $tag The tag to associate with the image on the registry. - * } + * @var string $tag The tag to associate with the image on the registry. + * } * * @param array $headerParameters { * - * @var string $X-Registry-Auth A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication) + * @var string $X-Registry-Auth A base64url-encoded auth configuration. + * + * Refer to the [authentication section](#section/Authentication) for + * details. + * * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $name, array $queryParameters = [], array $headerParameters = []) + public function __construct(string $name, array $queryParameters = [], array $headerParameters = [], array $accept = []) { $this->name = $name; $this->queryParameters = $queryParameters; $this->headerParameters = $headerParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -52,14 +54,18 @@ public function getUri(): string return str_replace(['{name}'], [$this->name], '/images/{name}/push'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -68,7 +74,7 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['tag']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('tag', ['string']); + $optionsResolver->addAllowedTypes('tag', ['string']); return $optionsResolver; } @@ -79,27 +85,33 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv $optionsResolver->setDefined(['X-Registry-Auth']); $optionsResolver->setRequired(['X-Registry-Auth']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('X-Registry-Auth', ['string']); + $optionsResolver->addAllowedTypes('X-Registry-Auth', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ImagePushNotFoundException * @throws \Docker\API\Exception\ImagePushInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\ImagePushNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImagePushNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ImagePushInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImagePushInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ImageSearch.php b/src/Endpoint/ImageSearch.php index 0144491e..fcc4cb36 100644 --- a/src/Endpoint/ImageSearch.php +++ b/src/Endpoint/ImageSearch.php @@ -2,29 +2,24 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ImageSearch extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ImageSearch extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** * Search for an image on Docker Hub. * * @param array $queryParameters { * - * @var string $term Term to search - * @var int $limit Maximum number of results to return - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: - - - `is-automated=(true|false)` - - `is-official=(true|false)` - - `stars=` Matches images that has at least 'number' stars. - + * @var string $term Term to search + * @var int $limit Maximum number of results to return + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: + * + * - `is-official=(true|false)` + * - `stars=` Matches images that has at least 'number' stars. + * * } */ public function __construct(array $queryParameters = []) @@ -32,8 +27,6 @@ public function __construct(array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -44,7 +37,7 @@ public function getUri(): string return '/images/search'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -60,27 +53,32 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['term', 'limit', 'filters']); $optionsResolver->setRequired(['term']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('term', ['string']); - $optionsResolver->setAllowedTypes('limit', ['int']); - $optionsResolver->setAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('term', ['string']); + $optionsResolver->addAllowedTypes('limit', ['int']); + $optionsResolver->addAllowedTypes('filters', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ImageSearchInternalServerErrorException * - * @return null|\Docker\API\Model\ImagesSearchGetResponse200Item[] + * @return \Docker\API\Model\ImagesSearchGetResponse200Item[]|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ImagesSearchGetResponse200Item[]', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\ImagesSearchGetResponse200Item[]', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\ImageSearchInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageSearchInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ImageTag.php b/src/Endpoint/ImageTag.php index a5ca0e42..b896956b 100644 --- a/src/Endpoint/ImageTag.php +++ b/src/Endpoint/ImageTag.php @@ -2,17 +2,13 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ImageTag extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ImageTag extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $name; + protected $accept; /** * Tag an image so that it becomes part of a repository. @@ -20,18 +16,19 @@ class ImageTag extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane * @param string $name image name or ID to tag * @param array $queryParameters { * - * @var string $repo The repository to tag in. For example, `someuser/someimage`. - * @var string $tag The name of the new tag. - * } + * @var string $repo The repository to tag in. For example, `someuser/someimage`. + * @var string $tag The name of the new tag. + * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $name, array $queryParameters = []) + public function __construct(string $name, array $queryParameters = [], array $accept = []) { $this->name = $name; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -42,14 +39,18 @@ public function getUri(): string return str_replace(['{name}'], [$this->name], '/images/{name}/tag'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -58,36 +59,42 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['repo', 'tag']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('repo', ['string']); - $optionsResolver->setAllowedTypes('tag', ['string']); + $optionsResolver->addAllowedTypes('repo', ['string']); + $optionsResolver->addAllowedTypes('tag', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ImageTagBadRequestException * @throws \Docker\API\Exception\ImageTagNotFoundException * @throws \Docker\API\Exception\ImageTagConflictException * @throws \Docker\API\Exception\ImageTagInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (201 === $status) { - return null; } - if (400 === $status) { - throw new \Docker\API\Exception\ImageTagBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageTagBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (404 === $status) { - throw new \Docker\API\Exception\ImageTagNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageTagNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (409 === $status) { - throw new \Docker\API\Exception\ImageTagConflictException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (409 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageTagConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ImageTagInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ImageTagInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/NetworkConnect.php b/src/Endpoint/NetworkConnect.php index 6b458851..5add6451 100644 --- a/src/Endpoint/NetworkConnect.php +++ b/src/Endpoint/NetworkConnect.php @@ -2,30 +2,27 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class NetworkConnect extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class NetworkConnect extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * @param string $id Network ID or name - * @param \Docker\API\Model\NetworksIdConnectPostBody $container + * The network must be either a local-scoped network or a swarm-scoped network with the `attachable` option set. A network cannot be re-attached to a running container. + * + * @param string $id Network ID or name + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, \Docker\API\Model\NetworksIdConnectPostBody $container) + public function __construct(string $id, ?\Docker\API\Model\NetworksIdConnectPostBody $requestBody = null, array $accept = []) { $this->id = $id; - $this->body = $container; + $this->body = $requestBody; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -36,36 +33,54 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/networks/{id}/connect'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\NetworksIdConnectPostBody) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + + return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } /** - * {@inheritdoc} - * + * @throws \Docker\API\Exception\NetworkConnectBadRequestException * @throws \Docker\API\Exception\NetworkConnectForbiddenException * @throws \Docker\API\Exception\NetworkConnectNotFoundException * @throws \Docker\API\Exception\NetworkConnectInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (403 === $status) { - throw new \Docker\API\Exception\NetworkConnectForbiddenException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkConnectBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if ((null === $contentType) === false && (403 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkConnectForbiddenException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (404 === $status) { - throw new \Docker\API\Exception\NetworkConnectNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkConnectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\NetworkConnectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkConnectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/NetworkCreate.php b/src/Endpoint/NetworkCreate.php index 0159216d..c674fda5 100644 --- a/src/Endpoint/NetworkCreate.php +++ b/src/Endpoint/NetworkCreate.php @@ -2,26 +2,17 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class NetworkCreate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class NetworkCreate extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - /** - * @param \Docker\API\Model\NetworksCreatePostBody $networkConfig Network configuration - */ - public function __construct(\Docker\API\Model\NetworksCreatePostBody $networkConfig) + use \Docker\API\Runtime\Client\EndpointTrait; + + public function __construct(?\Docker\API\Model\NetworksCreatePostBody $requestBody = null) { - $this->body = $networkConfig; + $this->body = $requestBody; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -32,9 +23,13 @@ public function getUri(): string return '/networks/create'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\NetworksCreatePostBody) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + + return [[], null]; } public function getExtraHeaders(): array @@ -43,27 +38,36 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * + * @throws \Docker\API\Exception\NetworkCreateBadRequestException * @throws \Docker\API\Exception\NetworkCreateForbiddenException * @throws \Docker\API\Exception\NetworkCreateNotFoundException * @throws \Docker\API\Exception\NetworkCreateInternalServerErrorException * - * @return null|\Docker\API\Model\NetworksCreatePostResponse201 + * @return \Docker\API\Model\NetworksCreatePostResponse201|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (201 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\NetworksCreatePostResponse201', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\NetworksCreatePostResponse201', 'json'); + } + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkCreateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (403 === $status) { - throw new \Docker\API\Exception\NetworkCreateForbiddenException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (403 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkCreateForbiddenException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (404 === $status) { - throw new \Docker\API\Exception\NetworkCreateNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkCreateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\NetworkCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/NetworkDelete.php b/src/Endpoint/NetworkDelete.php index 2be6b005..50a8cad4 100644 --- a/src/Endpoint/NetworkDelete.php +++ b/src/Endpoint/NetworkDelete.php @@ -2,28 +2,24 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class NetworkDelete extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class NetworkDelete extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * @param string $id Network ID or name + * @param string $id Network ID or name + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id) + public function __construct(string $id, array $accept = []) { $this->id = $id; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'DELETE'; @@ -34,36 +30,46 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/networks/{id}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\NetworkDeleteForbiddenException * @throws \Docker\API\Exception\NetworkDeleteNotFoundException * @throws \Docker\API\Exception\NetworkDeleteInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (204 === $status) { - return null; } - if (403 === $status) { - throw new \Docker\API\Exception\NetworkDeleteForbiddenException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (403 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkDeleteForbiddenException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (404 === $status) { - throw new \Docker\API\Exception\NetworkDeleteNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\NetworkDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/NetworkDisconnect.php b/src/Endpoint/NetworkDisconnect.php index 7edfaedf..87e4cb71 100644 --- a/src/Endpoint/NetworkDisconnect.php +++ b/src/Endpoint/NetworkDisconnect.php @@ -2,30 +2,25 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class NetworkDisconnect extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class NetworkDisconnect extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * @param string $id Network ID or name - * @param \Docker\API\Model\NetworksIdDisconnectPostBody $container + * @param string $id Network ID or name + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, \Docker\API\Model\NetworksIdDisconnectPostBody $container) + public function __construct(string $id, ?\Docker\API\Model\NetworksIdDisconnectPostBody $requestBody = null, array $accept = []) { $this->id = $id; - $this->body = $container; + $this->body = $requestBody; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -36,36 +31,50 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/networks/{id}/disconnect'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\NetworksIdDisconnectPostBody) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + + return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\NetworkDisconnectForbiddenException * @throws \Docker\API\Exception\NetworkDisconnectNotFoundException * @throws \Docker\API\Exception\NetworkDisconnectInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (403 === $status) { - throw new \Docker\API\Exception\NetworkDisconnectForbiddenException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (403 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkDisconnectForbiddenException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (404 === $status) { - throw new \Docker\API\Exception\NetworkDisconnectNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkDisconnectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\NetworkDisconnectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkDisconnectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/NetworkInspect.php b/src/Endpoint/NetworkInspect.php index c7341688..21054251 100644 --- a/src/Endpoint/NetworkInspect.php +++ b/src/Endpoint/NetworkInspect.php @@ -2,25 +2,20 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class NetworkInspect extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class NetworkInspect extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; /** * @param string $id Network ID or name * @param array $queryParameters { * - * @var bool $verbose Detailed inspect output for troubleshooting - * @var string $scope Filter the network by scope (swarm, global, or local) - * } + * @var bool $verbose Detailed inspect output for troubleshooting + * @var string $scope Filter the network by scope (swarm, global, or local) + * } */ public function __construct(string $id, array $queryParameters = []) { @@ -28,8 +23,6 @@ public function __construct(string $id, array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -40,7 +33,7 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/networks/{id}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -56,30 +49,35 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['verbose', 'scope']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['verbose' => false]); - $optionsResolver->setAllowedTypes('verbose', ['bool']); - $optionsResolver->setAllowedTypes('scope', ['string']); + $optionsResolver->addAllowedTypes('verbose', ['bool']); + $optionsResolver->addAllowedTypes('scope', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\NetworkInspectNotFoundException * @throws \Docker\API\Exception\NetworkInspectInternalServerErrorException * - * @return null|\Docker\API\Model\Network + * @return \Docker\API\Model\Network|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Network', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Network', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\NetworkInspectNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\NetworkInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/NetworkList.php b/src/Endpoint/NetworkList.php index bf5062b9..a008a6d3 100644 --- a/src/Endpoint/NetworkList.php +++ b/src/Endpoint/NetworkList.php @@ -2,34 +2,38 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class NetworkList extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class NetworkList extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - /** - * Returns a list of networks. For details on the format, see [the network inspect endpoint](#operation/NetworkInspect). - - Note that it uses a different, smaller representation of a network than inspecting a single network. For example, - the list of containers attached to the network is not propagated in API versions 1.28 and up. + use \Docker\API\Runtime\Client\EndpointTrait; + /** + * Returns a list of networks. For details on the format, see the + * [network inspect endpoint](#operation/NetworkInspect). + * + * Note that it uses a different, smaller representation of a network than + * inspecting a single network. For example, the list of containers attached + * to the network is not propagated in API versions 1.28 and up. * * @param array $queryParameters { * - * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to process on the networks list. Available filters: - - - `driver=` Matches a network's driver. - - `id=` Matches all or part of a network ID. - - `label=` or `label==` of a network label. - - `name=` Matches all or part of a network name. - - `scope=["swarm"|"global"|"local"]` Filters networks by scope (`swarm`, `global`, or `local`). - - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. - + * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to process + * on the networks list. + * + * Available filters: + * + * - `dangling=` When set to `true` (or `1`), returns all + * networks that are not in use by a container. When set to `false` + * (or `0`), only networks that are in use by one or more + * containers are returned. + * - `driver=` Matches a network's driver. + * - `id=` Matches all or part of a network ID. + * - `label=` or `label==` of a network label. + * - `name=` Matches all or part of a network name. + * - `scope=["swarm"|"global"|"local"]` Filters networks by scope (`swarm`, `global`, or `local`). + * - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. + * * } */ public function __construct(array $queryParameters = []) @@ -37,8 +41,6 @@ public function __construct(array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -49,7 +51,7 @@ public function getUri(): string return '/networks'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -65,25 +67,30 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['filters']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('filters', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\NetworkListInternalServerErrorException * - * @return null|\Docker\API\Model\Network[] + * @return \Docker\API\Model\Network[]|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Network[]', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Network[]', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\NetworkListInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/NetworkPrune.php b/src/Endpoint/NetworkPrune.php index 0d85e4da..e52b9265 100644 --- a/src/Endpoint/NetworkPrune.php +++ b/src/Endpoint/NetworkPrune.php @@ -2,25 +2,21 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class NetworkPrune extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class NetworkPrune extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** * @param array $queryParameters { * - * @var string $filters filters to process on the prune list, encoded as JSON (a `map[string][]string`) - - Available filters: - - `until=` Prune networks created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. - - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune networks with (or without, in case `label!=...` is used) the specified labels. - + * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + * + * Available filters: + * - `until=` Prune networks created before this timestamp. The `` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + * - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune networks with (or without, in case `label!=...` is used) the specified labels. + * * } */ public function __construct(array $queryParameters = []) @@ -28,8 +24,6 @@ public function __construct(array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -40,7 +34,7 @@ public function getUri(): string return '/networks/prune'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -56,25 +50,30 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['filters']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('filters', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\NetworkPruneInternalServerErrorException * - * @return null|\Docker\API\Model\NetworksPrunePostResponse200 + * @return \Docker\API\Model\NetworksPrunePostResponse200|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\NetworksPrunePostResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\NetworksPrunePostResponse200', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\NetworkPruneInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NetworkPruneInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/NodeDelete.php b/src/Endpoint/NodeDelete.php index ed67744c..c60a842a 100644 --- a/src/Endpoint/NodeDelete.php +++ b/src/Endpoint/NodeDelete.php @@ -2,33 +2,30 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class NodeDelete extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class NodeDelete extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** * @param string $id The ID or name of the node * @param array $queryParameters { * - * @var bool $force Force remove a node from the swarm - * } + * @var bool $force Force remove a node from the swarm + * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'DELETE'; @@ -39,14 +36,18 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/nodes/{id}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -55,31 +56,37 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['force']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['force' => false]); - $optionsResolver->setAllowedTypes('force', ['bool']); + $optionsResolver->addAllowedTypes('force', ['bool']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\NodeDeleteNotFoundException * @throws \Docker\API\Exception\NodeDeleteInternalServerErrorException * @throws \Docker\API\Exception\NodeDeleteServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\NodeDeleteNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NodeDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\NodeDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NodeDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\NodeDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NodeDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/NodeInspect.php b/src/Endpoint/NodeInspect.php index f34b7791..34caa74f 100644 --- a/src/Endpoint/NodeInspect.php +++ b/src/Endpoint/NodeInspect.php @@ -2,28 +2,24 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class NodeInspect extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class NodeInspect extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * @param string $id The ID or name of the node + * @param string $id The ID or name of the node + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id) + public function __construct(string $id, array $accept = []) { $this->id = $id; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -34,38 +30,47 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/nodes/{id}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\NodeInspectNotFoundException * @throws \Docker\API\Exception\NodeInspectInternalServerErrorException * @throws \Docker\API\Exception\NodeInspectServiceUnavailableException * - * @return null|\Docker\API\Model\Node + * @return \Docker\API\Model\Node|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Node', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Node', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\NodeInspectNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NodeInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\NodeInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NodeInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\NodeInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NodeInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/NodeList.php b/src/Endpoint/NodeList.php index 0f5cb07f..8d800b37 100644 --- a/src/Endpoint/NodeList.php +++ b/src/Endpoint/NodeList.php @@ -2,37 +2,36 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class NodeList extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class NodeList extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + protected $accept; + /** * @param array $queryParameters { * - * @var string $filters filters to process on the nodes list, encoded as JSON (a `map[string][]string`) - - Available filters: - - `id=` - - `label=` - - `membership=`(`accepted`|`pending`)` - - `name=` - - `role=`(`manager`|`worker`)` - + * @var string $filters Filters to process on the nodes list, encoded as JSON (a `map[string][]string`). + * + * Available filters: + * - `id=` + * - `label=` + * - `membership=`(`accepted`|`pending`)` + * - `name=` + * - `node.label=` + * - `role=`(`manager`|`worker`)` + * * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(array $queryParameters = []) + public function __construct(array $queryParameters = [], array $accept = []) { $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -43,14 +42,18 @@ public function getUri(): string return '/nodes'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -59,29 +62,34 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['filters']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('filters', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\NodeListInternalServerErrorException * @throws \Docker\API\Exception\NodeListServiceUnavailableException * - * @return null|\Docker\API\Model\Node[] + * @return \Docker\API\Model\Node[]|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Node[]', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Node[]', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\NodeListInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NodeListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\NodeListServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NodeListServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/NodeUpdate.php b/src/Endpoint/NodeUpdate.php index 98298014..64446dca 100644 --- a/src/Endpoint/NodeUpdate.php +++ b/src/Endpoint/NodeUpdate.php @@ -2,35 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class NodeUpdate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class NodeUpdate extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * @param string $id The ID of the node - * @param \Docker\API\Model\NodeSpec $body - * @param array $queryParameters { + * @param string $id The ID of the node + * @param array $queryParameters { + * + * @var int $version The version number of the node object being updated. This is required + * to avoid conflicting writes. * - * @var int $version The version number of the node object being updated. This is required to avoid conflicting writes. * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, \Docker\API\Model\NodeSpec $body, array $queryParameters = []) + public function __construct(string $id, ?\Docker\API\Model\NodeSpec $requestBody = null, array $queryParameters = [], array $accept = []) { $this->id = $id; - $this->body = $body; + $this->body = $requestBody; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -41,14 +39,25 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/nodes/{id}/update'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\NodeSpec) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + if ($this->body instanceof \Docker\API\Model\NodeSpec) { + return [['Content-Type' => ['text/plain']], $this->body]; + } + + return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -57,35 +66,41 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['version']); $optionsResolver->setRequired(['version']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('version', ['int']); + $optionsResolver->addAllowedTypes('version', ['int']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\NodeUpdateBadRequestException * @throws \Docker\API\Exception\NodeUpdateNotFoundException * @throws \Docker\API\Exception\NodeUpdateInternalServerErrorException * @throws \Docker\API\Exception\NodeUpdateServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (400 === $status) { - throw new \Docker\API\Exception\NodeUpdateBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NodeUpdateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (404 === $status) { - throw new \Docker\API\Exception\NodeUpdateNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NodeUpdateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\NodeUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NodeUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\NodeUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\NodeUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/PluginCreate.php b/src/Endpoint/PluginCreate.php index ff9deb17..e6936055 100644 --- a/src/Endpoint/PluginCreate.php +++ b/src/Endpoint/PluginCreate.php @@ -2,31 +2,31 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class PluginCreate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class PluginCreate extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + protected $accept; + /** - * @param string|resource|\Psr\Http\Message\StreamInterface $tarContext Path to tar containing plugin rootfs and manifest - * @param array $queryParameters { + * @param string|resource|\Psr\Http\Message\StreamInterface|null $requestBody + * @param array $queryParameters { + * + * @var string $name The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. * - * @var string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct($tarContext, array $queryParameters = []) + public function __construct($requestBody = null, array $queryParameters = [], array $accept = []) { - $this->body = $tarContext; + $this->body = $requestBody; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -37,14 +37,22 @@ public function getUri(): string return '/plugins/create'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return [[], $this->body]; + if (\is_string($this->body) || \is_resource($this->body) || $this->body instanceof \Psr\Http\Message\StreamInterface) { + return [['Content-Type' => ['application/x-tar']], $this->body]; + } + + return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -53,23 +61,29 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['name']); $optionsResolver->setRequired(['name']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('name', ['string']); + $optionsResolver->addAllowedTypes('name', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\PluginCreateInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (204 === $status) { - return null; } - if (500 === $status) { - throw new \Docker\API\Exception\PluginCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/PluginDelete.php b/src/Endpoint/PluginDelete.php index 99fd3dd5..fe613174 100644 --- a/src/Endpoint/PluginDelete.php +++ b/src/Endpoint/PluginDelete.php @@ -2,33 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class PluginDelete extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class PluginDelete extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $name; + protected $accept; /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. * @param array $queryParameters { * - * @var bool $force Disable the plugin before removing. This may result in issues if the plugin is in use by a container. + * @var bool $force Disable the plugin before removing. This may result in issues if the + * plugin is in use by a container. + * * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $name, array $queryParameters = []) + public function __construct(string $name, array $queryParameters = [], array $accept = []) { $this->name = $name; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'DELETE'; @@ -39,14 +39,18 @@ public function getUri(): string return str_replace(['{name}'], [$this->name], '/plugins/{name}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -55,29 +59,34 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['force']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['force' => false]); - $optionsResolver->setAllowedTypes('force', ['bool']); + $optionsResolver->addAllowedTypes('force', ['bool']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\PluginDeleteNotFoundException * @throws \Docker\API\Exception\PluginDeleteInternalServerErrorException * - * @return null|\Docker\API\Model\Plugin + * @return \Docker\API\Model\Plugin|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Plugin', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Plugin', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\PluginDeleteNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\PluginDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/PluginDisable.php b/src/Endpoint/PluginDisable.php index b5479c9c..7ab02fb1 100644 --- a/src/Endpoint/PluginDisable.php +++ b/src/Endpoint/PluginDisable.php @@ -2,28 +2,32 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class PluginDisable extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class PluginDisable extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $name; + protected $accept; /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. + * @param array $queryParameters { + * + * @var bool $force Force disable a plugin even if still in use. + * + * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $name) + public function __construct(string $name, array $queryParameters = [], array $accept = []) { $this->name = $name; + $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -34,32 +38,53 @@ public function getUri(): string return str_replace(['{name}'], [$this->name], '/plugins/{name}/disable'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['force']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('force', ['bool']); + + return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\PluginDisableNotFoundException * @throws \Docker\API\Exception\PluginDisableInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\PluginDisableNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginDisableNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\PluginDisableInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginDisableInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/PluginEnable.php b/src/Endpoint/PluginEnable.php index 62aaf0ea..83e73302 100644 --- a/src/Endpoint/PluginEnable.php +++ b/src/Endpoint/PluginEnable.php @@ -2,33 +2,31 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class PluginEnable extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class PluginEnable extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $name; + protected $accept; /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. * @param array $queryParameters { * - * @var int $timeout Set the HTTP client timeout (in seconds) - * } + * @var int $timeout Set the HTTP client timeout (in seconds) + * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $name, array $queryParameters = []) + public function __construct(string $name, array $queryParameters = [], array $accept = []) { $this->name = $name; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -39,14 +37,18 @@ public function getUri(): string return str_replace(['{name}'], [$this->name], '/plugins/{name}/enable'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -55,27 +57,33 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['timeout']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['timeout' => 0]); - $optionsResolver->setAllowedTypes('timeout', ['int']); + $optionsResolver->addAllowedTypes('timeout', ['int']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\PluginEnableNotFoundException * @throws \Docker\API\Exception\PluginEnableInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\PluginEnableNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginEnableNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\PluginEnableInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginEnableInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/PluginInspect.php b/src/Endpoint/PluginInspect.php index c28717c8..2a9b5883 100644 --- a/src/Endpoint/PluginInspect.php +++ b/src/Endpoint/PluginInspect.php @@ -2,28 +2,25 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class PluginInspect extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class PluginInspect extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $name; + protected $accept; /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $name) + public function __construct(string $name, array $accept = []) { $this->name = $name; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -34,34 +31,43 @@ public function getUri(): string return str_replace(['{name}'], [$this->name], '/plugins/{name}/json'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\PluginInspectNotFoundException * @throws \Docker\API\Exception\PluginInspectInternalServerErrorException * - * @return null|\Docker\API\Model\Plugin + * @return \Docker\API\Model\Plugin|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Plugin', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Plugin', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\PluginInspectNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\PluginInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/PluginList.php b/src/Endpoint/PluginList.php index 95ed0bab..75a79581 100644 --- a/src/Endpoint/PluginList.php +++ b/src/Endpoint/PluginList.php @@ -2,26 +2,25 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class PluginList extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class PluginList extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** * Returns information about installed plugins. * * @param array $queryParameters { * - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the plugin list. Available filters: - - - `capability=` - - `enable=|` - + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + * process on the plugin list. + * + * Available filters: + * + * - `capability=` + * - `enable=|` + * * } */ public function __construct(array $queryParameters = []) @@ -29,8 +28,6 @@ public function __construct(array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -41,7 +38,7 @@ public function getUri(): string return '/plugins'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -57,25 +54,30 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['filters']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('filters', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\PluginListInternalServerErrorException * - * @return null|\Docker\API\Model\Plugin[] + * @return \Docker\API\Model\Plugin[]|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Plugin[]', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Plugin[]', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\PluginListInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/PluginPull.php b/src/Endpoint/PluginPull.php index c31377b9..b7380cde 100644 --- a/src/Endpoint/PluginPull.php +++ b/src/Endpoint/PluginPull.php @@ -2,45 +2,45 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class PluginPull extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class PluginPull extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - /** - * Pulls and installs a plugin. After the plugin is installed, it can be enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable). + use \Docker\API\Runtime\Client\EndpointTrait; + /** + * Pulls and installs a plugin. After the plugin is installed, it can be + * enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable). * - * @param array $body - * @param array $queryParameters { + * @param \Docker\API\Model\PluginPrivilege[]|null $requestBody + * @param array $queryParameters { + * + * @var string $remote Remote reference for plugin to install. + * + * The `:latest` tag is optional, and is used as the default if omitted. + * @var string $name Local name for the pulled plugin. + * + * The `:latest` tag is optional, and is used as the default if omitted. * - * @var string $remote remote reference for plugin to install - - * @var string $name local name for the pulled plugin - - The `:latest` tag is optional, and is used as the default if omitted. - * } * * @param array $headerParameters { * - * @var string $X-Registry-Auth A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication) + * @var string $X-Registry-Auth A base64url-encoded auth configuration to use when pulling a plugin + * from a registry. + * + * Refer to the [authentication section](#section/Authentication) for + * details. + * * } */ - public function __construct(array $body, array $queryParameters = [], array $headerParameters = []) + public function __construct(?array $requestBody = null, array $queryParameters = [], array $headerParameters = []) { - $this->body = $body; + $this->body = $requestBody; $this->queryParameters = $queryParameters; $this->headerParameters = $headerParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -51,9 +51,16 @@ public function getUri(): string return '/plugins/pull'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if (\is_array($this->body) && isset($this->body[0]) && $this->body[0] instanceof \Docker\API\Model\PluginPrivilege) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + if (\is_array($this->body) && isset($this->body[0]) && $this->body[0] instanceof \Docker\API\Model\PluginPrivilege) { + return [['Content-Type' => ['text/plain']], $this->body]; + } + + return [[], null]; } public function getExtraHeaders(): array @@ -67,8 +74,8 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['remote', 'name']); $optionsResolver->setRequired(['remote']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('remote', ['string']); - $optionsResolver->setAllowedTypes('name', ['string']); + $optionsResolver->addAllowedTypes('remote', ['string']); + $optionsResolver->addAllowedTypes('name', ['string']); return $optionsResolver; } @@ -79,23 +86,29 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv $optionsResolver->setDefined(['X-Registry-Auth']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('X-Registry-Auth', ['string']); + $optionsResolver->addAllowedTypes('X-Registry-Auth', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\PluginPullInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (204 === $status) { - return null; } - if (500 === $status) { - throw new \Docker\API\Exception\PluginPullInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginPullInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/PluginPush.php b/src/Endpoint/PluginPush.php index b77f81f4..4b810290 100644 --- a/src/Endpoint/PluginPush.php +++ b/src/Endpoint/PluginPush.php @@ -2,30 +2,27 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class PluginPush extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class PluginPush extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $name; + protected $accept; /** * Push a plugin to the registry. * - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $name) + public function __construct(string $name, array $accept = []) { $this->name = $name; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -36,32 +33,42 @@ public function getUri(): string return str_replace(['{name}'], [$this->name], '/plugins/{name}/push'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\PluginPushNotFoundException * @throws \Docker\API\Exception\PluginPushInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\PluginPushNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginPushNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\PluginPushInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginPushInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/PluginSet.php b/src/Endpoint/PluginSet.php index affed2af..d9d9c89b 100644 --- a/src/Endpoint/PluginSet.php +++ b/src/Endpoint/PluginSet.php @@ -2,30 +2,27 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class PluginSet extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class PluginSet extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $name; + protected $accept; /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. - * @param array $body + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. + * @param array[]|null $requestBody + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $name, array $body) + public function __construct(string $name, ?array $requestBody = null, array $accept = []) { $this->name = $name; - $this->body = $body; + $this->body = $requestBody; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -36,32 +33,46 @@ public function getUri(): string return str_replace(['{name}'], [$this->name], '/plugins/{name}/set'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if (\is_array($this->body) && isset($this->body[0]) && \is_array($this->body[0])) { + return [['Content-Type' => ['application/json']], json_encode($this->body)]; + } + + return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\PluginSetNotFoundException * @throws \Docker\API\Exception\PluginSetInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (204 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\PluginSetNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginSetNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\PluginSetInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginSetInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/PluginUpgrade.php b/src/Endpoint/PluginUpgrade.php index 20b04d2e..d0daeed2 100644 --- a/src/Endpoint/PluginUpgrade.php +++ b/src/Endpoint/PluginUpgrade.php @@ -2,44 +2,47 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class PluginUpgrade extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class PluginUpgrade extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $name; + protected $accept; /** - * @param string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted. - * @param array $body - * @param array $queryParameters { + * @param string $name The name of the plugin. The `:latest` tag is optional, and is the + * default if omitted. + * @param \Docker\API\Model\PluginPrivilege[]|null $requestBody + * @param array $queryParameters { + * + * @var string $remote Remote reference to upgrade to. + * + * The `:latest` tag is optional, and is used as the default if omitted. * - * @var string $remote remote reference to upgrade to - - The `:latest` tag is optional, and is used as the default if omitted. - * } * * @param array $headerParameters { * - * @var string $X-Registry-Auth A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication) + * @var string $X-Registry-Auth A base64url-encoded auth configuration to use when pulling a plugin + * from a registry. + * + * Refer to the [authentication section](#section/Authentication) for + * details. + * * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $name, array $body, array $queryParameters = [], array $headerParameters = []) + public function __construct(string $name, ?array $requestBody = null, array $queryParameters = [], array $headerParameters = [], array $accept = []) { $this->name = $name; - $this->body = $body; + $this->body = $requestBody; $this->queryParameters = $queryParameters; $this->headerParameters = $headerParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -50,14 +53,25 @@ public function getUri(): string return str_replace(['{name}'], [$this->name], '/plugins/{name}/upgrade'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if (\is_array($this->body) && isset($this->body[0]) && $this->body[0] instanceof \Docker\API\Model\PluginPrivilege) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + if (\is_array($this->body) && isset($this->body[0]) && $this->body[0] instanceof \Docker\API\Model\PluginPrivilege) { + return [['Content-Type' => ['text/plain']], $this->body]; + } + + return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -66,7 +80,7 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['remote']); $optionsResolver->setRequired(['remote']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('remote', ['string']); + $optionsResolver->addAllowedTypes('remote', ['string']); return $optionsResolver; } @@ -77,27 +91,33 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv $optionsResolver->setDefined(['X-Registry-Auth']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('X-Registry-Auth', ['string']); + $optionsResolver->addAllowedTypes('X-Registry-Auth', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\PluginUpgradeNotFoundException * @throws \Docker\API\Exception\PluginUpgradeInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (204 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\PluginUpgradeNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginUpgradeNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\PluginUpgradeInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PluginUpgradeInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/PutContainerArchive.php b/src/Endpoint/PutContainerArchive.php index ac635b81..c425375e 100644 --- a/src/Endpoint/PutContainerArchive.php +++ b/src/Endpoint/PutContainerArchive.php @@ -2,38 +2,42 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class PutContainerArchive extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class PutContainerArchive extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** * Upload a tar archive to be extracted to a path in the filesystem of container id. + * `path` parameter is asserted to be a directory. If it exists as a file, 400 error + * will be returned with message "not a directory". + * + * @param string $id ID or name of the container + * @param string|resource|\Psr\Http\Message\StreamInterface|null $requestBody + * @param array $queryParameters { * - * @param string $id ID or name of the container - * @param string $inputStream the input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz - * @param array $queryParameters { + * @var string $path path to a directory in the container to extract the archive’s contents into + * @var string $noOverwriteDirNonDir if `1`, `true`, or `True` then it will be an error if unpacking the + * given content would cause an existing directory to be replaced with + * a non-directory and vice versa + * @var string $copyUIDGID If `1`, `true`, then it will copy UID/GID maps to the dest file or + * dir * - * @var string $path Path to a directory in the container to extract the archive’s contents into. - * @var string $noOverwriteDirNonDir If “1”, “true”, or “True” then it will be an error if unpacking the given content would cause an existing directory to be replaced with a non-directory and vice versa. * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, string $inputStream, array $queryParameters = []) + public function __construct(string $id, $requestBody = null, array $queryParameters = [], array $accept = []) { $this->id = $id; - $this->body = $inputStream; + $this->body = $requestBody; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'PUT'; @@ -44,52 +48,70 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/containers/{id}/archive'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return [[], $this->body]; + if (\is_string($this->body) || \is_resource($this->body) || $this->body instanceof \Psr\Http\Message\StreamInterface) { + return [['Content-Type' => ['application/x-tar']], $this->body]; + } + if (\is_string($this->body) || \is_resource($this->body) || $this->body instanceof \Psr\Http\Message\StreamInterface) { + return [['Content-Type' => ['application/octet-stream']], $this->body]; + } + + return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['path', 'noOverwriteDirNonDir']); + $optionsResolver->setDefined(['path', 'noOverwriteDirNonDir', 'copyUIDGID']); $optionsResolver->setRequired(['path']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('path', ['string']); - $optionsResolver->setAllowedTypes('noOverwriteDirNonDir', ['string']); + $optionsResolver->addAllowedTypes('path', ['string']); + $optionsResolver->addAllowedTypes('noOverwriteDirNonDir', ['string']); + $optionsResolver->addAllowedTypes('copyUIDGID', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\PutContainerArchiveBadRequestException * @throws \Docker\API\Exception\PutContainerArchiveForbiddenException * @throws \Docker\API\Exception\PutContainerArchiveNotFoundException * @throws \Docker\API\Exception\PutContainerArchiveInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (400 === $status) { - throw new \Docker\API\Exception\PutContainerArchiveBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PutContainerArchiveBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (403 === $status) { - throw new \Docker\API\Exception\PutContainerArchiveForbiddenException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (403 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PutContainerArchiveForbiddenException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (404 === $status) { - throw new \Docker\API\Exception\PutContainerArchiveNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PutContainerArchiveNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\PutContainerArchiveInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\PutContainerArchiveInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SecretCreate.php b/src/Endpoint/SecretCreate.php index a5a10ea1..b2e9a2a3 100644 --- a/src/Endpoint/SecretCreate.php +++ b/src/Endpoint/SecretCreate.php @@ -2,26 +2,17 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SecretCreate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SecretCreate extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - /** - * @param \Docker\API\Model\SecretsCreatePostBody $body - */ - public function __construct(\Docker\API\Model\SecretsCreatePostBody $body) + use \Docker\API\Runtime\Client\EndpointTrait; + + public function __construct(?\Docker\API\Model\SecretsCreatePostBody $requestBody = null) { - $this->body = $body; + $this->body = $requestBody; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -32,9 +23,13 @@ public function getUri(): string return '/secrets/create'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\SecretsCreatePostBody) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + + return [[], null]; } public function getExtraHeaders(): array @@ -43,27 +38,32 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\SecretCreateConflictException * @throws \Docker\API\Exception\SecretCreateInternalServerErrorException * @throws \Docker\API\Exception\SecretCreateServiceUnavailableException * - * @return null|\Docker\API\Model\IdResponse + * @return \Docker\API\Model\IdResponse|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (201 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\IdResponse', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\IdResponse', 'json'); } - if (409 === $status) { - throw new \Docker\API\Exception\SecretCreateConflictException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (409 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SecretCreateConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\SecretCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SecretCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\SecretCreateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SecretCreateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SecretDelete.php b/src/Endpoint/SecretDelete.php index cdd5bedc..619a4966 100644 --- a/src/Endpoint/SecretDelete.php +++ b/src/Endpoint/SecretDelete.php @@ -2,16 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SecretDelete extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SecretDelete extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; /** @@ -22,8 +17,6 @@ public function __construct(string $id) $this->id = $id; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'DELETE'; @@ -34,7 +27,7 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/secrets/{id}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -45,25 +38,31 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\SecretDeleteNotFoundException * @throws \Docker\API\Exception\SecretDeleteInternalServerErrorException * @throws \Docker\API\Exception\SecretDeleteServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (204 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\SecretDeleteNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SecretDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\SecretDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SecretDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\SecretDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SecretDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SecretInspect.php b/src/Endpoint/SecretInspect.php index 414c4400..c15203bc 100644 --- a/src/Endpoint/SecretInspect.php +++ b/src/Endpoint/SecretInspect.php @@ -2,16 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SecretInspect extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SecretInspect extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; /** @@ -22,8 +17,6 @@ public function __construct(string $id) $this->id = $id; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -34,7 +27,7 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/secrets/{id}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -45,27 +38,32 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\SecretInspectNotFoundException * @throws \Docker\API\Exception\SecretInspectInternalServerErrorException * @throws \Docker\API\Exception\SecretInspectServiceUnavailableException * - * @return null|\Docker\API\Model\Secret + * @return \Docker\API\Model\Secret|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Secret', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Secret', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\SecretInspectNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SecretInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\SecretInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SecretInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\SecretInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SecretInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SecretList.php b/src/Endpoint/SecretList.php index ef02b995..2f23ed2c 100644 --- a/src/Endpoint/SecretList.php +++ b/src/Endpoint/SecretList.php @@ -2,26 +2,25 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SecretList extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SecretList extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** * @param array $queryParameters { * - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the secrets list. Available filters: - - - `id=` - - `label= or label==value` - - `name=` - - `names=` - + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + * process on the secrets list. + * + * Available filters: + * + * - `id=` + * - `label= or label==value` + * - `name=` + * - `names=` + * * } */ public function __construct(array $queryParameters = []) @@ -29,8 +28,6 @@ public function __construct(array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -41,7 +38,7 @@ public function getUri(): string return '/secrets'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -57,29 +54,34 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['filters']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('filters', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\SecretListInternalServerErrorException * @throws \Docker\API\Exception\SecretListServiceUnavailableException * - * @return null|\Docker\API\Model\Secret[] + * @return \Docker\API\Model\Secret[]|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Secret[]', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Secret[]', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\SecretListInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SecretListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\SecretListServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SecretListServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SecretUpdate.php b/src/Endpoint/SecretUpdate.php index 132fd7f8..d9f4fc48 100644 --- a/src/Endpoint/SecretUpdate.php +++ b/src/Endpoint/SecretUpdate.php @@ -2,35 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SecretUpdate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SecretUpdate extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * @param string $id The ID or name of the secret - * @param \Docker\API\Model\SecretSpec $body The spec of the secret to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the [SecretInspect endpoint](#operation/SecretInspect) response values. - * @param array $queryParameters { + * @param string $id The ID or name of the secret + * @param array $queryParameters { + * + * @var int $version The version number of the secret object being updated. This is + * required to avoid conflicting writes. * - * @var int $version The version number of the secret object being updated. This is required to avoid conflicting writes. * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, \Docker\API\Model\SecretSpec $body, array $queryParameters = []) + public function __construct(string $id, ?\Docker\API\Model\SecretSpec $requestBody = null, array $queryParameters = [], array $accept = []) { $this->id = $id; - $this->body = $body; + $this->body = $requestBody; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -41,14 +39,25 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/secrets/{id}/update'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\SecretSpec) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + if ($this->body instanceof \Docker\API\Model\SecretSpec) { + return [['Content-Type' => ['text/plain']], $this->body]; + } + + return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -57,35 +66,41 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['version']); $optionsResolver->setRequired(['version']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('version', ['int']); + $optionsResolver->addAllowedTypes('version', ['int']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\SecretUpdateBadRequestException * @throws \Docker\API\Exception\SecretUpdateNotFoundException * @throws \Docker\API\Exception\SecretUpdateInternalServerErrorException * @throws \Docker\API\Exception\SecretUpdateServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (400 === $status) { - throw new \Docker\API\Exception\SecretUpdateBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SecretUpdateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (404 === $status) { - throw new \Docker\API\Exception\SecretUpdateNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SecretUpdateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\SecretUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SecretUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\SecretUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SecretUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ServiceCreate.php b/src/Endpoint/ServiceCreate.php index d0d9e8fe..0c21165d 100644 --- a/src/Endpoint/ServiceCreate.php +++ b/src/Endpoint/ServiceCreate.php @@ -2,31 +2,29 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ServiceCreate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ServiceCreate extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** - * @param \Docker\API\Model\ServicesCreatePostBody $body - * @param array $headerParameters { + * @param array $headerParameters { + * + * @var string $X-Registry-Auth A base64url-encoded auth configuration for pulling from private + * registries. + * + * Refer to the [authentication section](#section/Authentication) for + * details. * - * @var string $X-Registry-Auth A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication) * } */ - public function __construct(\Docker\API\Model\ServicesCreatePostBody $body, array $headerParameters = []) + public function __construct(?\Docker\API\Model\ServicesCreatePostBody $requestBody = null, array $headerParameters = []) { - $this->body = $body; + $this->body = $requestBody; $this->headerParameters = $headerParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -37,9 +35,13 @@ public function getUri(): string return '/services/create'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\ServicesCreatePostBody) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + + return [[], null]; } public function getExtraHeaders(): array @@ -53,41 +55,46 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv $optionsResolver->setDefined(['X-Registry-Auth']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('X-Registry-Auth', ['string']); + $optionsResolver->addAllowedTypes('X-Registry-Auth', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ServiceCreateBadRequestException * @throws \Docker\API\Exception\ServiceCreateForbiddenException * @throws \Docker\API\Exception\ServiceCreateConflictException * @throws \Docker\API\Exception\ServiceCreateInternalServerErrorException * @throws \Docker\API\Exception\ServiceCreateServiceUnavailableException * - * @return null|\Docker\API\Model\ServicesCreatePostResponse201 + * @return \Docker\API\Model\ServiceCreateResponse|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (201 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ServicesCreatePostResponse201', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\ServiceCreateResponse', 'json'); } - if (400 === $status) { - throw new \Docker\API\Exception\ServiceCreateBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceCreateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (403 === $status) { - throw new \Docker\API\Exception\ServiceCreateForbiddenException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (403 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceCreateForbiddenException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (409 === $status) { - throw new \Docker\API\Exception\ServiceCreateConflictException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (409 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceCreateConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ServiceCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\ServiceCreateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceCreateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ServiceDelete.php b/src/Endpoint/ServiceDelete.php index c71a698b..388c4988 100644 --- a/src/Endpoint/ServiceDelete.php +++ b/src/Endpoint/ServiceDelete.php @@ -2,28 +2,24 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ServiceDelete extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ServiceDelete extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * @param string $id ID or name of service + * @param string $id ID or name of service + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id) + public function __construct(string $id, array $accept = []) { $this->id = $id; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'DELETE'; @@ -34,36 +30,46 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/services/{id}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ServiceDeleteNotFoundException * @throws \Docker\API\Exception\ServiceDeleteInternalServerErrorException * @throws \Docker\API\Exception\ServiceDeleteServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\ServiceDeleteNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ServiceDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\ServiceDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ServiceInspect.php b/src/Endpoint/ServiceInspect.php index 8f3cf424..769d9540 100644 --- a/src/Endpoint/ServiceInspect.php +++ b/src/Endpoint/ServiceInspect.php @@ -2,33 +2,30 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ServiceInspect extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ServiceInspect extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** * @param string $id ID or name of service * @param array $queryParameters { * - * @var bool $insertDefaults Fill empty fields with default values. - * } + * @var bool $insertDefaults Fill empty fields with default values. + * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -39,14 +36,18 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/services/{id}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -55,33 +56,38 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['insertDefaults']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['insertDefaults' => false]); - $optionsResolver->setAllowedTypes('insertDefaults', ['bool']); + $optionsResolver->addAllowedTypes('insertDefaults', ['bool']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ServiceInspectNotFoundException * @throws \Docker\API\Exception\ServiceInspectInternalServerErrorException * @throws \Docker\API\Exception\ServiceInspectServiceUnavailableException * - * @return null|\Docker\API\Model\Service + * @return \Docker\API\Model\Service|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Service', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Service', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\ServiceInspectNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ServiceInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\ServiceInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ServiceList.php b/src/Endpoint/ServiceList.php index 1198877c..f7ef015f 100644 --- a/src/Endpoint/ServiceList.php +++ b/src/Endpoint/ServiceList.php @@ -2,35 +2,37 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ServiceList extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ServiceList extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + protected $accept; + /** * @param array $queryParameters { * - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the services list. Available filters: - - - `id=` - - `label=` - - `mode=["replicated"|"global"]` - - `name=` - + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + * process on the services list. + * + * Available filters: + * + * - `id=` + * - `label=` + * - `mode=["replicated"|"global"]` + * - `name=` + * @var bool $status Include service status, with count of running and desired tasks. + * * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(array $queryParameters = []) + public function __construct(array $queryParameters = [], array $accept = []) { $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -41,45 +43,55 @@ public function getUri(): string return '/services'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['filters']); + $optionsResolver->setDefined(['filters', 'status']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('status', ['bool']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ServiceListInternalServerErrorException * @throws \Docker\API\Exception\ServiceListServiceUnavailableException * - * @return null|\Docker\API\Model\Service[] + * @return \Docker\API\Model\Service[]|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Service[]', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Service[]', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\ServiceListInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\ServiceListServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceListServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ServiceLogs.php b/src/Endpoint/ServiceLogs.php index b385458c..7ec315c2 100644 --- a/src/Endpoint/ServiceLogs.php +++ b/src/Endpoint/ServiceLogs.php @@ -2,45 +2,44 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ServiceLogs extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ServiceLogs extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** - * Get `stdout` and `stderr` logs from a service. - - **Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers. - + * Get `stdout` and `stderr` logs from a service. See also + * [`/containers/{id}/logs`](#operation/ContainerLogs). + * + **Note**: This endpoint works only for services with the `local`, + * `json-file` or `journald` logging drivers. * * @param string $id ID or name of the service * @param array $queryParameters { * - * @var bool $details show service context and extra details provided to logs - * @var bool $follow return the logs as a stream - - * @var bool $stdout Return logs from `stdout` - * @var bool $stderr Return logs from `stderr` - * @var int $since Only return logs since this time, as a UNIX timestamp - * @var bool $timestamps Add timestamps to every log line - * @var string $tail Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines. + * @var bool $details show service context and extra details provided to logs + * @var bool $follow keep connection after returning logs + * @var bool $stdout Return logs from `stdout` + * @var bool $stderr Return logs from `stderr` + * @var int $since Only return logs since this time, as a UNIX timestamp + * @var bool $timestamps Add timestamps to every log line + * @var string $tail Only return this number of log lines from the end of the logs. + * Specify as an integer or `all` to output all log lines. + * * } + * + * @param array $accept Accept content header application/vnd.docker.raw-stream|application/vnd.docker.multiplexed-stream|application/json */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -51,14 +50,18 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/services/{id}/logs'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/vnd.docker.raw-stream', 'application/vnd.docker.multiplexed-stream', 'application/json']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -67,40 +70,39 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['details', 'follow', 'stdout', 'stderr', 'since', 'timestamps', 'tail']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['details' => false, 'follow' => false, 'stdout' => false, 'stderr' => false, 'since' => 0, 'timestamps' => false, 'tail' => 'all']); - $optionsResolver->setAllowedTypes('details', ['bool']); - $optionsResolver->setAllowedTypes('follow', ['bool']); - $optionsResolver->setAllowedTypes('stdout', ['bool']); - $optionsResolver->setAllowedTypes('stderr', ['bool']); - $optionsResolver->setAllowedTypes('since', ['int']); - $optionsResolver->setAllowedTypes('timestamps', ['bool']); - $optionsResolver->setAllowedTypes('tail', ['string']); + $optionsResolver->addAllowedTypes('details', ['bool']); + $optionsResolver->addAllowedTypes('follow', ['bool']); + $optionsResolver->addAllowedTypes('stdout', ['bool']); + $optionsResolver->addAllowedTypes('stderr', ['bool']); + $optionsResolver->addAllowedTypes('since', ['int']); + $optionsResolver->addAllowedTypes('timestamps', ['bool']); + $optionsResolver->addAllowedTypes('tail', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ServiceLogsNotFoundException - * @throws \Docker\API\Exception\ServiceLogsInternalServerErrorException - * @throws \Docker\API\Exception\ServiceLogsServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (101 === $status) { - return json_decode($body); - } + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return json_decode($body); } - if (404 === $status) { - throw new \Docker\API\Exception\ServiceLogsNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceLogsNotFoundException($response); } if (500 === $status) { - throw new \Docker\API\Exception\ServiceLogsInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } if (503 === $status) { - throw new \Docker\API\Exception\ServiceLogsServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/ServiceUpdate.php b/src/Endpoint/ServiceUpdate.php index 480d5dfb..629de29a 100644 --- a/src/Endpoint/ServiceUpdate.php +++ b/src/Endpoint/ServiceUpdate.php @@ -2,43 +2,48 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class ServiceUpdate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class ServiceUpdate extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; /** - * @param string $id ID or name of service - * @param \Docker\API\Model\ServicesIdUpdatePostBody $body - * @param array $queryParameters { + * @param string $id ID or name of service + * @param array $queryParameters { + * + * @var int $version The version number of the service object being updated. This is + * required to avoid conflicting writes. + * This version number should be the value as currently set on the + * service *before* the update. You can find the current version by + * calling `GET /services/{id}` + * @var string $registryAuthFrom if the `X-Registry-Auth` header is not specified, this parameter + * indicates where to find registry authorization credentials + * @var string $rollback Set to this parameter to `previous` to cause a server-side rollback + * to the previous service spec. The supplied spec will be ignored in + * this case. * - * @var int $version The version number of the service object being updated. This is required to avoid conflicting writes. - * @var string $registryAuthFrom If the X-Registry-Auth header is not specified, this parameter indicates where to find registry authorization credentials. The valid values are `spec` and `previous-spec`. - * @var string $rollback Set to this parameter to `previous` to cause a server-side rollback to the previous service spec. The supplied spec will be ignored in this case. * } * * @param array $headerParameters { * - * @var string $X-Registry-Auth A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication) + * @var string $X-Registry-Auth A base64url-encoded auth configuration for pulling from private + * registries. + * + * Refer to the [authentication section](#section/Authentication) for + * details. + * * } */ - public function __construct(string $id, \Docker\API\Model\ServicesIdUpdatePostBody $body, array $queryParameters = [], array $headerParameters = []) + public function __construct(string $id, ?\Docker\API\Model\ServicesIdUpdatePostBody $requestBody = null, array $queryParameters = [], array $headerParameters = []) { $this->id = $id; - $this->body = $body; + $this->body = $requestBody; $this->queryParameters = $queryParameters; $this->headerParameters = $headerParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -49,9 +54,13 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/services/{id}/update'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\ServicesIdUpdatePostBody) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + + return [[], null]; } public function getExtraHeaders(): array @@ -65,9 +74,9 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['version', 'registryAuthFrom', 'rollback']); $optionsResolver->setRequired(['version']); $optionsResolver->setDefaults(['registryAuthFrom' => 'spec']); - $optionsResolver->setAllowedTypes('version', ['int']); - $optionsResolver->setAllowedTypes('registryAuthFrom', ['string']); - $optionsResolver->setAllowedTypes('rollback', ['string']); + $optionsResolver->addAllowedTypes('version', ['int']); + $optionsResolver->addAllowedTypes('registryAuthFrom', ['string']); + $optionsResolver->addAllowedTypes('rollback', ['string']); return $optionsResolver; } @@ -78,37 +87,42 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv $optionsResolver->setDefined(['X-Registry-Auth']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('X-Registry-Auth', ['string']); + $optionsResolver->addAllowedTypes('X-Registry-Auth', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\ServiceUpdateBadRequestException * @throws \Docker\API\Exception\ServiceUpdateNotFoundException * @throws \Docker\API\Exception\ServiceUpdateInternalServerErrorException * @throws \Docker\API\Exception\ServiceUpdateServiceUnavailableException * - * @return null|\Docker\API\Model\ServiceUpdateResponse + * @return \Docker\API\Model\ServiceUpdateResponse|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\ServiceUpdateResponse', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\ServiceUpdateResponse', 'json'); } - if (400 === $status) { - throw new \Docker\API\Exception\ServiceUpdateBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceUpdateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (404 === $status) { - throw new \Docker\API\Exception\ServiceUpdateNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceUpdateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\ServiceUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\ServiceUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\ServiceUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/Session.php b/src/Endpoint/Session.php index c5f36a19..20801790 100644 --- a/src/Endpoint/Session.php +++ b/src/Endpoint/Session.php @@ -2,17 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class Session extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class Session extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; + use \Docker\API\Runtime\Client\EndpointTrait; public function getMethod(): string { @@ -24,32 +18,33 @@ public function getUri(): string return '/session'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + return ['Accept' => ['application/vnd.docker.raw-stream']]; } /** - * {@inheritdoc} - * - * @throws \Docker\API\Exception\SessionBadRequestException - * @throws \Docker\API\Exception\SessionInternalServerErrorException + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (101 === $status) { - return null; } if (400 === $status) { - throw new \Docker\API\Exception\SessionBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } if (500 === $status) { - throw new \Docker\API\Exception\SessionInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SwarmInit.php b/src/Endpoint/SwarmInit.php index 51fe9941..7bdabfc6 100644 --- a/src/Endpoint/SwarmInit.php +++ b/src/Endpoint/SwarmInit.php @@ -2,26 +2,22 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SwarmInit extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SwarmInit extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + protected $accept; + /** - * @param \Docker\API\Model\SwarmInitPostBody $body + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(\Docker\API\Model\SwarmInitPostBody $body) + public function __construct(?\Docker\API\Model\SwarmInitPostBody $requestBody = null, array $accept = []) { - $this->body = $body; + $this->body = $requestBody; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -32,36 +28,54 @@ public function getUri(): string return '/swarm/init'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\SwarmInitPostBody) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + if ($this->body instanceof \Docker\API\Model\SwarmInitPostBody) { + return [['Content-Type' => ['text/plain']], $this->body]; + } + + return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\SwarmInitBadRequestException * @throws \Docker\API\Exception\SwarmInitInternalServerErrorException * @throws \Docker\API\Exception\SwarmInitServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return json_decode($body); } - if (400 === $status) { - throw new \Docker\API\Exception\SwarmInitBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmInitBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\SwarmInitInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmInitInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\SwarmInitServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmInitServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SwarmInspect.php b/src/Endpoint/SwarmInspect.php index aa2e64c9..e342f533 100644 --- a/src/Endpoint/SwarmInspect.php +++ b/src/Endpoint/SwarmInspect.php @@ -2,17 +2,20 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SwarmInspect extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SwarmInspect extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; + use \Docker\API\Runtime\Client\EndpointTrait; + protected $accept; + + /** + * @param array $accept Accept content header application/json|text/plain + */ + public function __construct(array $accept = []) + { + $this->accept = $accept; + } public function getMethod(): string { @@ -24,38 +27,47 @@ public function getUri(): string return '/swarm'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\SwarmInspectNotFoundException * @throws \Docker\API\Exception\SwarmInspectInternalServerErrorException * @throws \Docker\API\Exception\SwarmInspectServiceUnavailableException * - * @return null|\Docker\API\Model\Swarm + * @return \Docker\API\Model\Swarm|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Swarm', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Swarm', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\SwarmInspectNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\SwarmInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\SwarmInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SwarmJoin.php b/src/Endpoint/SwarmJoin.php index e0ce9ee2..e697da79 100644 --- a/src/Endpoint/SwarmJoin.php +++ b/src/Endpoint/SwarmJoin.php @@ -2,26 +2,22 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SwarmJoin extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SwarmJoin extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + protected $accept; + /** - * @param \Docker\API\Model\SwarmJoinPostBody $body + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(\Docker\API\Model\SwarmJoinPostBody $body) + public function __construct(?\Docker\API\Model\SwarmJoinPostBody $requestBody = null, array $accept = []) { - $this->body = $body; + $this->body = $requestBody; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -32,36 +28,53 @@ public function getUri(): string return '/swarm/join'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\SwarmJoinPostBody) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + if ($this->body instanceof \Docker\API\Model\SwarmJoinPostBody) { + return [['Content-Type' => ['text/plain']], $this->body]; + } + + return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\SwarmJoinBadRequestException * @throws \Docker\API\Exception\SwarmJoinInternalServerErrorException * @throws \Docker\API\Exception\SwarmJoinServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (400 === $status) { - throw new \Docker\API\Exception\SwarmJoinBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmJoinBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\SwarmJoinInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmJoinInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\SwarmJoinServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmJoinServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SwarmLeave.php b/src/Endpoint/SwarmLeave.php index 3a5fc51c..ccc2db3b 100644 --- a/src/Endpoint/SwarmLeave.php +++ b/src/Endpoint/SwarmLeave.php @@ -2,29 +2,29 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SwarmLeave extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SwarmLeave extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + protected $accept; + /** * @param array $queryParameters { * - * @var bool $force Force leave swarm, even if this is the last manager or that it will break the cluster. + * @var bool $force Force leave swarm, even if this is the last manager or that it will + * break the cluster. + * * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(array $queryParameters = []) + public function __construct(array $queryParameters = [], array $accept = []) { $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -35,14 +35,18 @@ public function getUri(): string return '/swarm/leave'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -51,27 +55,33 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['force']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['force' => false]); - $optionsResolver->setAllowedTypes('force', ['bool']); + $optionsResolver->addAllowedTypes('force', ['bool']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\SwarmLeaveInternalServerErrorException * @throws \Docker\API\Exception\SwarmLeaveServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (500 === $status) { - throw new \Docker\API\Exception\SwarmLeaveInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmLeaveInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\SwarmLeaveServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmLeaveServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SwarmUnlock.php b/src/Endpoint/SwarmUnlock.php index c4044947..e98dd09f 100644 --- a/src/Endpoint/SwarmUnlock.php +++ b/src/Endpoint/SwarmUnlock.php @@ -2,26 +2,17 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SwarmUnlock extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SwarmUnlock extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - /** - * @param \Docker\API\Model\SwarmUnlockPostBody $body - */ - public function __construct(\Docker\API\Model\SwarmUnlockPostBody $body) + use \Docker\API\Runtime\Client\EndpointTrait; + + public function __construct(?\Docker\API\Model\SwarmUnlockPostBody $requestBody = null) { - $this->body = $body; + $this->body = $requestBody; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -32,9 +23,13 @@ public function getUri(): string return '/swarm/unlock'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\SwarmUnlockPostBody) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + + return [[], null]; } public function getExtraHeaders(): array @@ -43,21 +38,27 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\SwarmUnlockInternalServerErrorException * @throws \Docker\API\Exception\SwarmUnlockServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (500 === $status) { - throw new \Docker\API\Exception\SwarmUnlockInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmUnlockInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\SwarmUnlockServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmUnlockServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SwarmUnlockkey.php b/src/Endpoint/SwarmUnlockkey.php index 30f48457..f56eca6a 100644 --- a/src/Endpoint/SwarmUnlockkey.php +++ b/src/Endpoint/SwarmUnlockkey.php @@ -2,17 +2,20 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SwarmUnlockkey extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SwarmUnlockkey extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; + use \Docker\API\Runtime\Client\EndpointTrait; + protected $accept; + + /** + * @param array $accept Accept content header application/json|text/plain + */ + public function __construct(array $accept = []) + { + $this->accept = $accept; + } public function getMethod(): string { @@ -24,34 +27,43 @@ public function getUri(): string return '/swarm/unlockkey'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\SwarmUnlockkeyInternalServerErrorException * @throws \Docker\API\Exception\SwarmUnlockkeyServiceUnavailableException * - * @return null|\Docker\API\Model\SwarmUnlockkeyGetResponse200 + * @return \Docker\API\Model\SwarmUnlockkeyGetJsonResponse200|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\SwarmUnlockkeyGetResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\SwarmUnlockkeyGetJsonResponse200', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\SwarmUnlockkeyInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmUnlockkeyInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\SwarmUnlockkeyServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmUnlockkeyServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SwarmUpdate.php b/src/Endpoint/SwarmUpdate.php index 5401525b..7fafc203 100644 --- a/src/Endpoint/SwarmUpdate.php +++ b/src/Endpoint/SwarmUpdate.php @@ -2,34 +2,32 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SwarmUpdate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SwarmUpdate extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + protected $accept; + /** - * @param \Docker\API\Model\SwarmSpec $body - * @param array $queryParameters { + * @param array $queryParameters { * - * @var int $version The version number of the swarm object being updated. This is required to avoid conflicting writes. - * @var bool $rotateWorkerToken rotate the worker join token - * @var bool $rotateManagerToken rotate the manager join token - * @var bool $rotateManagerUnlockKey Rotate the manager unlock key. - * } + * @var int $version The version number of the swarm object being updated. This is + * required to avoid conflicting writes. + * @var bool $rotateWorkerToken rotate the worker join token + * @var bool $rotateManagerToken rotate the manager join token + * @var bool $rotateManagerUnlockKey Rotate the manager unlock key. + * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(\Docker\API\Model\SwarmSpec $body, array $queryParameters = []) + public function __construct(?\Docker\API\Model\SwarmSpec $requestBody = null, array $queryParameters = [], array $accept = []) { - $this->body = $body; + $this->body = $requestBody; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -40,14 +38,25 @@ public function getUri(): string return '/swarm/update'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\SwarmSpec) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + if ($this->body instanceof \Docker\API\Model\SwarmSpec) { + return [['Content-Type' => ['text/plain']], $this->body]; + } + + return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -56,34 +65,40 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['version', 'rotateWorkerToken', 'rotateManagerToken', 'rotateManagerUnlockKey']); $optionsResolver->setRequired(['version']); $optionsResolver->setDefaults(['rotateWorkerToken' => false, 'rotateManagerToken' => false, 'rotateManagerUnlockKey' => false]); - $optionsResolver->setAllowedTypes('version', ['int']); - $optionsResolver->setAllowedTypes('rotateWorkerToken', ['bool']); - $optionsResolver->setAllowedTypes('rotateManagerToken', ['bool']); - $optionsResolver->setAllowedTypes('rotateManagerUnlockKey', ['bool']); + $optionsResolver->addAllowedTypes('version', ['int']); + $optionsResolver->addAllowedTypes('rotateWorkerToken', ['bool']); + $optionsResolver->addAllowedTypes('rotateManagerToken', ['bool']); + $optionsResolver->addAllowedTypes('rotateManagerUnlockKey', ['bool']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\SwarmUpdateBadRequestException * @throws \Docker\API\Exception\SwarmUpdateInternalServerErrorException * @throws \Docker\API\Exception\SwarmUpdateServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return null; } - if (400 === $status) { - throw new \Docker\API\Exception\SwarmUpdateBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmUpdateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\SwarmUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\SwarmUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SwarmUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SystemAuth.php b/src/Endpoint/SystemAuth.php index e1a94c42..926a3df2 100644 --- a/src/Endpoint/SystemAuth.php +++ b/src/Endpoint/SystemAuth.php @@ -2,28 +2,21 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SystemAuth extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SystemAuth extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** - * Validate credentials for a registry and, if available, get an identity token for accessing the registry without password. - * - * @param \Docker\API\Model\AuthConfig $authConfig Authentication to check + * Validate credentials for a registry and, if available, get an identity + * token for accessing the registry without password. */ - public function __construct(\Docker\API\Model\AuthConfig $authConfig) + public function __construct(?\Docker\API\Model\AuthConfig $requestBody = null) { - $this->body = $authConfig; + $this->body = $requestBody; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -34,9 +27,13 @@ public function getUri(): string return '/auth'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\AuthConfig) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + + return [[], null]; } public function getExtraHeaders(): array @@ -45,22 +42,30 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * + * @throws \Docker\API\Exception\SystemAuthUnauthorizedException * @throws \Docker\API\Exception\SystemAuthInternalServerErrorException * - * @return null|\Docker\API\Model\AuthPostResponse200 + * @return \Docker\API\Model\AuthPostResponse200|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\AuthPostResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\AuthPostResponse200', 'json'); } if (204 === $status) { - return null; } - if (500 === $status) { - throw new \Docker\API\Exception\SystemAuthInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (401 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SystemAuthUnauthorizedException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SystemAuthInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SystemDataUsage.php b/src/Endpoint/SystemDataUsage.php index c0da2fbc..25a50f61 100644 --- a/src/Endpoint/SystemDataUsage.php +++ b/src/Endpoint/SystemDataUsage.php @@ -2,17 +2,26 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SystemDataUsage extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SystemDataUsage extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; + use \Docker\API\Runtime\Client\EndpointTrait; + protected $accept; + + /** + * @param array $queryParameters { + * + * @var array $type Object types, for which to compute and return data. + * } + * + * @param array $accept Accept content header application/json|text/plain + */ + public function __construct(array $queryParameters = [], array $accept = []) + { + $this->queryParameters = $queryParameters; + $this->accept = $accept; + } public function getMethod(): string { @@ -24,30 +33,50 @@ public function getUri(): string return '/system/df'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['type']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('type', ['array']); + + return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\SystemDataUsageInternalServerErrorException * - * @return null|\Docker\API\Model\SystemDfGetResponse200 + * @return \Docker\API\Model\SystemDfGetJsonResponse200|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\SystemDfGetResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\SystemDfGetJsonResponse200', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\SystemDataUsageInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SystemDataUsageInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SystemEvents.php b/src/Endpoint/SystemEvents.php index f81aac71..49c61cb2 100644 --- a/src/Endpoint/SystemEvents.php +++ b/src/Endpoint/SystemEvents.php @@ -2,61 +2,58 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SystemEvents extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SystemEvents extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** * Stream real-time events from the server. - - Various objects within Docker report events when something happens to them. - - Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, and `update` - - Images report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, and `untag` - - Volumes report these events: `create`, `mount`, `unmount`, and `destroy` - - Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, and `remove` - - The Docker daemon reports these events: `reload` - - Services report these events: `create`, `update`, and `remove` - - Nodes report these events: `create`, `update`, and `remove` - - Secrets report these events: `create`, `update`, and `remove` - - Configs report these events: `create`, `update`, and `remove` - + * + * Various objects within Docker report events when something happens to them. + * + * Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune` + * + * Images report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune` + * + * Volumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune` + * + * Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune` + * + * The Docker daemon reports these events: `reload` + * + * Services report these events: `create`, `update`, and `remove` + * + * Nodes report these events: `create`, `update`, and `remove` + * + * Secrets report these events: `create`, `update`, and `remove` + * + * Configs report these events: `create`, `update`, and `remove` + * + * The Builder reports `prune` events * * @param array $queryParameters { * - * @var string $since show events created since this timestamp then stream new events - * @var string $until show events created until this timestamp then stop streaming - * @var string $filters A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: - - - `config=` config name or ID - - `container=` container name or ID - - `daemon=` daemon name or ID - - `event=` event type - - `image=` image name or ID - - `label=` image or container label - - `network=` network name or ID - - `node=` node ID - - `plugin`= plugin name or ID - - `scope`= local or swarm - - `secret=` secret name or ID - - `service=` service name or ID - - `type=` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config` - - `volume=` volume name - + * @var string $since show events created since this timestamp then stream new events + * @var string $until show events created until this timestamp then stop streaming + * @var string $filters A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: + * + * - `config=` config name or ID + * - `container=` container name or ID + * - `daemon=` daemon name or ID + * - `event=` event type + * - `image=` image name or ID + * - `label=` image or container label + * - `network=` network name or ID + * - `node=` node ID + * - `plugin`= plugin name or ID + * - `scope`= local or swarm + * - `secret=` secret name or ID + * - `service=` service name or ID + * - `type=` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config` + * - `volume=` volume name + * * } */ public function __construct(array $queryParameters = []) @@ -64,8 +61,6 @@ public function __construct(array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -76,7 +71,7 @@ public function getUri(): string return '/events'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -92,31 +87,36 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['since', 'until', 'filters']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('since', ['string']); - $optionsResolver->setAllowedTypes('until', ['string']); - $optionsResolver->setAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('since', ['string']); + $optionsResolver->addAllowedTypes('until', ['string']); + $optionsResolver->addAllowedTypes('filters', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\SystemEventsBadRequestException * @throws \Docker\API\Exception\SystemEventsInternalServerErrorException * - * @return null|\Docker\API\Model\EventsGetResponse200 + * @return \Docker\API\Model\EventMessage|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\EventsGetResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\EventMessage', 'json'); } - if (400 === $status) { - throw new \Docker\API\Exception\SystemEventsBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SystemEventsBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\SystemEventsInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SystemEventsInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SystemInfo.php b/src/Endpoint/SystemInfo.php index 3b43e14a..d6a4d218 100644 --- a/src/Endpoint/SystemInfo.php +++ b/src/Endpoint/SystemInfo.php @@ -2,17 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SystemInfo extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SystemInfo extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; + use \Docker\API\Runtime\Client\EndpointTrait; public function getMethod(): string { @@ -24,7 +18,7 @@ public function getUri(): string return '/info'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -35,19 +29,24 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\SystemInfoInternalServerErrorException * - * @return null|\Docker\API\Model\SystemInfo + * @return \Docker\API\Model\SystemInfo|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\SystemInfo', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\SystemInfo', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\SystemInfoInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SystemInfoInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SystemPing.php b/src/Endpoint/SystemPing.php index 9a7edcb6..61f9b30b 100644 --- a/src/Endpoint/SystemPing.php +++ b/src/Endpoint/SystemPing.php @@ -2,17 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SystemPing extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SystemPing extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; + use \Docker\API\Runtime\Client\EndpointTrait; public function getMethod(): string { @@ -24,28 +18,31 @@ public function getUri(): string return '/_ping'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + return ['Accept' => ['text/plain']]; } /** - * {@inheritdoc} - * - * @throws \Docker\API\Exception\SystemPingInternalServerErrorException + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return json_decode($body); } if (500 === $status) { - throw new \Docker\API\Exception\SystemPingInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/SystemPingHead.php b/src/Endpoint/SystemPingHead.php new file mode 100644 index 00000000..c93d38e3 --- /dev/null +++ b/src/Endpoint/SystemPingHead.php @@ -0,0 +1,48 @@ + ['text/plain']]; + } + + /** + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + } + if (500 === $status) { + } + } + + public function getAuthenticationScopes(): array + { + return []; + } +} diff --git a/src/Endpoint/SystemVersion.php b/src/Endpoint/SystemVersion.php index b0461b01..60f69b4e 100644 --- a/src/Endpoint/SystemVersion.php +++ b/src/Endpoint/SystemVersion.php @@ -2,17 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class SystemVersion extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class SystemVersion extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; + use \Docker\API\Runtime\Client\EndpointTrait; public function getMethod(): string { @@ -24,7 +18,7 @@ public function getUri(): string return '/version'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -35,19 +29,24 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\SystemVersionInternalServerErrorException * - * @return null|\Docker\API\Model\VersionGetResponse200 + * @return \Docker\API\Model\SystemVersion|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\VersionGetResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\SystemVersion', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\SystemVersionInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\SystemVersionInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/TaskInspect.php b/src/Endpoint/TaskInspect.php index 97d97512..cad2a6f1 100644 --- a/src/Endpoint/TaskInspect.php +++ b/src/Endpoint/TaskInspect.php @@ -2,16 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class TaskInspect extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class TaskInspect extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; /** @@ -22,8 +17,6 @@ public function __construct(string $id) $this->id = $id; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -34,7 +27,7 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/tasks/{id}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -45,27 +38,32 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\TaskInspectNotFoundException * @throws \Docker\API\Exception\TaskInspectInternalServerErrorException * @throws \Docker\API\Exception\TaskInspectServiceUnavailableException * - * @return null|\Docker\API\Model\Task + * @return \Docker\API\Model\Task|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Task', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Task', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\TaskInspectNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\TaskInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\TaskInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\TaskInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\TaskInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\TaskInspectServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/TaskList.php b/src/Endpoint/TaskList.php index 9142a5d9..fb321524 100644 --- a/src/Endpoint/TaskList.php +++ b/src/Endpoint/TaskList.php @@ -2,28 +2,27 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class TaskList extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class TaskList extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** * @param array $queryParameters { * - * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the tasks list. Available filters: - - - `desired-state=(running | shutdown | accepted)` - - `id=` - - `label=key` or `label="key=value"` - - `name=` - - `node=` - - `service=` - + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to + * process on the tasks list. + * + * Available filters: + * + * - `desired-state=(running | shutdown | accepted)` + * - `id=` + * - `label=key` or `label="key=value"` + * - `name=` + * - `node=` + * - `service=` + * * } */ public function __construct(array $queryParameters = []) @@ -31,8 +30,6 @@ public function __construct(array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -43,7 +40,7 @@ public function getUri(): string return '/tasks'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -59,29 +56,34 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['filters']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('filters', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\TaskListInternalServerErrorException * @throws \Docker\API\Exception\TaskListServiceUnavailableException * - * @return null|\Docker\API\Model\Task[] + * @return \Docker\API\Model\Task[]|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Task[]', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Task[]', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\TaskListInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\TaskListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (503 === $status) { - throw new \Docker\API\Exception\TaskListServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\TaskListServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/TaskLogs.php b/src/Endpoint/TaskLogs.php index be0ddc4b..5e95f92f 100644 --- a/src/Endpoint/TaskLogs.php +++ b/src/Endpoint/TaskLogs.php @@ -2,45 +2,44 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class TaskLogs extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class TaskLogs extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $id; + protected $accept; /** * Get `stdout` and `stderr` logs from a task. - - **Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers. - + * See also [`/containers/{id}/logs`](#operation/ContainerLogs). + * + **Note**: This endpoint works only for services with the `local`, + * `json-file` or `journald` logging drivers. * * @param string $id ID of the task * @param array $queryParameters { * - * @var bool $details show task context and extra details provided to logs - * @var bool $follow return the logs as a stream - - * @var bool $stdout Return logs from `stdout` - * @var bool $stderr Return logs from `stderr` - * @var int $since Only return logs since this time, as a UNIX timestamp - * @var bool $timestamps Add timestamps to every log line - * @var string $tail Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines. + * @var bool $details show task context and extra details provided to logs + * @var bool $follow keep connection after returning logs + * @var bool $stdout Return logs from `stdout` + * @var bool $stderr Return logs from `stderr` + * @var int $since Only return logs since this time, as a UNIX timestamp + * @var bool $timestamps Add timestamps to every log line + * @var string $tail Only return this number of log lines from the end of the logs. + * Specify as an integer or `all` to output all log lines. + * * } + * + * @param array $accept Accept content header application/vnd.docker.raw-stream|application/vnd.docker.multiplexed-stream|application/json */ - public function __construct(string $id, array $queryParameters = []) + public function __construct(string $id, array $queryParameters = [], array $accept = []) { $this->id = $id; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -51,14 +50,18 @@ public function getUri(): string return str_replace(['{id}'], [$this->id], '/tasks/{id}/logs'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/vnd.docker.raw-stream', 'application/vnd.docker.multiplexed-stream', 'application/json']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -67,40 +70,39 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['details', 'follow', 'stdout', 'stderr', 'since', 'timestamps', 'tail']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['details' => false, 'follow' => false, 'stdout' => false, 'stderr' => false, 'since' => 0, 'timestamps' => false, 'tail' => 'all']); - $optionsResolver->setAllowedTypes('details', ['bool']); - $optionsResolver->setAllowedTypes('follow', ['bool']); - $optionsResolver->setAllowedTypes('stdout', ['bool']); - $optionsResolver->setAllowedTypes('stderr', ['bool']); - $optionsResolver->setAllowedTypes('since', ['int']); - $optionsResolver->setAllowedTypes('timestamps', ['bool']); - $optionsResolver->setAllowedTypes('tail', ['string']); + $optionsResolver->addAllowedTypes('details', ['bool']); + $optionsResolver->addAllowedTypes('follow', ['bool']); + $optionsResolver->addAllowedTypes('stdout', ['bool']); + $optionsResolver->addAllowedTypes('stderr', ['bool']); + $optionsResolver->addAllowedTypes('since', ['int']); + $optionsResolver->addAllowedTypes('timestamps', ['bool']); + $optionsResolver->addAllowedTypes('tail', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\TaskLogsNotFoundException - * @throws \Docker\API\Exception\TaskLogsInternalServerErrorException - * @throws \Docker\API\Exception\TaskLogsServiceUnavailableException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (101 === $status) { - return json_decode($body); - } + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { - return json_decode($body); } - if (404 === $status) { - throw new \Docker\API\Exception\TaskLogsNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\TaskLogsNotFoundException($response); } if (500 === $status) { - throw new \Docker\API\Exception\TaskLogsInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } if (503 === $status) { - throw new \Docker\API\Exception\TaskLogsServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/VolumeCreate.php b/src/Endpoint/VolumeCreate.php index 14d409a8..c7131688 100644 --- a/src/Endpoint/VolumeCreate.php +++ b/src/Endpoint/VolumeCreate.php @@ -2,26 +2,17 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class VolumeCreate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class VolumeCreate extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { - /** - * @param \Docker\API\Model\VolumesCreatePostBody $volumeConfig Volume configuration - */ - public function __construct(\Docker\API\Model\VolumesCreatePostBody $volumeConfig) + use \Docker\API\Runtime\Client\EndpointTrait; + + public function __construct(?\Docker\API\Model\VolumeCreateOptions $requestBody = null) { - $this->body = $volumeConfig; + $this->body = $requestBody; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -32,9 +23,13 @@ public function getUri(): string return '/volumes/create'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return $this->getSerializedBody($serializer); + if ($this->body instanceof \Docker\API\Model\VolumeCreateOptions) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + + return [[], null]; } public function getExtraHeaders(): array @@ -43,19 +38,24 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\VolumeCreateInternalServerErrorException * - * @return null|\Docker\API\Model\Volume + * @return \Docker\API\Model\Volume|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (201 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Volume', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Volume', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\VolumeCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\VolumeCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/VolumeDelete.php b/src/Endpoint/VolumeDelete.php index 447268e9..a24e78e0 100644 --- a/src/Endpoint/VolumeDelete.php +++ b/src/Endpoint/VolumeDelete.php @@ -2,17 +2,13 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class VolumeDelete extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class VolumeDelete extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $name; + protected $accept; /** * Instruct the driver to remove the volume. @@ -20,17 +16,18 @@ class VolumeDelete extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \ * @param string $name Volume name or ID * @param array $queryParameters { * - * @var bool $force Force the removal of the volume - * } + * @var bool $force Force the removal of the volume + * } + * + * @param array $accept Accept content header application/json|text/plain */ - public function __construct(string $name, array $queryParameters = []) + public function __construct(string $name, array $queryParameters = [], array $accept = []) { $this->name = $name; $this->queryParameters = $queryParameters; + $this->accept = $accept; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'DELETE'; @@ -41,14 +38,18 @@ public function getUri(): string return str_replace(['{name}'], [$this->name], '/volumes/{name}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } public function getExtraHeaders(): array { - return ['Accept' => ['application/json']]; + if (empty($this->accept)) { + return ['Accept' => ['application/json', 'text/plain']]; + } + + return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver @@ -57,31 +58,37 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['force']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults(['force' => false]); - $optionsResolver->setAllowedTypes('force', ['bool']); + $optionsResolver->addAllowedTypes('force', ['bool']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\VolumeDeleteNotFoundException * @throws \Docker\API\Exception\VolumeDeleteConflictException * @throws \Docker\API\Exception\VolumeDeleteInternalServerErrorException + * + * @return null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (204 === $status) { - return null; } - if (404 === $status) { - throw new \Docker\API\Exception\VolumeDeleteNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\VolumeDeleteNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (409 === $status) { - throw new \Docker\API\Exception\VolumeDeleteConflictException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (409 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\VolumeDeleteConflictException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\VolumeDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\VolumeDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/VolumeInspect.php b/src/Endpoint/VolumeInspect.php index 2e5decb4..c8b02b18 100644 --- a/src/Endpoint/VolumeInspect.php +++ b/src/Endpoint/VolumeInspect.php @@ -2,16 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class VolumeInspect extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class VolumeInspect extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; protected $name; /** @@ -22,8 +17,6 @@ public function __construct(string $name) $this->name = $name; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -34,7 +27,7 @@ public function getUri(): string return str_replace(['{name}'], [$this->name], '/volumes/{name}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -45,23 +38,28 @@ public function getExtraHeaders(): array } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\VolumeInspectNotFoundException * @throws \Docker\API\Exception\VolumeInspectInternalServerErrorException * - * @return null|\Docker\API\Model\Volume + * @return \Docker\API\Model\Volume|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\Volume', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\Volume', 'json'); } - if (404 === $status) { - throw new \Docker\API\Exception\VolumeInspectNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\VolumeInspectNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } - if (500 === $status) { - throw new \Docker\API\Exception\VolumeInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\VolumeInspectInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/VolumeList.php b/src/Endpoint/VolumeList.php index de7b3e87..5a644ae9 100644 --- a/src/Endpoint/VolumeList.php +++ b/src/Endpoint/VolumeList.php @@ -2,31 +2,27 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class VolumeList extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class VolumeList extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** * @param array $queryParameters { * - * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to - process on the volumes list. Available filters: - - - `dangling=` When set to `true` (or `1`), returns all - volumes that are not in use by a container. When set to `false` - (or `0`), only volumes that are in use by one or more - containers are returned. - - `driver=` Matches volumes based on their driver. - - `label=` or `label=:` Matches volumes based on - the presence of a `label` alone or a `label` and a value. - - `name=` Matches all or part of a volume name. - + * @var string $filters JSON encoded value of the filters (a `map[string][]string`) to + * process on the volumes list. Available filters: + * + * - `dangling=` When set to `true` (or `1`), returns all + * volumes that are not in use by a container. When set to `false` + * (or `0`), only volumes that are in use by one or more + * containers are returned. + * - `driver=` Matches volumes based on their driver. + * - `label=` or `label=:` Matches volumes based on + * the presence of a `label` alone or a `label` and a value. + * - `name=` Matches all or part of a volume name. + * * } */ public function __construct(array $queryParameters = []) @@ -34,8 +30,6 @@ public function __construct(array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'GET'; @@ -46,7 +40,7 @@ public function getUri(): string return '/volumes'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -62,25 +56,30 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['filters']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('filters', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\VolumeListInternalServerErrorException * - * @return null|\Docker\API\Model\VolumesGetResponse200 + * @return \Docker\API\Model\VolumeListResponse|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\VolumesGetResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\VolumeListResponse', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\VolumeListInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\VolumeListInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/VolumePrune.php b/src/Endpoint/VolumePrune.php index f885f71a..864dd98c 100644 --- a/src/Endpoint/VolumePrune.php +++ b/src/Endpoint/VolumePrune.php @@ -2,24 +2,21 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Endpoint; -class VolumePrune extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\AmpArtaxEndpoint, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint +class VolumePrune extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint { + use \Docker\API\Runtime\Client\EndpointTrait; + /** * @param array $queryParameters { * - * @var string $filters filters to process on the prune list, encoded as JSON (a `map[string][]string`) - - Available filters: - - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels. - + * @var string $filters Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + * + * Available filters: + * - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels. + * - `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes. + * * } */ public function __construct(array $queryParameters = []) @@ -27,8 +24,6 @@ public function __construct(array $queryParameters = []) $this->queryParameters = $queryParameters; } - use \Jane\OpenApiRuntime\Client\AmpArtaxEndpointTrait, \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; - public function getMethod(): string { return 'POST'; @@ -39,7 +34,7 @@ public function getUri(): string return '/volumes/prune'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null): array + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { return [[], null]; } @@ -55,25 +50,30 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['filters']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('filters', ['string']); + $optionsResolver->addAllowedTypes('filters', ['string']); return $optionsResolver; } /** - * {@inheritdoc} - * * @throws \Docker\API\Exception\VolumePruneInternalServerErrorException * - * @return null|\Docker\API\Model\VolumesPrunePostResponse200 + * @return \Docker\API\Model\VolumesPrunePostResponse200|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { - if (200 === $status) { - return $serializer->deserialize($body, 'Docker\\API\\Model\\VolumesPrunePostResponse200', 'json'); + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { + return $serializer->deserialize($body, 'Docker\API\Model\VolumesPrunePostResponse200', 'json'); } - if (500 === $status) { - throw new \Docker\API\Exception\VolumePruneInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\VolumePruneInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); } } + + public function getAuthenticationScopes(): array + { + return []; + } } diff --git a/src/Endpoint/VolumeUpdate.php b/src/Endpoint/VolumeUpdate.php new file mode 100644 index 00000000..5a437715 --- /dev/null +++ b/src/Endpoint/VolumeUpdate.php @@ -0,0 +1,96 @@ +name = $name; + $this->body = $requestBody; + $this->queryParameters = $queryParameters; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function getUri(): string + { + return str_replace(['{name}'], [$this->name], '/volumes/{name}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + if ($this->body instanceof \Docker\API\Model\VolumesNamePutBody) { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } + + return [[], null]; + } + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['version']); + $optionsResolver->setRequired(['version']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('version', ['int']); + + return $optionsResolver; + } + + /** + * @throws \Docker\API\Exception\VolumeUpdateBadRequestException + * @throws \Docker\API\Exception\VolumeUpdateNotFoundException + * @throws \Docker\API\Exception\VolumeUpdateInternalServerErrorException + * @throws \Docker\API\Exception\VolumeUpdateServiceUnavailableException + * + * @return null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + } + if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\VolumeUpdateBadRequestException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\VolumeUpdateNotFoundException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\VolumeUpdateInternalServerErrorException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) { + throw new \Docker\API\Exception\VolumeUpdateServiceUnavailableException($serializer->deserialize($body, 'Docker\API\Model\ErrorResponse', 'json'), $response); + } + } + + public function getAuthenticationScopes(): array + { + return []; + } +} diff --git a/src/Exception/ApiException.php b/src/Exception/ApiException.php index ea409aa8..f81cc495 100644 --- a/src/Exception/ApiException.php +++ b/src/Exception/ApiException.php @@ -2,12 +2,6 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; interface ApiException extends \Throwable diff --git a/src/Exception/BadRequestException.php b/src/Exception/BadRequestException.php new file mode 100644 index 00000000..3908c183 --- /dev/null +++ b/src/Exception/BadRequestException.php @@ -0,0 +1,13 @@ +errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ClientException.php b/src/Exception/ClientException.php index 3017d5b1..37ba24aa 100644 --- a/src/Exception/ClientException.php +++ b/src/Exception/ClientException.php @@ -2,12 +2,6 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; interface ClientException extends ApiException diff --git a/src/Exception/ConfigCreateConflictException.php b/src/Exception/ConfigCreateConflictException.php index 8740e98c..90041723 100644 --- a/src/Exception/ConfigCreateConflictException.php +++ b/src/Exception/ConfigCreateConflictException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ConfigCreateConflictException extends \RuntimeException implements ClientException +class ConfigCreateConflictException extends ConflictException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('name conflicts with an existing object', 409); + parent::__construct('name conflicts with an existing object'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ConfigCreateInternalServerErrorException.php b/src/Exception/ConfigCreateInternalServerErrorException.php index ac2b4ab0..b8b0ff26 100644 --- a/src/Exception/ConfigCreateInternalServerErrorException.php +++ b/src/Exception/ConfigCreateInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ConfigCreateInternalServerErrorException extends \RuntimeException implements ServerException +class ConfigCreateInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ConfigCreateServiceUnavailableException.php b/src/Exception/ConfigCreateServiceUnavailableException.php index d5c7a313..b0571c82 100644 --- a/src/Exception/ConfigCreateServiceUnavailableException.php +++ b/src/Exception/ConfigCreateServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ConfigCreateServiceUnavailableException extends \RuntimeException implements ServerException +class ConfigCreateServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ConfigDeleteInternalServerErrorException.php b/src/Exception/ConfigDeleteInternalServerErrorException.php index abebc0a7..ecd7ceec 100644 --- a/src/Exception/ConfigDeleteInternalServerErrorException.php +++ b/src/Exception/ConfigDeleteInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ConfigDeleteInternalServerErrorException extends \RuntimeException implements ServerException +class ConfigDeleteInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ConfigDeleteNotFoundException.php b/src/Exception/ConfigDeleteNotFoundException.php index d24e6516..ceac4491 100644 --- a/src/Exception/ConfigDeleteNotFoundException.php +++ b/src/Exception/ConfigDeleteNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ConfigDeleteNotFoundException extends \RuntimeException implements ClientException +class ConfigDeleteNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('config not found', 404); + parent::__construct('config not found'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ConfigDeleteServiceUnavailableException.php b/src/Exception/ConfigDeleteServiceUnavailableException.php index 13c5a59e..d80c49b7 100644 --- a/src/Exception/ConfigDeleteServiceUnavailableException.php +++ b/src/Exception/ConfigDeleteServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ConfigDeleteServiceUnavailableException extends \RuntimeException implements ServerException +class ConfigDeleteServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ConfigInspectInternalServerErrorException.php b/src/Exception/ConfigInspectInternalServerErrorException.php index d3d29a10..2c6384e7 100644 --- a/src/Exception/ConfigInspectInternalServerErrorException.php +++ b/src/Exception/ConfigInspectInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ConfigInspectInternalServerErrorException extends \RuntimeException implements ServerException +class ConfigInspectInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ConfigInspectNotFoundException.php b/src/Exception/ConfigInspectNotFoundException.php index 39c59bf0..b7c8bab7 100644 --- a/src/Exception/ConfigInspectNotFoundException.php +++ b/src/Exception/ConfigInspectNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ConfigInspectNotFoundException extends \RuntimeException implements ClientException +class ConfigInspectNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('config not found', 404); + parent::__construct('config not found'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ConfigInspectServiceUnavailableException.php b/src/Exception/ConfigInspectServiceUnavailableException.php index 9e6e3a26..5903584a 100644 --- a/src/Exception/ConfigInspectServiceUnavailableException.php +++ b/src/Exception/ConfigInspectServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ConfigInspectServiceUnavailableException extends \RuntimeException implements ServerException +class ConfigInspectServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ConfigListInternalServerErrorException.php b/src/Exception/ConfigListInternalServerErrorException.php index 319d2144..497ef694 100644 --- a/src/Exception/ConfigListInternalServerErrorException.php +++ b/src/Exception/ConfigListInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ConfigListInternalServerErrorException extends \RuntimeException implements ServerException +class ConfigListInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ConfigListServiceUnavailableException.php b/src/Exception/ConfigListServiceUnavailableException.php index 8b0c9c45..5d4a0635 100644 --- a/src/Exception/ConfigListServiceUnavailableException.php +++ b/src/Exception/ConfigListServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ConfigListServiceUnavailableException extends \RuntimeException implements ServerException +class ConfigListServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ConfigUpdateBadRequestException.php b/src/Exception/ConfigUpdateBadRequestException.php index 6c742b65..0ecc24f6 100644 --- a/src/Exception/ConfigUpdateBadRequestException.php +++ b/src/Exception/ConfigUpdateBadRequestException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ConfigUpdateBadRequestException extends \RuntimeException implements ClientException +class ConfigUpdateBadRequestException extends BadRequestException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('bad parameter', 400); + parent::__construct('bad parameter'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ConfigUpdateInternalServerErrorException.php b/src/Exception/ConfigUpdateInternalServerErrorException.php index f6c1e460..92f68ac7 100644 --- a/src/Exception/ConfigUpdateInternalServerErrorException.php +++ b/src/Exception/ConfigUpdateInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ConfigUpdateInternalServerErrorException extends \RuntimeException implements ServerException +class ConfigUpdateInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ConfigUpdateNotFoundException.php b/src/Exception/ConfigUpdateNotFoundException.php index c931ce46..01105c80 100644 --- a/src/Exception/ConfigUpdateNotFoundException.php +++ b/src/Exception/ConfigUpdateNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ConfigUpdateNotFoundException extends \RuntimeException implements ClientException +class ConfigUpdateNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such config', 404); + parent::__construct('no such config'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ConfigUpdateServiceUnavailableException.php b/src/Exception/ConfigUpdateServiceUnavailableException.php index e77c4856..a796d0c7 100644 --- a/src/Exception/ConfigUpdateServiceUnavailableException.php +++ b/src/Exception/ConfigUpdateServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ConfigUpdateServiceUnavailableException extends \RuntimeException implements ServerException +class ConfigUpdateServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ConflictException.php b/src/Exception/ConflictException.php new file mode 100644 index 00000000..0cd63b82 --- /dev/null +++ b/src/Exception/ConflictException.php @@ -0,0 +1,13 @@ +containersIdArchiveGetResponse400 = $containersIdArchiveGetResponse400; - } - - public function getContainersIdArchiveGetResponse400() - { - return $this->containersIdArchiveGetResponse400; - } -} diff --git a/src/Exception/ContainerArchiveInfoBadRequestException.php b/src/Exception/ContainerArchiveInfoBadRequestException.php index 1d0c44ee..8a76d18f 100644 --- a/src/Exception/ContainerArchiveInfoBadRequestException.php +++ b/src/Exception/ContainerArchiveInfoBadRequestException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerArchiveInfoBadRequestException extends \RuntimeException implements ClientException +class ContainerArchiveInfoBadRequestException extends BadRequestException { - private $containersIdArchiveHeadResponse400; + /** + * @var \Docker\API\Model\ErrorResponse + */ + private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; + + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) + { + parent::__construct('Bad parameter'); + $this->errorResponse = $errorResponse; + $this->response = $response; + } - public function __construct(\Docker\API\Model\ContainersIdArchiveHeadResponse400 $containersIdArchiveHeadResponse400) + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { - parent::__construct('Bad parameter', 400); - $this->containersIdArchiveHeadResponse400 = $containersIdArchiveHeadResponse400; + return $this->errorResponse; } - public function getContainersIdArchiveHeadResponse400() + public function getResponse(): \Psr\Http\Message\ResponseInterface { - return $this->containersIdArchiveHeadResponse400; + return $this->response; } } diff --git a/src/Exception/ContainerArchiveInfoInternalServerErrorException.php b/src/Exception/ContainerArchiveInfoInternalServerErrorException.php index a5c20a7f..a5598142 100644 --- a/src/Exception/ContainerArchiveInfoInternalServerErrorException.php +++ b/src/Exception/ContainerArchiveInfoInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerArchiveInfoInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerArchiveInfoInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerArchiveInfoNotFoundException.php b/src/Exception/ContainerArchiveInfoNotFoundException.php index a7af81c8..24b0bfb5 100644 --- a/src/Exception/ContainerArchiveInfoNotFoundException.php +++ b/src/Exception/ContainerArchiveInfoNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerArchiveInfoNotFoundException extends \RuntimeException implements ClientException +class ContainerArchiveInfoNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Container or path does not exist', 404); + parent::__construct('Container or path does not exist'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerArchiveInternalServerErrorException.php b/src/Exception/ContainerArchiveInternalServerErrorException.php deleted file mode 100644 index 0d479cc4..00000000 --- a/src/Exception/ContainerArchiveInternalServerErrorException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/ContainerArchiveNotFoundException.php b/src/Exception/ContainerArchiveNotFoundException.php index 2392dc29..13a11365 100644 --- a/src/Exception/ContainerArchiveNotFoundException.php +++ b/src/Exception/ContainerArchiveNotFoundException.php @@ -2,26 +2,23 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerArchiveNotFoundException extends \RuntimeException implements ClientException +class ContainerArchiveNotFoundException extends NotFoundException { - private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(?\Psr\Http\Message\ResponseInterface $response = null) { - parent::__construct('Container or path does not exist', 404); - $this->errorResponse = $errorResponse; + parent::__construct('Container or path does not exist'); + $this->response = $response; } - public function getErrorResponse() + public function getResponse(): ?\Psr\Http\Message\ResponseInterface { - return $this->errorResponse; + return $this->response; } } diff --git a/src/Exception/ContainerAttachBadRequestException.php b/src/Exception/ContainerAttachBadRequestException.php deleted file mode 100644 index 9fcc5689..00000000 --- a/src/Exception/ContainerAttachBadRequestException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/ContainerAttachInternalServerErrorException.php b/src/Exception/ContainerAttachInternalServerErrorException.php deleted file mode 100644 index ad69be16..00000000 --- a/src/Exception/ContainerAttachInternalServerErrorException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/ContainerAttachNotFoundException.php b/src/Exception/ContainerAttachNotFoundException.php index b6a1ea5e..22cd6816 100644 --- a/src/Exception/ContainerAttachNotFoundException.php +++ b/src/Exception/ContainerAttachNotFoundException.php @@ -2,26 +2,23 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerAttachNotFoundException extends \RuntimeException implements ClientException +class ContainerAttachNotFoundException extends NotFoundException { - private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(?\Psr\Http\Message\ResponseInterface $response = null) { - parent::__construct('no such container', 404); - $this->errorResponse = $errorResponse; + parent::__construct('no such container'); + $this->response = $response; } - public function getErrorResponse() + public function getResponse(): ?\Psr\Http\Message\ResponseInterface { - return $this->errorResponse; + return $this->response; } } diff --git a/src/Exception/ContainerAttachWebsocketBadRequestException.php b/src/Exception/ContainerAttachWebsocketBadRequestException.php index c342efe6..1302675f 100644 --- a/src/Exception/ContainerAttachWebsocketBadRequestException.php +++ b/src/Exception/ContainerAttachWebsocketBadRequestException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerAttachWebsocketBadRequestException extends \RuntimeException implements ClientException +class ContainerAttachWebsocketBadRequestException extends BadRequestException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('bad parameter', 400); + parent::__construct('bad parameter'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerAttachWebsocketInternalServerErrorException.php b/src/Exception/ContainerAttachWebsocketInternalServerErrorException.php index 841b4007..51274ff3 100644 --- a/src/Exception/ContainerAttachWebsocketInternalServerErrorException.php +++ b/src/Exception/ContainerAttachWebsocketInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerAttachWebsocketInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerAttachWebsocketInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerAttachWebsocketNotFoundException.php b/src/Exception/ContainerAttachWebsocketNotFoundException.php index dad1d11b..22ad842f 100644 --- a/src/Exception/ContainerAttachWebsocketNotFoundException.php +++ b/src/Exception/ContainerAttachWebsocketNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerAttachWebsocketNotFoundException extends \RuntimeException implements ClientException +class ContainerAttachWebsocketNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerChangesInternalServerErrorException.php b/src/Exception/ContainerChangesInternalServerErrorException.php index 0e4400ab..2851e1c4 100644 --- a/src/Exception/ContainerChangesInternalServerErrorException.php +++ b/src/Exception/ContainerChangesInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerChangesInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerChangesInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerChangesNotFoundException.php b/src/Exception/ContainerChangesNotFoundException.php index 5679e24a..2f973dd3 100644 --- a/src/Exception/ContainerChangesNotFoundException.php +++ b/src/Exception/ContainerChangesNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerChangesNotFoundException extends \RuntimeException implements ClientException +class ContainerChangesNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerCreateBadRequestException.php b/src/Exception/ContainerCreateBadRequestException.php index ace2b69b..2461c7d5 100644 --- a/src/Exception/ContainerCreateBadRequestException.php +++ b/src/Exception/ContainerCreateBadRequestException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerCreateBadRequestException extends \RuntimeException implements ClientException +class ContainerCreateBadRequestException extends BadRequestException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('bad parameter', 400); + parent::__construct('bad parameter'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerCreateConflictException.php b/src/Exception/ContainerCreateConflictException.php index 1ddc23b7..df93c5f0 100644 --- a/src/Exception/ContainerCreateConflictException.php +++ b/src/Exception/ContainerCreateConflictException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerCreateConflictException extends \RuntimeException implements ClientException +class ContainerCreateConflictException extends ConflictException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('conflict', 409); + parent::__construct('conflict'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerCreateInternalServerErrorException.php b/src/Exception/ContainerCreateInternalServerErrorException.php index 1b064c9a..18624c54 100644 --- a/src/Exception/ContainerCreateInternalServerErrorException.php +++ b/src/Exception/ContainerCreateInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerCreateInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerCreateInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerCreateNotFoundException.php b/src/Exception/ContainerCreateNotFoundException.php index a2fbafd8..eb4aff58 100644 --- a/src/Exception/ContainerCreateNotFoundException.php +++ b/src/Exception/ContainerCreateNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerCreateNotFoundException extends \RuntimeException implements ClientException +class ContainerCreateNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such image'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerDeleteBadRequestException.php b/src/Exception/ContainerDeleteBadRequestException.php index 0438ebc6..895a61c1 100644 --- a/src/Exception/ContainerDeleteBadRequestException.php +++ b/src/Exception/ContainerDeleteBadRequestException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerDeleteBadRequestException extends \RuntimeException implements ClientException +class ContainerDeleteBadRequestException extends BadRequestException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('bad parameter', 400); + parent::__construct('bad parameter'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerDeleteConflictException.php b/src/Exception/ContainerDeleteConflictException.php index 5f7578ed..87425031 100644 --- a/src/Exception/ContainerDeleteConflictException.php +++ b/src/Exception/ContainerDeleteConflictException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerDeleteConflictException extends \RuntimeException implements ClientException +class ContainerDeleteConflictException extends ConflictException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('conflict', 409); + parent::__construct('conflict'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerDeleteInternalServerErrorException.php b/src/Exception/ContainerDeleteInternalServerErrorException.php index 334ec94f..be965f67 100644 --- a/src/Exception/ContainerDeleteInternalServerErrorException.php +++ b/src/Exception/ContainerDeleteInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerDeleteInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerDeleteInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerDeleteNotFoundException.php b/src/Exception/ContainerDeleteNotFoundException.php index 323f3591..b9fbd929 100644 --- a/src/Exception/ContainerDeleteNotFoundException.php +++ b/src/Exception/ContainerDeleteNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerDeleteNotFoundException extends \RuntimeException implements ClientException +class ContainerDeleteNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerExecConflictException.php b/src/Exception/ContainerExecConflictException.php index 026db850..89eaafef 100644 --- a/src/Exception/ContainerExecConflictException.php +++ b/src/Exception/ContainerExecConflictException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerExecConflictException extends \RuntimeException implements ClientException +class ContainerExecConflictException extends ConflictException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('container is paused', 409); + parent::__construct('container is paused'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerExecInternalServerErrorException.php b/src/Exception/ContainerExecInternalServerErrorException.php index 0354f3c5..0aab4e68 100644 --- a/src/Exception/ContainerExecInternalServerErrorException.php +++ b/src/Exception/ContainerExecInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerExecInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerExecInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerExecNotFoundException.php b/src/Exception/ContainerExecNotFoundException.php index 9055de1f..e8f7d7dc 100644 --- a/src/Exception/ContainerExecNotFoundException.php +++ b/src/Exception/ContainerExecNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerExecNotFoundException extends \RuntimeException implements ClientException +class ContainerExecNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerExportInternalServerErrorException.php b/src/Exception/ContainerExportInternalServerErrorException.php deleted file mode 100644 index ebbccd56..00000000 --- a/src/Exception/ContainerExportInternalServerErrorException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/ContainerExportNotFoundException.php b/src/Exception/ContainerExportNotFoundException.php index 096d443c..4f128b8a 100644 --- a/src/Exception/ContainerExportNotFoundException.php +++ b/src/Exception/ContainerExportNotFoundException.php @@ -2,26 +2,23 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerExportNotFoundException extends \RuntimeException implements ClientException +class ContainerExportNotFoundException extends NotFoundException { - private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(?\Psr\Http\Message\ResponseInterface $response = null) { - parent::__construct('no such container', 404); - $this->errorResponse = $errorResponse; + parent::__construct('no such container'); + $this->response = $response; } - public function getErrorResponse() + public function getResponse(): ?\Psr\Http\Message\ResponseInterface { - return $this->errorResponse; + return $this->response; } } diff --git a/src/Exception/ContainerInspectInternalServerErrorException.php b/src/Exception/ContainerInspectInternalServerErrorException.php index 893f5f4d..6563e651 100644 --- a/src/Exception/ContainerInspectInternalServerErrorException.php +++ b/src/Exception/ContainerInspectInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerInspectInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerInspectInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerInspectNotFoundException.php b/src/Exception/ContainerInspectNotFoundException.php index 22e3ef10..4d0dcc35 100644 --- a/src/Exception/ContainerInspectNotFoundException.php +++ b/src/Exception/ContainerInspectNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerInspectNotFoundException extends \RuntimeException implements ClientException +class ContainerInspectNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerKillConflictException.php b/src/Exception/ContainerKillConflictException.php new file mode 100644 index 00000000..24cc80cf --- /dev/null +++ b/src/Exception/ContainerKillConflictException.php @@ -0,0 +1,34 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} diff --git a/src/Exception/ContainerKillInternalServerErrorException.php b/src/Exception/ContainerKillInternalServerErrorException.php index a1111060..910fb3ed 100644 --- a/src/Exception/ContainerKillInternalServerErrorException.php +++ b/src/Exception/ContainerKillInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerKillInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerKillInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerKillNotFoundException.php b/src/Exception/ContainerKillNotFoundException.php index 3bd06151..b18cac70 100644 --- a/src/Exception/ContainerKillNotFoundException.php +++ b/src/Exception/ContainerKillNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerKillNotFoundException extends \RuntimeException implements ClientException +class ContainerKillNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerListBadRequestException.php b/src/Exception/ContainerListBadRequestException.php index e189a259..9fdd6c72 100644 --- a/src/Exception/ContainerListBadRequestException.php +++ b/src/Exception/ContainerListBadRequestException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerListBadRequestException extends \RuntimeException implements ClientException +class ContainerListBadRequestException extends BadRequestException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('bad parameter', 400); + parent::__construct('bad parameter'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerListInternalServerErrorException.php b/src/Exception/ContainerListInternalServerErrorException.php index f255417e..c43049bb 100644 --- a/src/Exception/ContainerListInternalServerErrorException.php +++ b/src/Exception/ContainerListInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerListInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerListInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerLogsInternalServerErrorException.php b/src/Exception/ContainerLogsInternalServerErrorException.php deleted file mode 100644 index 846aae6b..00000000 --- a/src/Exception/ContainerLogsInternalServerErrorException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/ContainerLogsNotFoundException.php b/src/Exception/ContainerLogsNotFoundException.php index fe467647..a9e5bfcf 100644 --- a/src/Exception/ContainerLogsNotFoundException.php +++ b/src/Exception/ContainerLogsNotFoundException.php @@ -2,26 +2,23 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerLogsNotFoundException extends \RuntimeException implements ClientException +class ContainerLogsNotFoundException extends NotFoundException { - private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(?\Psr\Http\Message\ResponseInterface $response = null) { - parent::__construct('no such container', 404); - $this->errorResponse = $errorResponse; + parent::__construct('no such container'); + $this->response = $response; } - public function getErrorResponse() + public function getResponse(): ?\Psr\Http\Message\ResponseInterface { - return $this->errorResponse; + return $this->response; } } diff --git a/src/Exception/ContainerPauseInternalServerErrorException.php b/src/Exception/ContainerPauseInternalServerErrorException.php index 90c2b85f..b2e654a3 100644 --- a/src/Exception/ContainerPauseInternalServerErrorException.php +++ b/src/Exception/ContainerPauseInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerPauseInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerPauseInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerPauseNotFoundException.php b/src/Exception/ContainerPauseNotFoundException.php index 108e9257..f2d18120 100644 --- a/src/Exception/ContainerPauseNotFoundException.php +++ b/src/Exception/ContainerPauseNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerPauseNotFoundException extends \RuntimeException implements ClientException +class ContainerPauseNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerPruneInternalServerErrorException.php b/src/Exception/ContainerPruneInternalServerErrorException.php index 7691c98c..3c7d89fa 100644 --- a/src/Exception/ContainerPruneInternalServerErrorException.php +++ b/src/Exception/ContainerPruneInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerPruneInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerPruneInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerRenameConflictException.php b/src/Exception/ContainerRenameConflictException.php index d464b525..a77e4758 100644 --- a/src/Exception/ContainerRenameConflictException.php +++ b/src/Exception/ContainerRenameConflictException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerRenameConflictException extends \RuntimeException implements ClientException +class ContainerRenameConflictException extends ConflictException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('name already in use', 409); + parent::__construct('name already in use'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerRenameInternalServerErrorException.php b/src/Exception/ContainerRenameInternalServerErrorException.php index 10ffd9f3..f8655bb6 100644 --- a/src/Exception/ContainerRenameInternalServerErrorException.php +++ b/src/Exception/ContainerRenameInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerRenameInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerRenameInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerRenameNotFoundException.php b/src/Exception/ContainerRenameNotFoundException.php index 83165e99..f59a909e 100644 --- a/src/Exception/ContainerRenameNotFoundException.php +++ b/src/Exception/ContainerRenameNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerRenameNotFoundException extends \RuntimeException implements ClientException +class ContainerRenameNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerResizeInternalServerErrorException.php b/src/Exception/ContainerResizeInternalServerErrorException.php deleted file mode 100644 index 7fb31823..00000000 --- a/src/Exception/ContainerResizeInternalServerErrorException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/ContainerResizeNotFoundException.php b/src/Exception/ContainerResizeNotFoundException.php index 0c33f3c1..976c23cf 100644 --- a/src/Exception/ContainerResizeNotFoundException.php +++ b/src/Exception/ContainerResizeNotFoundException.php @@ -2,26 +2,23 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerResizeNotFoundException extends \RuntimeException implements ClientException +class ContainerResizeNotFoundException extends NotFoundException { - private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(?\Psr\Http\Message\ResponseInterface $response = null) { - parent::__construct('no such container', 404); - $this->errorResponse = $errorResponse; + parent::__construct('no such container'); + $this->response = $response; } - public function getErrorResponse() + public function getResponse(): ?\Psr\Http\Message\ResponseInterface { - return $this->errorResponse; + return $this->response; } } diff --git a/src/Exception/ContainerRestartInternalServerErrorException.php b/src/Exception/ContainerRestartInternalServerErrorException.php index 8d75e61e..336fd2cb 100644 --- a/src/Exception/ContainerRestartInternalServerErrorException.php +++ b/src/Exception/ContainerRestartInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerRestartInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerRestartInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerRestartNotFoundException.php b/src/Exception/ContainerRestartNotFoundException.php index ec90d095..ad4a9590 100644 --- a/src/Exception/ContainerRestartNotFoundException.php +++ b/src/Exception/ContainerRestartNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerRestartNotFoundException extends \RuntimeException implements ClientException +class ContainerRestartNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerStartInternalServerErrorException.php b/src/Exception/ContainerStartInternalServerErrorException.php index 2cfbda9d..8b756f85 100644 --- a/src/Exception/ContainerStartInternalServerErrorException.php +++ b/src/Exception/ContainerStartInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerStartInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerStartInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerStartNotFoundException.php b/src/Exception/ContainerStartNotFoundException.php index 6d2f5d59..48f5ee28 100644 --- a/src/Exception/ContainerStartNotFoundException.php +++ b/src/Exception/ContainerStartNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerStartNotFoundException extends \RuntimeException implements ClientException +class ContainerStartNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerStatsInternalServerErrorException.php b/src/Exception/ContainerStatsInternalServerErrorException.php index 18df6565..250f84a3 100644 --- a/src/Exception/ContainerStatsInternalServerErrorException.php +++ b/src/Exception/ContainerStatsInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerStatsInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerStatsInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerStatsNotFoundException.php b/src/Exception/ContainerStatsNotFoundException.php index 4de7cd1f..7466ee23 100644 --- a/src/Exception/ContainerStatsNotFoundException.php +++ b/src/Exception/ContainerStatsNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerStatsNotFoundException extends \RuntimeException implements ClientException +class ContainerStatsNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerStopInternalServerErrorException.php b/src/Exception/ContainerStopInternalServerErrorException.php index 83d821fb..e2aca002 100644 --- a/src/Exception/ContainerStopInternalServerErrorException.php +++ b/src/Exception/ContainerStopInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerStopInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerStopInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerStopNotFoundException.php b/src/Exception/ContainerStopNotFoundException.php index 91644695..3c5bbe4e 100644 --- a/src/Exception/ContainerStopNotFoundException.php +++ b/src/Exception/ContainerStopNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerStopNotFoundException extends \RuntimeException implements ClientException +class ContainerStopNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerTopInternalServerErrorException.php b/src/Exception/ContainerTopInternalServerErrorException.php index 67143d1a..f0e5b071 100644 --- a/src/Exception/ContainerTopInternalServerErrorException.php +++ b/src/Exception/ContainerTopInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerTopInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerTopInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerTopNotFoundException.php b/src/Exception/ContainerTopNotFoundException.php index d0897e38..157145cf 100644 --- a/src/Exception/ContainerTopNotFoundException.php +++ b/src/Exception/ContainerTopNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerTopNotFoundException extends \RuntimeException implements ClientException +class ContainerTopNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerUnpauseInternalServerErrorException.php b/src/Exception/ContainerUnpauseInternalServerErrorException.php index c7ec4ff5..51f7b274 100644 --- a/src/Exception/ContainerUnpauseInternalServerErrorException.php +++ b/src/Exception/ContainerUnpauseInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerUnpauseInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerUnpauseInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerUnpauseNotFoundException.php b/src/Exception/ContainerUnpauseNotFoundException.php index a1c3a36b..ea8d5466 100644 --- a/src/Exception/ContainerUnpauseNotFoundException.php +++ b/src/Exception/ContainerUnpauseNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerUnpauseNotFoundException extends \RuntimeException implements ClientException +class ContainerUnpauseNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerUpdateInternalServerErrorException.php b/src/Exception/ContainerUpdateInternalServerErrorException.php index e3e670a0..2d762803 100644 --- a/src/Exception/ContainerUpdateInternalServerErrorException.php +++ b/src/Exception/ContainerUpdateInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerUpdateInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerUpdateInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerUpdateNotFoundException.php b/src/Exception/ContainerUpdateNotFoundException.php index 919fc5f8..2eeba767 100644 --- a/src/Exception/ContainerUpdateNotFoundException.php +++ b/src/Exception/ContainerUpdateNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerUpdateNotFoundException extends \RuntimeException implements ClientException +class ContainerUpdateNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerWaitBadRequestException.php b/src/Exception/ContainerWaitBadRequestException.php new file mode 100644 index 00000000..a986e90c --- /dev/null +++ b/src/Exception/ContainerWaitBadRequestException.php @@ -0,0 +1,34 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} diff --git a/src/Exception/ContainerWaitInternalServerErrorException.php b/src/Exception/ContainerWaitInternalServerErrorException.php index 2c7c6126..64db3fa4 100644 --- a/src/Exception/ContainerWaitInternalServerErrorException.php +++ b/src/Exception/ContainerWaitInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerWaitInternalServerErrorException extends \RuntimeException implements ServerException +class ContainerWaitInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ContainerWaitNotFoundException.php b/src/Exception/ContainerWaitNotFoundException.php index 5345bb94..d4e2853c 100644 --- a/src/Exception/ContainerWaitNotFoundException.php +++ b/src/Exception/ContainerWaitNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ContainerWaitNotFoundException extends \RuntimeException implements ClientException +class ContainerWaitNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/DistributionInspectInternalServerErrorException.php b/src/Exception/DistributionInspectInternalServerErrorException.php index 9983e8d8..f395da0d 100644 --- a/src/Exception/DistributionInspectInternalServerErrorException.php +++ b/src/Exception/DistributionInspectInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class DistributionInspectInternalServerErrorException extends \RuntimeException implements ServerException +class DistributionInspectInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/DistributionInspectUnauthorizedException.php b/src/Exception/DistributionInspectUnauthorizedException.php index a466a58a..328db46e 100644 --- a/src/Exception/DistributionInspectUnauthorizedException.php +++ b/src/Exception/DistributionInspectUnauthorizedException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class DistributionInspectUnauthorizedException extends \RuntimeException implements ClientException +class DistributionInspectUnauthorizedException extends UnauthorizedException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Failed authentication or no image found', 401); + parent::__construct('Failed authentication or no image found'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ExecInspectInternalServerErrorException.php b/src/Exception/ExecInspectInternalServerErrorException.php index 41f9cdc0..9e4bc326 100644 --- a/src/Exception/ExecInspectInternalServerErrorException.php +++ b/src/Exception/ExecInspectInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ExecInspectInternalServerErrorException extends \RuntimeException implements ServerException +class ExecInspectInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ExecInspectNotFoundException.php b/src/Exception/ExecInspectNotFoundException.php index c871832a..dd7daeac 100644 --- a/src/Exception/ExecInspectNotFoundException.php +++ b/src/Exception/ExecInspectNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ExecInspectNotFoundException extends \RuntimeException implements ClientException +class ExecInspectNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('No such exec instance', 404); + parent::__construct('No such exec instance'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ExecResizeBadRequestException.php b/src/Exception/ExecResizeBadRequestException.php new file mode 100644 index 00000000..bc8818f2 --- /dev/null +++ b/src/Exception/ExecResizeBadRequestException.php @@ -0,0 +1,34 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} diff --git a/src/Exception/ExecResizeInternalServerErrorException.php b/src/Exception/ExecResizeInternalServerErrorException.php new file mode 100644 index 00000000..b9426d3e --- /dev/null +++ b/src/Exception/ExecResizeInternalServerErrorException.php @@ -0,0 +1,34 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} diff --git a/src/Exception/ExecResizeNotFoundException.php b/src/Exception/ExecResizeNotFoundException.php index 94068f7c..352d958a 100644 --- a/src/Exception/ExecResizeNotFoundException.php +++ b/src/Exception/ExecResizeNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ExecResizeNotFoundException extends \RuntimeException implements ClientException +class ExecResizeNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('No such exec instance', 404); + parent::__construct('No such exec instance'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ExecStartConflictException.php b/src/Exception/ExecStartConflictException.php deleted file mode 100644 index 139bcbdd..00000000 --- a/src/Exception/ExecStartConflictException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/ExecStartNotFoundException.php b/src/Exception/ExecStartNotFoundException.php deleted file mode 100644 index d6f211a6..00000000 --- a/src/Exception/ExecStartNotFoundException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/ForbiddenException.php b/src/Exception/ForbiddenException.php new file mode 100644 index 00000000..07dee618 --- /dev/null +++ b/src/Exception/ForbiddenException.php @@ -0,0 +1,13 @@ +errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageBuildBadRequestException.php b/src/Exception/ImageBuildBadRequestException.php index d5a4916e..6d076373 100644 --- a/src/Exception/ImageBuildBadRequestException.php +++ b/src/Exception/ImageBuildBadRequestException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageBuildBadRequestException extends \RuntimeException implements ClientException +class ImageBuildBadRequestException extends BadRequestException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Bad parameter', 400); + parent::__construct('Bad parameter'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageBuildInternalServerErrorException.php b/src/Exception/ImageBuildInternalServerErrorException.php index 32785c53..59f8bdce 100644 --- a/src/Exception/ImageBuildInternalServerErrorException.php +++ b/src/Exception/ImageBuildInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageBuildInternalServerErrorException extends \RuntimeException implements ServerException +class ImageBuildInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageCommitInternalServerErrorException.php b/src/Exception/ImageCommitInternalServerErrorException.php index df5dd02a..aeda8c8f 100644 --- a/src/Exception/ImageCommitInternalServerErrorException.php +++ b/src/Exception/ImageCommitInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageCommitInternalServerErrorException extends \RuntimeException implements ServerException +class ImageCommitInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageCommitNotFoundException.php b/src/Exception/ImageCommitNotFoundException.php index 99242695..b80bff3f 100644 --- a/src/Exception/ImageCommitNotFoundException.php +++ b/src/Exception/ImageCommitNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageCommitNotFoundException extends \RuntimeException implements ClientException +class ImageCommitNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such container', 404); + parent::__construct('no such container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageCreateInternalServerErrorException.php b/src/Exception/ImageCreateInternalServerErrorException.php index 32ff9e96..c657732f 100644 --- a/src/Exception/ImageCreateInternalServerErrorException.php +++ b/src/Exception/ImageCreateInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageCreateInternalServerErrorException extends \RuntimeException implements ServerException +class ImageCreateInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageCreateNotFoundException.php b/src/Exception/ImageCreateNotFoundException.php index ec26fae0..2e2429d9 100644 --- a/src/Exception/ImageCreateNotFoundException.php +++ b/src/Exception/ImageCreateNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageCreateNotFoundException extends \RuntimeException implements ClientException +class ImageCreateNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('repository does not exist or no read access', 404); + parent::__construct('repository does not exist or no read access'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageDeleteConflictException.php b/src/Exception/ImageDeleteConflictException.php index 3c97afd1..77f89816 100644 --- a/src/Exception/ImageDeleteConflictException.php +++ b/src/Exception/ImageDeleteConflictException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageDeleteConflictException extends \RuntimeException implements ClientException +class ImageDeleteConflictException extends ConflictException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Conflict', 409); + parent::__construct('Conflict'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageDeleteInternalServerErrorException.php b/src/Exception/ImageDeleteInternalServerErrorException.php index fdd4a230..df17fe10 100644 --- a/src/Exception/ImageDeleteInternalServerErrorException.php +++ b/src/Exception/ImageDeleteInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageDeleteInternalServerErrorException extends \RuntimeException implements ServerException +class ImageDeleteInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageDeleteNotFoundException.php b/src/Exception/ImageDeleteNotFoundException.php index a5191b77..2e401e85 100644 --- a/src/Exception/ImageDeleteNotFoundException.php +++ b/src/Exception/ImageDeleteNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageDeleteNotFoundException extends \RuntimeException implements ClientException +class ImageDeleteNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('No such image', 404); + parent::__construct('No such image'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageGetAllInternalServerErrorException.php b/src/Exception/ImageGetAllInternalServerErrorException.php deleted file mode 100644 index d0369d64..00000000 --- a/src/Exception/ImageGetAllInternalServerErrorException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/ImageGetInternalServerErrorException.php b/src/Exception/ImageGetInternalServerErrorException.php deleted file mode 100644 index c6b3e18e..00000000 --- a/src/Exception/ImageGetInternalServerErrorException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/ImageHistoryInternalServerErrorException.php b/src/Exception/ImageHistoryInternalServerErrorException.php index b91a1942..bfee684e 100644 --- a/src/Exception/ImageHistoryInternalServerErrorException.php +++ b/src/Exception/ImageHistoryInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageHistoryInternalServerErrorException extends \RuntimeException implements ServerException +class ImageHistoryInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageHistoryNotFoundException.php b/src/Exception/ImageHistoryNotFoundException.php index ccef36fe..47907878 100644 --- a/src/Exception/ImageHistoryNotFoundException.php +++ b/src/Exception/ImageHistoryNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageHistoryNotFoundException extends \RuntimeException implements ClientException +class ImageHistoryNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('No such image', 404); + parent::__construct('No such image'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageInspectInternalServerErrorException.php b/src/Exception/ImageInspectInternalServerErrorException.php index 64232e74..f06f1f6e 100644 --- a/src/Exception/ImageInspectInternalServerErrorException.php +++ b/src/Exception/ImageInspectInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageInspectInternalServerErrorException extends \RuntimeException implements ServerException +class ImageInspectInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageInspectNotFoundException.php b/src/Exception/ImageInspectNotFoundException.php index d97ae7b7..c1d6da00 100644 --- a/src/Exception/ImageInspectNotFoundException.php +++ b/src/Exception/ImageInspectNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageInspectNotFoundException extends \RuntimeException implements ClientException +class ImageInspectNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('No such image', 404); + parent::__construct('No such image'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageListInternalServerErrorException.php b/src/Exception/ImageListInternalServerErrorException.php index 2684780c..69f4c061 100644 --- a/src/Exception/ImageListInternalServerErrorException.php +++ b/src/Exception/ImageListInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageListInternalServerErrorException extends \RuntimeException implements ServerException +class ImageListInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageLoadInternalServerErrorException.php b/src/Exception/ImageLoadInternalServerErrorException.php index 9eadb976..8b216324 100644 --- a/src/Exception/ImageLoadInternalServerErrorException.php +++ b/src/Exception/ImageLoadInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageLoadInternalServerErrorException extends \RuntimeException implements ServerException +class ImageLoadInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImagePruneInternalServerErrorException.php b/src/Exception/ImagePruneInternalServerErrorException.php index f4572552..696f092a 100644 --- a/src/Exception/ImagePruneInternalServerErrorException.php +++ b/src/Exception/ImagePruneInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImagePruneInternalServerErrorException extends \RuntimeException implements ServerException +class ImagePruneInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImagePushInternalServerErrorException.php b/src/Exception/ImagePushInternalServerErrorException.php index adc44464..3fa34318 100644 --- a/src/Exception/ImagePushInternalServerErrorException.php +++ b/src/Exception/ImagePushInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImagePushInternalServerErrorException extends \RuntimeException implements ServerException +class ImagePushInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImagePushNotFoundException.php b/src/Exception/ImagePushNotFoundException.php index f8d4baf8..b2c78898 100644 --- a/src/Exception/ImagePushNotFoundException.php +++ b/src/Exception/ImagePushNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImagePushNotFoundException extends \RuntimeException implements ClientException +class ImagePushNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('No such image', 404); + parent::__construct('No such image'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageSearchInternalServerErrorException.php b/src/Exception/ImageSearchInternalServerErrorException.php index 83d7aac3..82c859d7 100644 --- a/src/Exception/ImageSearchInternalServerErrorException.php +++ b/src/Exception/ImageSearchInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageSearchInternalServerErrorException extends \RuntimeException implements ServerException +class ImageSearchInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageTagBadRequestException.php b/src/Exception/ImageTagBadRequestException.php index 1a67a368..c447bacc 100644 --- a/src/Exception/ImageTagBadRequestException.php +++ b/src/Exception/ImageTagBadRequestException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageTagBadRequestException extends \RuntimeException implements ClientException +class ImageTagBadRequestException extends BadRequestException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Bad parameter', 400); + parent::__construct('Bad parameter'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageTagConflictException.php b/src/Exception/ImageTagConflictException.php index 8ed29ed4..bc65db35 100644 --- a/src/Exception/ImageTagConflictException.php +++ b/src/Exception/ImageTagConflictException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageTagConflictException extends \RuntimeException implements ClientException +class ImageTagConflictException extends ConflictException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Conflict', 409); + parent::__construct('Conflict'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageTagInternalServerErrorException.php b/src/Exception/ImageTagInternalServerErrorException.php index fae6f38c..aee456a7 100644 --- a/src/Exception/ImageTagInternalServerErrorException.php +++ b/src/Exception/ImageTagInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageTagInternalServerErrorException extends \RuntimeException implements ServerException +class ImageTagInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ImageTagNotFoundException.php b/src/Exception/ImageTagNotFoundException.php index f96e768e..593758e8 100644 --- a/src/Exception/ImageTagNotFoundException.php +++ b/src/Exception/ImageTagNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ImageTagNotFoundException extends \RuntimeException implements ClientException +class ImageTagNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('No such image', 404); + parent::__construct('No such image'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/InternalServerErrorException.php b/src/Exception/InternalServerErrorException.php new file mode 100644 index 00000000..e59af6ac --- /dev/null +++ b/src/Exception/InternalServerErrorException.php @@ -0,0 +1,13 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} diff --git a/src/Exception/NetworkConnectForbiddenException.php b/src/Exception/NetworkConnectForbiddenException.php index 55a8a6a5..35069480 100644 --- a/src/Exception/NetworkConnectForbiddenException.php +++ b/src/Exception/NetworkConnectForbiddenException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NetworkConnectForbiddenException extends \RuntimeException implements ClientException +class NetworkConnectForbiddenException extends ForbiddenException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Operation not supported for swarm scoped networks', 403); + parent::__construct('Operation forbidden'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NetworkConnectInternalServerErrorException.php b/src/Exception/NetworkConnectInternalServerErrorException.php index 146400c4..7a9e96dc 100644 --- a/src/Exception/NetworkConnectInternalServerErrorException.php +++ b/src/Exception/NetworkConnectInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NetworkConnectInternalServerErrorException extends \RuntimeException implements ServerException +class NetworkConnectInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NetworkConnectNotFoundException.php b/src/Exception/NetworkConnectNotFoundException.php index 47241092..5c1fae31 100644 --- a/src/Exception/NetworkConnectNotFoundException.php +++ b/src/Exception/NetworkConnectNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NetworkConnectNotFoundException extends \RuntimeException implements ClientException +class NetworkConnectNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Network or container not found', 404); + parent::__construct('Network or container not found'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NetworkCreateBadRequestException.php b/src/Exception/NetworkCreateBadRequestException.php new file mode 100644 index 00000000..943ea126 --- /dev/null +++ b/src/Exception/NetworkCreateBadRequestException.php @@ -0,0 +1,34 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} diff --git a/src/Exception/NetworkCreateForbiddenException.php b/src/Exception/NetworkCreateForbiddenException.php index 19adcf5f..38493f28 100644 --- a/src/Exception/NetworkCreateForbiddenException.php +++ b/src/Exception/NetworkCreateForbiddenException.php @@ -2,26 +2,35 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NetworkCreateForbiddenException extends \RuntimeException implements ClientException +class NetworkCreateForbiddenException extends ForbiddenException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('operation not supported for pre-defined networks', 403); + parent::__construct('Forbidden operation. This happens when trying to create a network named after a pre-defined network, +or when trying to create an overlay network on a daemon which is not part of a Swarm cluster. +'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NetworkCreateInternalServerErrorException.php b/src/Exception/NetworkCreateInternalServerErrorException.php index b375495c..f8dfdf62 100644 --- a/src/Exception/NetworkCreateInternalServerErrorException.php +++ b/src/Exception/NetworkCreateInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NetworkCreateInternalServerErrorException extends \RuntimeException implements ServerException +class NetworkCreateInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NetworkCreateNotFoundException.php b/src/Exception/NetworkCreateNotFoundException.php index aa10cb56..fdcf8ab2 100644 --- a/src/Exception/NetworkCreateNotFoundException.php +++ b/src/Exception/NetworkCreateNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NetworkCreateNotFoundException extends \RuntimeException implements ClientException +class NetworkCreateNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('plugin not found', 404); + parent::__construct('plugin not found'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NetworkDeleteForbiddenException.php b/src/Exception/NetworkDeleteForbiddenException.php index 04af0f9a..35245599 100644 --- a/src/Exception/NetworkDeleteForbiddenException.php +++ b/src/Exception/NetworkDeleteForbiddenException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NetworkDeleteForbiddenException extends \RuntimeException implements ClientException +class NetworkDeleteForbiddenException extends ForbiddenException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('operation not supported for pre-defined networks', 403); + parent::__construct('operation not supported for pre-defined networks'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NetworkDeleteInternalServerErrorException.php b/src/Exception/NetworkDeleteInternalServerErrorException.php index 6ddef07b..04242362 100644 --- a/src/Exception/NetworkDeleteInternalServerErrorException.php +++ b/src/Exception/NetworkDeleteInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NetworkDeleteInternalServerErrorException extends \RuntimeException implements ServerException +class NetworkDeleteInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NetworkDeleteNotFoundException.php b/src/Exception/NetworkDeleteNotFoundException.php index 71a1669d..8b2acb7a 100644 --- a/src/Exception/NetworkDeleteNotFoundException.php +++ b/src/Exception/NetworkDeleteNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NetworkDeleteNotFoundException extends \RuntimeException implements ClientException +class NetworkDeleteNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such network', 404); + parent::__construct('no such network'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NetworkDisconnectForbiddenException.php b/src/Exception/NetworkDisconnectForbiddenException.php index 30b4af63..830dcd29 100644 --- a/src/Exception/NetworkDisconnectForbiddenException.php +++ b/src/Exception/NetworkDisconnectForbiddenException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NetworkDisconnectForbiddenException extends \RuntimeException implements ClientException +class NetworkDisconnectForbiddenException extends ForbiddenException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Operation not supported for swarm scoped networks', 403); + parent::__construct('Operation not supported for swarm scoped networks'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NetworkDisconnectInternalServerErrorException.php b/src/Exception/NetworkDisconnectInternalServerErrorException.php index 7ba0f62a..955160a3 100644 --- a/src/Exception/NetworkDisconnectInternalServerErrorException.php +++ b/src/Exception/NetworkDisconnectInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NetworkDisconnectInternalServerErrorException extends \RuntimeException implements ServerException +class NetworkDisconnectInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NetworkDisconnectNotFoundException.php b/src/Exception/NetworkDisconnectNotFoundException.php index a42d5551..66e89149 100644 --- a/src/Exception/NetworkDisconnectNotFoundException.php +++ b/src/Exception/NetworkDisconnectNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NetworkDisconnectNotFoundException extends \RuntimeException implements ClientException +class NetworkDisconnectNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Network or container not found', 404); + parent::__construct('Network or container not found'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NetworkInspectInternalServerErrorException.php b/src/Exception/NetworkInspectInternalServerErrorException.php index 761c5186..09755ee4 100644 --- a/src/Exception/NetworkInspectInternalServerErrorException.php +++ b/src/Exception/NetworkInspectInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NetworkInspectInternalServerErrorException extends \RuntimeException implements ServerException +class NetworkInspectInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NetworkInspectNotFoundException.php b/src/Exception/NetworkInspectNotFoundException.php index 44b1f4f4..7f1ad636 100644 --- a/src/Exception/NetworkInspectNotFoundException.php +++ b/src/Exception/NetworkInspectNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NetworkInspectNotFoundException extends \RuntimeException implements ClientException +class NetworkInspectNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Network not found', 404); + parent::__construct('Network not found'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NetworkListInternalServerErrorException.php b/src/Exception/NetworkListInternalServerErrorException.php index ead2ef4f..881e3c92 100644 --- a/src/Exception/NetworkListInternalServerErrorException.php +++ b/src/Exception/NetworkListInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NetworkListInternalServerErrorException extends \RuntimeException implements ServerException +class NetworkListInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NetworkPruneInternalServerErrorException.php b/src/Exception/NetworkPruneInternalServerErrorException.php index ed76d14b..c957acd6 100644 --- a/src/Exception/NetworkPruneInternalServerErrorException.php +++ b/src/Exception/NetworkPruneInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NetworkPruneInternalServerErrorException extends \RuntimeException implements ServerException +class NetworkPruneInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NodeDeleteInternalServerErrorException.php b/src/Exception/NodeDeleteInternalServerErrorException.php index 40c173ff..c968a408 100644 --- a/src/Exception/NodeDeleteInternalServerErrorException.php +++ b/src/Exception/NodeDeleteInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NodeDeleteInternalServerErrorException extends \RuntimeException implements ServerException +class NodeDeleteInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NodeDeleteNotFoundException.php b/src/Exception/NodeDeleteNotFoundException.php index e75989a3..bffeeedd 100644 --- a/src/Exception/NodeDeleteNotFoundException.php +++ b/src/Exception/NodeDeleteNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NodeDeleteNotFoundException extends \RuntimeException implements ClientException +class NodeDeleteNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such node', 404); + parent::__construct('no such node'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NodeDeleteServiceUnavailableException.php b/src/Exception/NodeDeleteServiceUnavailableException.php index c481fe70..36872a20 100644 --- a/src/Exception/NodeDeleteServiceUnavailableException.php +++ b/src/Exception/NodeDeleteServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NodeDeleteServiceUnavailableException extends \RuntimeException implements ServerException +class NodeDeleteServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NodeInspectInternalServerErrorException.php b/src/Exception/NodeInspectInternalServerErrorException.php index 468177cd..4fc61833 100644 --- a/src/Exception/NodeInspectInternalServerErrorException.php +++ b/src/Exception/NodeInspectInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NodeInspectInternalServerErrorException extends \RuntimeException implements ServerException +class NodeInspectInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NodeInspectNotFoundException.php b/src/Exception/NodeInspectNotFoundException.php index 9b408a8c..d7a7cd3d 100644 --- a/src/Exception/NodeInspectNotFoundException.php +++ b/src/Exception/NodeInspectNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NodeInspectNotFoundException extends \RuntimeException implements ClientException +class NodeInspectNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such node', 404); + parent::__construct('no such node'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NodeInspectServiceUnavailableException.php b/src/Exception/NodeInspectServiceUnavailableException.php index 8d00f68e..427267b2 100644 --- a/src/Exception/NodeInspectServiceUnavailableException.php +++ b/src/Exception/NodeInspectServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NodeInspectServiceUnavailableException extends \RuntimeException implements ServerException +class NodeInspectServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NodeListInternalServerErrorException.php b/src/Exception/NodeListInternalServerErrorException.php index b1e64aa1..2cd0ba48 100644 --- a/src/Exception/NodeListInternalServerErrorException.php +++ b/src/Exception/NodeListInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NodeListInternalServerErrorException extends \RuntimeException implements ServerException +class NodeListInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NodeListServiceUnavailableException.php b/src/Exception/NodeListServiceUnavailableException.php index 85f119d0..abadf632 100644 --- a/src/Exception/NodeListServiceUnavailableException.php +++ b/src/Exception/NodeListServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NodeListServiceUnavailableException extends \RuntimeException implements ServerException +class NodeListServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NodeUpdateBadRequestException.php b/src/Exception/NodeUpdateBadRequestException.php index f5c8c667..4a8ec869 100644 --- a/src/Exception/NodeUpdateBadRequestException.php +++ b/src/Exception/NodeUpdateBadRequestException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NodeUpdateBadRequestException extends \RuntimeException implements ClientException +class NodeUpdateBadRequestException extends BadRequestException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('bad parameter', 400); + parent::__construct('bad parameter'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NodeUpdateInternalServerErrorException.php b/src/Exception/NodeUpdateInternalServerErrorException.php index 8cbf3434..9630e88a 100644 --- a/src/Exception/NodeUpdateInternalServerErrorException.php +++ b/src/Exception/NodeUpdateInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NodeUpdateInternalServerErrorException extends \RuntimeException implements ServerException +class NodeUpdateInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NodeUpdateNotFoundException.php b/src/Exception/NodeUpdateNotFoundException.php index e75d12ee..660a2b78 100644 --- a/src/Exception/NodeUpdateNotFoundException.php +++ b/src/Exception/NodeUpdateNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NodeUpdateNotFoundException extends \RuntimeException implements ClientException +class NodeUpdateNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such node', 404); + parent::__construct('no such node'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NodeUpdateServiceUnavailableException.php b/src/Exception/NodeUpdateServiceUnavailableException.php index 83305db8..4453c01c 100644 --- a/src/Exception/NodeUpdateServiceUnavailableException.php +++ b/src/Exception/NodeUpdateServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class NodeUpdateServiceUnavailableException extends \RuntimeException implements ServerException +class NodeUpdateServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/NotFoundException.php b/src/Exception/NotFoundException.php new file mode 100644 index 00000000..fa6f6c8a --- /dev/null +++ b/src/Exception/NotFoundException.php @@ -0,0 +1,13 @@ +errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PluginDeleteInternalServerErrorException.php b/src/Exception/PluginDeleteInternalServerErrorException.php index 4bfa0abe..c0816e5a 100644 --- a/src/Exception/PluginDeleteInternalServerErrorException.php +++ b/src/Exception/PluginDeleteInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PluginDeleteInternalServerErrorException extends \RuntimeException implements ServerException +class PluginDeleteInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PluginDeleteNotFoundException.php b/src/Exception/PluginDeleteNotFoundException.php index f394a2f5..9daea453 100644 --- a/src/Exception/PluginDeleteNotFoundException.php +++ b/src/Exception/PluginDeleteNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PluginDeleteNotFoundException extends \RuntimeException implements ClientException +class PluginDeleteNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('plugin is not installed', 404); + parent::__construct('plugin is not installed'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PluginDisableInternalServerErrorException.php b/src/Exception/PluginDisableInternalServerErrorException.php index 623d3307..017c5ada 100644 --- a/src/Exception/PluginDisableInternalServerErrorException.php +++ b/src/Exception/PluginDisableInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PluginDisableInternalServerErrorException extends \RuntimeException implements ServerException +class PluginDisableInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PluginDisableNotFoundException.php b/src/Exception/PluginDisableNotFoundException.php index 2512cb6e..a51779fb 100644 --- a/src/Exception/PluginDisableNotFoundException.php +++ b/src/Exception/PluginDisableNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PluginDisableNotFoundException extends \RuntimeException implements ClientException +class PluginDisableNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('plugin is not installed', 404); + parent::__construct('plugin is not installed'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PluginEnableInternalServerErrorException.php b/src/Exception/PluginEnableInternalServerErrorException.php index 0b33283e..53b14846 100644 --- a/src/Exception/PluginEnableInternalServerErrorException.php +++ b/src/Exception/PluginEnableInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PluginEnableInternalServerErrorException extends \RuntimeException implements ServerException +class PluginEnableInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PluginEnableNotFoundException.php b/src/Exception/PluginEnableNotFoundException.php index 54f6d609..3eb438cc 100644 --- a/src/Exception/PluginEnableNotFoundException.php +++ b/src/Exception/PluginEnableNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PluginEnableNotFoundException extends \RuntimeException implements ClientException +class PluginEnableNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('plugin is not installed', 404); + parent::__construct('plugin is not installed'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PluginInspectInternalServerErrorException.php b/src/Exception/PluginInspectInternalServerErrorException.php index d401e7de..d4242ae5 100644 --- a/src/Exception/PluginInspectInternalServerErrorException.php +++ b/src/Exception/PluginInspectInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PluginInspectInternalServerErrorException extends \RuntimeException implements ServerException +class PluginInspectInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PluginInspectNotFoundException.php b/src/Exception/PluginInspectNotFoundException.php index dca1a60b..6d1aef71 100644 --- a/src/Exception/PluginInspectNotFoundException.php +++ b/src/Exception/PluginInspectNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PluginInspectNotFoundException extends \RuntimeException implements ClientException +class PluginInspectNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('plugin is not installed', 404); + parent::__construct('plugin is not installed'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PluginListInternalServerErrorException.php b/src/Exception/PluginListInternalServerErrorException.php index 33f70ded..a5c7fc04 100644 --- a/src/Exception/PluginListInternalServerErrorException.php +++ b/src/Exception/PluginListInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PluginListInternalServerErrorException extends \RuntimeException implements ServerException +class PluginListInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PluginPullInternalServerErrorException.php b/src/Exception/PluginPullInternalServerErrorException.php index 92759e52..d1c480bf 100644 --- a/src/Exception/PluginPullInternalServerErrorException.php +++ b/src/Exception/PluginPullInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PluginPullInternalServerErrorException extends \RuntimeException implements ServerException +class PluginPullInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PluginPushInternalServerErrorException.php b/src/Exception/PluginPushInternalServerErrorException.php index ab8bafd4..75546029 100644 --- a/src/Exception/PluginPushInternalServerErrorException.php +++ b/src/Exception/PluginPushInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PluginPushInternalServerErrorException extends \RuntimeException implements ServerException +class PluginPushInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PluginPushNotFoundException.php b/src/Exception/PluginPushNotFoundException.php index f7751ccc..486ff0c5 100644 --- a/src/Exception/PluginPushNotFoundException.php +++ b/src/Exception/PluginPushNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PluginPushNotFoundException extends \RuntimeException implements ClientException +class PluginPushNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('plugin not installed', 404); + parent::__construct('plugin not installed'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PluginSetInternalServerErrorException.php b/src/Exception/PluginSetInternalServerErrorException.php index 81c74218..071b5d3f 100644 --- a/src/Exception/PluginSetInternalServerErrorException.php +++ b/src/Exception/PluginSetInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PluginSetInternalServerErrorException extends \RuntimeException implements ServerException +class PluginSetInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PluginSetNotFoundException.php b/src/Exception/PluginSetNotFoundException.php index 6de73319..e7d2f37c 100644 --- a/src/Exception/PluginSetNotFoundException.php +++ b/src/Exception/PluginSetNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PluginSetNotFoundException extends \RuntimeException implements ClientException +class PluginSetNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Plugin not installed', 404); + parent::__construct('Plugin not installed'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PluginUpgradeInternalServerErrorException.php b/src/Exception/PluginUpgradeInternalServerErrorException.php index 08b0a8ef..9a4b34c8 100644 --- a/src/Exception/PluginUpgradeInternalServerErrorException.php +++ b/src/Exception/PluginUpgradeInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PluginUpgradeInternalServerErrorException extends \RuntimeException implements ServerException +class PluginUpgradeInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PluginUpgradeNotFoundException.php b/src/Exception/PluginUpgradeNotFoundException.php index a14c7bd1..e02bba69 100644 --- a/src/Exception/PluginUpgradeNotFoundException.php +++ b/src/Exception/PluginUpgradeNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PluginUpgradeNotFoundException extends \RuntimeException implements ClientException +class PluginUpgradeNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('plugin not installed', 404); + parent::__construct('plugin not installed'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PutContainerArchiveBadRequestException.php b/src/Exception/PutContainerArchiveBadRequestException.php index dcdbcd1d..903f49a7 100644 --- a/src/Exception/PutContainerArchiveBadRequestException.php +++ b/src/Exception/PutContainerArchiveBadRequestException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PutContainerArchiveBadRequestException extends \RuntimeException implements ClientException +class PutContainerArchiveBadRequestException extends BadRequestException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Bad parameter', 400); + parent::__construct('Bad parameter'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PutContainerArchiveForbiddenException.php b/src/Exception/PutContainerArchiveForbiddenException.php index acfb8d71..4fd78e92 100644 --- a/src/Exception/PutContainerArchiveForbiddenException.php +++ b/src/Exception/PutContainerArchiveForbiddenException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PutContainerArchiveForbiddenException extends \RuntimeException implements ClientException +class PutContainerArchiveForbiddenException extends ForbiddenException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Permission denied, the volume or container rootfs is marked as read-only.', 403); + parent::__construct('Permission denied, the volume or container rootfs is marked as read-only.'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PutContainerArchiveInternalServerErrorException.php b/src/Exception/PutContainerArchiveInternalServerErrorException.php index a512fea2..db3937bd 100644 --- a/src/Exception/PutContainerArchiveInternalServerErrorException.php +++ b/src/Exception/PutContainerArchiveInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PutContainerArchiveInternalServerErrorException extends \RuntimeException implements ServerException +class PutContainerArchiveInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/PutContainerArchiveNotFoundException.php b/src/Exception/PutContainerArchiveNotFoundException.php index 393fa843..e05b6e47 100644 --- a/src/Exception/PutContainerArchiveNotFoundException.php +++ b/src/Exception/PutContainerArchiveNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class PutContainerArchiveNotFoundException extends \RuntimeException implements ClientException +class PutContainerArchiveNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('No such container or path does not exist inside the container', 404); + parent::__construct('No such container or path does not exist inside the container'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SecretCreateConflictException.php b/src/Exception/SecretCreateConflictException.php index 08e88bf1..350fcd51 100644 --- a/src/Exception/SecretCreateConflictException.php +++ b/src/Exception/SecretCreateConflictException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SecretCreateConflictException extends \RuntimeException implements ClientException +class SecretCreateConflictException extends ConflictException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('name conflicts with an existing object', 409); + parent::__construct('name conflicts with an existing object'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SecretCreateInternalServerErrorException.php b/src/Exception/SecretCreateInternalServerErrorException.php index e6abe7fa..19e25051 100644 --- a/src/Exception/SecretCreateInternalServerErrorException.php +++ b/src/Exception/SecretCreateInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SecretCreateInternalServerErrorException extends \RuntimeException implements ServerException +class SecretCreateInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SecretCreateServiceUnavailableException.php b/src/Exception/SecretCreateServiceUnavailableException.php index 521e3cb4..c09454b0 100644 --- a/src/Exception/SecretCreateServiceUnavailableException.php +++ b/src/Exception/SecretCreateServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SecretCreateServiceUnavailableException extends \RuntimeException implements ServerException +class SecretCreateServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SecretDeleteInternalServerErrorException.php b/src/Exception/SecretDeleteInternalServerErrorException.php index e0f4fda5..3515bcce 100644 --- a/src/Exception/SecretDeleteInternalServerErrorException.php +++ b/src/Exception/SecretDeleteInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SecretDeleteInternalServerErrorException extends \RuntimeException implements ServerException +class SecretDeleteInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SecretDeleteNotFoundException.php b/src/Exception/SecretDeleteNotFoundException.php index de1991f7..bb280a66 100644 --- a/src/Exception/SecretDeleteNotFoundException.php +++ b/src/Exception/SecretDeleteNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SecretDeleteNotFoundException extends \RuntimeException implements ClientException +class SecretDeleteNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('secret not found', 404); + parent::__construct('secret not found'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SecretDeleteServiceUnavailableException.php b/src/Exception/SecretDeleteServiceUnavailableException.php index 573431a6..512fe0ad 100644 --- a/src/Exception/SecretDeleteServiceUnavailableException.php +++ b/src/Exception/SecretDeleteServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SecretDeleteServiceUnavailableException extends \RuntimeException implements ServerException +class SecretDeleteServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SecretInspectInternalServerErrorException.php b/src/Exception/SecretInspectInternalServerErrorException.php index 990a65f2..9bcaa572 100644 --- a/src/Exception/SecretInspectInternalServerErrorException.php +++ b/src/Exception/SecretInspectInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SecretInspectInternalServerErrorException extends \RuntimeException implements ServerException +class SecretInspectInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SecretInspectNotFoundException.php b/src/Exception/SecretInspectNotFoundException.php index 6d65d60a..bd6dbe81 100644 --- a/src/Exception/SecretInspectNotFoundException.php +++ b/src/Exception/SecretInspectNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SecretInspectNotFoundException extends \RuntimeException implements ClientException +class SecretInspectNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('secret not found', 404); + parent::__construct('secret not found'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SecretInspectServiceUnavailableException.php b/src/Exception/SecretInspectServiceUnavailableException.php index 45b9462e..ed9cd288 100644 --- a/src/Exception/SecretInspectServiceUnavailableException.php +++ b/src/Exception/SecretInspectServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SecretInspectServiceUnavailableException extends \RuntimeException implements ServerException +class SecretInspectServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SecretListInternalServerErrorException.php b/src/Exception/SecretListInternalServerErrorException.php index d6627ace..6e085f3c 100644 --- a/src/Exception/SecretListInternalServerErrorException.php +++ b/src/Exception/SecretListInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SecretListInternalServerErrorException extends \RuntimeException implements ServerException +class SecretListInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SecretListServiceUnavailableException.php b/src/Exception/SecretListServiceUnavailableException.php index 18f0b2e3..5cbf8b4b 100644 --- a/src/Exception/SecretListServiceUnavailableException.php +++ b/src/Exception/SecretListServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SecretListServiceUnavailableException extends \RuntimeException implements ServerException +class SecretListServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SecretUpdateBadRequestException.php b/src/Exception/SecretUpdateBadRequestException.php index d7be7395..481d040b 100644 --- a/src/Exception/SecretUpdateBadRequestException.php +++ b/src/Exception/SecretUpdateBadRequestException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SecretUpdateBadRequestException extends \RuntimeException implements ClientException +class SecretUpdateBadRequestException extends BadRequestException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('bad parameter', 400); + parent::__construct('bad parameter'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SecretUpdateInternalServerErrorException.php b/src/Exception/SecretUpdateInternalServerErrorException.php index e860a6df..a5b6e273 100644 --- a/src/Exception/SecretUpdateInternalServerErrorException.php +++ b/src/Exception/SecretUpdateInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SecretUpdateInternalServerErrorException extends \RuntimeException implements ServerException +class SecretUpdateInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SecretUpdateNotFoundException.php b/src/Exception/SecretUpdateNotFoundException.php index e12d75bf..8fe63ba8 100644 --- a/src/Exception/SecretUpdateNotFoundException.php +++ b/src/Exception/SecretUpdateNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SecretUpdateNotFoundException extends \RuntimeException implements ClientException +class SecretUpdateNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such secret', 404); + parent::__construct('no such secret'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SecretUpdateServiceUnavailableException.php b/src/Exception/SecretUpdateServiceUnavailableException.php index f5dc42ac..456d714c 100644 --- a/src/Exception/SecretUpdateServiceUnavailableException.php +++ b/src/Exception/SecretUpdateServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SecretUpdateServiceUnavailableException extends \RuntimeException implements ServerException +class SecretUpdateServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServerException.php b/src/Exception/ServerException.php index 9e0cffda..76ae5c35 100644 --- a/src/Exception/ServerException.php +++ b/src/Exception/ServerException.php @@ -2,12 +2,6 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; interface ServerException extends ApiException diff --git a/src/Exception/ServiceCreateBadRequestException.php b/src/Exception/ServiceCreateBadRequestException.php index ac524e99..56bb0af2 100644 --- a/src/Exception/ServiceCreateBadRequestException.php +++ b/src/Exception/ServiceCreateBadRequestException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceCreateBadRequestException extends \RuntimeException implements ClientException +class ServiceCreateBadRequestException extends BadRequestException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('bad parameter', 400); + parent::__construct('bad parameter'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServiceCreateConflictException.php b/src/Exception/ServiceCreateConflictException.php index 7d74ab7b..2e2973d4 100644 --- a/src/Exception/ServiceCreateConflictException.php +++ b/src/Exception/ServiceCreateConflictException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceCreateConflictException extends \RuntimeException implements ClientException +class ServiceCreateConflictException extends ConflictException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('name conflicts with an existing service', 409); + parent::__construct('name conflicts with an existing service'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServiceCreateForbiddenException.php b/src/Exception/ServiceCreateForbiddenException.php index 533cdff0..1a6fe660 100644 --- a/src/Exception/ServiceCreateForbiddenException.php +++ b/src/Exception/ServiceCreateForbiddenException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceCreateForbiddenException extends \RuntimeException implements ClientException +class ServiceCreateForbiddenException extends ForbiddenException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('network is not eligible for services', 403); + parent::__construct('network is not eligible for services'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServiceCreateInternalServerErrorException.php b/src/Exception/ServiceCreateInternalServerErrorException.php index 4aa39bc9..6f945730 100644 --- a/src/Exception/ServiceCreateInternalServerErrorException.php +++ b/src/Exception/ServiceCreateInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceCreateInternalServerErrorException extends \RuntimeException implements ServerException +class ServiceCreateInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServiceCreateServiceUnavailableException.php b/src/Exception/ServiceCreateServiceUnavailableException.php index f8995939..59c5ee55 100644 --- a/src/Exception/ServiceCreateServiceUnavailableException.php +++ b/src/Exception/ServiceCreateServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceCreateServiceUnavailableException extends \RuntimeException implements ServerException +class ServiceCreateServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServiceDeleteInternalServerErrorException.php b/src/Exception/ServiceDeleteInternalServerErrorException.php index b6a11cc4..89f3a71e 100644 --- a/src/Exception/ServiceDeleteInternalServerErrorException.php +++ b/src/Exception/ServiceDeleteInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceDeleteInternalServerErrorException extends \RuntimeException implements ServerException +class ServiceDeleteInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServiceDeleteNotFoundException.php b/src/Exception/ServiceDeleteNotFoundException.php index b3ffe5ed..c42ba315 100644 --- a/src/Exception/ServiceDeleteNotFoundException.php +++ b/src/Exception/ServiceDeleteNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceDeleteNotFoundException extends \RuntimeException implements ClientException +class ServiceDeleteNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such service', 404); + parent::__construct('no such service'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServiceDeleteServiceUnavailableException.php b/src/Exception/ServiceDeleteServiceUnavailableException.php index 2f530dd8..0355948a 100644 --- a/src/Exception/ServiceDeleteServiceUnavailableException.php +++ b/src/Exception/ServiceDeleteServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceDeleteServiceUnavailableException extends \RuntimeException implements ServerException +class ServiceDeleteServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServiceInspectInternalServerErrorException.php b/src/Exception/ServiceInspectInternalServerErrorException.php index c945498b..0ac6f293 100644 --- a/src/Exception/ServiceInspectInternalServerErrorException.php +++ b/src/Exception/ServiceInspectInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceInspectInternalServerErrorException extends \RuntimeException implements ServerException +class ServiceInspectInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServiceInspectNotFoundException.php b/src/Exception/ServiceInspectNotFoundException.php index d8fb3309..e4b7a91e 100644 --- a/src/Exception/ServiceInspectNotFoundException.php +++ b/src/Exception/ServiceInspectNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceInspectNotFoundException extends \RuntimeException implements ClientException +class ServiceInspectNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such service', 404); + parent::__construct('no such service'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServiceInspectServiceUnavailableException.php b/src/Exception/ServiceInspectServiceUnavailableException.php index e1866f77..8cc3cb2e 100644 --- a/src/Exception/ServiceInspectServiceUnavailableException.php +++ b/src/Exception/ServiceInspectServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceInspectServiceUnavailableException extends \RuntimeException implements ServerException +class ServiceInspectServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServiceListInternalServerErrorException.php b/src/Exception/ServiceListInternalServerErrorException.php index fc1cd1e3..49a88cf6 100644 --- a/src/Exception/ServiceListInternalServerErrorException.php +++ b/src/Exception/ServiceListInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceListInternalServerErrorException extends \RuntimeException implements ServerException +class ServiceListInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServiceListServiceUnavailableException.php b/src/Exception/ServiceListServiceUnavailableException.php index c83de6a0..5c9316df 100644 --- a/src/Exception/ServiceListServiceUnavailableException.php +++ b/src/Exception/ServiceListServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceListServiceUnavailableException extends \RuntimeException implements ServerException +class ServiceListServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServiceLogsInternalServerErrorException.php b/src/Exception/ServiceLogsInternalServerErrorException.php deleted file mode 100644 index ced82992..00000000 --- a/src/Exception/ServiceLogsInternalServerErrorException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/ServiceLogsNotFoundException.php b/src/Exception/ServiceLogsNotFoundException.php index 21082f0c..a0778712 100644 --- a/src/Exception/ServiceLogsNotFoundException.php +++ b/src/Exception/ServiceLogsNotFoundException.php @@ -2,26 +2,23 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceLogsNotFoundException extends \RuntimeException implements ClientException +class ServiceLogsNotFoundException extends NotFoundException { - private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(?\Psr\Http\Message\ResponseInterface $response = null) { - parent::__construct('no such service', 404); - $this->errorResponse = $errorResponse; + parent::__construct('no such service'); + $this->response = $response; } - public function getErrorResponse() + public function getResponse(): ?\Psr\Http\Message\ResponseInterface { - return $this->errorResponse; + return $this->response; } } diff --git a/src/Exception/ServiceLogsServiceUnavailableException.php b/src/Exception/ServiceLogsServiceUnavailableException.php deleted file mode 100644 index a669558f..00000000 --- a/src/Exception/ServiceLogsServiceUnavailableException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/ServiceUnavailableException.php b/src/Exception/ServiceUnavailableException.php new file mode 100644 index 00000000..ef87f510 --- /dev/null +++ b/src/Exception/ServiceUnavailableException.php @@ -0,0 +1,13 @@ +errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServiceUpdateInternalServerErrorException.php b/src/Exception/ServiceUpdateInternalServerErrorException.php index e51ef8fb..83e0a895 100644 --- a/src/Exception/ServiceUpdateInternalServerErrorException.php +++ b/src/Exception/ServiceUpdateInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceUpdateInternalServerErrorException extends \RuntimeException implements ServerException +class ServiceUpdateInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServiceUpdateNotFoundException.php b/src/Exception/ServiceUpdateNotFoundException.php index 35524460..de2ace0e 100644 --- a/src/Exception/ServiceUpdateNotFoundException.php +++ b/src/Exception/ServiceUpdateNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceUpdateNotFoundException extends \RuntimeException implements ClientException +class ServiceUpdateNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such service', 404); + parent::__construct('no such service'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/ServiceUpdateServiceUnavailableException.php b/src/Exception/ServiceUpdateServiceUnavailableException.php index 740e29ac..3007a482 100644 --- a/src/Exception/ServiceUpdateServiceUnavailableException.php +++ b/src/Exception/ServiceUpdateServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class ServiceUpdateServiceUnavailableException extends \RuntimeException implements ServerException +class ServiceUpdateServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SessionBadRequestException.php b/src/Exception/SessionBadRequestException.php deleted file mode 100644 index 8f84716c..00000000 --- a/src/Exception/SessionBadRequestException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/SessionInternalServerErrorException.php b/src/Exception/SessionInternalServerErrorException.php deleted file mode 100644 index 18bec0a5..00000000 --- a/src/Exception/SessionInternalServerErrorException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/SwarmInitBadRequestException.php b/src/Exception/SwarmInitBadRequestException.php index b960c08b..057e87da 100644 --- a/src/Exception/SwarmInitBadRequestException.php +++ b/src/Exception/SwarmInitBadRequestException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmInitBadRequestException extends \RuntimeException implements ClientException +class SwarmInitBadRequestException extends BadRequestException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('bad parameter', 400); + parent::__construct('bad parameter'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmInitInternalServerErrorException.php b/src/Exception/SwarmInitInternalServerErrorException.php index ede2438c..7fb83e46 100644 --- a/src/Exception/SwarmInitInternalServerErrorException.php +++ b/src/Exception/SwarmInitInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmInitInternalServerErrorException extends \RuntimeException implements ServerException +class SwarmInitInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmInitServiceUnavailableException.php b/src/Exception/SwarmInitServiceUnavailableException.php index 66777ca7..70b8354a 100644 --- a/src/Exception/SwarmInitServiceUnavailableException.php +++ b/src/Exception/SwarmInitServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmInitServiceUnavailableException extends \RuntimeException implements ServerException +class SwarmInitServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is already part of a swarm', 503); + parent::__construct('node is already part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmInspectInternalServerErrorException.php b/src/Exception/SwarmInspectInternalServerErrorException.php index 5d80932a..03a1a39a 100644 --- a/src/Exception/SwarmInspectInternalServerErrorException.php +++ b/src/Exception/SwarmInspectInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmInspectInternalServerErrorException extends \RuntimeException implements ServerException +class SwarmInspectInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmInspectNotFoundException.php b/src/Exception/SwarmInspectNotFoundException.php index dbaba42d..6c81eb3a 100644 --- a/src/Exception/SwarmInspectNotFoundException.php +++ b/src/Exception/SwarmInspectNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmInspectNotFoundException extends \RuntimeException implements ClientException +class SwarmInspectNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such swarm', 404); + parent::__construct('no such swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmInspectServiceUnavailableException.php b/src/Exception/SwarmInspectServiceUnavailableException.php index afdee1ee..c6db133a 100644 --- a/src/Exception/SwarmInspectServiceUnavailableException.php +++ b/src/Exception/SwarmInspectServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmInspectServiceUnavailableException extends \RuntimeException implements ServerException +class SwarmInspectServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmJoinBadRequestException.php b/src/Exception/SwarmJoinBadRequestException.php index 14b00bf0..fc2b5aba 100644 --- a/src/Exception/SwarmJoinBadRequestException.php +++ b/src/Exception/SwarmJoinBadRequestException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmJoinBadRequestException extends \RuntimeException implements ClientException +class SwarmJoinBadRequestException extends BadRequestException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('bad parameter', 400); + parent::__construct('bad parameter'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmJoinInternalServerErrorException.php b/src/Exception/SwarmJoinInternalServerErrorException.php index 935b706c..2ba81d3a 100644 --- a/src/Exception/SwarmJoinInternalServerErrorException.php +++ b/src/Exception/SwarmJoinInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmJoinInternalServerErrorException extends \RuntimeException implements ServerException +class SwarmJoinInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmJoinServiceUnavailableException.php b/src/Exception/SwarmJoinServiceUnavailableException.php index feea00fb..ca054324 100644 --- a/src/Exception/SwarmJoinServiceUnavailableException.php +++ b/src/Exception/SwarmJoinServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmJoinServiceUnavailableException extends \RuntimeException implements ServerException +class SwarmJoinServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is already part of a swarm', 503); + parent::__construct('node is already part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmLeaveInternalServerErrorException.php b/src/Exception/SwarmLeaveInternalServerErrorException.php index 967aa3a6..d9a56313 100644 --- a/src/Exception/SwarmLeaveInternalServerErrorException.php +++ b/src/Exception/SwarmLeaveInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmLeaveInternalServerErrorException extends \RuntimeException implements ServerException +class SwarmLeaveInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmLeaveServiceUnavailableException.php b/src/Exception/SwarmLeaveServiceUnavailableException.php index 9b96fc9a..a7b6dfc5 100644 --- a/src/Exception/SwarmLeaveServiceUnavailableException.php +++ b/src/Exception/SwarmLeaveServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmLeaveServiceUnavailableException extends \RuntimeException implements ServerException +class SwarmLeaveServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmUnlockInternalServerErrorException.php b/src/Exception/SwarmUnlockInternalServerErrorException.php index a8831555..85f16b09 100644 --- a/src/Exception/SwarmUnlockInternalServerErrorException.php +++ b/src/Exception/SwarmUnlockInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmUnlockInternalServerErrorException extends \RuntimeException implements ServerException +class SwarmUnlockInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmUnlockServiceUnavailableException.php b/src/Exception/SwarmUnlockServiceUnavailableException.php index 648d5b14..31e2ad3c 100644 --- a/src/Exception/SwarmUnlockServiceUnavailableException.php +++ b/src/Exception/SwarmUnlockServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmUnlockServiceUnavailableException extends \RuntimeException implements ServerException +class SwarmUnlockServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmUnlockkeyInternalServerErrorException.php b/src/Exception/SwarmUnlockkeyInternalServerErrorException.php index ddb3de0e..cb4258d8 100644 --- a/src/Exception/SwarmUnlockkeyInternalServerErrorException.php +++ b/src/Exception/SwarmUnlockkeyInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmUnlockkeyInternalServerErrorException extends \RuntimeException implements ServerException +class SwarmUnlockkeyInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmUnlockkeyServiceUnavailableException.php b/src/Exception/SwarmUnlockkeyServiceUnavailableException.php index 66abfac2..68713402 100644 --- a/src/Exception/SwarmUnlockkeyServiceUnavailableException.php +++ b/src/Exception/SwarmUnlockkeyServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmUnlockkeyServiceUnavailableException extends \RuntimeException implements ServerException +class SwarmUnlockkeyServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmUpdateBadRequestException.php b/src/Exception/SwarmUpdateBadRequestException.php index 3f872a7e..e176ed41 100644 --- a/src/Exception/SwarmUpdateBadRequestException.php +++ b/src/Exception/SwarmUpdateBadRequestException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmUpdateBadRequestException extends \RuntimeException implements ClientException +class SwarmUpdateBadRequestException extends BadRequestException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('bad parameter', 400); + parent::__construct('bad parameter'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmUpdateInternalServerErrorException.php b/src/Exception/SwarmUpdateInternalServerErrorException.php index a0c8e263..63f0004a 100644 --- a/src/Exception/SwarmUpdateInternalServerErrorException.php +++ b/src/Exception/SwarmUpdateInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmUpdateInternalServerErrorException extends \RuntimeException implements ServerException +class SwarmUpdateInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SwarmUpdateServiceUnavailableException.php b/src/Exception/SwarmUpdateServiceUnavailableException.php index b74a4dbf..c3f12c12 100644 --- a/src/Exception/SwarmUpdateServiceUnavailableException.php +++ b/src/Exception/SwarmUpdateServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SwarmUpdateServiceUnavailableException extends \RuntimeException implements ServerException +class SwarmUpdateServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SystemAuthInternalServerErrorException.php b/src/Exception/SystemAuthInternalServerErrorException.php index 8e1575d7..55ba05e4 100644 --- a/src/Exception/SystemAuthInternalServerErrorException.php +++ b/src/Exception/SystemAuthInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SystemAuthInternalServerErrorException extends \RuntimeException implements ServerException +class SystemAuthInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SystemAuthUnauthorizedException.php b/src/Exception/SystemAuthUnauthorizedException.php new file mode 100644 index 00000000..3b98013b --- /dev/null +++ b/src/Exception/SystemAuthUnauthorizedException.php @@ -0,0 +1,34 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} diff --git a/src/Exception/SystemDataUsageInternalServerErrorException.php b/src/Exception/SystemDataUsageInternalServerErrorException.php index 4c642bc6..7c8b720d 100644 --- a/src/Exception/SystemDataUsageInternalServerErrorException.php +++ b/src/Exception/SystemDataUsageInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SystemDataUsageInternalServerErrorException extends \RuntimeException implements ServerException +class SystemDataUsageInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SystemEventsBadRequestException.php b/src/Exception/SystemEventsBadRequestException.php index 58b02f1c..a606cbd6 100644 --- a/src/Exception/SystemEventsBadRequestException.php +++ b/src/Exception/SystemEventsBadRequestException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SystemEventsBadRequestException extends \RuntimeException implements ClientException +class SystemEventsBadRequestException extends BadRequestException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('bad parameter', 400); + parent::__construct('bad parameter'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SystemEventsInternalServerErrorException.php b/src/Exception/SystemEventsInternalServerErrorException.php index 79e1e32b..abab7b3a 100644 --- a/src/Exception/SystemEventsInternalServerErrorException.php +++ b/src/Exception/SystemEventsInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SystemEventsInternalServerErrorException extends \RuntimeException implements ServerException +class SystemEventsInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SystemInfoInternalServerErrorException.php b/src/Exception/SystemInfoInternalServerErrorException.php index e10e8463..00746aec 100644 --- a/src/Exception/SystemInfoInternalServerErrorException.php +++ b/src/Exception/SystemInfoInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SystemInfoInternalServerErrorException extends \RuntimeException implements ServerException +class SystemInfoInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/SystemPingInternalServerErrorException.php b/src/Exception/SystemPingInternalServerErrorException.php deleted file mode 100644 index f0323684..00000000 --- a/src/Exception/SystemPingInternalServerErrorException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/SystemVersionInternalServerErrorException.php b/src/Exception/SystemVersionInternalServerErrorException.php index e4e97f57..a1aadc79 100644 --- a/src/Exception/SystemVersionInternalServerErrorException.php +++ b/src/Exception/SystemVersionInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class SystemVersionInternalServerErrorException extends \RuntimeException implements ServerException +class SystemVersionInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/TaskInspectInternalServerErrorException.php b/src/Exception/TaskInspectInternalServerErrorException.php index a20b97d8..9ebce1e6 100644 --- a/src/Exception/TaskInspectInternalServerErrorException.php +++ b/src/Exception/TaskInspectInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class TaskInspectInternalServerErrorException extends \RuntimeException implements ServerException +class TaskInspectInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/TaskInspectNotFoundException.php b/src/Exception/TaskInspectNotFoundException.php index 618a9bb8..e3384421 100644 --- a/src/Exception/TaskInspectNotFoundException.php +++ b/src/Exception/TaskInspectNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class TaskInspectNotFoundException extends \RuntimeException implements ClientException +class TaskInspectNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('no such task', 404); + parent::__construct('no such task'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/TaskInspectServiceUnavailableException.php b/src/Exception/TaskInspectServiceUnavailableException.php index 100ac563..bf3258d8 100644 --- a/src/Exception/TaskInspectServiceUnavailableException.php +++ b/src/Exception/TaskInspectServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class TaskInspectServiceUnavailableException extends \RuntimeException implements ServerException +class TaskInspectServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/TaskListInternalServerErrorException.php b/src/Exception/TaskListInternalServerErrorException.php index d99f548e..7e3d4873 100644 --- a/src/Exception/TaskListInternalServerErrorException.php +++ b/src/Exception/TaskListInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class TaskListInternalServerErrorException extends \RuntimeException implements ServerException +class TaskListInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('server error', 500); + parent::__construct('server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/TaskListServiceUnavailableException.php b/src/Exception/TaskListServiceUnavailableException.php index a174d19d..e6cd1067 100644 --- a/src/Exception/TaskListServiceUnavailableException.php +++ b/src/Exception/TaskListServiceUnavailableException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class TaskListServiceUnavailableException extends \RuntimeException implements ServerException +class TaskListServiceUnavailableException extends ServiceUnavailableException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('node is not part of a swarm', 503); + parent::__construct('node is not part of a swarm'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/TaskLogsInternalServerErrorException.php b/src/Exception/TaskLogsInternalServerErrorException.php deleted file mode 100644 index ef886c23..00000000 --- a/src/Exception/TaskLogsInternalServerErrorException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/TaskLogsNotFoundException.php b/src/Exception/TaskLogsNotFoundException.php index fd8bd261..21fff1be 100644 --- a/src/Exception/TaskLogsNotFoundException.php +++ b/src/Exception/TaskLogsNotFoundException.php @@ -2,26 +2,23 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class TaskLogsNotFoundException extends \RuntimeException implements ClientException +class TaskLogsNotFoundException extends NotFoundException { - private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(?\Psr\Http\Message\ResponseInterface $response = null) { - parent::__construct('no such task', 404); - $this->errorResponse = $errorResponse; + parent::__construct('no such task'); + $this->response = $response; } - public function getErrorResponse() + public function getResponse(): ?\Psr\Http\Message\ResponseInterface { - return $this->errorResponse; + return $this->response; } } diff --git a/src/Exception/TaskLogsServiceUnavailableException.php b/src/Exception/TaskLogsServiceUnavailableException.php deleted file mode 100644 index e17c168c..00000000 --- a/src/Exception/TaskLogsServiceUnavailableException.php +++ /dev/null @@ -1,27 +0,0 @@ -errorResponse = $errorResponse; - } - - public function getErrorResponse() - { - return $this->errorResponse; - } -} diff --git a/src/Exception/UnauthorizedException.php b/src/Exception/UnauthorizedException.php new file mode 100644 index 00000000..685c19c6 --- /dev/null +++ b/src/Exception/UnauthorizedException.php @@ -0,0 +1,13 @@ +errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/VolumeDeleteConflictException.php b/src/Exception/VolumeDeleteConflictException.php index 17bf126b..32282d9a 100644 --- a/src/Exception/VolumeDeleteConflictException.php +++ b/src/Exception/VolumeDeleteConflictException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class VolumeDeleteConflictException extends \RuntimeException implements ClientException +class VolumeDeleteConflictException extends ConflictException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Volume is in use and cannot be removed', 409); + parent::__construct('Volume is in use and cannot be removed'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/VolumeDeleteInternalServerErrorException.php b/src/Exception/VolumeDeleteInternalServerErrorException.php index a3bf54b3..95ec47b8 100644 --- a/src/Exception/VolumeDeleteInternalServerErrorException.php +++ b/src/Exception/VolumeDeleteInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class VolumeDeleteInternalServerErrorException extends \RuntimeException implements ServerException +class VolumeDeleteInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/VolumeDeleteNotFoundException.php b/src/Exception/VolumeDeleteNotFoundException.php index 5f2423a1..18c02b15 100644 --- a/src/Exception/VolumeDeleteNotFoundException.php +++ b/src/Exception/VolumeDeleteNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class VolumeDeleteNotFoundException extends \RuntimeException implements ClientException +class VolumeDeleteNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('No such volume or volume driver', 404); + parent::__construct('No such volume or volume driver'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/VolumeInspectInternalServerErrorException.php b/src/Exception/VolumeInspectInternalServerErrorException.php index 9f1af985..24928851 100644 --- a/src/Exception/VolumeInspectInternalServerErrorException.php +++ b/src/Exception/VolumeInspectInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class VolumeInspectInternalServerErrorException extends \RuntimeException implements ServerException +class VolumeInspectInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/VolumeInspectNotFoundException.php b/src/Exception/VolumeInspectNotFoundException.php index eb924fe3..49e72842 100644 --- a/src/Exception/VolumeInspectNotFoundException.php +++ b/src/Exception/VolumeInspectNotFoundException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class VolumeInspectNotFoundException extends \RuntimeException implements ClientException +class VolumeInspectNotFoundException extends NotFoundException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('No such volume', 404); + parent::__construct('No such volume'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/VolumeListInternalServerErrorException.php b/src/Exception/VolumeListInternalServerErrorException.php index f8644e69..2e323ed8 100644 --- a/src/Exception/VolumeListInternalServerErrorException.php +++ b/src/Exception/VolumeListInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class VolumeListInternalServerErrorException extends \RuntimeException implements ServerException +class VolumeListInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/VolumePruneInternalServerErrorException.php b/src/Exception/VolumePruneInternalServerErrorException.php index b25daf92..70e52fd0 100644 --- a/src/Exception/VolumePruneInternalServerErrorException.php +++ b/src/Exception/VolumePruneInternalServerErrorException.php @@ -2,26 +2,33 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Exception; -class VolumePruneInternalServerErrorException extends \RuntimeException implements ServerException +class VolumePruneInternalServerErrorException extends InternalServerErrorException { + /** + * @var \Docker\API\Model\ErrorResponse + */ private $errorResponse; + /** + * @var \Psr\Http\Message\ResponseInterface + */ + private $response; - public function __construct(\Docker\API\Model\ErrorResponse $errorResponse) + public function __construct(\Docker\API\Model\ErrorResponse $errorResponse, \Psr\Http\Message\ResponseInterface $response) { - parent::__construct('Server error', 500); + parent::__construct('Server error'); $this->errorResponse = $errorResponse; + $this->response = $response; } - public function getErrorResponse() + public function getErrorResponse(): \Docker\API\Model\ErrorResponse { return $this->errorResponse; } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } } diff --git a/src/Exception/VolumeUpdateBadRequestException.php b/src/Exception/VolumeUpdateBadRequestException.php new file mode 100644 index 00000000..d423d4cf --- /dev/null +++ b/src/Exception/VolumeUpdateBadRequestException.php @@ -0,0 +1,34 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} diff --git a/src/Exception/VolumeUpdateInternalServerErrorException.php b/src/Exception/VolumeUpdateInternalServerErrorException.php new file mode 100644 index 00000000..fad2b710 --- /dev/null +++ b/src/Exception/VolumeUpdateInternalServerErrorException.php @@ -0,0 +1,34 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} diff --git a/src/Exception/VolumeUpdateNotFoundException.php b/src/Exception/VolumeUpdateNotFoundException.php new file mode 100644 index 00000000..0309562d --- /dev/null +++ b/src/Exception/VolumeUpdateNotFoundException.php @@ -0,0 +1,34 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} diff --git a/src/Exception/VolumeUpdateServiceUnavailableException.php b/src/Exception/VolumeUpdateServiceUnavailableException.php new file mode 100644 index 00000000..52e891a1 --- /dev/null +++ b/src/Exception/VolumeUpdateServiceUnavailableException.php @@ -0,0 +1,34 @@ +errorResponse = $errorResponse; + $this->response = $response; + } + + public function getErrorResponse(): \Docker\API\Model\ErrorResponse + { + return $this->errorResponse; + } + + public function getResponse(): \Psr\Http\Message\ResponseInterface + { + return $this->response; + } +} diff --git a/src/Model/Address.php b/src/Model/Address.php index 9e38b190..536395cb 100644 --- a/src/Model/Address.php +++ b/src/Model/Address.php @@ -2,33 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Address +class Address extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * IP address. * - * @var string + * @var string|null */ protected $addr; /** * Mask length of the IP address. * - * @var int + * @var int|null */ protected $prefixLen; /** * IP address. - * - * @return string */ public function getAddr(): ?string { @@ -37,13 +38,10 @@ public function getAddr(): ?string /** * IP address. - * - * @param string $addr - * - * @return self */ public function setAddr(?string $addr): self { + $this->initialized['addr'] = true; $this->addr = $addr; return $this; @@ -51,8 +49,6 @@ public function setAddr(?string $addr): self /** * Mask length of the IP address. - * - * @return int */ public function getPrefixLen(): ?int { @@ -61,13 +57,10 @@ public function getPrefixLen(): ?int /** * Mask length of the IP address. - * - * @param int $prefixLen - * - * @return self */ public function setPrefixLen(?int $prefixLen): self { + $this->initialized['prefixLen'] = true; $this->prefixLen = $prefixLen; return $this; diff --git a/src/Model/AuthConfig.php b/src/Model/AuthConfig.php index 3a548a52..ed7af28b 100644 --- a/src/Model/AuthConfig.php +++ b/src/Model/AuthConfig.php @@ -2,108 +2,83 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class AuthConfig +class AuthConfig extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $username; /** - * @var string + * @var string|null */ protected $password; /** - * @var string + * @var string|null */ protected $email; /** - * @var string + * @var string|null */ protected $serveraddress; - /** - * @return string - */ public function getUsername(): ?string { return $this->username; } - /** - * @param string $username - * - * @return self - */ public function setUsername(?string $username): self { + $this->initialized['username'] = true; $this->username = $username; return $this; } - /** - * @return string - */ public function getPassword(): ?string { return $this->password; } - /** - * @param string $password - * - * @return self - */ public function setPassword(?string $password): self { + $this->initialized['password'] = true; $this->password = $password; return $this; } - /** - * @return string - */ public function getEmail(): ?string { return $this->email; } - /** - * @param string $email - * - * @return self - */ public function setEmail(?string $email): self { + $this->initialized['email'] = true; $this->email = $email; return $this; } - /** - * @return string - */ public function getServeraddress(): ?string { return $this->serveraddress; } - /** - * @param string $serveraddress - * - * @return self - */ public function setServeraddress(?string $serveraddress): self { + $this->initialized['serveraddress'] = true; $this->serveraddress = $serveraddress; return $this; diff --git a/src/Model/AuthPostResponse200.php b/src/Model/AuthPostResponse200.php index 2d253338..3ef9bdfa 100644 --- a/src/Model/AuthPostResponse200.php +++ b/src/Model/AuthPostResponse200.php @@ -2,33 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class AuthPostResponse200 +class AuthPostResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The status of the authentication. * - * @var string + * @var string|null */ protected $status; /** * An opaque token used to authenticate a user after a successful login. * - * @var string + * @var string|null */ protected $identityToken; /** * The status of the authentication. - * - * @return string */ public function getStatus(): ?string { @@ -37,13 +38,10 @@ public function getStatus(): ?string /** * The status of the authentication. - * - * @param string $status - * - * @return self */ public function setStatus(?string $status): self { + $this->initialized['status'] = true; $this->status = $status; return $this; @@ -51,8 +49,6 @@ public function setStatus(?string $status): self /** * An opaque token used to authenticate a user after a successful login. - * - * @return string */ public function getIdentityToken(): ?string { @@ -61,13 +57,10 @@ public function getIdentityToken(): ?string /** * An opaque token used to authenticate a user after a successful login. - * - * @param string $identityToken - * - * @return self */ public function setIdentityToken(?string $identityToken): self { + $this->initialized['identityToken'] = true; $this->identityToken = $identityToken; return $this; diff --git a/src/Model/BuildCache.php b/src/Model/BuildCache.php new file mode 100644 index 00000000..c947bd23 --- /dev/null +++ b/src/Model/BuildCache.php @@ -0,0 +1,301 @@ +initialized); + } + /** + * Unique ID of the build cache record. + * + * @var string|null + */ + protected $iD; + /** + * ID of the parent build cache record. + * + * > **Deprecated**: This field is deprecated, and omitted if empty. + * + * @var string|null + */ + protected $parent; + /** + * List of parent build cache record IDs. + * + * @var list|null + */ + protected $parents; + /** + * Cache record type. + * + * @var string|null + */ + protected $type; + /** + * Description of the build-step that produced the build cache. + * + * @var string|null + */ + protected $description; + /** + * Indicates if the build cache is in use. + * + * @var bool|null + */ + protected $inUse; + /** + * Indicates if the build cache is shared. + * + * @var bool|null + */ + protected $shared; + /** + * Amount of disk space used by the build cache (in bytes). + * + * @var int|null + */ + protected $size; + /** + * Date and time at which the build cache was created in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + * + * @var string|null + */ + protected $createdAt; + /** + * Date and time at which the build cache was last used in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + * + * @var string|null + */ + protected $lastUsedAt; + /** + * @var int|null + */ + protected $usageCount; + + /** + * Unique ID of the build cache record. + */ + public function getID(): ?string + { + return $this->iD; + } + + /** + * Unique ID of the build cache record. + */ + public function setID(?string $iD): self + { + $this->initialized['iD'] = true; + $this->iD = $iD; + + return $this; + } + + /** + * ID of the parent build cache record. + * + * > **Deprecated**: This field is deprecated, and omitted if empty. + */ + public function getParent(): ?string + { + return $this->parent; + } + + /** + * ID of the parent build cache record. + * + * > **Deprecated**: This field is deprecated, and omitted if empty. + */ + public function setParent(?string $parent): self + { + $this->initialized['parent'] = true; + $this->parent = $parent; + + return $this; + } + + /** + * List of parent build cache record IDs. + * + * @return list|null + */ + public function getParents(): ?array + { + return $this->parents; + } + + /** + * List of parent build cache record IDs. + * + * @param list|null $parents + */ + public function setParents(?array $parents): self + { + $this->initialized['parents'] = true; + $this->parents = $parents; + + return $this; + } + + /** + * Cache record type. + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * Cache record type. + */ + public function setType(?string $type): self + { + $this->initialized['type'] = true; + $this->type = $type; + + return $this; + } + + /** + * Description of the build-step that produced the build cache. + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * Description of the build-step that produced the build cache. + */ + public function setDescription(?string $description): self + { + $this->initialized['description'] = true; + $this->description = $description; + + return $this; + } + + /** + * Indicates if the build cache is in use. + */ + public function getInUse(): ?bool + { + return $this->inUse; + } + + /** + * Indicates if the build cache is in use. + */ + public function setInUse(?bool $inUse): self + { + $this->initialized['inUse'] = true; + $this->inUse = $inUse; + + return $this; + } + + /** + * Indicates if the build cache is shared. + */ + public function getShared(): ?bool + { + return $this->shared; + } + + /** + * Indicates if the build cache is shared. + */ + public function setShared(?bool $shared): self + { + $this->initialized['shared'] = true; + $this->shared = $shared; + + return $this; + } + + /** + * Amount of disk space used by the build cache (in bytes). + */ + public function getSize(): ?int + { + return $this->size; + } + + /** + * Amount of disk space used by the build cache (in bytes). + */ + public function setSize(?int $size): self + { + $this->initialized['size'] = true; + $this->size = $size; + + return $this; + } + + /** + * Date and time at which the build cache was created in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * Date and time at which the build cache was created in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + */ + public function setCreatedAt(?string $createdAt): self + { + $this->initialized['createdAt'] = true; + $this->createdAt = $createdAt; + + return $this; + } + + /** + * Date and time at which the build cache was last used in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + */ + public function getLastUsedAt(): ?string + { + return $this->lastUsedAt; + } + + /** + * Date and time at which the build cache was last used in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + */ + public function setLastUsedAt(?string $lastUsedAt): self + { + $this->initialized['lastUsedAt'] = true; + $this->lastUsedAt = $lastUsedAt; + + return $this; + } + + public function getUsageCount(): ?int + { + return $this->usageCount; + } + + public function setUsageCount(?int $usageCount): self + { + $this->initialized['usageCount'] = true; + $this->usageCount = $usageCount; + + return $this; + } +} diff --git a/src/Model/BuildInfo.php b/src/Model/BuildInfo.php index 59fd204d..c849d615 100644 --- a/src/Model/BuildInfo.php +++ b/src/Model/BuildInfo.php @@ -2,186 +2,140 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class BuildInfo +class BuildInfo extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $id; /** - * @var string + * @var string|null */ protected $stream; /** - * @var string + * @var string|null */ protected $error; /** - * @var ErrorDetail + * @var ErrorDetail|null */ protected $errorDetail; /** - * @var string + * @var string|null */ protected $status; /** - * @var string + * @var string|null */ protected $progress; /** - * @var ProgressDetail + * @var ProgressDetail|null */ protected $progressDetail; /** * Image ID or Digest. * - * @var ImageID + * @var ImageID|null */ protected $aux; - /** - * @return string - */ public function getId(): ?string { return $this->id; } - /** - * @param string $id - * - * @return self - */ public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; } - /** - * @return string - */ public function getStream(): ?string { return $this->stream; } - /** - * @param string $stream - * - * @return self - */ public function setStream(?string $stream): self { + $this->initialized['stream'] = true; $this->stream = $stream; return $this; } - /** - * @return string - */ public function getError(): ?string { return $this->error; } - /** - * @param string $error - * - * @return self - */ public function setError(?string $error): self { + $this->initialized['error'] = true; $this->error = $error; return $this; } - /** - * @return ErrorDetail - */ public function getErrorDetail(): ?ErrorDetail { return $this->errorDetail; } - /** - * @param ErrorDetail $errorDetail - * - * @return self - */ public function setErrorDetail(?ErrorDetail $errorDetail): self { + $this->initialized['errorDetail'] = true; $this->errorDetail = $errorDetail; return $this; } - /** - * @return string - */ public function getStatus(): ?string { return $this->status; } - /** - * @param string $status - * - * @return self - */ public function setStatus(?string $status): self { + $this->initialized['status'] = true; $this->status = $status; return $this; } - /** - * @return string - */ public function getProgress(): ?string { return $this->progress; } - /** - * @param string $progress - * - * @return self - */ public function setProgress(?string $progress): self { + $this->initialized['progress'] = true; $this->progress = $progress; return $this; } - /** - * @return ProgressDetail - */ public function getProgressDetail(): ?ProgressDetail { return $this->progressDetail; } - /** - * @param ProgressDetail $progressDetail - * - * @return self - */ public function setProgressDetail(?ProgressDetail $progressDetail): self { + $this->initialized['progressDetail'] = true; $this->progressDetail = $progressDetail; return $this; @@ -189,8 +143,6 @@ public function setProgressDetail(?ProgressDetail $progressDetail): self /** * Image ID or Digest. - * - * @return ImageID */ public function getAux(): ?ImageID { @@ -199,13 +151,10 @@ public function getAux(): ?ImageID /** * Image ID or Digest. - * - * @param ImageID $aux - * - * @return self */ public function setAux(?ImageID $aux): self { + $this->initialized['aux'] = true; $this->aux = $aux; return $this; diff --git a/src/Model/BuildPrunePostResponse200.php b/src/Model/BuildPrunePostResponse200.php index 20e1970e..b630ca4c 100644 --- a/src/Model/BuildPrunePostResponse200.php +++ b/src/Model/BuildPrunePostResponse200.php @@ -2,27 +2,51 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class BuildPrunePostResponse200 +class BuildPrunePostResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var list|null + */ + protected $cachesDeleted; /** * Disk space reclaimed in bytes. * - * @var int + * @var int|null */ protected $spaceReclaimed; + /** + * @return list|null + */ + public function getCachesDeleted(): ?array + { + return $this->cachesDeleted; + } + + /** + * @param list|null $cachesDeleted + */ + public function setCachesDeleted(?array $cachesDeleted): self + { + $this->initialized['cachesDeleted'] = true; + $this->cachesDeleted = $cachesDeleted; + + return $this; + } + /** * Disk space reclaimed in bytes. - * - * @return int */ public function getSpaceReclaimed(): ?int { @@ -31,13 +55,10 @@ public function getSpaceReclaimed(): ?int /** * Disk space reclaimed in bytes. - * - * @param int $spaceReclaimed - * - * @return self */ public function setSpaceReclaimed(?int $spaceReclaimed): self { + $this->initialized['spaceReclaimed'] = true; $this->spaceReclaimed = $spaceReclaimed; return $this; diff --git a/src/Model/ClusterInfo.php b/src/Model/ClusterInfo.php index 17998136..0b679457 100644 --- a/src/Model/ClusterInfo.php +++ b/src/Model/ClusterInfo.php @@ -2,74 +2,98 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ClusterInfo +class ClusterInfo extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The ID of the swarm. * - * @var string + * @var string|null */ protected $iD; /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. + * + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. * - * @var ObjectVersion + * @var ObjectVersion|null */ protected $version; /** - * Date and time at which the swarm was initialised in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - + * Date and time at which the swarm was initialised in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. * - * @var string + * @var string|null */ protected $createdAt; /** - * Date and time at which the swarm was last updated in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - + * Date and time at which the swarm was last updated in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. * - * @var string + * @var string|null */ protected $updatedAt; /** * User modifiable swarm configuration. * - * @var SwarmSpec + * @var SwarmSpec|null */ protected $spec; /** - * Information about the issuer of leaf TLS certificates and the trusted root CA certificate. + * Information about the issuer of leaf TLS certificates and the trusted root + * CA certificate. * - * @var TLSInfo + * @var TLSInfo|null */ protected $tLSInfo; /** * Whether there is currently a root CA rotation in progress for the swarm. * - * @var bool + * @var bool|null */ protected $rootRotationInProgress; + /** + * DataPathPort specifies the data path port number for data traffic. + * Acceptable port range is 1024 to 49151. + * If no port is set or is set to 0, the default port (4789) is used. + * + * @var int|null + */ + protected $dataPathPort; + /** + * Default Address Pool specifies default subnet pools for global scope + * networks. + * + * @var list|null + */ + protected $defaultAddrPool; + /** + * SubnetSize specifies the subnet size of the networks created from the + * default subnet pool. + * + * @var int|null + */ + protected $subnetSize; /** * The ID of the swarm. - * - * @return string */ public function getID(): ?string { @@ -78,29 +102,26 @@ public function getID(): ?string /** * The ID of the swarm. - * - * @param string $iD - * - * @return self */ public function setID(?string $iD): self { + $this->initialized['iD'] = true; $this->iD = $iD; return $this; } /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. * - * @return ObjectVersion + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. */ public function getVersion(): ?ObjectVersion { @@ -108,32 +129,28 @@ public function getVersion(): ?ObjectVersion } /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. * - * @param ObjectVersion $version - * - * @return self + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. */ public function setVersion(?ObjectVersion $version): self { + $this->initialized['version'] = true; $this->version = $version; return $this; } /** - * Date and time at which the swarm was initialised in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - - * - * @return string + * Date and time at which the swarm was initialised in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. */ public function getCreatedAt(): ?string { @@ -141,27 +158,20 @@ public function getCreatedAt(): ?string } /** - * Date and time at which the swarm was initialised in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - - * - * @param string $createdAt - * - * @return self + * Date and time at which the swarm was initialised in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. */ public function setCreatedAt(?string $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; } /** - * Date and time at which the swarm was last updated in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - - * - * @return string + * Date and time at which the swarm was last updated in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. */ public function getUpdatedAt(): ?string { @@ -169,16 +179,12 @@ public function getUpdatedAt(): ?string } /** - * Date and time at which the swarm was last updated in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - - * - * @param string $updatedAt - * - * @return self + * Date and time at which the swarm was last updated in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. */ public function setUpdatedAt(?string $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; @@ -186,8 +192,6 @@ public function setUpdatedAt(?string $updatedAt): self /** * User modifiable swarm configuration. - * - * @return SwarmSpec */ public function getSpec(): ?SwarmSpec { @@ -196,22 +200,18 @@ public function getSpec(): ?SwarmSpec /** * User modifiable swarm configuration. - * - * @param SwarmSpec $spec - * - * @return self */ public function setSpec(?SwarmSpec $spec): self { + $this->initialized['spec'] = true; $this->spec = $spec; return $this; } /** - * Information about the issuer of leaf TLS certificates and the trusted root CA certificate. - * - * @return TLSInfo + * Information about the issuer of leaf TLS certificates and the trusted root + * CA certificate. */ public function getTLSInfo(): ?TLSInfo { @@ -219,14 +219,12 @@ public function getTLSInfo(): ?TLSInfo } /** - * Information about the issuer of leaf TLS certificates and the trusted root CA certificate. - * - * @param TLSInfo $tLSInfo - * - * @return self + * Information about the issuer of leaf TLS certificates and the trusted root + * CA certificate. */ public function setTLSInfo(?TLSInfo $tLSInfo): self { + $this->initialized['tLSInfo'] = true; $this->tLSInfo = $tLSInfo; return $this; @@ -234,8 +232,6 @@ public function setTLSInfo(?TLSInfo $tLSInfo): self /** * Whether there is currently a root CA rotation in progress for the swarm. - * - * @return bool */ public function getRootRotationInProgress(): ?bool { @@ -244,15 +240,81 @@ public function getRootRotationInProgress(): ?bool /** * Whether there is currently a root CA rotation in progress for the swarm. - * - * @param bool $rootRotationInProgress - * - * @return self */ public function setRootRotationInProgress(?bool $rootRotationInProgress): self { + $this->initialized['rootRotationInProgress'] = true; $this->rootRotationInProgress = $rootRotationInProgress; return $this; } + + /** + * DataPathPort specifies the data path port number for data traffic. + * Acceptable port range is 1024 to 49151. + * If no port is set or is set to 0, the default port (4789) is used. + */ + public function getDataPathPort(): ?int + { + return $this->dataPathPort; + } + + /** + * DataPathPort specifies the data path port number for data traffic. + * Acceptable port range is 1024 to 49151. + * If no port is set or is set to 0, the default port (4789) is used. + */ + public function setDataPathPort(?int $dataPathPort): self + { + $this->initialized['dataPathPort'] = true; + $this->dataPathPort = $dataPathPort; + + return $this; + } + + /** + * Default Address Pool specifies default subnet pools for global scope + * networks. + * + * @return list|null + */ + public function getDefaultAddrPool(): ?array + { + return $this->defaultAddrPool; + } + + /** + * Default Address Pool specifies default subnet pools for global scope + * networks. + * + * @param list|null $defaultAddrPool + */ + public function setDefaultAddrPool(?array $defaultAddrPool): self + { + $this->initialized['defaultAddrPool'] = true; + $this->defaultAddrPool = $defaultAddrPool; + + return $this; + } + + /** + * SubnetSize specifies the subnet size of the networks created from the + * default subnet pool. + */ + public function getSubnetSize(): ?int + { + return $this->subnetSize; + } + + /** + * SubnetSize specifies the subnet size of the networks created from the + * default subnet pool. + */ + public function setSubnetSize(?int $subnetSize): self + { + $this->initialized['subnetSize'] = true; + $this->subnetSize = $subnetSize; + + return $this; + } } diff --git a/src/Model/ClusterVolume.php b/src/Model/ClusterVolume.php new file mode 100644 index 00000000..dfc6e9f3 --- /dev/null +++ b/src/Model/ClusterVolume.php @@ -0,0 +1,217 @@ +initialized); + } + /** + * The Swarm ID of this volume. Because cluster volumes are Swarm + * objects, they have an ID, unlike non-cluster volumes. This ID can + * be used to refer to the Volume instead of the name. + * + * @var string|null + */ + protected $iD; + /** + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. + * + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. + * + * @var ObjectVersion|null + */ + protected $version; + /** + * @var string|null + */ + protected $createdAt; + /** + * @var string|null + */ + protected $updatedAt; + /** + * Cluster-specific options used to create the volume. + * + * @var ClusterVolumeSpec|null + */ + protected $spec; + /** + * Information about the global status of the volume. + * + * @var ClusterVolumeInfo|null + */ + protected $info; + /** + * The status of the volume as it pertains to its publishing and use on + * specific nodes. + * + * @var list|null + */ + protected $publishStatus; + + /** + * The Swarm ID of this volume. Because cluster volumes are Swarm + * objects, they have an ID, unlike non-cluster volumes. This ID can + * be used to refer to the Volume instead of the name. + */ + public function getID(): ?string + { + return $this->iD; + } + + /** + * The Swarm ID of this volume. Because cluster volumes are Swarm + * objects, they have an ID, unlike non-cluster volumes. This ID can + * be used to refer to the Volume instead of the name. + */ + public function setID(?string $iD): self + { + $this->initialized['iD'] = true; + $this->iD = $iD; + + return $this; + } + + /** + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. + * + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. + */ + public function getVersion(): ?ObjectVersion + { + return $this->version; + } + + /** + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. + * + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. + */ + public function setVersion(?ObjectVersion $version): self + { + $this->initialized['version'] = true; + $this->version = $version; + + return $this; + } + + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + public function setCreatedAt(?string $createdAt): self + { + $this->initialized['createdAt'] = true; + $this->createdAt = $createdAt; + + return $this; + } + + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + public function setUpdatedAt(?string $updatedAt): self + { + $this->initialized['updatedAt'] = true; + $this->updatedAt = $updatedAt; + + return $this; + } + + /** + * Cluster-specific options used to create the volume. + */ + public function getSpec(): ?ClusterVolumeSpec + { + return $this->spec; + } + + /** + * Cluster-specific options used to create the volume. + */ + public function setSpec(?ClusterVolumeSpec $spec): self + { + $this->initialized['spec'] = true; + $this->spec = $spec; + + return $this; + } + + /** + * Information about the global status of the volume. + */ + public function getInfo(): ?ClusterVolumeInfo + { + return $this->info; + } + + /** + * Information about the global status of the volume. + */ + public function setInfo(?ClusterVolumeInfo $info): self + { + $this->initialized['info'] = true; + $this->info = $info; + + return $this; + } + + /** + * The status of the volume as it pertains to its publishing and use on + * specific nodes. + * + * @return list|null + */ + public function getPublishStatus(): ?array + { + return $this->publishStatus; + } + + /** + * The status of the volume as it pertains to its publishing and use on + * specific nodes. + * + * @param list|null $publishStatus + */ + public function setPublishStatus(?array $publishStatus): self + { + $this->initialized['publishStatus'] = true; + $this->publishStatus = $publishStatus; + + return $this; + } +} diff --git a/src/Model/ClusterVolumeInfo.php b/src/Model/ClusterVolumeInfo.php new file mode 100644 index 00000000..1a8d4f58 --- /dev/null +++ b/src/Model/ClusterVolumeInfo.php @@ -0,0 +1,144 @@ +initialized); + } + /** + * The capacity of the volume in bytes. A value of 0 indicates that + * the capacity is unknown. + * + * @var int|null + */ + protected $capacityBytes; + /** + * A map of strings to strings returned from the storage plugin when + * the volume is created. + * + * @var array|null + */ + protected $volumeContext; + /** + * The ID of the volume as returned by the CSI storage plugin. This + * is distinct from the volume's ID as provided by Docker. This ID + * is never used by the user when communicating with Docker to refer + * to this volume. If the ID is blank, then the Volume has not been + * successfully created in the plugin yet. + * + * @var string|null + */ + protected $volumeID; + /** + * The topology this volume is actually accessible from. + * + * @var list>|null + */ + protected $accessibleTopology; + + /** + * The capacity of the volume in bytes. A value of 0 indicates that + * the capacity is unknown. + */ + public function getCapacityBytes(): ?int + { + return $this->capacityBytes; + } + + /** + * The capacity of the volume in bytes. A value of 0 indicates that + * the capacity is unknown. + */ + public function setCapacityBytes(?int $capacityBytes): self + { + $this->initialized['capacityBytes'] = true; + $this->capacityBytes = $capacityBytes; + + return $this; + } + + /** + * A map of strings to strings returned from the storage plugin when + * the volume is created. + * + * @return array|null + */ + public function getVolumeContext(): ?iterable + { + return $this->volumeContext; + } + + /** + * A map of strings to strings returned from the storage plugin when + * the volume is created. + * + * @param array|null $volumeContext + */ + public function setVolumeContext(?iterable $volumeContext): self + { + $this->initialized['volumeContext'] = true; + $this->volumeContext = $volumeContext; + + return $this; + } + + /** + * The ID of the volume as returned by the CSI storage plugin. This + * is distinct from the volume's ID as provided by Docker. This ID + * is never used by the user when communicating with Docker to refer + * to this volume. If the ID is blank, then the Volume has not been + * successfully created in the plugin yet. + */ + public function getVolumeID(): ?string + { + return $this->volumeID; + } + + /** + * The ID of the volume as returned by the CSI storage plugin. This + * is distinct from the volume's ID as provided by Docker. This ID + * is never used by the user when communicating with Docker to refer + * to this volume. If the ID is blank, then the Volume has not been + * successfully created in the plugin yet. + */ + public function setVolumeID(?string $volumeID): self + { + $this->initialized['volumeID'] = true; + $this->volumeID = $volumeID; + + return $this; + } + + /** + * The topology this volume is actually accessible from. + * + * @return list>|null + */ + public function getAccessibleTopology(): ?array + { + return $this->accessibleTopology; + } + + /** + * The topology this volume is actually accessible from. + * + * @param list>|null $accessibleTopology + */ + public function setAccessibleTopology(?array $accessibleTopology): self + { + $this->initialized['accessibleTopology'] = true; + $this->accessibleTopology = $accessibleTopology; + + return $this; + } +} diff --git a/src/Model/ClusterVolumePublishStatusItem.php b/src/Model/ClusterVolumePublishStatusItem.php new file mode 100644 index 00000000..11f99925 --- /dev/null +++ b/src/Model/ClusterVolumePublishStatusItem.php @@ -0,0 +1,112 @@ +initialized); + } + /** + * The ID of the Swarm node the volume is published on. + * + * @var string|null + */ + protected $nodeID; + /** + * The published state of the volume. + * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed. + * `published` The volume is published successfully to the node. + * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so. + * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller. + * + * @var string|null + */ + protected $state; + /** + * A map of strings to strings returned by the CSI controller + * plugin when a volume is published. + * + * @var array|null + */ + protected $publishContext; + + /** + * The ID of the Swarm node the volume is published on. + */ + public function getNodeID(): ?string + { + return $this->nodeID; + } + + /** + * The ID of the Swarm node the volume is published on. + */ + public function setNodeID(?string $nodeID): self + { + $this->initialized['nodeID'] = true; + $this->nodeID = $nodeID; + + return $this; + } + + /** + * The published state of the volume. + * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed. + * `published` The volume is published successfully to the node. + * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so. + * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller. + */ + public function getState(): ?string + { + return $this->state; + } + + /** + * The published state of the volume. + * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed. + * `published` The volume is published successfully to the node. + * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so. + * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller. + */ + public function setState(?string $state): self + { + $this->initialized['state'] = true; + $this->state = $state; + + return $this; + } + + /** + * A map of strings to strings returned by the CSI controller + * plugin when a volume is published. + * + * @return array|null + */ + public function getPublishContext(): ?iterable + { + return $this->publishContext; + } + + /** + * A map of strings to strings returned by the CSI controller + * plugin when a volume is published. + * + * @param array|null $publishContext + */ + public function setPublishContext(?iterable $publishContext): self + { + $this->initialized['publishContext'] = true; + $this->publishContext = $publishContext; + + return $this; + } +} diff --git a/src/Model/ClusterVolumeSpec.php b/src/Model/ClusterVolumeSpec.php new file mode 100644 index 00000000..a8e8db24 --- /dev/null +++ b/src/Model/ClusterVolumeSpec.php @@ -0,0 +1,83 @@ +initialized); + } + /** + * Group defines the volume group of this volume. Volumes belonging to + * the same group can be referred to by group name when creating + * Services. Referring to a volume by group instructs Swarm to treat + * volumes in that group interchangeably for the purpose of scheduling. + * Volumes with an empty string for a group technically all belong to + * the same, emptystring group. + * + * @var string|null + */ + protected $group; + /** + * Defines how the volume is used by tasks. + * + * @var ClusterVolumeSpecAccessMode|null + */ + protected $accessMode; + + /** + * Group defines the volume group of this volume. Volumes belonging to + * the same group can be referred to by group name when creating + * Services. Referring to a volume by group instructs Swarm to treat + * volumes in that group interchangeably for the purpose of scheduling. + * Volumes with an empty string for a group technically all belong to + * the same, emptystring group. + */ + public function getGroup(): ?string + { + return $this->group; + } + + /** + * Group defines the volume group of this volume. Volumes belonging to + * the same group can be referred to by group name when creating + * Services. Referring to a volume by group instructs Swarm to treat + * volumes in that group interchangeably for the purpose of scheduling. + * Volumes with an empty string for a group technically all belong to + * the same, emptystring group. + */ + public function setGroup(?string $group): self + { + $this->initialized['group'] = true; + $this->group = $group; + + return $this; + } + + /** + * Defines how the volume is used by tasks. + */ + public function getAccessMode(): ?ClusterVolumeSpecAccessMode + { + return $this->accessMode; + } + + /** + * Defines how the volume is used by tasks. + */ + public function setAccessMode(?ClusterVolumeSpecAccessMode $accessMode): self + { + $this->initialized['accessMode'] = true; + $this->accessMode = $accessMode; + + return $this; + } +} diff --git a/src/Model/ClusterVolumeSpecAccessMode.php b/src/Model/ClusterVolumeSpecAccessMode.php new file mode 100644 index 00000000..661b6be1 --- /dev/null +++ b/src/Model/ClusterVolumeSpecAccessMode.php @@ -0,0 +1,299 @@ +initialized); + } + /** + * The set of nodes this volume can be used on at one time. + * - `single` The volume may only be scheduled to one node at a time. + * - `multi` the volume may be scheduled to any supported number of nodes at a time. + * + * @var string|null + */ + protected $scope = 'single'; + /** + * The number and way that different tasks can use this volume + * at one time. + * - `none` The volume may only be used by one task at a time. + * - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly + * - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write. + * - `all` The volume may have any number of readers and writers. + * + * @var string|null + */ + protected $sharing = 'none'; + /** + * Options for using this volume as a Mount-type volume. + * + * Either MountVolume or BlockVolume, but not both, must be + * present. + * properties: + * FsType: + * type: "string" + * description: | + * Specifies the filesystem type for the mount volume. + * Optional. + * MountFlags: + * type: "array" + * description: | + * Flags to pass when mounting the volume. Optional. + * items: + * type: "string" + * BlockVolume: + * type: "object" + * description: | + * Options for using this volume as a Block-type volume. + * Intentionally empty. + * + * @var ClusterVolumeSpecAccessModeMountVolume|null + */ + protected $mountVolume; + /** + * Swarm Secrets that are passed to the CSI storage plugin when + * operating on this volume. + * + * @var list|null + */ + protected $secrets; + /** + * Requirements for the accessible topology of the volume. These + * fields are optional. For an in-depth description of what these + * fields mean, see the CSI specification. + * + * @var ClusterVolumeSpecAccessModeAccessibilityRequirements|null + */ + protected $accessibilityRequirements; + /** + * The desired capacity that the volume should be created with. If + * empty, the plugin will decide the capacity. + * + * @var ClusterVolumeSpecAccessModeCapacityRange|null + */ + protected $capacityRange; + /** + * The availability of the volume for use in tasks. + * - `active` The volume is fully available for scheduling on the cluster + * - `pause` No new workloads should use the volume, but existing workloads are not stopped. + * - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started. + * + * @var string|null + */ + protected $availability = 'active'; + + /** + * The set of nodes this volume can be used on at one time. + * - `single` The volume may only be scheduled to one node at a time. + * - `multi` the volume may be scheduled to any supported number of nodes at a time. + */ + public function getScope(): ?string + { + return $this->scope; + } + + /** + * The set of nodes this volume can be used on at one time. + * - `single` The volume may only be scheduled to one node at a time. + * - `multi` the volume may be scheduled to any supported number of nodes at a time. + */ + public function setScope(?string $scope): self + { + $this->initialized['scope'] = true; + $this->scope = $scope; + + return $this; + } + + /** + * The number and way that different tasks can use this volume + * at one time. + * - `none` The volume may only be used by one task at a time. + * - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly + * - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write. + * - `all` The volume may have any number of readers and writers. + */ + public function getSharing(): ?string + { + return $this->sharing; + } + + /** + * The number and way that different tasks can use this volume + * at one time. + * - `none` The volume may only be used by one task at a time. + * - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly + * - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write. + * - `all` The volume may have any number of readers and writers. + */ + public function setSharing(?string $sharing): self + { + $this->initialized['sharing'] = true; + $this->sharing = $sharing; + + return $this; + } + + /** + * Options for using this volume as a Mount-type volume. + * + * Either MountVolume or BlockVolume, but not both, must be + * present. + * properties: + * FsType: + * type: "string" + * description: | + * Specifies the filesystem type for the mount volume. + * Optional. + * MountFlags: + * type: "array" + * description: | + * Flags to pass when mounting the volume. Optional. + * items: + * type: "string" + * BlockVolume: + * type: "object" + * description: | + * Options for using this volume as a Block-type volume. + * Intentionally empty. + */ + public function getMountVolume(): ?ClusterVolumeSpecAccessModeMountVolume + { + return $this->mountVolume; + } + + /** + * Options for using this volume as a Mount-type volume. + * + * Either MountVolume or BlockVolume, but not both, must be + * present. + * properties: + * FsType: + * type: "string" + * description: | + * Specifies the filesystem type for the mount volume. + * Optional. + * MountFlags: + * type: "array" + * description: | + * Flags to pass when mounting the volume. Optional. + * items: + * type: "string" + * BlockVolume: + * type: "object" + * description: | + * Options for using this volume as a Block-type volume. + * Intentionally empty. + */ + public function setMountVolume(?ClusterVolumeSpecAccessModeMountVolume $mountVolume): self + { + $this->initialized['mountVolume'] = true; + $this->mountVolume = $mountVolume; + + return $this; + } + + /** + * Swarm Secrets that are passed to the CSI storage plugin when + * operating on this volume. + * + * @return list|null + */ + public function getSecrets(): ?array + { + return $this->secrets; + } + + /** + * Swarm Secrets that are passed to the CSI storage plugin when + * operating on this volume. + * + * @param list|null $secrets + */ + public function setSecrets(?array $secrets): self + { + $this->initialized['secrets'] = true; + $this->secrets = $secrets; + + return $this; + } + + /** + * Requirements for the accessible topology of the volume. These + * fields are optional. For an in-depth description of what these + * fields mean, see the CSI specification. + */ + public function getAccessibilityRequirements(): ?ClusterVolumeSpecAccessModeAccessibilityRequirements + { + return $this->accessibilityRequirements; + } + + /** + * Requirements for the accessible topology of the volume. These + * fields are optional. For an in-depth description of what these + * fields mean, see the CSI specification. + */ + public function setAccessibilityRequirements(?ClusterVolumeSpecAccessModeAccessibilityRequirements $accessibilityRequirements): self + { + $this->initialized['accessibilityRequirements'] = true; + $this->accessibilityRequirements = $accessibilityRequirements; + + return $this; + } + + /** + * The desired capacity that the volume should be created with. If + * empty, the plugin will decide the capacity. + */ + public function getCapacityRange(): ?ClusterVolumeSpecAccessModeCapacityRange + { + return $this->capacityRange; + } + + /** + * The desired capacity that the volume should be created with. If + * empty, the plugin will decide the capacity. + */ + public function setCapacityRange(?ClusterVolumeSpecAccessModeCapacityRange $capacityRange): self + { + $this->initialized['capacityRange'] = true; + $this->capacityRange = $capacityRange; + + return $this; + } + + /** + * The availability of the volume for use in tasks. + * - `active` The volume is fully available for scheduling on the cluster + * - `pause` No new workloads should use the volume, but existing workloads are not stopped. + * - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started. + */ + public function getAvailability(): ?string + { + return $this->availability; + } + + /** + * The availability of the volume for use in tasks. + * - `active` The volume is fully available for scheduling on the cluster + * - `pause` No new workloads should use the volume, but existing workloads are not stopped. + * - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started. + */ + public function setAvailability(?string $availability): self + { + $this->initialized['availability'] = true; + $this->availability = $availability; + + return $this; + } +} diff --git a/src/Model/ClusterVolumeSpecAccessModeAccessibilityRequirements.php b/src/Model/ClusterVolumeSpecAccessModeAccessibilityRequirements.php new file mode 100644 index 00000000..795f330b --- /dev/null +++ b/src/Model/ClusterVolumeSpecAccessModeAccessibilityRequirements.php @@ -0,0 +1,82 @@ +initialized); + } + /** + * A list of required topologies, at least one of which the + * volume must be accessible from. + * + * @var list>|null + */ + protected $requisite; + /** + * A list of topologies that the volume should attempt to be + * provisioned in. + * + * @var list>|null + */ + protected $preferred; + + /** + * A list of required topologies, at least one of which the + * volume must be accessible from. + * + * @return list>|null + */ + public function getRequisite(): ?array + { + return $this->requisite; + } + + /** + * A list of required topologies, at least one of which the + * volume must be accessible from. + * + * @param list>|null $requisite + */ + public function setRequisite(?array $requisite): self + { + $this->initialized['requisite'] = true; + $this->requisite = $requisite; + + return $this; + } + + /** + * A list of topologies that the volume should attempt to be + * provisioned in. + * + * @return list>|null + */ + public function getPreferred(): ?array + { + return $this->preferred; + } + + /** + * A list of topologies that the volume should attempt to be + * provisioned in. + * + * @param list>|null $preferred + */ + public function setPreferred(?array $preferred): self + { + $this->initialized['preferred'] = true; + $this->preferred = $preferred; + + return $this; + } +} diff --git a/src/Model/ClusterVolumeSpecAccessModeCapacityRange.php b/src/Model/ClusterVolumeSpecAccessModeCapacityRange.php new file mode 100644 index 00000000..36d430f3 --- /dev/null +++ b/src/Model/ClusterVolumeSpecAccessModeCapacityRange.php @@ -0,0 +1,74 @@ +initialized); + } + /** + * The volume must be at least this big. The value of 0 + * indicates an unspecified minimum. + * + * @var int|null + */ + protected $requiredBytes; + /** + * The volume must not be bigger than this. The value of 0 + * indicates an unspecified maximum. + * + * @var int|null + */ + protected $limitBytes; + + /** + * The volume must be at least this big. The value of 0 + * indicates an unspecified minimum. + */ + public function getRequiredBytes(): ?int + { + return $this->requiredBytes; + } + + /** + * The volume must be at least this big. The value of 0 + * indicates an unspecified minimum. + */ + public function setRequiredBytes(?int $requiredBytes): self + { + $this->initialized['requiredBytes'] = true; + $this->requiredBytes = $requiredBytes; + + return $this; + } + + /** + * The volume must not be bigger than this. The value of 0 + * indicates an unspecified maximum. + */ + public function getLimitBytes(): ?int + { + return $this->limitBytes; + } + + /** + * The volume must not be bigger than this. The value of 0 + * indicates an unspecified maximum. + */ + public function setLimitBytes(?int $limitBytes): self + { + $this->initialized['limitBytes'] = true; + $this->limitBytes = $limitBytes; + + return $this; + } +} diff --git a/src/Model/ClusterVolumeSpecAccessModeMountVolume.php b/src/Model/ClusterVolumeSpecAccessModeMountVolume.php new file mode 100644 index 00000000..3148eaad --- /dev/null +++ b/src/Model/ClusterVolumeSpecAccessModeMountVolume.php @@ -0,0 +1,18 @@ +initialized); + } +} diff --git a/src/Model/ClusterVolumeSpecAccessModeSecretsItem.php b/src/Model/ClusterVolumeSpecAccessModeSecretsItem.php new file mode 100644 index 00000000..1c68a7dd --- /dev/null +++ b/src/Model/ClusterVolumeSpecAccessModeSecretsItem.php @@ -0,0 +1,80 @@ +initialized); + } + /** + * Key is the name of the key of the key-value pair passed to + * the plugin. + * + * @var string|null + */ + protected $key; + /** + * Secret is the swarm Secret object from which to read data. + * This can be a Secret name or ID. The Secret data is + * retrieved by swarm and used as the value of the key-value + * pair passed to the plugin. + * + * @var string|null + */ + protected $secret; + + /** + * Key is the name of the key of the key-value pair passed to + * the plugin. + */ + public function getKey(): ?string + { + return $this->key; + } + + /** + * Key is the name of the key of the key-value pair passed to + * the plugin. + */ + public function setKey(?string $key): self + { + $this->initialized['key'] = true; + $this->key = $key; + + return $this; + } + + /** + * Secret is the swarm Secret object from which to read data. + * This can be a Secret name or ID. The Secret data is + * retrieved by swarm and used as the value of the key-value + * pair passed to the plugin. + */ + public function getSecret(): ?string + { + return $this->secret; + } + + /** + * Secret is the swarm Secret object from which to read data. + * This can be a Secret name or ID. The Secret data is + * retrieved by swarm and used as the value of the key-value + * pair passed to the plugin. + */ + public function setSecret(?string $secret): self + { + $this->initialized['secret'] = true; + $this->secret = $secret; + + return $this; + } +} diff --git a/src/Model/Commit.php b/src/Model/Commit.php index eade836d..d66c9247 100644 --- a/src/Model/Commit.php +++ b/src/Model/Commit.php @@ -2,33 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Commit +class Commit extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Actual commit ID of external tool. * - * @var string + * @var string|null */ protected $iD; /** * Commit ID of external tool expected by dockerd as set at build time. * - * @var string + * @var string|null */ protected $expected; /** * Actual commit ID of external tool. - * - * @return string */ public function getID(): ?string { @@ -37,13 +38,10 @@ public function getID(): ?string /** * Actual commit ID of external tool. - * - * @param string $iD - * - * @return self */ public function setID(?string $iD): self { + $this->initialized['iD'] = true; $this->iD = $iD; return $this; @@ -51,8 +49,6 @@ public function setID(?string $iD): self /** * Commit ID of external tool expected by dockerd as set at build time. - * - * @return string */ public function getExpected(): ?string { @@ -61,13 +57,10 @@ public function getExpected(): ?string /** * Commit ID of external tool expected by dockerd as set at build time. - * - * @param string $expected - * - * @return self */ public function setExpected(?string $expected): self { + $this->initialized['expected'] = true; $this->expected = $expected; return $this; diff --git a/src/Model/Config.php b/src/Model/Config.php index c21e24af..43285757 100644 --- a/src/Model/Config.php +++ b/src/Model/Config.php @@ -2,77 +2,75 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Config +class Config extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $iD; /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. + * + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. * - * @var ObjectVersion + * @var ObjectVersion|null */ protected $version; /** - * @var string + * @var string|null */ protected $createdAt; /** - * @var string + * @var string|null */ protected $updatedAt; /** - * @var ConfigSpec + * @var ConfigSpec|null */ protected $spec; - /** - * @return string - */ public function getID(): ?string { return $this->iD; } - /** - * @param string $iD - * - * @return self - */ public function setID(?string $iD): self { + $this->initialized['iD'] = true; $this->iD = $iD; return $this; } /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. * - * @return ObjectVersion + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. */ public function getVersion(): ?ObjectVersion { @@ -80,81 +78,59 @@ public function getVersion(): ?ObjectVersion } /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - - * - * @param ObjectVersion $version + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. * - * @return self + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. */ public function setVersion(?ObjectVersion $version): self { + $this->initialized['version'] = true; $this->version = $version; return $this; } - /** - * @return string - */ public function getCreatedAt(): ?string { return $this->createdAt; } - /** - * @param string $createdAt - * - * @return self - */ public function setCreatedAt(?string $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; } - /** - * @return string - */ public function getUpdatedAt(): ?string { return $this->updatedAt; } - /** - * @param string $updatedAt - * - * @return self - */ public function setUpdatedAt(?string $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; } - /** - * @return ConfigSpec - */ public function getSpec(): ?ConfigSpec { return $this->spec; } - /** - * @param ConfigSpec $spec - * - * @return self - */ public function setSpec(?ConfigSpec $spec): self { + $this->initialized['spec'] = true; $this->spec = $spec; return $this; diff --git a/src/Model/ConfigSpec.php b/src/Model/ConfigSpec.php index 088e9364..876e4b11 100644 --- a/src/Model/ConfigSpec.php +++ b/src/Model/ConfigSpec.php @@ -2,41 +2,47 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ConfigSpec +class ConfigSpec extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * User-defined name of the config. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). - config data. - + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + * config data. * - * @var string + * @var string|null */ protected $data; + /** + * Driver represents a driver (network, logging, secrets). + * + * @var Driver|null + */ + protected $templating; /** * User-defined name of the config. - * - * @return string */ public function getName(): ?string { @@ -45,13 +51,10 @@ public function getName(): ?string /** * User-defined name of the config. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -60,9 +63,9 @@ public function setName(?string $name): self /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -70,23 +73,19 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value metadata. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; } /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). - config data. - - * - * @return string + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + * config data. */ public function getData(): ?string { @@ -94,18 +93,33 @@ public function getData(): ?string } /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). - config data. - - * - * @param string $data - * - * @return self + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + * config data. */ public function setData(?string $data): self { + $this->initialized['data'] = true; $this->data = $data; return $this; } + + /** + * Driver represents a driver (network, logging, secrets). + */ + public function getTemplating(): ?Driver + { + return $this->templating; + } + + /** + * Driver represents a driver (network, logging, secrets). + */ + public function setTemplating(?Driver $templating): self + { + $this->initialized['templating'] = true; + $this->templating = $templating; + + return $this; + } } diff --git a/src/Model/ConfigsCreatePostBody.php b/src/Model/ConfigsCreatePostBody.php index b6a30b5b..4d2b7078 100644 --- a/src/Model/ConfigsCreatePostBody.php +++ b/src/Model/ConfigsCreatePostBody.php @@ -2,41 +2,47 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ConfigsCreatePostBody +class ConfigsCreatePostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * User-defined name of the config. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). - config data. - + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + * config data. * - * @var string + * @var string|null */ protected $data; + /** + * Driver represents a driver (network, logging, secrets). + * + * @var Driver|null + */ + protected $templating; /** * User-defined name of the config. - * - * @return string */ public function getName(): ?string { @@ -45,13 +51,10 @@ public function getName(): ?string /** * User-defined name of the config. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -60,9 +63,9 @@ public function setName(?string $name): self /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -70,23 +73,19 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value metadata. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; } /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). - config data. - - * - * @return string + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + * config data. */ public function getData(): ?string { @@ -94,18 +93,33 @@ public function getData(): ?string } /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). - config data. - - * - * @param string $data - * - * @return self + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + * config data. */ public function setData(?string $data): self { + $this->initialized['data'] = true; $this->data = $data; return $this; } + + /** + * Driver represents a driver (network, logging, secrets). + */ + public function getTemplating(): ?Driver + { + return $this->templating; + } + + /** + * Driver represents a driver (network, logging, secrets). + */ + public function setTemplating(?Driver $templating): self + { + $this->initialized['templating'] = true; + $this->templating = $templating; + + return $this; + } } diff --git a/src/Model/ContainerConfig.php b/src/Model/ContainerConfig.php index 38d9ca5b..7eaef0f2 100644 --- a/src/Model/ContainerConfig.php +++ b/src/Model/ContainerConfig.php @@ -2,177 +2,184 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ContainerConfig +class ContainerConfig extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The hostname to use for the container, as a valid RFC 1123 hostname. * - * @var string + * @var string|null */ protected $hostname; /** * The domain name to use for the container. * - * @var string + * @var string|null */ protected $domainname; /** * The user that commands are run as inside the container. * - * @var string + * @var string|null */ protected $user; /** * Whether to attach to `stdin`. * - * @var bool + * @var bool|null */ - protected $attachStdin; + protected $attachStdin = false; /** * Whether to attach to `stdout`. * - * @var bool + * @var bool|null */ - protected $attachStdout; + protected $attachStdout = true; /** * Whether to attach to `stderr`. * - * @var bool + * @var bool|null */ - protected $attachStderr; + protected $attachStderr = true; /** - * An object mapping ports to an empty object in the form:. - - `{"/": {}}` - + * An object mapping ports to an empty object in the form: * - * @var mixed[] + * `{"/": {}}` + * + * @var array|null */ protected $exposedPorts; /** * Attach standard streams to a TTY, including `stdin` if it is not closed. * - * @var bool + * @var bool|null */ - protected $tty; + protected $tty = false; /** * Open `stdin`. * - * @var bool + * @var bool|null */ - protected $openStdin; + protected $openStdin = false; /** * Close `stdin` after one attached client disconnects. * - * @var bool + * @var bool|null */ - protected $stdinOnce; + protected $stdinOnce = false; /** - * A list of environment variables to set inside the container in the form `["VAR=value", ...]`. A variable without `=` is removed from the environment, rather than to have an empty value. + * A list of environment variables to set inside the container in the + * form `["VAR=value", ...]`. A variable without `=` is removed from the + * environment, rather than to have an empty value. * - * @var string[] + * @var list|null */ protected $env; /** * Command to run specified as a string or an array of strings. * - * @var string[] + * @var list|null */ protected $cmd; /** * A test to perform to check that the container is healthy. * - * @var HealthConfig + * @var HealthConfig|null */ protected $healthcheck; /** * Command is already escaped (Windows only). * - * @var bool + * @var bool|null */ - protected $argsEscaped; + protected $argsEscaped = false; /** - * The name of the image to use when creating the container. + * The name (or reference) of the image to use when creating the container, + * or which was used when the container was created. * - * @var string + * @var string|null */ protected $image; /** - * An object mapping mount point paths inside the container to empty objects. + * An object mapping mount point paths inside the container to empty + * objects. * - * @var mixed[] + * @var array|null */ protected $volumes; /** * The working directory for commands to run in. * - * @var string + * @var string|null */ protected $workingDir; /** * The entry point for the container as a string or an array of strings. - - If the array consists of exactly one empty string (`[""]`) then the entry point is reset to system default (i.e., the entry point used by docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). - * - * @var string[] + * 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`). + * + * @var list|null */ protected $entrypoint; /** * Disable networking for the container. * - * @var bool + * @var bool|null */ protected $networkDisabled; /** * MAC address of the container. * - * @var string + * Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. + * + * @var string|null */ protected $macAddress; /** * `ONBUILD` metadata that were defined in the image's `Dockerfile`. * - * @var string[] + * @var list|null */ protected $onBuild; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * Signal to stop a container as a string or unsigned integer. * - * @var string + * @var string|null */ protected $stopSignal; /** * Timeout to stop a container in seconds. * - * @var int + * @var int|null */ protected $stopTimeout; /** * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. * - * @var string[] + * @var list|null */ protected $shell; /** * The hostname to use for the container, as a valid RFC 1123 hostname. - * - * @return string */ public function getHostname(): ?string { @@ -181,13 +188,10 @@ public function getHostname(): ?string /** * The hostname to use for the container, as a valid RFC 1123 hostname. - * - * @param string $hostname - * - * @return self */ public function setHostname(?string $hostname): self { + $this->initialized['hostname'] = true; $this->hostname = $hostname; return $this; @@ -195,8 +199,6 @@ public function setHostname(?string $hostname): self /** * The domain name to use for the container. - * - * @return string */ public function getDomainname(): ?string { @@ -205,13 +207,10 @@ public function getDomainname(): ?string /** * The domain name to use for the container. - * - * @param string $domainname - * - * @return self */ public function setDomainname(?string $domainname): self { + $this->initialized['domainname'] = true; $this->domainname = $domainname; return $this; @@ -219,8 +218,6 @@ public function setDomainname(?string $domainname): self /** * The user that commands are run as inside the container. - * - * @return string */ public function getUser(): ?string { @@ -229,13 +226,10 @@ public function getUser(): ?string /** * The user that commands are run as inside the container. - * - * @param string $user - * - * @return self */ public function setUser(?string $user): self { + $this->initialized['user'] = true; $this->user = $user; return $this; @@ -243,8 +237,6 @@ public function setUser(?string $user): self /** * Whether to attach to `stdin`. - * - * @return bool */ public function getAttachStdin(): ?bool { @@ -253,13 +245,10 @@ public function getAttachStdin(): ?bool /** * Whether to attach to `stdin`. - * - * @param bool $attachStdin - * - * @return self */ public function setAttachStdin(?bool $attachStdin): self { + $this->initialized['attachStdin'] = true; $this->attachStdin = $attachStdin; return $this; @@ -267,8 +256,6 @@ public function setAttachStdin(?bool $attachStdin): self /** * Whether to attach to `stdout`. - * - * @return bool */ public function getAttachStdout(): ?bool { @@ -277,13 +264,10 @@ public function getAttachStdout(): ?bool /** * Whether to attach to `stdout`. - * - * @param bool $attachStdout - * - * @return self */ public function setAttachStdout(?bool $attachStdout): self { + $this->initialized['attachStdout'] = true; $this->attachStdout = $attachStdout; return $this; @@ -291,8 +275,6 @@ public function setAttachStdout(?bool $attachStdout): self /** * Whether to attach to `stderr`. - * - * @return bool */ public function getAttachStderr(): ?bool { @@ -301,43 +283,37 @@ public function getAttachStderr(): ?bool /** * Whether to attach to `stderr`. - * - * @param bool $attachStderr - * - * @return self */ public function setAttachStderr(?bool $attachStderr): self { + $this->initialized['attachStderr'] = true; $this->attachStderr = $attachStderr; return $this; } /** - * An object mapping ports to an empty object in the form:. - - `{"/": {}}` - + * An object mapping ports to an empty object in the form: * - * @return mixed[] + * `{"/": {}}` + * + * @return array|null */ - public function getExposedPorts(): ?\ArrayObject + public function getExposedPorts(): ?iterable { return $this->exposedPorts; } /** - * An object mapping ports to an empty object in the form:. - - `{"/": {}}` - + * An object mapping ports to an empty object in the form: * - * @param mixed[] $exposedPorts + * `{"/": {}}` * - * @return self + * @param array|null $exposedPorts */ - public function setExposedPorts(?\ArrayObject $exposedPorts): self + public function setExposedPorts(?iterable $exposedPorts): self { + $this->initialized['exposedPorts'] = true; $this->exposedPorts = $exposedPorts; return $this; @@ -345,8 +321,6 @@ public function setExposedPorts(?\ArrayObject $exposedPorts): self /** * Attach standard streams to a TTY, including `stdin` if it is not closed. - * - * @return bool */ public function getTty(): ?bool { @@ -355,13 +329,10 @@ public function getTty(): ?bool /** * Attach standard streams to a TTY, including `stdin` if it is not closed. - * - * @param bool $tty - * - * @return self */ public function setTty(?bool $tty): self { + $this->initialized['tty'] = true; $this->tty = $tty; return $this; @@ -369,8 +340,6 @@ public function setTty(?bool $tty): self /** * Open `stdin`. - * - * @return bool */ public function getOpenStdin(): ?bool { @@ -379,13 +348,10 @@ public function getOpenStdin(): ?bool /** * Open `stdin`. - * - * @param bool $openStdin - * - * @return self */ public function setOpenStdin(?bool $openStdin): self { + $this->initialized['openStdin'] = true; $this->openStdin = $openStdin; return $this; @@ -393,8 +359,6 @@ public function setOpenStdin(?bool $openStdin): self /** * Close `stdin` after one attached client disconnects. - * - * @return bool */ public function getStdinOnce(): ?bool { @@ -403,22 +367,21 @@ public function getStdinOnce(): ?bool /** * Close `stdin` after one attached client disconnects. - * - * @param bool $stdinOnce - * - * @return self */ public function setStdinOnce(?bool $stdinOnce): self { + $this->initialized['stdinOnce'] = true; $this->stdinOnce = $stdinOnce; return $this; } /** - * A list of environment variables to set inside the container in the form `["VAR=value", ...]`. A variable without `=` is removed from the environment, rather than to have an empty value. + * A list of environment variables to set inside the container in the + * form `["VAR=value", ...]`. A variable without `=` is removed from the + * environment, rather than to have an empty value. * - * @return string[] + * @return list|null */ public function getEnv(): ?array { @@ -426,14 +389,15 @@ public function getEnv(): ?array } /** - * A list of environment variables to set inside the container in the form `["VAR=value", ...]`. A variable without `=` is removed from the environment, rather than to have an empty value. - * - * @param string[] $env + * A list of environment variables to set inside the container in the + * form `["VAR=value", ...]`. A variable without `=` is removed from the + * environment, rather than to have an empty value. * - * @return self + * @param list|null $env */ public function setEnv(?array $env): self { + $this->initialized['env'] = true; $this->env = $env; return $this; @@ -442,7 +406,7 @@ public function setEnv(?array $env): self /** * Command to run specified as a string or an array of strings. * - * @return string[] + * @return list|null */ public function getCmd(): ?array { @@ -452,12 +416,11 @@ public function getCmd(): ?array /** * Command to run specified as a string or an array of strings. * - * @param string[] $cmd - * - * @return self + * @param list|null $cmd */ public function setCmd(?array $cmd): self { + $this->initialized['cmd'] = true; $this->cmd = $cmd; return $this; @@ -465,8 +428,6 @@ public function setCmd(?array $cmd): self /** * A test to perform to check that the container is healthy. - * - * @return HealthConfig */ public function getHealthcheck(): ?HealthConfig { @@ -475,13 +436,10 @@ public function getHealthcheck(): ?HealthConfig /** * A test to perform to check that the container is healthy. - * - * @param HealthConfig $healthcheck - * - * @return self */ public function setHealthcheck(?HealthConfig $healthcheck): self { + $this->initialized['healthcheck'] = true; $this->healthcheck = $healthcheck; return $this; @@ -489,8 +447,6 @@ public function setHealthcheck(?HealthConfig $healthcheck): self /** * Command is already escaped (Windows only). - * - * @return bool */ public function getArgsEscaped(): ?bool { @@ -499,22 +455,18 @@ public function getArgsEscaped(): ?bool /** * Command is already escaped (Windows only). - * - * @param bool $argsEscaped - * - * @return self */ public function setArgsEscaped(?bool $argsEscaped): self { + $this->initialized['argsEscaped'] = true; $this->argsEscaped = $argsEscaped; return $this; } /** - * The name of the image to use when creating the container. - * - * @return string + * The name (or reference) of the image to use when creating the container, + * or which was used when the container was created. */ public function getImage(): ?string { @@ -522,38 +474,37 @@ public function getImage(): ?string } /** - * The name of the image to use when creating the container. - * - * @param string $image - * - * @return self + * The name (or reference) of the image to use when creating the container, + * or which was used when the container was created. */ public function setImage(?string $image): self { + $this->initialized['image'] = true; $this->image = $image; return $this; } /** - * An object mapping mount point paths inside the container to empty objects. + * An object mapping mount point paths inside the container to empty + * objects. * - * @return mixed[] + * @return array|null */ - public function getVolumes(): ?\ArrayObject + public function getVolumes(): ?iterable { return $this->volumes; } /** - * An object mapping mount point paths inside the container to empty objects. - * - * @param mixed[] $volumes + * An object mapping mount point paths inside the container to empty + * objects. * - * @return self + * @param array|null $volumes */ - public function setVolumes(?\ArrayObject $volumes): self + public function setVolumes(?iterable $volumes): self { + $this->initialized['volumes'] = true; $this->volumes = $volumes; return $this; @@ -561,8 +512,6 @@ public function setVolumes(?\ArrayObject $volumes): self /** * The working directory for commands to run in. - * - * @return string */ public function getWorkingDir(): ?string { @@ -571,13 +520,10 @@ public function getWorkingDir(): ?string /** * The working directory for commands to run in. - * - * @param string $workingDir - * - * @return self */ public function setWorkingDir(?string $workingDir): self { + $this->initialized['workingDir'] = true; $this->workingDir = $workingDir; return $this; @@ -585,11 +531,12 @@ public function setWorkingDir(?string $workingDir): self /** * The entry point for the container as a string or an array of strings. - - If the array consists of exactly one empty string (`[""]`) then the entry point is reset to system default (i.e., the entry point used by docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). - * - * @return string[] + * 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`). + * + * @return list|null */ public function getEntrypoint(): ?array { @@ -598,16 +545,16 @@ public function getEntrypoint(): ?array /** * The entry point for the container as a string or an array of strings. - - If the array consists of exactly one empty string (`[""]`) then the entry point is reset to system default (i.e., the entry point used by docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). - * - * @param string[] $entrypoint + * 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`). * - * @return self + * @param list|null $entrypoint */ public function setEntrypoint(?array $entrypoint): self { + $this->initialized['entrypoint'] = true; $this->entrypoint = $entrypoint; return $this; @@ -615,8 +562,6 @@ public function setEntrypoint(?array $entrypoint): self /** * Disable networking for the container. - * - * @return bool */ public function getNetworkDisabled(): ?bool { @@ -625,13 +570,10 @@ public function getNetworkDisabled(): ?bool /** * Disable networking for the container. - * - * @param bool $networkDisabled - * - * @return self */ public function setNetworkDisabled(?bool $networkDisabled): self { + $this->initialized['networkDisabled'] = true; $this->networkDisabled = $networkDisabled; return $this; @@ -640,7 +582,7 @@ public function setNetworkDisabled(?bool $networkDisabled): self /** * MAC address of the container. * - * @return string + * Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. */ public function getMacAddress(): ?string { @@ -650,12 +592,11 @@ public function getMacAddress(): ?string /** * MAC address of the container. * - * @param string $macAddress - * - * @return self + * Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. */ public function setMacAddress(?string $macAddress): self { + $this->initialized['macAddress'] = true; $this->macAddress = $macAddress; return $this; @@ -664,7 +605,7 @@ public function setMacAddress(?string $macAddress): self /** * `ONBUILD` metadata that were defined in the image's `Dockerfile`. * - * @return string[] + * @return list|null */ public function getOnBuild(): ?array { @@ -674,12 +615,11 @@ public function getOnBuild(): ?array /** * `ONBUILD` metadata that were defined in the image's `Dockerfile`. * - * @param string[] $onBuild - * - * @return self + * @param list|null $onBuild */ public function setOnBuild(?array $onBuild): self { + $this->initialized['onBuild'] = true; $this->onBuild = $onBuild; return $this; @@ -688,9 +628,9 @@ public function setOnBuild(?array $onBuild): self /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -698,12 +638,11 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value metadata. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; @@ -711,8 +650,6 @@ public function setLabels(?\ArrayObject $labels): self /** * Signal to stop a container as a string or unsigned integer. - * - * @return string */ public function getStopSignal(): ?string { @@ -721,13 +658,10 @@ public function getStopSignal(): ?string /** * Signal to stop a container as a string or unsigned integer. - * - * @param string $stopSignal - * - * @return self */ public function setStopSignal(?string $stopSignal): self { + $this->initialized['stopSignal'] = true; $this->stopSignal = $stopSignal; return $this; @@ -735,8 +669,6 @@ public function setStopSignal(?string $stopSignal): self /** * Timeout to stop a container in seconds. - * - * @return int */ public function getStopTimeout(): ?int { @@ -745,13 +677,10 @@ public function getStopTimeout(): ?int /** * Timeout to stop a container in seconds. - * - * @param int $stopTimeout - * - * @return self */ public function setStopTimeout(?int $stopTimeout): self { + $this->initialized['stopTimeout'] = true; $this->stopTimeout = $stopTimeout; return $this; @@ -760,7 +689,7 @@ public function setStopTimeout(?int $stopTimeout): self /** * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. * - * @return string[] + * @return list|null */ public function getShell(): ?array { @@ -770,12 +699,11 @@ public function getShell(): ?array /** * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. * - * @param string[] $shell - * - * @return self + * @param list|null $shell */ public function setShell(?array $shell): self { + $this->initialized['shell'] = true; $this->shell = $shell; return $this; diff --git a/src/Model/ContainerConfigExposedPortsItem.php b/src/Model/ContainerConfigExposedPortsItem.php new file mode 100644 index 00000000..3db6a830 --- /dev/null +++ b/src/Model/ContainerConfigExposedPortsItem.php @@ -0,0 +1,18 @@ +initialized); + } +} diff --git a/src/Model/ContainerConfigVolumesItem.php b/src/Model/ContainerConfigVolumesItem.php new file mode 100644 index 00000000..c2984715 --- /dev/null +++ b/src/Model/ContainerConfigVolumesItem.php @@ -0,0 +1,18 @@ +initialized); + } +} diff --git a/src/Model/ContainersCreatePostResponse201.php b/src/Model/ContainerCreateResponse.php similarity index 66% rename from src/Model/ContainersCreatePostResponse201.php rename to src/Model/ContainerCreateResponse.php index fc3b1732..1bfbafc3 100644 --- a/src/Model/ContainersCreatePostResponse201.php +++ b/src/Model/ContainerCreateResponse.php @@ -2,33 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ContainersCreatePostResponse201 +class ContainerCreateResponse extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The ID of the created container. * - * @var string + * @var string|null */ protected $id; /** * Warnings encountered when creating the container. * - * @var string[] + * @var list|null */ protected $warnings; /** * The ID of the created container. - * - * @return string */ public function getId(): ?string { @@ -37,13 +38,10 @@ public function getId(): ?string /** * The ID of the created container. - * - * @param string $id - * - * @return self */ public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -52,7 +50,7 @@ public function setId(?string $id): self /** * Warnings encountered when creating the container. * - * @return string[] + * @return list|null */ public function getWarnings(): ?array { @@ -62,12 +60,11 @@ public function getWarnings(): ?array /** * Warnings encountered when creating the container. * - * @param string[] $warnings - * - * @return self + * @param list|null $warnings */ public function setWarnings(?array $warnings): self { + $this->initialized['warnings'] = true; $this->warnings = $warnings; return $this; diff --git a/src/Model/ContainersIdJsonGetResponse200State.php b/src/Model/ContainerState.php similarity index 53% rename from src/Model/ContainersIdJsonGetResponse200State.php rename to src/Model/ContainerState.php index 33555608..94819a62 100644 --- a/src/Model/ContainersIdJsonGetResponse200State.php +++ b/src/Model/ContainerState.php @@ -2,93 +2,102 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ContainersIdJsonGetResponse200State +class ContainerState extends \ArrayObject { /** - * The status of the container. For example, `"running"` or `"exited"`. + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * String representation of the container state. Can be one of "created", + * "running", "paused", "restarting", "removing", "exited", or "dead". * - * @var string + * @var string|null */ protected $status; /** * Whether this container is running. - - Note that a running container can be _paused_. The `Running` and `Paused` - booleans are not mutually exclusive: - - When pausing a container (on Linux), the cgroups freezer is used to suspend - all processes in the container. Freezing the process requires the process to - be running. As a result, paused containers are both `Running` _and_ `Paused`. - - Use the `Status` field instead to determine if a container's state is "running". - * - * @var bool + * Note that a running container can be _paused_. The `Running` and `Paused` + * booleans are not mutually exclusive: + * + * When pausing a container (on Linux), the freezer cgroup is used to suspend + * all processes in the container. Freezing the process requires the process to + * be running. As a result, paused containers are both `Running` _and_ `Paused`. + * + * Use the `Status` field instead to determine if a container's state is "running". + * + * @var bool|null */ protected $running; /** * Whether this container is paused. * - * @var bool + * @var bool|null */ protected $paused; /** * Whether this container is restarting. * - * @var bool + * @var bool|null */ protected $restarting; /** - * Whether this container has been killed because it ran out of memory. + * Whether a process within this container has been killed because it ran + * out of memory since the container was last started. * - * @var bool + * @var bool|null */ protected $oOMKilled; /** - * @var bool + * @var bool|null */ protected $dead; /** * The process ID of this container. * - * @var int + * @var int|null */ protected $pid; /** * The last exit code of this container. * - * @var int + * @var int|null */ protected $exitCode; /** - * @var string + * @var string|null */ protected $error; /** * The time when this container was last started. * - * @var string + * @var string|null */ protected $startedAt; /** * The time when this container last exited. * - * @var string + * @var string|null */ protected $finishedAt; - /** - * The status of the container. For example, `"running"` or `"exited"`. + * Health stores information about the container's healthcheck results. * - * @return string + * @var Health|null + */ + protected $health; + + /** + * String representation of the container state. Can be one of "created", + * "running", "paused", "restarting", "removing", "exited", or "dead". */ public function getStatus(): ?string { @@ -96,14 +105,12 @@ public function getStatus(): ?string } /** - * The status of the container. For example, `"running"` or `"exited"`. - * - * @param string $status - * - * @return self + * String representation of the container state. Can be one of "created", + * "running", "paused", "restarting", "removing", "exited", or "dead". */ public function setStatus(?string $status): self { + $this->initialized['status'] = true; $this->status = $status; return $this; @@ -111,18 +118,15 @@ public function setStatus(?string $status): self /** * Whether this container is running. - - Note that a running container can be _paused_. The `Running` and `Paused` - booleans are not mutually exclusive: - - When pausing a container (on Linux), the cgroups freezer is used to suspend - all processes in the container. Freezing the process requires the process to - be running. As a result, paused containers are both `Running` _and_ `Paused`. - - Use the `Status` field instead to determine if a container's state is "running". - * - * @return bool + * Note that a running container can be _paused_. The `Running` and `Paused` + * booleans are not mutually exclusive: + * + * When pausing a container (on Linux), the freezer cgroup is used to suspend + * all processes in the container. Freezing the process requires the process to + * be running. As a result, paused containers are both `Running` _and_ `Paused`. + * + * Use the `Status` field instead to determine if a container's state is "running". */ public function getRunning(): ?bool { @@ -131,23 +135,19 @@ public function getRunning(): ?bool /** * Whether this container is running. - - Note that a running container can be _paused_. The `Running` and `Paused` - booleans are not mutually exclusive: - - When pausing a container (on Linux), the cgroups freezer is used to suspend - all processes in the container. Freezing the process requires the process to - be running. As a result, paused containers are both `Running` _and_ `Paused`. - - Use the `Status` field instead to determine if a container's state is "running". - * - * @param bool $running + * Note that a running container can be _paused_. The `Running` and `Paused` + * booleans are not mutually exclusive: + * + * When pausing a container (on Linux), the freezer cgroup is used to suspend + * all processes in the container. Freezing the process requires the process to + * be running. As a result, paused containers are both `Running` _and_ `Paused`. * - * @return self + * Use the `Status` field instead to determine if a container's state is "running". */ public function setRunning(?bool $running): self { + $this->initialized['running'] = true; $this->running = $running; return $this; @@ -155,8 +155,6 @@ public function setRunning(?bool $running): self /** * Whether this container is paused. - * - * @return bool */ public function getPaused(): ?bool { @@ -165,13 +163,10 @@ public function getPaused(): ?bool /** * Whether this container is paused. - * - * @param bool $paused - * - * @return self */ public function setPaused(?bool $paused): self { + $this->initialized['paused'] = true; $this->paused = $paused; return $this; @@ -179,8 +174,6 @@ public function setPaused(?bool $paused): self /** * Whether this container is restarting. - * - * @return bool */ public function getRestarting(): ?bool { @@ -189,22 +182,18 @@ public function getRestarting(): ?bool /** * Whether this container is restarting. - * - * @param bool $restarting - * - * @return self */ public function setRestarting(?bool $restarting): self { + $this->initialized['restarting'] = true; $this->restarting = $restarting; return $this; } /** - * Whether this container has been killed because it ran out of memory. - * - * @return bool + * Whether a process within this container has been killed because it ran + * out of memory since the container was last started. */ public function getOOMKilled(): ?bool { @@ -212,34 +201,25 @@ public function getOOMKilled(): ?bool } /** - * Whether this container has been killed because it ran out of memory. - * - * @param bool $oOMKilled - * - * @return self + * Whether a process within this container has been killed because it ran + * out of memory since the container was last started. */ public function setOOMKilled(?bool $oOMKilled): self { + $this->initialized['oOMKilled'] = true; $this->oOMKilled = $oOMKilled; return $this; } - /** - * @return bool - */ public function getDead(): ?bool { return $this->dead; } - /** - * @param bool $dead - * - * @return self - */ public function setDead(?bool $dead): self { + $this->initialized['dead'] = true; $this->dead = $dead; return $this; @@ -247,8 +227,6 @@ public function setDead(?bool $dead): self /** * The process ID of this container. - * - * @return int */ public function getPid(): ?int { @@ -257,13 +235,10 @@ public function getPid(): ?int /** * The process ID of this container. - * - * @param int $pid - * - * @return self */ public function setPid(?int $pid): self { + $this->initialized['pid'] = true; $this->pid = $pid; return $this; @@ -271,8 +246,6 @@ public function setPid(?int $pid): self /** * The last exit code of this container. - * - * @return int */ public function getExitCode(): ?int { @@ -281,33 +254,23 @@ public function getExitCode(): ?int /** * The last exit code of this container. - * - * @param int $exitCode - * - * @return self */ public function setExitCode(?int $exitCode): self { + $this->initialized['exitCode'] = true; $this->exitCode = $exitCode; return $this; } - /** - * @return string - */ public function getError(): ?string { return $this->error; } - /** - * @param string $error - * - * @return self - */ public function setError(?string $error): self { + $this->initialized['error'] = true; $this->error = $error; return $this; @@ -315,8 +278,6 @@ public function setError(?string $error): self /** * The time when this container was last started. - * - * @return string */ public function getStartedAt(): ?string { @@ -325,13 +286,10 @@ public function getStartedAt(): ?string /** * The time when this container was last started. - * - * @param string $startedAt - * - * @return self */ public function setStartedAt(?string $startedAt): self { + $this->initialized['startedAt'] = true; $this->startedAt = $startedAt; return $this; @@ -339,8 +297,6 @@ public function setStartedAt(?string $startedAt): self /** * The time when this container last exited. - * - * @return string */ public function getFinishedAt(): ?string { @@ -349,15 +305,31 @@ public function getFinishedAt(): ?string /** * The time when this container last exited. - * - * @param string $finishedAt - * - * @return self */ public function setFinishedAt(?string $finishedAt): self { + $this->initialized['finishedAt'] = true; $this->finishedAt = $finishedAt; return $this; } + + /** + * Health stores information about the container's healthcheck results. + */ + public function getHealth(): ?Health + { + return $this->health; + } + + /** + * Health stores information about the container's healthcheck results. + */ + public function setHealth(?Health $health): self + { + $this->initialized['health'] = true; + $this->health = $health; + + return $this; + } } diff --git a/src/Model/TaskStatusContainerStatus.php b/src/Model/ContainerStatus.php similarity index 63% rename from src/Model/TaskStatusContainerStatus.php rename to src/Model/ContainerStatus.php index a048ade4..86284fe0 100644 --- a/src/Model/TaskStatusContainerStatus.php +++ b/src/Model/ContainerStatus.php @@ -2,84 +2,66 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskStatusContainerStatus +class ContainerStatus extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $containerID; /** - * @var int + * @var int|null */ protected $pID; /** - * @var int + * @var int|null */ protected $exitCode; - /** - * @return string - */ public function getContainerID(): ?string { return $this->containerID; } - /** - * @param string $containerID - * - * @return self - */ public function setContainerID(?string $containerID): self { + $this->initialized['containerID'] = true; $this->containerID = $containerID; return $this; } - /** - * @return int - */ public function getPID(): ?int { return $this->pID; } - /** - * @param int $pID - * - * @return self - */ public function setPID(?int $pID): self { + $this->initialized['pID'] = true; $this->pID = $pID; return $this; } - /** - * @return int - */ public function getExitCode(): ?int { return $this->exitCode; } - /** - * @param int $exitCode - * - * @return self - */ public function setExitCode(?int $exitCode): self { + $this->initialized['exitCode'] = true; $this->exitCode = $exitCode; return $this; diff --git a/src/Model/ContainerSummaryItem.php b/src/Model/ContainerSummary.php similarity index 72% rename from src/Model/ContainerSummaryItem.php rename to src/Model/ContainerSummary.php index 25dc46bb..7d225e47 100644 --- a/src/Model/ContainerSummaryItem.php +++ b/src/Model/ContainerSummary.php @@ -2,107 +2,108 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ContainerSummaryItem +class ContainerSummary extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The ID of this container. * - * @var string + * @var string|null */ protected $id; /** * The names that this container has been given. * - * @var string[] + * @var list|null */ protected $names; /** * The name of the image used when creating this container. * - * @var string + * @var string|null */ protected $image; /** * The ID of the image that this container was created from. * - * @var string + * @var string|null */ protected $imageID; /** * Command to run when starting the container. * - * @var string + * @var string|null */ protected $command; /** * When the container was created. * - * @var int + * @var int|null */ protected $created; /** * The ports exposed by this container. * - * @var Port[] + * @var list|null */ protected $ports; /** * The size of files that have been created or changed by this container. * - * @var int + * @var int|null */ protected $sizeRw; /** * The total size of all the files in this container. * - * @var int + * @var int|null */ protected $sizeRootFs; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * The state of this container (e.g. `Exited`). * - * @var string + * @var string|null */ protected $state; /** * Additional human-readable status of this container (e.g. `Exit 0`). * - * @var string + * @var string|null */ protected $status; /** - * @var ContainerSummaryItemHostConfig + * @var ContainerSummaryHostConfig|null */ protected $hostConfig; /** * A summary of the container's network settings. * - * @var ContainerSummaryItemNetworkSettings + * @var ContainerSummaryNetworkSettings|null */ protected $networkSettings; /** - * @var Mount[] + * @var list|null */ protected $mounts; /** * The ID of this container. - * - * @return string */ public function getId(): ?string { @@ -111,13 +112,10 @@ public function getId(): ?string /** * The ID of this container. - * - * @param string $id - * - * @return self */ public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -126,7 +124,7 @@ public function setId(?string $id): self /** * The names that this container has been given. * - * @return string[] + * @return list|null */ public function getNames(): ?array { @@ -136,12 +134,11 @@ public function getNames(): ?array /** * The names that this container has been given. * - * @param string[] $names - * - * @return self + * @param list|null $names */ public function setNames(?array $names): self { + $this->initialized['names'] = true; $this->names = $names; return $this; @@ -149,8 +146,6 @@ public function setNames(?array $names): self /** * The name of the image used when creating this container. - * - * @return string */ public function getImage(): ?string { @@ -159,13 +154,10 @@ public function getImage(): ?string /** * The name of the image used when creating this container. - * - * @param string $image - * - * @return self */ public function setImage(?string $image): self { + $this->initialized['image'] = true; $this->image = $image; return $this; @@ -173,8 +165,6 @@ public function setImage(?string $image): self /** * The ID of the image that this container was created from. - * - * @return string */ public function getImageID(): ?string { @@ -183,13 +173,10 @@ public function getImageID(): ?string /** * The ID of the image that this container was created from. - * - * @param string $imageID - * - * @return self */ public function setImageID(?string $imageID): self { + $this->initialized['imageID'] = true; $this->imageID = $imageID; return $this; @@ -197,8 +184,6 @@ public function setImageID(?string $imageID): self /** * Command to run when starting the container. - * - * @return string */ public function getCommand(): ?string { @@ -207,13 +192,10 @@ public function getCommand(): ?string /** * Command to run when starting the container. - * - * @param string $command - * - * @return self */ public function setCommand(?string $command): self { + $this->initialized['command'] = true; $this->command = $command; return $this; @@ -221,8 +203,6 @@ public function setCommand(?string $command): self /** * When the container was created. - * - * @return int */ public function getCreated(): ?int { @@ -231,13 +211,10 @@ public function getCreated(): ?int /** * When the container was created. - * - * @param int $created - * - * @return self */ public function setCreated(?int $created): self { + $this->initialized['created'] = true; $this->created = $created; return $this; @@ -246,7 +223,7 @@ public function setCreated(?int $created): self /** * The ports exposed by this container. * - * @return Port[] + * @return list|null */ public function getPorts(): ?array { @@ -256,12 +233,11 @@ public function getPorts(): ?array /** * The ports exposed by this container. * - * @param Port[] $ports - * - * @return self + * @param list|null $ports */ public function setPorts(?array $ports): self { + $this->initialized['ports'] = true; $this->ports = $ports; return $this; @@ -269,8 +245,6 @@ public function setPorts(?array $ports): self /** * The size of files that have been created or changed by this container. - * - * @return int */ public function getSizeRw(): ?int { @@ -279,13 +253,10 @@ public function getSizeRw(): ?int /** * The size of files that have been created or changed by this container. - * - * @param int $sizeRw - * - * @return self */ public function setSizeRw(?int $sizeRw): self { + $this->initialized['sizeRw'] = true; $this->sizeRw = $sizeRw; return $this; @@ -293,8 +264,6 @@ public function setSizeRw(?int $sizeRw): self /** * The total size of all the files in this container. - * - * @return int */ public function getSizeRootFs(): ?int { @@ -303,13 +272,10 @@ public function getSizeRootFs(): ?int /** * The total size of all the files in this container. - * - * @param int $sizeRootFs - * - * @return self */ public function setSizeRootFs(?int $sizeRootFs): self { + $this->initialized['sizeRootFs'] = true; $this->sizeRootFs = $sizeRootFs; return $this; @@ -318,9 +284,9 @@ public function setSizeRootFs(?int $sizeRootFs): self /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -328,12 +294,11 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value metadata. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; @@ -341,8 +306,6 @@ public function setLabels(?\ArrayObject $labels): self /** * The state of this container (e.g. `Exited`). - * - * @return string */ public function getState(): ?string { @@ -351,13 +314,10 @@ public function getState(): ?string /** * The state of this container (e.g. `Exited`). - * - * @param string $state - * - * @return self */ public function setState(?string $state): self { + $this->initialized['state'] = true; $this->state = $state; return $this; @@ -365,8 +325,6 @@ public function setState(?string $state): self /** * Additional human-readable status of this container (e.g. `Exit 0`). - * - * @return string */ public function getStatus(): ?string { @@ -375,33 +333,23 @@ public function getStatus(): ?string /** * Additional human-readable status of this container (e.g. `Exit 0`). - * - * @param string $status - * - * @return self */ public function setStatus(?string $status): self { + $this->initialized['status'] = true; $this->status = $status; return $this; } - /** - * @return ContainerSummaryItemHostConfig - */ - public function getHostConfig(): ?ContainerSummaryItemHostConfig + public function getHostConfig(): ?ContainerSummaryHostConfig { return $this->hostConfig; } - /** - * @param ContainerSummaryItemHostConfig $hostConfig - * - * @return self - */ - public function setHostConfig(?ContainerSummaryItemHostConfig $hostConfig): self + public function setHostConfig(?ContainerSummaryHostConfig $hostConfig): self { + $this->initialized['hostConfig'] = true; $this->hostConfig = $hostConfig; return $this; @@ -409,30 +357,25 @@ public function setHostConfig(?ContainerSummaryItemHostConfig $hostConfig): self /** * A summary of the container's network settings. - * - * @return ContainerSummaryItemNetworkSettings */ - public function getNetworkSettings(): ?ContainerSummaryItemNetworkSettings + public function getNetworkSettings(): ?ContainerSummaryNetworkSettings { return $this->networkSettings; } /** * A summary of the container's network settings. - * - * @param ContainerSummaryItemNetworkSettings $networkSettings - * - * @return self */ - public function setNetworkSettings(?ContainerSummaryItemNetworkSettings $networkSettings): self + public function setNetworkSettings(?ContainerSummaryNetworkSettings $networkSettings): self { + $this->initialized['networkSettings'] = true; $this->networkSettings = $networkSettings; return $this; } /** - * @return Mount[] + * @return list|null */ public function getMounts(): ?array { @@ -440,12 +383,11 @@ public function getMounts(): ?array } /** - * @param Mount[] $mounts - * - * @return self + * @param list|null $mounts */ public function setMounts(?array $mounts): self { + $this->initialized['mounts'] = true; $this->mounts = $mounts; return $this; diff --git a/src/Model/ContainerSummaryItemHostConfig.php b/src/Model/ContainerSummaryHostConfig.php similarity index 54% rename from src/Model/ContainerSummaryItemHostConfig.php rename to src/Model/ContainerSummaryHostConfig.php index 1c660342..6c845f93 100644 --- a/src/Model/ContainerSummaryItemHostConfig.php +++ b/src/Model/ContainerSummaryHostConfig.php @@ -2,36 +2,32 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ContainerSummaryItemHostConfig +class ContainerSummaryHostConfig extends \ArrayObject { /** - * @var string + * @var array */ - protected $networkMode; + protected $initialized = []; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** - * @return string + * @var string|null */ + protected $networkMode; + public function getNetworkMode(): ?string { return $this->networkMode; } - /** - * @param string $networkMode - * - * @return self - */ public function setNetworkMode(?string $networkMode): self { + $this->initialized['networkMode'] = true; $this->networkMode = $networkMode; return $this; diff --git a/src/Model/ContainerSummaryItemNetworkSettings.php b/src/Model/ContainerSummaryItemNetworkSettings.php deleted file mode 100644 index 0cc61e24..00000000 --- a/src/Model/ContainerSummaryItemNetworkSettings.php +++ /dev/null @@ -1,39 +0,0 @@ -networks; - } - - /** - * @param EndpointSettings[] $networks - * - * @return self - */ - public function setNetworks(?\ArrayObject $networks): self - { - $this->networks = $networks; - - return $this; - } -} diff --git a/src/Model/ContainerSummaryNetworkSettings.php b/src/Model/ContainerSummaryNetworkSettings.php new file mode 100644 index 00000000..237de0f6 --- /dev/null +++ b/src/Model/ContainerSummaryNetworkSettings.php @@ -0,0 +1,41 @@ +initialized); + } + /** + * @var array|null + */ + protected $networks; + + /** + * @return array|null + */ + public function getNetworks(): ?iterable + { + return $this->networks; + } + + /** + * @param array|null $networks + */ + public function setNetworks(?iterable $networks): self + { + $this->initialized['networks'] = true; + $this->networks = $networks; + + return $this; + } +} diff --git a/src/Model/ContainersIdWaitPostResponse200Error.php b/src/Model/ContainerWaitExitError.php similarity index 58% rename from src/Model/ContainersIdWaitPostResponse200Error.php rename to src/Model/ContainerWaitExitError.php index 16d049cf..bce2ac56 100644 --- a/src/Model/ContainersIdWaitPostResponse200Error.php +++ b/src/Model/ContainerWaitExitError.php @@ -2,27 +2,28 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ContainersIdWaitPostResponse200Error +class ContainerWaitExitError extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Details of an error. * - * @var string + * @var string|null */ protected $message; /** * Details of an error. - * - * @return string */ public function getMessage(): ?string { @@ -31,13 +32,10 @@ public function getMessage(): ?string /** * Details of an error. - * - * @param string $message - * - * @return self */ public function setMessage(?string $message): self { + $this->initialized['message'] = true; $this->message = $message; return $this; diff --git a/src/Model/ContainersIdWaitPostResponse200.php b/src/Model/ContainerWaitResponse.php similarity index 57% rename from src/Model/ContainersIdWaitPostResponse200.php rename to src/Model/ContainerWaitResponse.php index d5b4badc..ff2125f2 100644 --- a/src/Model/ContainersIdWaitPostResponse200.php +++ b/src/Model/ContainerWaitResponse.php @@ -2,33 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ContainersIdWaitPostResponse200 +class ContainerWaitResponse extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Exit code of the container. * - * @var int + * @var int|null */ protected $statusCode; /** * container waiting error, if any. * - * @var ContainersIdWaitPostResponse200Error + * @var ContainerWaitExitError|null */ protected $error; /** * Exit code of the container. - * - * @return int */ public function getStatusCode(): ?int { @@ -37,13 +38,10 @@ public function getStatusCode(): ?int /** * Exit code of the container. - * - * @param int $statusCode - * - * @return self */ public function setStatusCode(?int $statusCode): self { + $this->initialized['statusCode'] = true; $this->statusCode = $statusCode; return $this; @@ -51,23 +49,18 @@ public function setStatusCode(?int $statusCode): self /** * container waiting error, if any. - * - * @return ContainersIdWaitPostResponse200Error */ - public function getError(): ?ContainersIdWaitPostResponse200Error + public function getError(): ?ContainerWaitExitError { return $this->error; } /** * container waiting error, if any. - * - * @param ContainersIdWaitPostResponse200Error $error - * - * @return self */ - public function setError(?ContainersIdWaitPostResponse200Error $error): self + public function setError(?ContainerWaitExitError $error): self { + $this->initialized['error'] = true; $this->error = $error; return $this; diff --git a/src/Model/ContainersCreatePostBody.php b/src/Model/ContainersCreatePostBody.php index 8bcca83c..2772f972 100644 --- a/src/Model/ContainersCreatePostBody.php +++ b/src/Model/ContainersCreatePostBody.php @@ -2,189 +2,199 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ContainersCreatePostBody +class ContainersCreatePostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The hostname to use for the container, as a valid RFC 1123 hostname. * - * @var string + * @var string|null */ protected $hostname; /** * The domain name to use for the container. * - * @var string + * @var string|null */ protected $domainname; /** * The user that commands are run as inside the container. * - * @var string + * @var string|null */ protected $user; /** * Whether to attach to `stdin`. * - * @var bool + * @var bool|null */ - protected $attachStdin; + protected $attachStdin = false; /** * Whether to attach to `stdout`. * - * @var bool + * @var bool|null */ - protected $attachStdout; + protected $attachStdout = true; /** * Whether to attach to `stderr`. * - * @var bool + * @var bool|null */ - protected $attachStderr; + protected $attachStderr = true; /** - * An object mapping ports to an empty object in the form:. - - `{"/": {}}` - + * An object mapping ports to an empty object in the form: + * + * `{"/": {}}` * - * @var mixed[] + * @var array|null */ protected $exposedPorts; /** * Attach standard streams to a TTY, including `stdin` if it is not closed. * - * @var bool + * @var bool|null */ - protected $tty; + protected $tty = false; /** * Open `stdin`. * - * @var bool + * @var bool|null */ - protected $openStdin; + protected $openStdin = false; /** * Close `stdin` after one attached client disconnects. * - * @var bool + * @var bool|null */ - protected $stdinOnce; + protected $stdinOnce = false; /** - * A list of environment variables to set inside the container in the form `["VAR=value", ...]`. A variable without `=` is removed from the environment, rather than to have an empty value. + * A list of environment variables to set inside the container in the + * form `["VAR=value", ...]`. A variable without `=` is removed from the + * environment, rather than to have an empty value. * - * @var string[] + * @var list|null */ protected $env; /** * Command to run specified as a string or an array of strings. * - * @var string[] + * @var list|null */ protected $cmd; /** * A test to perform to check that the container is healthy. * - * @var HealthConfig + * @var HealthConfig|null */ protected $healthcheck; /** * Command is already escaped (Windows only). * - * @var bool + * @var bool|null */ - protected $argsEscaped; + protected $argsEscaped = false; /** - * The name of the image to use when creating the container. + * The name (or reference) of the image to use when creating the container, + * or which was used when the container was created. * - * @var string + * @var string|null */ protected $image; /** - * An object mapping mount point paths inside the container to empty objects. + * An object mapping mount point paths inside the container to empty + * objects. * - * @var mixed[] + * @var array|null */ protected $volumes; /** * The working directory for commands to run in. * - * @var string + * @var string|null */ protected $workingDir; /** * The entry point for the container as a string or an array of strings. - - If the array consists of exactly one empty string (`[""]`) then the entry point is reset to system default (i.e., the entry point used by docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). - * - * @var string[] + * 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`). + * + * @var list|null */ protected $entrypoint; /** * Disable networking for the container. * - * @var bool + * @var bool|null */ protected $networkDisabled; /** * MAC address of the container. * - * @var string + * Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. + * + * @var string|null */ protected $macAddress; /** * `ONBUILD` metadata that were defined in the image's `Dockerfile`. * - * @var string[] + * @var list|null */ protected $onBuild; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * Signal to stop a container as a string or unsigned integer. * - * @var string + * @var string|null */ protected $stopSignal; /** * Timeout to stop a container in seconds. * - * @var int + * @var int|null */ protected $stopTimeout; /** * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. * - * @var string[] + * @var list|null */ protected $shell; /** * Container configuration that depends on the host we are running on. * - * @var HostConfig + * @var HostConfig|null */ protected $hostConfig; /** - * This container's networking configuration. + * NetworkingConfig represents the container's networking configuration for + * each of its interfaces. + * It is used for the networking configs specified in the `docker create` + * and `docker network connect` commands. * - * @var ContainersCreatePostBodyNetworkingConfig + * @var NetworkingConfig|null */ protected $networkingConfig; /** * The hostname to use for the container, as a valid RFC 1123 hostname. - * - * @return string */ public function getHostname(): ?string { @@ -193,13 +203,10 @@ public function getHostname(): ?string /** * The hostname to use for the container, as a valid RFC 1123 hostname. - * - * @param string $hostname - * - * @return self */ public function setHostname(?string $hostname): self { + $this->initialized['hostname'] = true; $this->hostname = $hostname; return $this; @@ -207,8 +214,6 @@ public function setHostname(?string $hostname): self /** * The domain name to use for the container. - * - * @return string */ public function getDomainname(): ?string { @@ -217,13 +222,10 @@ public function getDomainname(): ?string /** * The domain name to use for the container. - * - * @param string $domainname - * - * @return self */ public function setDomainname(?string $domainname): self { + $this->initialized['domainname'] = true; $this->domainname = $domainname; return $this; @@ -231,8 +233,6 @@ public function setDomainname(?string $domainname): self /** * The user that commands are run as inside the container. - * - * @return string */ public function getUser(): ?string { @@ -241,13 +241,10 @@ public function getUser(): ?string /** * The user that commands are run as inside the container. - * - * @param string $user - * - * @return self */ public function setUser(?string $user): self { + $this->initialized['user'] = true; $this->user = $user; return $this; @@ -255,8 +252,6 @@ public function setUser(?string $user): self /** * Whether to attach to `stdin`. - * - * @return bool */ public function getAttachStdin(): ?bool { @@ -265,13 +260,10 @@ public function getAttachStdin(): ?bool /** * Whether to attach to `stdin`. - * - * @param bool $attachStdin - * - * @return self */ public function setAttachStdin(?bool $attachStdin): self { + $this->initialized['attachStdin'] = true; $this->attachStdin = $attachStdin; return $this; @@ -279,8 +271,6 @@ public function setAttachStdin(?bool $attachStdin): self /** * Whether to attach to `stdout`. - * - * @return bool */ public function getAttachStdout(): ?bool { @@ -289,13 +279,10 @@ public function getAttachStdout(): ?bool /** * Whether to attach to `stdout`. - * - * @param bool $attachStdout - * - * @return self */ public function setAttachStdout(?bool $attachStdout): self { + $this->initialized['attachStdout'] = true; $this->attachStdout = $attachStdout; return $this; @@ -303,8 +290,6 @@ public function setAttachStdout(?bool $attachStdout): self /** * Whether to attach to `stderr`. - * - * @return bool */ public function getAttachStderr(): ?bool { @@ -313,43 +298,37 @@ public function getAttachStderr(): ?bool /** * Whether to attach to `stderr`. - * - * @param bool $attachStderr - * - * @return self */ public function setAttachStderr(?bool $attachStderr): self { + $this->initialized['attachStderr'] = true; $this->attachStderr = $attachStderr; return $this; } /** - * An object mapping ports to an empty object in the form:. - - `{"/": {}}` - + * An object mapping ports to an empty object in the form: + * + * `{"/": {}}` * - * @return mixed[] + * @return array|null */ - public function getExposedPorts(): ?\ArrayObject + public function getExposedPorts(): ?iterable { return $this->exposedPorts; } /** - * An object mapping ports to an empty object in the form:. - - `{"/": {}}` - + * An object mapping ports to an empty object in the form: * - * @param mixed[] $exposedPorts + * `{"/": {}}` * - * @return self + * @param array|null $exposedPorts */ - public function setExposedPorts(?\ArrayObject $exposedPorts): self + public function setExposedPorts(?iterable $exposedPorts): self { + $this->initialized['exposedPorts'] = true; $this->exposedPorts = $exposedPorts; return $this; @@ -357,8 +336,6 @@ public function setExposedPorts(?\ArrayObject $exposedPorts): self /** * Attach standard streams to a TTY, including `stdin` if it is not closed. - * - * @return bool */ public function getTty(): ?bool { @@ -367,13 +344,10 @@ public function getTty(): ?bool /** * Attach standard streams to a TTY, including `stdin` if it is not closed. - * - * @param bool $tty - * - * @return self */ public function setTty(?bool $tty): self { + $this->initialized['tty'] = true; $this->tty = $tty; return $this; @@ -381,8 +355,6 @@ public function setTty(?bool $tty): self /** * Open `stdin`. - * - * @return bool */ public function getOpenStdin(): ?bool { @@ -391,13 +363,10 @@ public function getOpenStdin(): ?bool /** * Open `stdin`. - * - * @param bool $openStdin - * - * @return self */ public function setOpenStdin(?bool $openStdin): self { + $this->initialized['openStdin'] = true; $this->openStdin = $openStdin; return $this; @@ -405,8 +374,6 @@ public function setOpenStdin(?bool $openStdin): self /** * Close `stdin` after one attached client disconnects. - * - * @return bool */ public function getStdinOnce(): ?bool { @@ -415,22 +382,21 @@ public function getStdinOnce(): ?bool /** * Close `stdin` after one attached client disconnects. - * - * @param bool $stdinOnce - * - * @return self */ public function setStdinOnce(?bool $stdinOnce): self { + $this->initialized['stdinOnce'] = true; $this->stdinOnce = $stdinOnce; return $this; } /** - * A list of environment variables to set inside the container in the form `["VAR=value", ...]`. A variable without `=` is removed from the environment, rather than to have an empty value. + * A list of environment variables to set inside the container in the + * form `["VAR=value", ...]`. A variable without `=` is removed from the + * environment, rather than to have an empty value. * - * @return string[] + * @return list|null */ public function getEnv(): ?array { @@ -438,14 +404,15 @@ public function getEnv(): ?array } /** - * A list of environment variables to set inside the container in the form `["VAR=value", ...]`. A variable without `=` is removed from the environment, rather than to have an empty value. + * A list of environment variables to set inside the container in the + * form `["VAR=value", ...]`. A variable without `=` is removed from the + * environment, rather than to have an empty value. * - * @param string[] $env - * - * @return self + * @param list|null $env */ public function setEnv(?array $env): self { + $this->initialized['env'] = true; $this->env = $env; return $this; @@ -454,7 +421,7 @@ public function setEnv(?array $env): self /** * Command to run specified as a string or an array of strings. * - * @return string[] + * @return list|null */ public function getCmd(): ?array { @@ -464,12 +431,11 @@ public function getCmd(): ?array /** * Command to run specified as a string or an array of strings. * - * @param string[] $cmd - * - * @return self + * @param list|null $cmd */ public function setCmd(?array $cmd): self { + $this->initialized['cmd'] = true; $this->cmd = $cmd; return $this; @@ -477,8 +443,6 @@ public function setCmd(?array $cmd): self /** * A test to perform to check that the container is healthy. - * - * @return HealthConfig */ public function getHealthcheck(): ?HealthConfig { @@ -487,13 +451,10 @@ public function getHealthcheck(): ?HealthConfig /** * A test to perform to check that the container is healthy. - * - * @param HealthConfig $healthcheck - * - * @return self */ public function setHealthcheck(?HealthConfig $healthcheck): self { + $this->initialized['healthcheck'] = true; $this->healthcheck = $healthcheck; return $this; @@ -501,8 +462,6 @@ public function setHealthcheck(?HealthConfig $healthcheck): self /** * Command is already escaped (Windows only). - * - * @return bool */ public function getArgsEscaped(): ?bool { @@ -511,22 +470,18 @@ public function getArgsEscaped(): ?bool /** * Command is already escaped (Windows only). - * - * @param bool $argsEscaped - * - * @return self */ public function setArgsEscaped(?bool $argsEscaped): self { + $this->initialized['argsEscaped'] = true; $this->argsEscaped = $argsEscaped; return $this; } /** - * The name of the image to use when creating the container. - * - * @return string + * The name (or reference) of the image to use when creating the container, + * or which was used when the container was created. */ public function getImage(): ?string { @@ -534,38 +489,37 @@ public function getImage(): ?string } /** - * The name of the image to use when creating the container. - * - * @param string $image - * - * @return self + * The name (or reference) of the image to use when creating the container, + * or which was used when the container was created. */ public function setImage(?string $image): self { + $this->initialized['image'] = true; $this->image = $image; return $this; } /** - * An object mapping mount point paths inside the container to empty objects. + * An object mapping mount point paths inside the container to empty + * objects. * - * @return mixed[] + * @return array|null */ - public function getVolumes(): ?\ArrayObject + public function getVolumes(): ?iterable { return $this->volumes; } /** - * An object mapping mount point paths inside the container to empty objects. + * An object mapping mount point paths inside the container to empty + * objects. * - * @param mixed[] $volumes - * - * @return self + * @param array|null $volumes */ - public function setVolumes(?\ArrayObject $volumes): self + public function setVolumes(?iterable $volumes): self { + $this->initialized['volumes'] = true; $this->volumes = $volumes; return $this; @@ -573,8 +527,6 @@ public function setVolumes(?\ArrayObject $volumes): self /** * The working directory for commands to run in. - * - * @return string */ public function getWorkingDir(): ?string { @@ -583,13 +535,10 @@ public function getWorkingDir(): ?string /** * The working directory for commands to run in. - * - * @param string $workingDir - * - * @return self */ public function setWorkingDir(?string $workingDir): self { + $this->initialized['workingDir'] = true; $this->workingDir = $workingDir; return $this; @@ -597,11 +546,12 @@ public function setWorkingDir(?string $workingDir): self /** * The entry point for the container as a string or an array of strings. - - If the array consists of exactly one empty string (`[""]`) then the entry point is reset to system default (i.e., the entry point used by docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). - * - * @return string[] + * 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`). + * + * @return list|null */ public function getEntrypoint(): ?array { @@ -610,16 +560,16 @@ public function getEntrypoint(): ?array /** * The entry point for the container as a string or an array of strings. - - If the array consists of exactly one empty string (`[""]`) then the entry point is reset to system default (i.e., the entry point used by docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). - * - * @param string[] $entrypoint + * 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`). * - * @return self + * @param list|null $entrypoint */ public function setEntrypoint(?array $entrypoint): self { + $this->initialized['entrypoint'] = true; $this->entrypoint = $entrypoint; return $this; @@ -627,8 +577,6 @@ public function setEntrypoint(?array $entrypoint): self /** * Disable networking for the container. - * - * @return bool */ public function getNetworkDisabled(): ?bool { @@ -637,13 +585,10 @@ public function getNetworkDisabled(): ?bool /** * Disable networking for the container. - * - * @param bool $networkDisabled - * - * @return self */ public function setNetworkDisabled(?bool $networkDisabled): self { + $this->initialized['networkDisabled'] = true; $this->networkDisabled = $networkDisabled; return $this; @@ -652,7 +597,7 @@ public function setNetworkDisabled(?bool $networkDisabled): self /** * MAC address of the container. * - * @return string + * Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. */ public function getMacAddress(): ?string { @@ -662,12 +607,11 @@ public function getMacAddress(): ?string /** * MAC address of the container. * - * @param string $macAddress - * - * @return self + * Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. */ public function setMacAddress(?string $macAddress): self { + $this->initialized['macAddress'] = true; $this->macAddress = $macAddress; return $this; @@ -676,7 +620,7 @@ public function setMacAddress(?string $macAddress): self /** * `ONBUILD` metadata that were defined in the image's `Dockerfile`. * - * @return string[] + * @return list|null */ public function getOnBuild(): ?array { @@ -686,12 +630,11 @@ public function getOnBuild(): ?array /** * `ONBUILD` metadata that were defined in the image's `Dockerfile`. * - * @param string[] $onBuild - * - * @return self + * @param list|null $onBuild */ public function setOnBuild(?array $onBuild): self { + $this->initialized['onBuild'] = true; $this->onBuild = $onBuild; return $this; @@ -700,9 +643,9 @@ public function setOnBuild(?array $onBuild): self /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -710,12 +653,11 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value metadata. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; @@ -723,8 +665,6 @@ public function setLabels(?\ArrayObject $labels): self /** * Signal to stop a container as a string or unsigned integer. - * - * @return string */ public function getStopSignal(): ?string { @@ -733,13 +673,10 @@ public function getStopSignal(): ?string /** * Signal to stop a container as a string or unsigned integer. - * - * @param string $stopSignal - * - * @return self */ public function setStopSignal(?string $stopSignal): self { + $this->initialized['stopSignal'] = true; $this->stopSignal = $stopSignal; return $this; @@ -747,8 +684,6 @@ public function setStopSignal(?string $stopSignal): self /** * Timeout to stop a container in seconds. - * - * @return int */ public function getStopTimeout(): ?int { @@ -757,13 +692,10 @@ public function getStopTimeout(): ?int /** * Timeout to stop a container in seconds. - * - * @param int $stopTimeout - * - * @return self */ public function setStopTimeout(?int $stopTimeout): self { + $this->initialized['stopTimeout'] = true; $this->stopTimeout = $stopTimeout; return $this; @@ -772,7 +704,7 @@ public function setStopTimeout(?int $stopTimeout): self /** * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. * - * @return string[] + * @return list|null */ public function getShell(): ?array { @@ -782,12 +714,11 @@ public function getShell(): ?array /** * Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. * - * @param string[] $shell - * - * @return self + * @param list|null $shell */ public function setShell(?array $shell): self { + $this->initialized['shell'] = true; $this->shell = $shell; return $this; @@ -795,8 +726,6 @@ public function setShell(?array $shell): self /** * Container configuration that depends on the host we are running on. - * - * @return HostConfig */ public function getHostConfig(): ?HostConfig { @@ -805,37 +734,35 @@ public function getHostConfig(): ?HostConfig /** * Container configuration that depends on the host we are running on. - * - * @param HostConfig $hostConfig - * - * @return self */ public function setHostConfig(?HostConfig $hostConfig): self { + $this->initialized['hostConfig'] = true; $this->hostConfig = $hostConfig; return $this; } /** - * This container's networking configuration. - * - * @return ContainersCreatePostBodyNetworkingConfig + * NetworkingConfig represents the container's networking configuration for + * each of its interfaces. + * It is used for the networking configs specified in the `docker create` + * and `docker network connect` commands. */ - public function getNetworkingConfig(): ?ContainersCreatePostBodyNetworkingConfig + public function getNetworkingConfig(): ?NetworkingConfig { return $this->networkingConfig; } /** - * This container's networking configuration. - * - * @param ContainersCreatePostBodyNetworkingConfig $networkingConfig - * - * @return self + * NetworkingConfig represents the container's networking configuration for + * each of its interfaces. + * It is used for the networking configs specified in the `docker create` + * and `docker network connect` commands. */ - public function setNetworkingConfig(?ContainersCreatePostBodyNetworkingConfig $networkingConfig): self + public function setNetworkingConfig(?NetworkingConfig $networkingConfig): self { + $this->initialized['networkingConfig'] = true; $this->networkingConfig = $networkingConfig; return $this; diff --git a/src/Model/ContainersCreatePostBodyNetworkingConfig.php b/src/Model/ContainersCreatePostBodyNetworkingConfig.php deleted file mode 100644 index 3897a05c..00000000 --- a/src/Model/ContainersCreatePostBodyNetworkingConfig.php +++ /dev/null @@ -1,45 +0,0 @@ -endpointsConfig; - } - - /** - * A mapping of network name to endpoint configuration for that network. - * - * @param EndpointSettings[] $endpointsConfig - * - * @return self - */ - public function setEndpointsConfig(?\ArrayObject $endpointsConfig): self - { - $this->endpointsConfig = $endpointsConfig; - - return $this; - } -} diff --git a/src/Model/ContainersIdArchiveGetResponse400.php b/src/Model/ContainersIdArchiveGetResponse400.php deleted file mode 100644 index 491f9ef4..00000000 --- a/src/Model/ContainersIdArchiveGetResponse400.php +++ /dev/null @@ -1,45 +0,0 @@ -message; - } - - /** - * 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). - * - * @param string $message - * - * @return self - */ - public function setMessage(?string $message): self - { - $this->message = $message; - - return $this; - } -} diff --git a/src/Model/ContainersIdArchiveHeadResponse400.php b/src/Model/ContainersIdArchiveHeadResponse400.php deleted file mode 100644 index 02baa159..00000000 --- a/src/Model/ContainersIdArchiveHeadResponse400.php +++ /dev/null @@ -1,45 +0,0 @@ -message; - } - - /** - * 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). - * - * @param string $message - * - * @return self - */ - public function setMessage(?string $message): self - { - $this->message = $message; - - return $this; - } -} diff --git a/src/Model/ContainersIdChangesGetResponse200Item.php b/src/Model/ContainersIdChangesGetResponse200Item.php deleted file mode 100644 index 50a4dc23..00000000 --- a/src/Model/ContainersIdChangesGetResponse200Item.php +++ /dev/null @@ -1,75 +0,0 @@ -path; - } - - /** - * Path to file that has changed. - * - * @param string $path - * - * @return self - */ - public function setPath(?string $path): self - { - $this->path = $path; - - return $this; - } - - /** - * Kind of change. - * - * @return int - */ - public function getKind(): ?int - { - return $this->kind; - } - - /** - * Kind of change. - * - * @param int $kind - * - * @return self - */ - public function setKind(?int $kind): self - { - $this->kind = $kind; - - return $this; - } -} diff --git a/src/Model/ContainersIdExecPostBody.php b/src/Model/ContainersIdExecPostBody.php index ea7b344b..ae0c8b2c 100644 --- a/src/Model/ContainersIdExecPostBody.php +++ b/src/Model/ContainersIdExecPostBody.php @@ -2,81 +2,92 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ContainersIdExecPostBody +class ContainersIdExecPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Attach to `stdin` of the exec command. * - * @var bool + * @var bool|null */ protected $attachStdin; /** * Attach to `stdout` of the exec command. * - * @var bool + * @var bool|null */ protected $attachStdout; /** * Attach to `stderr` of the exec command. * - * @var bool + * @var bool|null */ protected $attachStderr; /** - * Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + * Initial console size, as an `[height, width]` array. * - * @var string + * @var list|null + */ + protected $consoleSize; + /** + * Override the key sequence for detaching a container. Format is + * a single character `[a-Z]` or `ctrl-` where `` + * is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + * + * @var string|null */ protected $detachKeys; /** * Allocate a pseudo-TTY. * - * @var bool + * @var bool|null */ protected $tty; /** * A list of environment variables in the form `["VAR=value", ...]`. * - * @var string[] + * @var list|null */ protected $env; /** * Command to run, as a string or array of strings. * - * @var string[] + * @var list|null */ protected $cmd; /** * Runs the exec process with extended privileges. * - * @var bool + * @var bool|null */ - protected $privileged; + protected $privileged = false; /** - * The user, and optionally, group to run the exec process inside the container. Format is one of: `user`, `user:group`, `uid`, or `uid:gid`. + * The user, and optionally, group to run the exec process inside + * the container. Format is one of: `user`, `user:group`, `uid`, + * or `uid:gid`. * - * @var string + * @var string|null */ protected $user; /** * The working directory for the exec process inside the container. * - * @var string + * @var string|null */ protected $workingDir; /** * Attach to `stdin` of the exec command. - * - * @return bool */ public function getAttachStdin(): ?bool { @@ -85,13 +96,10 @@ public function getAttachStdin(): ?bool /** * Attach to `stdin` of the exec command. - * - * @param bool $attachStdin - * - * @return self */ public function setAttachStdin(?bool $attachStdin): self { + $this->initialized['attachStdin'] = true; $this->attachStdin = $attachStdin; return $this; @@ -99,8 +107,6 @@ public function setAttachStdin(?bool $attachStdin): self /** * Attach to `stdout` of the exec command. - * - * @return bool */ public function getAttachStdout(): ?bool { @@ -109,13 +115,10 @@ public function getAttachStdout(): ?bool /** * Attach to `stdout` of the exec command. - * - * @param bool $attachStdout - * - * @return self */ public function setAttachStdout(?bool $attachStdout): self { + $this->initialized['attachStdout'] = true; $this->attachStdout = $attachStdout; return $this; @@ -123,8 +126,6 @@ public function setAttachStdout(?bool $attachStdout): self /** * Attach to `stderr` of the exec command. - * - * @return bool */ public function getAttachStderr(): ?bool { @@ -133,22 +134,42 @@ public function getAttachStderr(): ?bool /** * Attach to `stderr` of the exec command. - * - * @param bool $attachStderr - * - * @return self */ public function setAttachStderr(?bool $attachStderr): self { + $this->initialized['attachStderr'] = true; $this->attachStderr = $attachStderr; return $this; } /** - * Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + * Initial console size, as an `[height, width]` array. + * + * @return list|null + */ + public function getConsoleSize(): ?array + { + return $this->consoleSize; + } + + /** + * Initial console size, as an `[height, width]` array. * - * @return string + * @param list|null $consoleSize + */ + public function setConsoleSize(?array $consoleSize): self + { + $this->initialized['consoleSize'] = true; + $this->consoleSize = $consoleSize; + + return $this; + } + + /** + * Override the key sequence for detaching a container. Format is + * a single character `[a-Z]` or `ctrl-` where `` + * is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. */ public function getDetachKeys(): ?string { @@ -156,14 +177,13 @@ public function getDetachKeys(): ?string } /** - * Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-` where `` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. - * - * @param string $detachKeys - * - * @return self + * Override the key sequence for detaching a container. Format is + * a single character `[a-Z]` or `ctrl-` where `` + * is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. */ public function setDetachKeys(?string $detachKeys): self { + $this->initialized['detachKeys'] = true; $this->detachKeys = $detachKeys; return $this; @@ -171,8 +191,6 @@ public function setDetachKeys(?string $detachKeys): self /** * Allocate a pseudo-TTY. - * - * @return bool */ public function getTty(): ?bool { @@ -181,13 +199,10 @@ public function getTty(): ?bool /** * Allocate a pseudo-TTY. - * - * @param bool $tty - * - * @return self */ public function setTty(?bool $tty): self { + $this->initialized['tty'] = true; $this->tty = $tty; return $this; @@ -196,7 +211,7 @@ public function setTty(?bool $tty): self /** * A list of environment variables in the form `["VAR=value", ...]`. * - * @return string[] + * @return list|null */ public function getEnv(): ?array { @@ -206,12 +221,11 @@ public function getEnv(): ?array /** * A list of environment variables in the form `["VAR=value", ...]`. * - * @param string[] $env - * - * @return self + * @param list|null $env */ public function setEnv(?array $env): self { + $this->initialized['env'] = true; $this->env = $env; return $this; @@ -220,7 +234,7 @@ public function setEnv(?array $env): self /** * Command to run, as a string or array of strings. * - * @return string[] + * @return list|null */ public function getCmd(): ?array { @@ -230,12 +244,11 @@ public function getCmd(): ?array /** * Command to run, as a string or array of strings. * - * @param string[] $cmd - * - * @return self + * @param list|null $cmd */ public function setCmd(?array $cmd): self { + $this->initialized['cmd'] = true; $this->cmd = $cmd; return $this; @@ -243,8 +256,6 @@ public function setCmd(?array $cmd): self /** * Runs the exec process with extended privileges. - * - * @return bool */ public function getPrivileged(): ?bool { @@ -253,22 +264,19 @@ public function getPrivileged(): ?bool /** * Runs the exec process with extended privileges. - * - * @param bool $privileged - * - * @return self */ public function setPrivileged(?bool $privileged): self { + $this->initialized['privileged'] = true; $this->privileged = $privileged; return $this; } /** - * The user, and optionally, group to run the exec process inside the container. Format is one of: `user`, `user:group`, `uid`, or `uid:gid`. - * - * @return string + * The user, and optionally, group to run the exec process inside + * the container. Format is one of: `user`, `user:group`, `uid`, + * or `uid:gid`. */ public function getUser(): ?string { @@ -276,14 +284,13 @@ public function getUser(): ?string } /** - * The user, and optionally, group to run the exec process inside the container. Format is one of: `user`, `user:group`, `uid`, or `uid:gid`. - * - * @param string $user - * - * @return self + * The user, and optionally, group to run the exec process inside + * the container. Format is one of: `user`, `user:group`, `uid`, + * or `uid:gid`. */ public function setUser(?string $user): self { + $this->initialized['user'] = true; $this->user = $user; return $this; @@ -291,8 +298,6 @@ public function setUser(?string $user): self /** * The working directory for the exec process inside the container. - * - * @return string */ public function getWorkingDir(): ?string { @@ -301,13 +306,10 @@ public function getWorkingDir(): ?string /** * The working directory for the exec process inside the container. - * - * @param string $workingDir - * - * @return self */ public function setWorkingDir(?string $workingDir): self { + $this->initialized['workingDir'] = true; $this->workingDir = $workingDir; return $this; diff --git a/src/Model/ContainersIdJsonGetResponse200.php b/src/Model/ContainersIdJsonGetResponse200.php index 465e3c8f..cc7030ca 100644 --- a/src/Model/ContainersIdJsonGetResponse200.php +++ b/src/Model/ContainersIdJsonGetResponse200.php @@ -2,147 +2,158 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ContainersIdJsonGetResponse200 +class ContainersIdJsonGetResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The ID of the container. * - * @var string + * @var string|null */ protected $id; /** * The time the container was created. * - * @var string + * @var string|null */ protected $created; /** * The path to the command being run. * - * @var string + * @var string|null */ protected $path; /** * The arguments to the command being run. * - * @var string[] + * @var list|null */ protected $args; /** - * The state of the container. + * ContainerState stores container's running state. It's part of ContainerJSONBase + * and will be returned by the "inspect" command. * - * @var ContainersIdJsonGetResponse200State + * @var ContainerState|null */ protected $state; /** - * The container's image. + * The container's image ID. * - * @var string + * @var string|null */ protected $image; /** - * @var string + * @var string|null */ protected $resolvConfPath; /** - * @var string + * @var string|null */ protected $hostnamePath; /** - * @var string + * @var string|null */ protected $hostsPath; /** - * @var string + * @var string|null */ protected $logPath; /** - * TODO. - * - * @var mixed - */ - protected $node; - /** - * @var string + * @var string|null */ protected $name; /** - * @var int + * @var int|null */ protected $restartCount; /** - * @var string + * @var string|null */ protected $driver; /** - * @var string + * @var string|null + */ + protected $platform; + /** + * @var string|null */ protected $mountLabel; /** - * @var string + * @var string|null */ protected $processLabel; /** - * @var string + * @var string|null */ protected $appArmorProfile; /** - * @var string + * IDs of exec instances that are running in the container. + * + * @var list|null */ protected $execIDs; /** * Container configuration that depends on the host we are running on. * - * @var HostConfig + * @var HostConfig|null */ protected $hostConfig; /** - * Information about a container's graph driver. + * Information about the storage driver used to store the container's and + * image's filesystem. * - * @var GraphDriverData + * @var GraphDriverData|null */ protected $graphDriver; /** - * The size of files that have been created or changed by this container. + * The size of files that have been created or changed by this + * container. * - * @var int + * @var int|null */ protected $sizeRw; /** * The total size of all the files in this container. * - * @var int + * @var int|null */ protected $sizeRootFs; /** - * @var MountPoint[] + * @var list|null */ protected $mounts; /** * Configuration for a container that is portable between hosts. * - * @var ContainerConfig + * When used as `ContainerConfig` field in an image, `ContainerConfig` is an + * optional field containing the configuration of the container that was last + * committed when creating the image. + * + * Previous versions of Docker builder used this field to store build cache, + * and it is not in active use anymore. + * + * @var ContainerConfig|null */ protected $config; /** * NetworkSettings exposes the network settings in the API. * - * @var NetworkSettings + * @var NetworkSettings|null */ protected $networkSettings; /** * The ID of the container. - * - * @return string */ public function getId(): ?string { @@ -151,13 +162,10 @@ public function getId(): ?string /** * The ID of the container. - * - * @param string $id - * - * @return self */ public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -165,8 +173,6 @@ public function setId(?string $id): self /** * The time the container was created. - * - * @return string */ public function getCreated(): ?string { @@ -175,13 +181,10 @@ public function getCreated(): ?string /** * The time the container was created. - * - * @param string $created - * - * @return self */ public function setCreated(?string $created): self { + $this->initialized['created'] = true; $this->created = $created; return $this; @@ -189,8 +192,6 @@ public function setCreated(?string $created): self /** * The path to the command being run. - * - * @return string */ public function getPath(): ?string { @@ -199,13 +200,10 @@ public function getPath(): ?string /** * The path to the command being run. - * - * @param string $path - * - * @return self */ public function setPath(?string $path): self { + $this->initialized['path'] = true; $this->path = $path; return $this; @@ -214,7 +212,7 @@ public function setPath(?string $path): self /** * The arguments to the command being run. * - * @return string[] + * @return list|null */ public function getArgs(): ?array { @@ -224,45 +222,39 @@ public function getArgs(): ?array /** * The arguments to the command being run. * - * @param string[] $args - * - * @return self + * @param list|null $args */ public function setArgs(?array $args): self { + $this->initialized['args'] = true; $this->args = $args; return $this; } /** - * The state of the container. - * - * @return ContainersIdJsonGetResponse200State + * ContainerState stores container's running state. It's part of ContainerJSONBase + * and will be returned by the "inspect" command. */ - public function getState(): ?ContainersIdJsonGetResponse200State + public function getState(): ?ContainerState { return $this->state; } /** - * The state of the container. - * - * @param ContainersIdJsonGetResponse200State $state - * - * @return self + * ContainerState stores container's running state. It's part of ContainerJSONBase + * and will be returned by the "inspect" command. */ - public function setState(?ContainersIdJsonGetResponse200State $state): self + public function setState(?ContainerState $state): self { + $this->initialized['state'] = true; $this->state = $state; return $this; } /** - * The container's image. - * - * @return string + * The container's image ID. */ public function getImage(): ?string { @@ -270,258 +262,177 @@ public function getImage(): ?string } /** - * The container's image. - * - * @param string $image - * - * @return self + * The container's image ID. */ public function setImage(?string $image): self { + $this->initialized['image'] = true; $this->image = $image; return $this; } - /** - * @return string - */ public function getResolvConfPath(): ?string { return $this->resolvConfPath; } - /** - * @param string $resolvConfPath - * - * @return self - */ public function setResolvConfPath(?string $resolvConfPath): self { + $this->initialized['resolvConfPath'] = true; $this->resolvConfPath = $resolvConfPath; return $this; } - /** - * @return string - */ public function getHostnamePath(): ?string { return $this->hostnamePath; } - /** - * @param string $hostnamePath - * - * @return self - */ public function setHostnamePath(?string $hostnamePath): self { + $this->initialized['hostnamePath'] = true; $this->hostnamePath = $hostnamePath; return $this; } - /** - * @return string - */ public function getHostsPath(): ?string { return $this->hostsPath; } - /** - * @param string $hostsPath - * - * @return self - */ public function setHostsPath(?string $hostsPath): self { + $this->initialized['hostsPath'] = true; $this->hostsPath = $hostsPath; return $this; } - /** - * @return string - */ public function getLogPath(): ?string { return $this->logPath; } - /** - * @param string $logPath - * - * @return self - */ public function setLogPath(?string $logPath): self { + $this->initialized['logPath'] = true; $this->logPath = $logPath; return $this; } - /** - * TODO. - * - * @return mixed - */ - public function getNode() - { - return $this->node; - } - - /** - * TODO. - * - * @param mixed $node - * - * @return self - */ - public function setNode($node): self - { - $this->node = $node; - - return $this; - } - - /** - * @return string - */ public function getName(): ?string { return $this->name; } - /** - * @param string $name - * - * @return self - */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } - /** - * @return int - */ public function getRestartCount(): ?int { return $this->restartCount; } - /** - * @param int $restartCount - * - * @return self - */ public function setRestartCount(?int $restartCount): self { + $this->initialized['restartCount'] = true; $this->restartCount = $restartCount; return $this; } - /** - * @return string - */ public function getDriver(): ?string { return $this->driver; } - /** - * @param string $driver - * - * @return self - */ public function setDriver(?string $driver): self { + $this->initialized['driver'] = true; $this->driver = $driver; return $this; } - /** - * @return string - */ + public function getPlatform(): ?string + { + return $this->platform; + } + + public function setPlatform(?string $platform): self + { + $this->initialized['platform'] = true; + $this->platform = $platform; + + return $this; + } + public function getMountLabel(): ?string { return $this->mountLabel; } - /** - * @param string $mountLabel - * - * @return self - */ public function setMountLabel(?string $mountLabel): self { + $this->initialized['mountLabel'] = true; $this->mountLabel = $mountLabel; return $this; } - /** - * @return string - */ public function getProcessLabel(): ?string { return $this->processLabel; } - /** - * @param string $processLabel - * - * @return self - */ public function setProcessLabel(?string $processLabel): self { + $this->initialized['processLabel'] = true; $this->processLabel = $processLabel; return $this; } - /** - * @return string - */ public function getAppArmorProfile(): ?string { return $this->appArmorProfile; } - /** - * @param string $appArmorProfile - * - * @return self - */ public function setAppArmorProfile(?string $appArmorProfile): self { + $this->initialized['appArmorProfile'] = true; $this->appArmorProfile = $appArmorProfile; return $this; } /** - * @return string + * IDs of exec instances that are running in the container. + * + * @return list|null */ - public function getExecIDs(): ?string + public function getExecIDs(): ?array { return $this->execIDs; } /** - * @param string $execIDs + * IDs of exec instances that are running in the container. * - * @return self + * @param list|null $execIDs */ - public function setExecIDs(?string $execIDs): self + public function setExecIDs(?array $execIDs): self { + $this->initialized['execIDs'] = true; $this->execIDs = $execIDs; return $this; @@ -529,8 +440,6 @@ public function setExecIDs(?string $execIDs): self /** * Container configuration that depends on the host we are running on. - * - * @return HostConfig */ public function getHostConfig(): ?HostConfig { @@ -539,22 +448,18 @@ public function getHostConfig(): ?HostConfig /** * Container configuration that depends on the host we are running on. - * - * @param HostConfig $hostConfig - * - * @return self */ public function setHostConfig(?HostConfig $hostConfig): self { + $this->initialized['hostConfig'] = true; $this->hostConfig = $hostConfig; return $this; } /** - * Information about a container's graph driver. - * - * @return GraphDriverData + * Information about the storage driver used to store the container's and + * image's filesystem. */ public function getGraphDriver(): ?GraphDriverData { @@ -562,23 +467,20 @@ public function getGraphDriver(): ?GraphDriverData } /** - * Information about a container's graph driver. - * - * @param GraphDriverData $graphDriver - * - * @return self + * Information about the storage driver used to store the container's and + * image's filesystem. */ public function setGraphDriver(?GraphDriverData $graphDriver): self { + $this->initialized['graphDriver'] = true; $this->graphDriver = $graphDriver; return $this; } /** - * The size of files that have been created or changed by this container. - * - * @return int + * The size of files that have been created or changed by this + * container. */ public function getSizeRw(): ?int { @@ -586,14 +488,12 @@ public function getSizeRw(): ?int } /** - * The size of files that have been created or changed by this container. - * - * @param int $sizeRw - * - * @return self + * The size of files that have been created or changed by this + * container. */ public function setSizeRw(?int $sizeRw): self { + $this->initialized['sizeRw'] = true; $this->sizeRw = $sizeRw; return $this; @@ -601,8 +501,6 @@ public function setSizeRw(?int $sizeRw): self /** * The total size of all the files in this container. - * - * @return int */ public function getSizeRootFs(): ?int { @@ -611,20 +509,17 @@ public function getSizeRootFs(): ?int /** * The total size of all the files in this container. - * - * @param int $sizeRootFs - * - * @return self */ public function setSizeRootFs(?int $sizeRootFs): self { + $this->initialized['sizeRootFs'] = true; $this->sizeRootFs = $sizeRootFs; return $this; } /** - * @return MountPoint[] + * @return list|null */ public function getMounts(): ?array { @@ -632,12 +527,11 @@ public function getMounts(): ?array } /** - * @param MountPoint[] $mounts - * - * @return self + * @param list|null $mounts */ public function setMounts(?array $mounts): self { + $this->initialized['mounts'] = true; $this->mounts = $mounts; return $this; @@ -646,7 +540,12 @@ public function setMounts(?array $mounts): self /** * Configuration for a container that is portable between hosts. * - * @return ContainerConfig + * When used as `ContainerConfig` field in an image, `ContainerConfig` is an + * optional field containing the configuration of the container that was last + * committed when creating the image. + * + * Previous versions of Docker builder used this field to store build cache, + * and it is not in active use anymore. */ public function getConfig(): ?ContainerConfig { @@ -656,12 +555,16 @@ public function getConfig(): ?ContainerConfig /** * Configuration for a container that is portable between hosts. * - * @param ContainerConfig $config + * When used as `ContainerConfig` field in an image, `ContainerConfig` is an + * optional field containing the configuration of the container that was last + * committed when creating the image. * - * @return self + * Previous versions of Docker builder used this field to store build cache, + * and it is not in active use anymore. */ public function setConfig(?ContainerConfig $config): self { + $this->initialized['config'] = true; $this->config = $config; return $this; @@ -669,8 +572,6 @@ public function setConfig(?ContainerConfig $config): self /** * NetworkSettings exposes the network settings in the API. - * - * @return NetworkSettings */ public function getNetworkSettings(): ?NetworkSettings { @@ -679,13 +580,10 @@ public function getNetworkSettings(): ?NetworkSettings /** * NetworkSettings exposes the network settings in the API. - * - * @param NetworkSettings $networkSettings - * - * @return self */ public function setNetworkSettings(?NetworkSettings $networkSettings): self { + $this->initialized['networkSettings'] = true; $this->networkSettings = $networkSettings; return $this; diff --git a/src/Model/ContainersIdTopGetResponse200.php b/src/Model/ContainersIdTopGetJsonResponse200.php similarity index 55% rename from src/Model/ContainersIdTopGetResponse200.php rename to src/Model/ContainersIdTopGetJsonResponse200.php index f30f7d33..d7b48795 100644 --- a/src/Model/ContainersIdTopGetResponse200.php +++ b/src/Model/ContainersIdTopGetJsonResponse200.php @@ -2,33 +2,37 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ContainersIdTopGetResponse200 +class ContainersIdTopGetJsonResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The ps column titles. * - * @var string[] + * @var list|null */ protected $titles; /** - * Each process running in the container, where each is process is an array of values corresponding to the titles. + * Each process running in the container, where each is process + * is an array of values corresponding to the titles. * - * @var string[][] + * @var list>|null */ protected $processes; /** * The ps column titles. * - * @return string[] + * @return list|null */ public function getTitles(): ?array { @@ -38,21 +42,21 @@ public function getTitles(): ?array /** * The ps column titles. * - * @param string[] $titles - * - * @return self + * @param list|null $titles */ public function setTitles(?array $titles): self { + $this->initialized['titles'] = true; $this->titles = $titles; return $this; } /** - * Each process running in the container, where each is process is an array of values corresponding to the titles. + * Each process running in the container, where each is process + * is an array of values corresponding to the titles. * - * @return string[][] + * @return list>|null */ public function getProcesses(): ?array { @@ -60,14 +64,14 @@ public function getProcesses(): ?array } /** - * Each process running in the container, where each is process is an array of values corresponding to the titles. - * - * @param string[][] $processes + * Each process running in the container, where each is process + * is an array of values corresponding to the titles. * - * @return self + * @param list>|null $processes */ public function setProcesses(?array $processes): self { + $this->initialized['processes'] = true; $this->processes = $processes; return $this; diff --git a/src/Model/ContainersIdTopGetTextplainResponse200.php b/src/Model/ContainersIdTopGetTextplainResponse200.php new file mode 100644 index 00000000..d991cc22 --- /dev/null +++ b/src/Model/ContainersIdTopGetTextplainResponse200.php @@ -0,0 +1,79 @@ +initialized); + } + /** + * The ps column titles. + * + * @var list|null + */ + protected $titles; + /** + * Each process running in the container, where each is process + * is an array of values corresponding to the titles. + * + * @var list>|null + */ + protected $processes; + + /** + * The ps column titles. + * + * @return list|null + */ + public function getTitles(): ?array + { + return $this->titles; + } + + /** + * The ps column titles. + * + * @param list|null $titles + */ + public function setTitles(?array $titles): self + { + $this->initialized['titles'] = true; + $this->titles = $titles; + + return $this; + } + + /** + * Each process running in the container, where each is process + * is an array of values corresponding to the titles. + * + * @return list>|null + */ + public function getProcesses(): ?array + { + return $this->processes; + } + + /** + * Each process running in the container, where each is process + * is an array of values corresponding to the titles. + * + * @param list>|null $processes + */ + public function setProcesses(?array $processes): self + { + $this->initialized['processes'] = true; + $this->processes = $processes; + + return $this; + } +} diff --git a/src/Model/ContainersIdUpdatePostBody.php b/src/Model/ContainersIdUpdatePostBody.php index 6f04d9b6..fc6fb763 100644 --- a/src/Model/ContainersIdUpdatePostBody.php +++ b/src/Model/ContainersIdUpdatePostBody.php @@ -2,216 +2,268 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ContainersIdUpdatePostBody +class ContainersIdUpdatePostBody extends \ArrayObject { /** - * An integer value representing this container's relative CPU weight versus other containers. + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * An integer value representing this container's relative CPU weight + * versus other containers. * - * @var int + * @var int|null */ protected $cpuShares; /** * Memory limit in bytes. * - * @var int + * @var int|null */ - protected $memory; + protected $memory = 0; /** - * 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. + * 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. * - * @var string + * @var string|null */ protected $cgroupParent; /** * Block IO weight (relative weight). * - * @var int + * @var int|null */ protected $blkioWeight; /** - * Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. + * Block IO weight (relative device weight) in the form: * - * @var ResourcesBlkioWeightDeviceItem[] + * ``` + * [{"Path": "device_path", "Weight": weight}] + * ``` + * + * @var list|null */ protected $blkioWeightDevice; /** - * Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (bytes per second) from a device, in the form: + * + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @var ThrottleDevice[] + * @var list|null */ protected $blkioDeviceReadBps; /** - * Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (bytes per second) to a device, in the form: * - * @var ThrottleDevice[] + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` + * + * @var list|null */ protected $blkioDeviceWriteBps; /** - * Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (IO per second) from a device, in the form: + * + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @var ThrottleDevice[] + * @var list|null */ protected $blkioDeviceReadIOps; /** - * Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (IO per second) to a device, in the form: * - * @var ThrottleDevice[] + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` + * + * @var list|null */ protected $blkioDeviceWriteIOps; /** * The length of a CPU period in microseconds. * - * @var int + * @var int|null */ protected $cpuPeriod; /** * Microseconds of CPU time that the container can get in a CPU period. * - * @var int + * @var int|null */ protected $cpuQuota; /** - * The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks. + * The length of a CPU real-time period in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. * - * @var int + * @var int|null */ protected $cpuRealtimePeriod; /** - * The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks. + * The length of a CPU real-time runtime in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. * - * @var int + * @var int|null */ protected $cpuRealtimeRuntime; /** * CPUs in which to allow execution (e.g., `0-3`, `0,1`). * - * @var string + * @var string|null */ protected $cpusetCpus; /** - * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + * effective on NUMA systems. * - * @var string + * @var string|null */ protected $cpusetMems; /** * A list of devices to add to the container. * - * @var DeviceMapping[] + * @var list|null */ protected $devices; /** * a list of cgroup rules to apply to the container. * - * @var string[] + * @var list|null */ protected $deviceCgroupRules; /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @var int + * @var list|null */ - protected $diskQuota; + protected $deviceRequests; /** - * Kernel memory limit in bytes. + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + * OCI runtime in use, this option may be ignored. It is no longer supported + * by the default (runc) runtime. + * + * This field is omitted when empty. * - * @var int + * @var int|null */ - protected $kernelMemory; + protected $kernelMemoryTCP; /** * Memory soft limit in bytes. * - * @var int + * @var int|null */ protected $memoryReservation; /** - * Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + * swap. * - * @var int + * @var int|null */ protected $memorySwap; /** - * Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. + * Tune a container's memory swappiness behavior. Accepts an integer + * between 0 and 100. * - * @var int + * @var int|null */ protected $memorySwappiness; /** * CPU quota in units of 10-9 CPUs. * - * @var int + * @var int|null */ - protected $nanoCPUs; + protected $nanoCpus; /** * Disable OOM Killer for the container. * - * @var bool + * @var bool|null */ protected $oomKillDisable; /** - * Tune a container's pids limit. Set -1 for unlimited. + * Run an init inside the container that forwards signals and reaps + * processes. This field is omitted if empty, and the default (as + * configured on the daemon) is used. + * + * @var bool|null + */ + protected $init; + /** + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + * to not change. * - * @var int + * @var int|null */ protected $pidsLimit; /** - * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`". + * A list of resource limits to set in the container. For example: * - * @var ResourcesUlimitsItem[] + * ``` + * {"Name": "nofile", "Soft": 1024, "Hard": 2048} + * ``` + * + * @var list|null */ protected $ulimits; /** * The number of usable CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - * - * @var int + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. + * + * @var int|null */ protected $cpuCount; /** * The usable percentage of the available CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - * - * @var int + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. + * + * @var int|null */ protected $cpuPercent; /** * Maximum IOps for the container system drive (Windows only). * - * @var int + * @var int|null */ protected $iOMaximumIOps; /** - * Maximum IO in bytes per second for the container system drive (Windows only). + * Maximum IO in bytes per second for the container system drive + * (Windows only). * - * @var int + * @var int|null */ protected $iOMaximumBandwidth; /** - * The behavior to apply when the container exits. The default is not to restart. - - An ever increasing delay (double the previous delay, starting at 100ms) is added before each restart to prevent flooding the server. - + * The behavior to apply when the container exits. The default is not to + * restart. * - * @var RestartPolicy + * An ever increasing delay (double the previous delay, starting at 100ms) is + * added before each restart to prevent flooding the server. + * + * @var RestartPolicy|null */ protected $restartPolicy; /** - * An integer value representing this container's relative CPU weight versus other containers. - * - * @return int + * An integer value representing this container's relative CPU weight + * versus other containers. */ public function getCpuShares(): ?int { @@ -219,14 +271,12 @@ public function getCpuShares(): ?int } /** - * An integer value representing this container's relative CPU weight versus other containers. - * - * @param int $cpuShares - * - * @return self + * An integer value representing this container's relative CPU weight + * versus other containers. */ public function setCpuShares(?int $cpuShares): self { + $this->initialized['cpuShares'] = true; $this->cpuShares = $cpuShares; return $this; @@ -234,8 +284,6 @@ public function setCpuShares(?int $cpuShares): self /** * Memory limit in bytes. - * - * @return int */ public function getMemory(): ?int { @@ -244,22 +292,20 @@ public function getMemory(): ?int /** * Memory limit in bytes. - * - * @param int $memory - * - * @return self */ public function setMemory(?int $memory): self { + $this->initialized['memory'] = true; $this->memory = $memory; return $this; } /** - * 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. - * - * @return string + * 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. */ public function getCgroupParent(): ?string { @@ -267,14 +313,14 @@ public function getCgroupParent(): ?string } /** - * 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. - * - * @param string $cgroupParent - * - * @return self + * 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. */ public function setCgroupParent(?string $cgroupParent): self { + $this->initialized['cgroupParent'] = true; $this->cgroupParent = $cgroupParent; return $this; @@ -282,8 +328,6 @@ public function setCgroupParent(?string $cgroupParent): self /** * Block IO weight (relative weight). - * - * @return int */ public function getBlkioWeight(): ?int { @@ -292,22 +336,23 @@ public function getBlkioWeight(): ?int /** * Block IO weight (relative weight). - * - * @param int $blkioWeight - * - * @return self */ public function setBlkioWeight(?int $blkioWeight): self { + $this->initialized['blkioWeight'] = true; $this->blkioWeight = $blkioWeight; return $this; } /** - * Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. + * Block IO weight (relative device weight) in the form: * - * @return ResourcesBlkioWeightDeviceItem[] + * ``` + * [{"Path": "device_path", "Weight": weight}] + * ``` + * + * @return list|null */ public function getBlkioWeightDevice(): ?array { @@ -315,23 +360,30 @@ public function getBlkioWeightDevice(): ?array } /** - * Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. + * Block IO weight (relative device weight) in the form: * - * @param ResourcesBlkioWeightDeviceItem[] $blkioWeightDevice + * ``` + * [{"Path": "device_path", "Weight": weight}] + * ``` * - * @return self + * @param list|null $blkioWeightDevice */ public function setBlkioWeightDevice(?array $blkioWeightDevice): self { + $this->initialized['blkioWeightDevice'] = true; $this->blkioWeightDevice = $blkioWeightDevice; return $this; } /** - * Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (bytes per second) from a device, in the form: + * + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return ThrottleDevice[] + * @return list|null */ public function getBlkioDeviceReadBps(): ?array { @@ -339,23 +391,30 @@ public function getBlkioDeviceReadBps(): ?array } /** - * Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (bytes per second) from a device, in the form: * - * @param ThrottleDevice[] $blkioDeviceReadBps + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return self + * @param list|null $blkioDeviceReadBps */ public function setBlkioDeviceReadBps(?array $blkioDeviceReadBps): self { + $this->initialized['blkioDeviceReadBps'] = true; $this->blkioDeviceReadBps = $blkioDeviceReadBps; return $this; } /** - * Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (bytes per second) to a device, in the form: * - * @return ThrottleDevice[] + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` + * + * @return list|null */ public function getBlkioDeviceWriteBps(): ?array { @@ -363,23 +422,30 @@ public function getBlkioDeviceWriteBps(): ?array } /** - * Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (bytes per second) to a device, in the form: * - * @param ThrottleDevice[] $blkioDeviceWriteBps + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return self + * @param list|null $blkioDeviceWriteBps */ public function setBlkioDeviceWriteBps(?array $blkioDeviceWriteBps): self { + $this->initialized['blkioDeviceWriteBps'] = true; $this->blkioDeviceWriteBps = $blkioDeviceWriteBps; return $this; } /** - * Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (IO per second) from a device, in the form: + * + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return ThrottleDevice[] + * @return list|null */ public function getBlkioDeviceReadIOps(): ?array { @@ -387,23 +453,30 @@ public function getBlkioDeviceReadIOps(): ?array } /** - * Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (IO per second) from a device, in the form: * - * @param ThrottleDevice[] $blkioDeviceReadIOps + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return self + * @param list|null $blkioDeviceReadIOps */ public function setBlkioDeviceReadIOps(?array $blkioDeviceReadIOps): self { + $this->initialized['blkioDeviceReadIOps'] = true; $this->blkioDeviceReadIOps = $blkioDeviceReadIOps; return $this; } /** - * Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (IO per second) to a device, in the form: * - * @return ThrottleDevice[] + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` + * + * @return list|null */ public function getBlkioDeviceWriteIOps(): ?array { @@ -411,14 +484,17 @@ public function getBlkioDeviceWriteIOps(): ?array } /** - * Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (IO per second) to a device, in the form: * - * @param ThrottleDevice[] $blkioDeviceWriteIOps + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return self + * @param list|null $blkioDeviceWriteIOps */ public function setBlkioDeviceWriteIOps(?array $blkioDeviceWriteIOps): self { + $this->initialized['blkioDeviceWriteIOps'] = true; $this->blkioDeviceWriteIOps = $blkioDeviceWriteIOps; return $this; @@ -426,8 +502,6 @@ public function setBlkioDeviceWriteIOps(?array $blkioDeviceWriteIOps): self /** * The length of a CPU period in microseconds. - * - * @return int */ public function getCpuPeriod(): ?int { @@ -436,13 +510,10 @@ public function getCpuPeriod(): ?int /** * The length of a CPU period in microseconds. - * - * @param int $cpuPeriod - * - * @return self */ public function setCpuPeriod(?int $cpuPeriod): self { + $this->initialized['cpuPeriod'] = true; $this->cpuPeriod = $cpuPeriod; return $this; @@ -450,8 +521,6 @@ public function setCpuPeriod(?int $cpuPeriod): self /** * Microseconds of CPU time that the container can get in a CPU period. - * - * @return int */ public function getCpuQuota(): ?int { @@ -460,22 +529,18 @@ public function getCpuQuota(): ?int /** * Microseconds of CPU time that the container can get in a CPU period. - * - * @param int $cpuQuota - * - * @return self */ public function setCpuQuota(?int $cpuQuota): self { + $this->initialized['cpuQuota'] = true; $this->cpuQuota = $cpuQuota; return $this; } /** - * The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks. - * - * @return int + * The length of a CPU real-time period in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. */ public function getCpuRealtimePeriod(): ?int { @@ -483,23 +548,20 @@ public function getCpuRealtimePeriod(): ?int } /** - * The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks. - * - * @param int $cpuRealtimePeriod - * - * @return self + * The length of a CPU real-time period in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. */ public function setCpuRealtimePeriod(?int $cpuRealtimePeriod): self { + $this->initialized['cpuRealtimePeriod'] = true; $this->cpuRealtimePeriod = $cpuRealtimePeriod; return $this; } /** - * The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks. - * - * @return int + * The length of a CPU real-time runtime in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. */ public function getCpuRealtimeRuntime(): ?int { @@ -507,14 +569,12 @@ public function getCpuRealtimeRuntime(): ?int } /** - * The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks. - * - * @param int $cpuRealtimeRuntime - * - * @return self + * The length of a CPU real-time runtime in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. */ public function setCpuRealtimeRuntime(?int $cpuRealtimeRuntime): self { + $this->initialized['cpuRealtimeRuntime'] = true; $this->cpuRealtimeRuntime = $cpuRealtimeRuntime; return $this; @@ -522,8 +582,6 @@ public function setCpuRealtimeRuntime(?int $cpuRealtimeRuntime): self /** * CPUs in which to allow execution (e.g., `0-3`, `0,1`). - * - * @return string */ public function getCpusetCpus(): ?string { @@ -532,22 +590,18 @@ public function getCpusetCpus(): ?string /** * CPUs in which to allow execution (e.g., `0-3`, `0,1`). - * - * @param string $cpusetCpus - * - * @return self */ public function setCpusetCpus(?string $cpusetCpus): self { + $this->initialized['cpusetCpus'] = true; $this->cpusetCpus = $cpusetCpus; return $this; } /** - * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. - * - * @return string + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + * effective on NUMA systems. */ public function getCpusetMems(): ?string { @@ -555,14 +609,12 @@ public function getCpusetMems(): ?string } /** - * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. - * - * @param string $cpusetMems - * - * @return self + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + * effective on NUMA systems. */ public function setCpusetMems(?string $cpusetMems): self { + $this->initialized['cpusetMems'] = true; $this->cpusetMems = $cpusetMems; return $this; @@ -571,7 +623,7 @@ public function setCpusetMems(?string $cpusetMems): self /** * A list of devices to add to the container. * - * @return DeviceMapping[] + * @return list|null */ public function getDevices(): ?array { @@ -581,12 +633,11 @@ public function getDevices(): ?array /** * A list of devices to add to the container. * - * @param DeviceMapping[] $devices - * - * @return self + * @param list|null $devices */ public function setDevices(?array $devices): self { + $this->initialized['devices'] = true; $this->devices = $devices; return $this; @@ -595,7 +646,7 @@ public function setDevices(?array $devices): self /** * a list of cgroup rules to apply to the container. * - * @return string[] + * @return list|null */ public function getDeviceCgroupRules(): ?array { @@ -605,69 +656,68 @@ public function getDeviceCgroupRules(): ?array /** * a list of cgroup rules to apply to the container. * - * @param string[] $deviceCgroupRules - * - * @return self + * @param list|null $deviceCgroupRules */ public function setDeviceCgroupRules(?array $deviceCgroupRules): self { + $this->initialized['deviceCgroupRules'] = true; $this->deviceCgroupRules = $deviceCgroupRules; return $this; } /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @return int + * @return list|null */ - public function getDiskQuota(): ?int + public function getDeviceRequests(): ?array { - return $this->diskQuota; + return $this->deviceRequests; } /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @param int $diskQuota - * - * @return self + * @param list|null $deviceRequests */ - public function setDiskQuota(?int $diskQuota): self + public function setDeviceRequests(?array $deviceRequests): self { - $this->diskQuota = $diskQuota; + $this->initialized['deviceRequests'] = true; + $this->deviceRequests = $deviceRequests; return $this; } /** - * Kernel memory limit in bytes. + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + * OCI runtime in use, this option may be ignored. It is no longer supported + * by the default (runc) runtime. * - * @return int + * This field is omitted when empty. */ - public function getKernelMemory(): ?int + public function getKernelMemoryTCP(): ?int { - return $this->kernelMemory; + return $this->kernelMemoryTCP; } /** - * Kernel memory limit in bytes. - * - * @param int $kernelMemory + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + * OCI runtime in use, this option may be ignored. It is no longer supported + * by the default (runc) runtime. * - * @return self + * This field is omitted when empty. */ - public function setKernelMemory(?int $kernelMemory): self + public function setKernelMemoryTCP(?int $kernelMemoryTCP): self { - $this->kernelMemory = $kernelMemory; + $this->initialized['kernelMemoryTCP'] = true; + $this->kernelMemoryTCP = $kernelMemoryTCP; return $this; } /** * Memory soft limit in bytes. - * - * @return int */ public function getMemoryReservation(): ?int { @@ -676,22 +726,18 @@ public function getMemoryReservation(): ?int /** * Memory soft limit in bytes. - * - * @param int $memoryReservation - * - * @return self */ public function setMemoryReservation(?int $memoryReservation): self { + $this->initialized['memoryReservation'] = true; $this->memoryReservation = $memoryReservation; return $this; } /** - * Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. - * - * @return int + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + * swap. */ public function getMemorySwap(): ?int { @@ -699,23 +745,20 @@ public function getMemorySwap(): ?int } /** - * Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. - * - * @param int $memorySwap - * - * @return self + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + * swap. */ public function setMemorySwap(?int $memorySwap): self { + $this->initialized['memorySwap'] = true; $this->memorySwap = $memorySwap; return $this; } /** - * Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. - * - * @return int + * Tune a container's memory swappiness behavior. Accepts an integer + * between 0 and 100. */ public function getMemorySwappiness(): ?int { @@ -723,14 +766,12 @@ public function getMemorySwappiness(): ?int } /** - * Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. - * - * @param int $memorySwappiness - * - * @return self + * Tune a container's memory swappiness behavior. Accepts an integer + * between 0 and 100. */ public function setMemorySwappiness(?int $memorySwappiness): self { + $this->initialized['memorySwappiness'] = true; $this->memorySwappiness = $memorySwappiness; return $this; @@ -738,32 +779,25 @@ public function setMemorySwappiness(?int $memorySwappiness): self /** * CPU quota in units of 10-9 CPUs. - * - * @return int */ - public function getNanoCPUs(): ?int + public function getNanoCpus(): ?int { - return $this->nanoCPUs; + return $this->nanoCpus; } /** * CPU quota in units of 10-9 CPUs. - * - * @param int $nanoCPUs - * - * @return self */ - public function setNanoCPUs(?int $nanoCPUs): self + public function setNanoCpus(?int $nanoCpus): self { - $this->nanoCPUs = $nanoCPUs; + $this->initialized['nanoCpus'] = true; + $this->nanoCpus = $nanoCpus; return $this; } /** * Disable OOM Killer for the container. - * - * @return bool */ public function getOomKillDisable(): ?bool { @@ -772,22 +806,41 @@ public function getOomKillDisable(): ?bool /** * Disable OOM Killer for the container. - * - * @param bool $oomKillDisable - * - * @return self */ public function setOomKillDisable(?bool $oomKillDisable): self { + $this->initialized['oomKillDisable'] = true; $this->oomKillDisable = $oomKillDisable; return $this; } /** - * Tune a container's pids limit. Set -1 for unlimited. - * - * @return int + * Run an init inside the container that forwards signals and reaps + * processes. This field is omitted if empty, and the default (as + * configured on the daemon) is used. + */ + public function getInit(): ?bool + { + return $this->init; + } + + /** + * Run an init inside the container that forwards signals and reaps + * processes. This field is omitted if empty, and the default (as + * configured on the daemon) is used. + */ + public function setInit(?bool $init): self + { + $this->initialized['init'] = true; + $this->init = $init; + + return $this; + } + + /** + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + * to not change. */ public function getPidsLimit(): ?int { @@ -795,23 +848,25 @@ public function getPidsLimit(): ?int } /** - * Tune a container's pids limit. Set -1 for unlimited. - * - * @param int $pidsLimit - * - * @return self + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + * to not change. */ public function setPidsLimit(?int $pidsLimit): self { + $this->initialized['pidsLimit'] = true; $this->pidsLimit = $pidsLimit; return $this; } /** - * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`". + * A list of resource limits to set in the container. For example: + * + * ``` + * {"Name": "nofile", "Soft": 1024, "Hard": 2048} + * ``` * - * @return ResourcesUlimitsItem[] + * @return list|null */ public function getUlimits(): ?array { @@ -819,14 +874,17 @@ public function getUlimits(): ?array } /** - * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`". + * A list of resource limits to set in the container. For example: * - * @param ResourcesUlimitsItem[] $ulimits + * ``` + * {"Name": "nofile", "Soft": 1024, "Hard": 2048} + * ``` * - * @return self + * @param list|null $ulimits */ public function setUlimits(?array $ulimits): self { + $this->initialized['ulimits'] = true; $this->ulimits = $ulimits; return $this; @@ -834,11 +892,10 @@ public function setUlimits(?array $ulimits): self /** * The number of usable CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - * - * @return int + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. */ public function getCpuCount(): ?int { @@ -847,16 +904,14 @@ public function getCpuCount(): ?int /** * The number of usable CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - * - * @param int $cpuCount - * - * @return self + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. */ public function setCpuCount(?int $cpuCount): self { + $this->initialized['cpuCount'] = true; $this->cpuCount = $cpuCount; return $this; @@ -864,11 +919,10 @@ public function setCpuCount(?int $cpuCount): self /** * The usable percentage of the available CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - * - * @return int + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. */ public function getCpuPercent(): ?int { @@ -877,16 +931,14 @@ public function getCpuPercent(): ?int /** * The usable percentage of the available CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - * - * @param int $cpuPercent - * - * @return self + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. */ public function setCpuPercent(?int $cpuPercent): self { + $this->initialized['cpuPercent'] = true; $this->cpuPercent = $cpuPercent; return $this; @@ -894,8 +946,6 @@ public function setCpuPercent(?int $cpuPercent): self /** * Maximum IOps for the container system drive (Windows only). - * - * @return int */ public function getIOMaximumIOps(): ?int { @@ -904,22 +954,18 @@ public function getIOMaximumIOps(): ?int /** * Maximum IOps for the container system drive (Windows only). - * - * @param int $iOMaximumIOps - * - * @return self */ public function setIOMaximumIOps(?int $iOMaximumIOps): self { + $this->initialized['iOMaximumIOps'] = true; $this->iOMaximumIOps = $iOMaximumIOps; return $this; } /** - * Maximum IO in bytes per second for the container system drive (Windows only). - * - * @return int + * Maximum IO in bytes per second for the container system drive + * (Windows only). */ public function getIOMaximumBandwidth(): ?int { @@ -927,26 +973,23 @@ public function getIOMaximumBandwidth(): ?int } /** - * Maximum IO in bytes per second for the container system drive (Windows only). - * - * @param int $iOMaximumBandwidth - * - * @return self + * Maximum IO in bytes per second for the container system drive + * (Windows only). */ public function setIOMaximumBandwidth(?int $iOMaximumBandwidth): self { + $this->initialized['iOMaximumBandwidth'] = true; $this->iOMaximumBandwidth = $iOMaximumBandwidth; return $this; } /** - * The behavior to apply when the container exits. The default is not to restart. - - An ever increasing delay (double the previous delay, starting at 100ms) is added before each restart to prevent flooding the server. - + * The behavior to apply when the container exits. The default is not to + * restart. * - * @return RestartPolicy + * An ever increasing delay (double the previous delay, starting at 100ms) is + * added before each restart to prevent flooding the server. */ public function getRestartPolicy(): ?RestartPolicy { @@ -954,17 +997,15 @@ public function getRestartPolicy(): ?RestartPolicy } /** - * The behavior to apply when the container exits. The default is not to restart. - - An ever increasing delay (double the previous delay, starting at 100ms) is added before each restart to prevent flooding the server. - - * - * @param RestartPolicy $restartPolicy + * The behavior to apply when the container exits. The default is not to + * restart. * - * @return self + * An ever increasing delay (double the previous delay, starting at 100ms) is + * added before each restart to prevent flooding the server. */ public function setRestartPolicy(?RestartPolicy $restartPolicy): self { + $this->initialized['restartPolicy'] = true; $this->restartPolicy = $restartPolicy; return $this; diff --git a/src/Model/ContainersIdUpdatePostResponse200.php b/src/Model/ContainersIdUpdatePostResponse200.php index 2a571bad..8cff530c 100644 --- a/src/Model/ContainersIdUpdatePostResponse200.php +++ b/src/Model/ContainersIdUpdatePostResponse200.php @@ -2,23 +2,26 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ContainersIdUpdatePostResponse200 +class ContainersIdUpdatePostResponse200 extends \ArrayObject { /** - * @var string[] + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var list|null */ protected $warnings; /** - * @return string[] + * @return list|null */ public function getWarnings(): ?array { @@ -26,12 +29,11 @@ public function getWarnings(): ?array } /** - * @param string[] $warnings - * - * @return self + * @param list|null $warnings */ public function setWarnings(?array $warnings): self { + $this->initialized['warnings'] = true; $this->warnings = $warnings; return $this; diff --git a/src/Model/ContainersPrunePostResponse200.php b/src/Model/ContainersPrunePostResponse200.php index da940589..99d4f002 100644 --- a/src/Model/ContainersPrunePostResponse200.php +++ b/src/Model/ContainersPrunePostResponse200.php @@ -2,33 +2,36 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ContainersPrunePostResponse200 +class ContainersPrunePostResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Container IDs that were deleted. * - * @var string[] + * @var list|null */ protected $containersDeleted; /** * Disk space reclaimed in bytes. * - * @var int + * @var int|null */ protected $spaceReclaimed; /** * Container IDs that were deleted. * - * @return string[] + * @return list|null */ public function getContainersDeleted(): ?array { @@ -38,12 +41,11 @@ public function getContainersDeleted(): ?array /** * Container IDs that were deleted. * - * @param string[] $containersDeleted - * - * @return self + * @param list|null $containersDeleted */ public function setContainersDeleted(?array $containersDeleted): self { + $this->initialized['containersDeleted'] = true; $this->containersDeleted = $containersDeleted; return $this; @@ -51,8 +53,6 @@ public function setContainersDeleted(?array $containersDeleted): self /** * Disk space reclaimed in bytes. - * - * @return int */ public function getSpaceReclaimed(): ?int { @@ -61,13 +61,10 @@ public function getSpaceReclaimed(): ?int /** * Disk space reclaimed in bytes. - * - * @param int $spaceReclaimed - * - * @return self */ public function setSpaceReclaimed(?int $spaceReclaimed): self { + $this->initialized['spaceReclaimed'] = true; $this->spaceReclaimed = $spaceReclaimed; return $this; diff --git a/src/Model/CreateImageInfo.php b/src/Model/CreateImageInfo.php index b0f00aed..3d1b8398 100644 --- a/src/Model/CreateImageInfo.php +++ b/src/Model/CreateImageInfo.php @@ -2,132 +2,117 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class CreateImageInfo +class CreateImageInfo extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $id; /** - * @var string + * @var string|null */ protected $error; /** - * @var string + * @var ErrorDetail|null + */ + protected $errorDetail; + /** + * @var string|null */ protected $status; /** - * @var string + * @var string|null */ protected $progress; /** - * @var ProgressDetail + * @var ProgressDetail|null */ protected $progressDetail; - /** - * @return string - */ public function getId(): ?string { return $this->id; } - /** - * @param string $id - * - * @return self - */ public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; } - /** - * @return string - */ public function getError(): ?string { return $this->error; } - /** - * @param string $error - * - * @return self - */ public function setError(?string $error): self { + $this->initialized['error'] = true; $this->error = $error; return $this; } - /** - * @return string - */ + public function getErrorDetail(): ?ErrorDetail + { + return $this->errorDetail; + } + + public function setErrorDetail(?ErrorDetail $errorDetail): self + { + $this->initialized['errorDetail'] = true; + $this->errorDetail = $errorDetail; + + return $this; + } + public function getStatus(): ?string { return $this->status; } - /** - * @param string $status - * - * @return self - */ public function setStatus(?string $status): self { + $this->initialized['status'] = true; $this->status = $status; return $this; } - /** - * @return string - */ public function getProgress(): ?string { return $this->progress; } - /** - * @param string $progress - * - * @return self - */ public function setProgress(?string $progress): self { + $this->initialized['progress'] = true; $this->progress = $progress; return $this; } - /** - * @return ProgressDetail - */ public function getProgressDetail(): ?ProgressDetail { return $this->progressDetail; } - /** - * @param ProgressDetail $progressDetail - * - * @return self - */ public function setProgressDetail(?ProgressDetail $progressDetail): self { + $this->initialized['progressDetail'] = true; $this->progressDetail = $progressDetail; return $this; diff --git a/src/Model/DeviceMapping.php b/src/Model/DeviceMapping.php index cf6b7677..437cccef 100644 --- a/src/Model/DeviceMapping.php +++ b/src/Model/DeviceMapping.php @@ -2,84 +2,66 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class DeviceMapping +class DeviceMapping extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $pathOnHost; /** - * @var string + * @var string|null */ protected $pathInContainer; /** - * @var string + * @var string|null */ protected $cgroupPermissions; - /** - * @return string - */ public function getPathOnHost(): ?string { return $this->pathOnHost; } - /** - * @param string $pathOnHost - * - * @return self - */ public function setPathOnHost(?string $pathOnHost): self { + $this->initialized['pathOnHost'] = true; $this->pathOnHost = $pathOnHost; return $this; } - /** - * @return string - */ public function getPathInContainer(): ?string { return $this->pathInContainer; } - /** - * @param string $pathInContainer - * - * @return self - */ public function setPathInContainer(?string $pathInContainer): self { + $this->initialized['pathInContainer'] = true; $this->pathInContainer = $pathInContainer; return $this; } - /** - * @return string - */ public function getCgroupPermissions(): ?string { return $this->cgroupPermissions; } - /** - * @param string $cgroupPermissions - * - * @return self - */ public function setCgroupPermissions(?string $cgroupPermissions): self { + $this->initialized['cgroupPermissions'] = true; $this->cgroupPermissions = $cgroupPermissions; return $this; diff --git a/src/Model/DeviceRequest.php b/src/Model/DeviceRequest.php new file mode 100644 index 00000000..a57bf77f --- /dev/null +++ b/src/Model/DeviceRequest.php @@ -0,0 +1,136 @@ +initialized); + } + /** + * @var string|null + */ + protected $driver; + /** + * @var int|null + */ + protected $count; + /** + * @var list|null + */ + protected $deviceIDs; + /** + * A list of capabilities; an OR list of AND lists of capabilities. + * + * @var list>|null + */ + protected $capabilities; + /** + * Driver-specific options, specified as a key/value pairs. These options + * are passed directly to the driver. + * + * @var array|null + */ + protected $options; + + public function getDriver(): ?string + { + return $this->driver; + } + + public function setDriver(?string $driver): self + { + $this->initialized['driver'] = true; + $this->driver = $driver; + + return $this; + } + + public function getCount(): ?int + { + return $this->count; + } + + public function setCount(?int $count): self + { + $this->initialized['count'] = true; + $this->count = $count; + + return $this; + } + + /** + * @return list|null + */ + public function getDeviceIDs(): ?array + { + return $this->deviceIDs; + } + + /** + * @param list|null $deviceIDs + */ + public function setDeviceIDs(?array $deviceIDs): self + { + $this->initialized['deviceIDs'] = true; + $this->deviceIDs = $deviceIDs; + + return $this; + } + + /** + * A list of capabilities; an OR list of AND lists of capabilities. + * + * @return list>|null + */ + public function getCapabilities(): ?array + { + return $this->capabilities; + } + + /** + * A list of capabilities; an OR list of AND lists of capabilities. + * + * @param list>|null $capabilities + */ + public function setCapabilities(?array $capabilities): self + { + $this->initialized['capabilities'] = true; + $this->capabilities = $capabilities; + + return $this; + } + + /** + * Driver-specific options, specified as a key/value pairs. These options + * are passed directly to the driver. + * + * @return array|null + */ + public function getOptions(): ?iterable + { + return $this->options; + } + + /** + * Driver-specific options, specified as a key/value pairs. These options + * are passed directly to the driver. + * + * @param array|null $options + */ + public function setOptions(?iterable $options): self + { + $this->initialized['options'] = true; + $this->options = $options; + + return $this; + } +} diff --git a/src/Model/DistributionInspect.php b/src/Model/DistributionInspect.php new file mode 100644 index 00000000..40a11718 --- /dev/null +++ b/src/Model/DistributionInspect.php @@ -0,0 +1,75 @@ +initialized); + } + /** + * A descriptor struct containing digest, media type, and size, as defined in + * the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + * + * @var OCIDescriptor|null + */ + protected $descriptor; + /** + * An array containing all platforms supported by the image. + * + * @var list|null + */ + protected $platforms; + + /** + * A descriptor struct containing digest, media type, and size, as defined in + * the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + */ + public function getDescriptor(): ?OCIDescriptor + { + return $this->descriptor; + } + + /** + * A descriptor struct containing digest, media type, and size, as defined in + * the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + */ + public function setDescriptor(?OCIDescriptor $descriptor): self + { + $this->initialized['descriptor'] = true; + $this->descriptor = $descriptor; + + return $this; + } + + /** + * An array containing all platforms supported by the image. + * + * @return list|null + */ + public function getPlatforms(): ?array + { + return $this->platforms; + } + + /** + * An array containing all platforms supported by the image. + * + * @param list|null $platforms + */ + public function setPlatforms(?array $platforms): self + { + $this->initialized['platforms'] = true; + $this->platforms = $platforms; + + return $this; + } +} diff --git a/src/Model/DistributionNameJsonGetResponse200.php b/src/Model/DistributionNameJsonGetResponse200.php deleted file mode 100644 index 9fa678d2..00000000 --- a/src/Model/DistributionNameJsonGetResponse200.php +++ /dev/null @@ -1,75 +0,0 @@ -descriptor; - } - - /** - * A descriptor struct containing digest, media type, and size. - * - * @param DistributionNameJsonGetResponse200Descriptor $descriptor - * - * @return self - */ - public function setDescriptor(?DistributionNameJsonGetResponse200Descriptor $descriptor): self - { - $this->descriptor = $descriptor; - - return $this; - } - - /** - * An array containing all platforms supported by the image. - * - * @return DistributionNameJsonGetResponse200PlatformsItem[] - */ - public function getPlatforms(): ?array - { - return $this->platforms; - } - - /** - * An array containing all platforms supported by the image. - * - * @param DistributionNameJsonGetResponse200PlatformsItem[] $platforms - * - * @return self - */ - public function setPlatforms(?array $platforms): self - { - $this->platforms = $platforms; - - return $this; - } -} diff --git a/src/Model/DistributionNameJsonGetResponse200PlatformsItem.php b/src/Model/DistributionNameJsonGetResponse200PlatformsItem.php deleted file mode 100644 index 5e94bcab..00000000 --- a/src/Model/DistributionNameJsonGetResponse200PlatformsItem.php +++ /dev/null @@ -1,159 +0,0 @@ -architecture; - } - - /** - * @param string $architecture - * - * @return self - */ - public function setArchitecture(?string $architecture): self - { - $this->architecture = $architecture; - - return $this; - } - - /** - * @return string - */ - public function getOS(): ?string - { - return $this->oS; - } - - /** - * @param string $oS - * - * @return self - */ - public function setOS(?string $oS): self - { - $this->oS = $oS; - - return $this; - } - - /** - * @return string - */ - public function getOSVersion(): ?string - { - return $this->oSVersion; - } - - /** - * @param string $oSVersion - * - * @return self - */ - public function setOSVersion(?string $oSVersion): self - { - $this->oSVersion = $oSVersion; - - return $this; - } - - /** - * @return string[] - */ - public function getOSFeatures(): ?array - { - return $this->oSFeatures; - } - - /** - * @param string[] $oSFeatures - * - * @return self - */ - public function setOSFeatures(?array $oSFeatures): self - { - $this->oSFeatures = $oSFeatures; - - return $this; - } - - /** - * @return string - */ - public function getVariant(): ?string - { - return $this->variant; - } - - /** - * @param string $variant - * - * @return self - */ - public function setVariant(?string $variant): self - { - $this->variant = $variant; - - return $this; - } - - /** - * @return string[] - */ - public function getFeatures(): ?array - { - return $this->features; - } - - /** - * @param string[] $features - * - * @return self - */ - public function setFeatures(?array $features): self - { - $this->features = $features; - - return $this; - } -} diff --git a/src/Model/Driver.php b/src/Model/Driver.php index 2b1340d7..648bbc60 100644 --- a/src/Model/Driver.php +++ b/src/Model/Driver.php @@ -2,33 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Driver +class Driver extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Name of the driver. * - * @var string + * @var string|null */ protected $name; /** * Key/value map of driver-specific options. * - * @var string[] + * @var array|null */ protected $options; /** * Name of the driver. - * - * @return string */ public function getName(): ?string { @@ -37,13 +38,10 @@ public function getName(): ?string /** * Name of the driver. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -52,9 +50,9 @@ public function setName(?string $name): self /** * Key/value map of driver-specific options. * - * @return string[] + * @return array|null */ - public function getOptions(): ?\ArrayObject + public function getOptions(): ?iterable { return $this->options; } @@ -62,12 +60,11 @@ public function getOptions(): ?\ArrayObject /** * Key/value map of driver-specific options. * - * @param string[] $options - * - * @return self + * @param array|null $options */ - public function setOptions(?\ArrayObject $options): self + public function setOptions(?iterable $options): self { + $this->initialized['options'] = true; $this->options = $options; return $this; diff --git a/src/Model/EndpointIPAMConfig.php b/src/Model/EndpointIPAMConfig.php index 720ab45e..fb6e33fe 100644 --- a/src/Model/EndpointIPAMConfig.php +++ b/src/Model/EndpointIPAMConfig.php @@ -2,71 +2,60 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class EndpointIPAMConfig +class EndpointIPAMConfig extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $iPv4Address; /** - * @var string + * @var string|null */ protected $iPv6Address; /** - * @var string[] + * @var list|null */ protected $linkLocalIPs; - /** - * @return string - */ public function getIPv4Address(): ?string { return $this->iPv4Address; } - /** - * @param string $iPv4Address - * - * @return self - */ public function setIPv4Address(?string $iPv4Address): self { + $this->initialized['iPv4Address'] = true; $this->iPv4Address = $iPv4Address; return $this; } - /** - * @return string - */ public function getIPv6Address(): ?string { return $this->iPv6Address; } - /** - * @param string $iPv6Address - * - * @return self - */ public function setIPv6Address(?string $iPv6Address): self { + $this->initialized['iPv6Address'] = true; $this->iPv6Address = $iPv6Address; return $this; } /** - * @return string[] + * @return list|null */ public function getLinkLocalIPs(): ?array { @@ -74,12 +63,11 @@ public function getLinkLocalIPs(): ?array } /** - * @param string[] $linkLocalIPs - * - * @return self + * @param list|null $linkLocalIPs */ public function setLinkLocalIPs(?array $linkLocalIPs): self { + $this->initialized['linkLocalIPs'] = true; $this->linkLocalIPs = $linkLocalIPs; return $this; diff --git a/src/Model/EndpointPortConfig.php b/src/Model/EndpointPortConfig.php index d27f64d8..443ec8f7 100644 --- a/src/Model/EndpointPortConfig.php +++ b/src/Model/EndpointPortConfig.php @@ -2,87 +2,75 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class EndpointPortConfig +class EndpointPortConfig extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $name; /** - * @var string + * @var string|null */ protected $protocol; /** * The port inside the container. * - * @var int + * @var int|null */ protected $targetPort; /** * The port on the swarm hosts. * - * @var int + * @var int|null */ protected $publishedPort; /** * The mode in which port is published. - -


- - - "ingress" makes the target port accessible on on every node, - regardless of whether there is a task for the service running on - that node or not. - - "host" bypasses the routing mesh and publish the port directly on - the swarm node where that service is running. - * - * @var string + *


+ * + * - "ingress" makes the target port accessible on every node, + * regardless of whether there is a task for the service running on + * that node or not. + * - "host" bypasses the routing mesh and publish the port directly on + * the swarm node where that service is running. + * + * @var string|null */ - protected $publishMode; + protected $publishMode = 'ingress'; - /** - * @return string - */ public function getName(): ?string { return $this->name; } - /** - * @param string $name - * - * @return self - */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } - /** - * @return string - */ public function getProtocol(): ?string { return $this->protocol; } - /** - * @param string $protocol - * - * @return self - */ public function setProtocol(?string $protocol): self { + $this->initialized['protocol'] = true; $this->protocol = $protocol; return $this; @@ -90,8 +78,6 @@ public function setProtocol(?string $protocol): self /** * The port inside the container. - * - * @return int */ public function getTargetPort(): ?int { @@ -100,13 +86,10 @@ public function getTargetPort(): ?int /** * The port inside the container. - * - * @param int $targetPort - * - * @return self */ public function setTargetPort(?int $targetPort): self { + $this->initialized['targetPort'] = true; $this->targetPort = $targetPort; return $this; @@ -114,8 +97,6 @@ public function setTargetPort(?int $targetPort): self /** * The port on the swarm hosts. - * - * @return int */ public function getPublishedPort(): ?int { @@ -124,13 +105,10 @@ public function getPublishedPort(): ?int /** * The port on the swarm hosts. - * - * @param int $publishedPort - * - * @return self */ public function setPublishedPort(?int $publishedPort): self { + $this->initialized['publishedPort'] = true; $this->publishedPort = $publishedPort; return $this; @@ -138,17 +116,14 @@ public function setPublishedPort(?int $publishedPort): self /** * The mode in which port is published. - -


- - - "ingress" makes the target port accessible on on every node, - regardless of whether there is a task for the service running on - that node or not. - - "host" bypasses the routing mesh and publish the port directly on - the swarm node where that service is running. - * - * @return string + *


+ * + * - "ingress" makes the target port accessible on every node, + * regardless of whether there is a task for the service running on + * that node or not. + * - "host" bypasses the routing mesh and publish the port directly on + * the swarm node where that service is running. */ public function getPublishMode(): ?string { @@ -157,22 +132,18 @@ public function getPublishMode(): ?string /** * The mode in which port is published. - -


- - - "ingress" makes the target port accessible on on every node, - regardless of whether there is a task for the service running on - that node or not. - - "host" bypasses the routing mesh and publish the port directly on - the swarm node where that service is running. - * - * @param string $publishMode + *


* - * @return self + * - "ingress" makes the target port accessible on every node, + * regardless of whether there is a task for the service running on + * that node or not. + * - "host" bypasses the routing mesh and publish the port directly on + * the swarm node where that service is running. */ public function setPublishMode(?string $publishMode): self { + $this->initialized['publishMode'] = true; $this->publishMode = $publishMode; return $this; diff --git a/src/Model/EndpointSettings.php b/src/Model/EndpointSettings.php index ec0c9ba7..dd01dec6 100644 --- a/src/Model/EndpointSettings.php +++ b/src/Model/EndpointSettings.php @@ -2,97 +2,111 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class EndpointSettings +class EndpointSettings extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * EndpointIPAMConfig represents an endpoint's IPAM configuration. * - * @var EndpointIPAMConfig + * @var EndpointIPAMConfig|null */ protected $iPAMConfig; /** - * @var string[] + * @var list|null */ protected $links; /** - * @var string[] + * MAC address for the endpoint on this network. The network driver might ignore this parameter. + * + * @var string|null + */ + protected $macAddress; + /** + * @var list|null */ protected $aliases; /** * Unique ID of the network. * - * @var string + * @var string|null */ protected $networkID; /** * Unique ID for the service endpoint in a Sandbox. * - * @var string + * @var string|null */ protected $endpointID; /** * Gateway address for this network. * - * @var string + * @var string|null */ protected $gateway; /** * IPv4 address. * - * @var string + * @var string|null */ protected $iPAddress; /** * Mask length of the IPv4 address. * - * @var int + * @var int|null */ protected $iPPrefixLen; /** * IPv6 gateway address. * - * @var string + * @var string|null */ protected $iPv6Gateway; /** * Global IPv6 address. * - * @var string + * @var string|null */ protected $globalIPv6Address; /** * Mask length of the global IPv6 address. * - * @var int + * @var int|null */ protected $globalIPv6PrefixLen; /** - * MAC address for the endpoint on this network. + * DriverOpts is a mapping of driver options and values. These options + * are passed directly to the driver and are driver specific. * - * @var string + * @var array|null */ - protected $macAddress; + protected $driverOpts; /** - * DriverOpts is a mapping of driver options and values. These options. - are passed directly to the driver and are driver specific. - + * List of all DNS names an endpoint has on a specific network. This + * list is based on the container name, network aliases, container short + * ID, and hostname. + * + * These DNS names are non-fully qualified but can contain several dots. + * You can get fully qualified DNS names by appending `.`. + * For instance, if container name is `my.ctr` and the network is named + * `testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be + * `my.ctr.testnet`. * - * @var string[] + * @var list|null */ - protected $driverOpts; + protected $dNSNames; /** * EndpointIPAMConfig represents an endpoint's IPAM configuration. - * - * @return EndpointIPAMConfig */ public function getIPAMConfig(): ?EndpointIPAMConfig { @@ -101,20 +115,17 @@ public function getIPAMConfig(): ?EndpointIPAMConfig /** * EndpointIPAMConfig represents an endpoint's IPAM configuration. - * - * @param EndpointIPAMConfig $iPAMConfig - * - * @return self */ public function setIPAMConfig(?EndpointIPAMConfig $iPAMConfig): self { + $this->initialized['iPAMConfig'] = true; $this->iPAMConfig = $iPAMConfig; return $this; } /** - * @return string[] + * @return list|null */ public function getLinks(): ?array { @@ -122,19 +133,37 @@ public function getLinks(): ?array } /** - * @param string[] $links - * - * @return self + * @param list|null $links */ public function setLinks(?array $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; } /** - * @return string[] + * MAC address for the endpoint on this network. The network driver might ignore this parameter. + */ + public function getMacAddress(): ?string + { + return $this->macAddress; + } + + /** + * MAC address for the endpoint on this network. The network driver might ignore this parameter. + */ + public function setMacAddress(?string $macAddress): self + { + $this->initialized['macAddress'] = true; + $this->macAddress = $macAddress; + + return $this; + } + + /** + * @return list|null */ public function getAliases(): ?array { @@ -142,12 +171,11 @@ public function getAliases(): ?array } /** - * @param string[] $aliases - * - * @return self + * @param list|null $aliases */ public function setAliases(?array $aliases): self { + $this->initialized['aliases'] = true; $this->aliases = $aliases; return $this; @@ -155,8 +183,6 @@ public function setAliases(?array $aliases): self /** * Unique ID of the network. - * - * @return string */ public function getNetworkID(): ?string { @@ -165,13 +191,10 @@ public function getNetworkID(): ?string /** * Unique ID of the network. - * - * @param string $networkID - * - * @return self */ public function setNetworkID(?string $networkID): self { + $this->initialized['networkID'] = true; $this->networkID = $networkID; return $this; @@ -179,8 +202,6 @@ public function setNetworkID(?string $networkID): self /** * Unique ID for the service endpoint in a Sandbox. - * - * @return string */ public function getEndpointID(): ?string { @@ -189,13 +210,10 @@ public function getEndpointID(): ?string /** * Unique ID for the service endpoint in a Sandbox. - * - * @param string $endpointID - * - * @return self */ public function setEndpointID(?string $endpointID): self { + $this->initialized['endpointID'] = true; $this->endpointID = $endpointID; return $this; @@ -203,8 +221,6 @@ public function setEndpointID(?string $endpointID): self /** * Gateway address for this network. - * - * @return string */ public function getGateway(): ?string { @@ -213,13 +229,10 @@ public function getGateway(): ?string /** * Gateway address for this network. - * - * @param string $gateway - * - * @return self */ public function setGateway(?string $gateway): self { + $this->initialized['gateway'] = true; $this->gateway = $gateway; return $this; @@ -227,8 +240,6 @@ public function setGateway(?string $gateway): self /** * IPv4 address. - * - * @return string */ public function getIPAddress(): ?string { @@ -237,13 +248,10 @@ public function getIPAddress(): ?string /** * IPv4 address. - * - * @param string $iPAddress - * - * @return self */ public function setIPAddress(?string $iPAddress): self { + $this->initialized['iPAddress'] = true; $this->iPAddress = $iPAddress; return $this; @@ -251,8 +259,6 @@ public function setIPAddress(?string $iPAddress): self /** * Mask length of the IPv4 address. - * - * @return int */ public function getIPPrefixLen(): ?int { @@ -261,13 +267,10 @@ public function getIPPrefixLen(): ?int /** * Mask length of the IPv4 address. - * - * @param int $iPPrefixLen - * - * @return self */ public function setIPPrefixLen(?int $iPPrefixLen): self { + $this->initialized['iPPrefixLen'] = true; $this->iPPrefixLen = $iPPrefixLen; return $this; @@ -275,8 +278,6 @@ public function setIPPrefixLen(?int $iPPrefixLen): self /** * IPv6 gateway address. - * - * @return string */ public function getIPv6Gateway(): ?string { @@ -285,13 +286,10 @@ public function getIPv6Gateway(): ?string /** * IPv6 gateway address. - * - * @param string $iPv6Gateway - * - * @return self */ public function setIPv6Gateway(?string $iPv6Gateway): self { + $this->initialized['iPv6Gateway'] = true; $this->iPv6Gateway = $iPv6Gateway; return $this; @@ -299,8 +297,6 @@ public function setIPv6Gateway(?string $iPv6Gateway): self /** * Global IPv6 address. - * - * @return string */ public function getGlobalIPv6Address(): ?string { @@ -309,13 +305,10 @@ public function getGlobalIPv6Address(): ?string /** * Global IPv6 address. - * - * @param string $globalIPv6Address - * - * @return self */ public function setGlobalIPv6Address(?string $globalIPv6Address): self { + $this->initialized['globalIPv6Address'] = true; $this->globalIPv6Address = $globalIPv6Address; return $this; @@ -323,8 +316,6 @@ public function setGlobalIPv6Address(?string $globalIPv6Address): self /** * Mask length of the global IPv6 address. - * - * @return int */ public function getGlobalIPv6PrefixLen(): ?int { @@ -333,66 +324,75 @@ public function getGlobalIPv6PrefixLen(): ?int /** * Mask length of the global IPv6 address. - * - * @param int $globalIPv6PrefixLen - * - * @return self */ public function setGlobalIPv6PrefixLen(?int $globalIPv6PrefixLen): self { + $this->initialized['globalIPv6PrefixLen'] = true; $this->globalIPv6PrefixLen = $globalIPv6PrefixLen; return $this; } /** - * MAC address for the endpoint on this network. + * DriverOpts is a mapping of driver options and values. These options + * are passed directly to the driver and are driver specific. * - * @return string + * @return array|null */ - public function getMacAddress(): ?string + public function getDriverOpts(): ?iterable { - return $this->macAddress; + return $this->driverOpts; } /** - * MAC address for the endpoint on this network. + * DriverOpts is a mapping of driver options and values. These options + * are passed directly to the driver and are driver specific. * - * @param string $macAddress - * - * @return self + * @param array|null $driverOpts */ - public function setMacAddress(?string $macAddress): self + public function setDriverOpts(?iterable $driverOpts): self { - $this->macAddress = $macAddress; + $this->initialized['driverOpts'] = true; + $this->driverOpts = $driverOpts; return $this; } /** - * DriverOpts is a mapping of driver options and values. These options. - are passed directly to the driver and are driver specific. - + * List of all DNS names an endpoint has on a specific network. This + * list is based on the container name, network aliases, container short + * ID, and hostname. * - * @return string[] + * These DNS names are non-fully qualified but can contain several dots. + * You can get fully qualified DNS names by appending `.`. + * For instance, if container name is `my.ctr` and the network is named + * `testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be + * `my.ctr.testnet`. + * + * @return list|null */ - public function getDriverOpts(): ?\ArrayObject + public function getDNSNames(): ?array { - return $this->driverOpts; + return $this->dNSNames; } /** - * DriverOpts is a mapping of driver options and values. These options. - are passed directly to the driver and are driver specific. - + * List of all DNS names an endpoint has on a specific network. This + * list is based on the container name, network aliases, container short + * ID, and hostname. * - * @param string[] $driverOpts + * These DNS names are non-fully qualified but can contain several dots. + * You can get fully qualified DNS names by appending `.`. + * For instance, if container name is `my.ctr` and the network is named + * `testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be + * `my.ctr.testnet`. * - * @return self + * @param list|null $dNSNames */ - public function setDriverOpts(?\ArrayObject $driverOpts): self + public function setDNSNames(?array $dNSNames): self { - $this->driverOpts = $driverOpts; + $this->initialized['dNSNames'] = true; + $this->dNSNames = $dNSNames; return $this; } diff --git a/src/Model/EndpointSpec.php b/src/Model/EndpointSpec.php index d8ca38ad..1acd53a9 100644 --- a/src/Model/EndpointSpec.php +++ b/src/Model/EndpointSpec.php @@ -2,33 +2,35 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class EndpointSpec +class EndpointSpec extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The mode of resolution to use for internal load balancing between tasks. * - * @var string + * @var string|null */ - protected $mode; + protected $mode = 'vip'; /** - * List of exposed ports that this service is accessible on from the outside. Ports can only be provided if `vip` resolution mode is used. + * List of exposed ports that this service is accessible on from the + * outside. Ports can only be provided if `vip` resolution mode is used. * - * @var EndpointPortConfig[] + * @var list|null */ protected $ports; /** * The mode of resolution to use for internal load balancing between tasks. - * - * @return string */ public function getMode(): ?string { @@ -37,22 +39,20 @@ public function getMode(): ?string /** * The mode of resolution to use for internal load balancing between tasks. - * - * @param string $mode - * - * @return self */ public function setMode(?string $mode): self { + $this->initialized['mode'] = true; $this->mode = $mode; return $this; } /** - * List of exposed ports that this service is accessible on from the outside. Ports can only be provided if `vip` resolution mode is used. + * List of exposed ports that this service is accessible on from the + * outside. Ports can only be provided if `vip` resolution mode is used. * - * @return EndpointPortConfig[] + * @return list|null */ public function getPorts(): ?array { @@ -60,14 +60,14 @@ public function getPorts(): ?array } /** - * List of exposed ports that this service is accessible on from the outside. Ports can only be provided if `vip` resolution mode is used. - * - * @param EndpointPortConfig[] $ports + * List of exposed ports that this service is accessible on from the + * outside. Ports can only be provided if `vip` resolution mode is used. * - * @return self + * @param list|null $ports */ public function setPorts(?array $ports): self { + $this->initialized['ports'] = true; $this->ports = $ports; return $this; diff --git a/src/Model/EngineDescription.php b/src/Model/EngineDescription.php index 1ca665aa..c3458ca9 100644 --- a/src/Model/EngineDescription.php +++ b/src/Model/EngineDescription.php @@ -2,71 +2,66 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class EngineDescription +class EngineDescription extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $engineVersion; /** - * @var string[] + * @var array|null */ protected $labels; /** - * @var EngineDescriptionPluginsItem[] + * @var list|null */ protected $plugins; - /** - * @return string - */ public function getEngineVersion(): ?string { return $this->engineVersion; } - /** - * @param string $engineVersion - * - * @return self - */ public function setEngineVersion(?string $engineVersion): self { + $this->initialized['engineVersion'] = true; $this->engineVersion = $engineVersion; return $this; } /** - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } /** - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; } /** - * @return EngineDescriptionPluginsItem[] + * @return list|null */ public function getPlugins(): ?array { @@ -74,12 +69,11 @@ public function getPlugins(): ?array } /** - * @param EngineDescriptionPluginsItem[] $plugins - * - * @return self + * @param list|null $plugins */ public function setPlugins(?array $plugins): self { + $this->initialized['plugins'] = true; $this->plugins = $plugins; return $this; diff --git a/src/Model/EngineDescriptionPluginsItem.php b/src/Model/EngineDescriptionPluginsItem.php index 3639f536..e0eff224 100644 --- a/src/Model/EngineDescriptionPluginsItem.php +++ b/src/Model/EngineDescriptionPluginsItem.php @@ -2,60 +2,49 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class EngineDescriptionPluginsItem +class EngineDescriptionPluginsItem extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $type; /** - * @var string + * @var string|null */ protected $name; - /** - * @return string - */ public function getType(): ?string { return $this->type; } - /** - * @param string $type - * - * @return self - */ public function setType(?string $type): self { + $this->initialized['type'] = true; $this->type = $type; return $this; } - /** - * @return string - */ public function getName(): ?string { return $this->name; } - /** - * @param string $name - * - * @return self - */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/src/Model/ErrorDetail.php b/src/Model/ErrorDetail.php index 1a7dad50..65940b3a 100644 --- a/src/Model/ErrorDetail.php +++ b/src/Model/ErrorDetail.php @@ -2,60 +2,49 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ErrorDetail +class ErrorDetail extends \ArrayObject { /** - * @var int + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var int|null */ protected $code; /** - * @var string + * @var string|null */ protected $message; - /** - * @return int - */ public function getCode(): ?int { return $this->code; } - /** - * @param int $code - * - * @return self - */ public function setCode(?int $code): self { + $this->initialized['code'] = true; $this->code = $code; return $this; } - /** - * @return string - */ public function getMessage(): ?string { return $this->message; } - /** - * @param string $message - * - * @return self - */ public function setMessage(?string $message): self { + $this->initialized['message'] = true; $this->message = $message; return $this; diff --git a/src/Model/ErrorResponse.php b/src/Model/ErrorResponse.php index 6e10b3b1..2258140c 100644 --- a/src/Model/ErrorResponse.php +++ b/src/Model/ErrorResponse.php @@ -2,27 +2,28 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ErrorResponse +class ErrorResponse extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The error message. * - * @var string + * @var string|null */ protected $message; /** * The error message. - * - * @return string */ public function getMessage(): ?string { @@ -31,13 +32,10 @@ public function getMessage(): ?string /** * The error message. - * - * @param string $message - * - * @return self */ public function setMessage(?string $message): self { + $this->initialized['message'] = true; $this->message = $message; return $this; diff --git a/src/Model/EventsGetResponse200Actor.php b/src/Model/EventActor.php similarity index 60% rename from src/Model/EventsGetResponse200Actor.php rename to src/Model/EventActor.php index 84824aa7..a6fd7e38 100644 --- a/src/Model/EventsGetResponse200Actor.php +++ b/src/Model/EventActor.php @@ -2,33 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class EventsGetResponse200Actor +class EventActor extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The ID of the object emitting the event. * - * @var string + * @var string|null */ protected $iD; /** * Various key/value attributes of the object, depending on its type. * - * @var string[] + * @var array|null */ protected $attributes; /** * The ID of the object emitting the event. - * - * @return string */ public function getID(): ?string { @@ -37,13 +38,10 @@ public function getID(): ?string /** * The ID of the object emitting the event. - * - * @param string $iD - * - * @return self */ public function setID(?string $iD): self { + $this->initialized['iD'] = true; $this->iD = $iD; return $this; @@ -52,9 +50,9 @@ public function setID(?string $iD): self /** * Various key/value attributes of the object, depending on its type. * - * @return string[] + * @return array|null */ - public function getAttributes(): ?\ArrayObject + public function getAttributes(): ?iterable { return $this->attributes; } @@ -62,12 +60,11 @@ public function getAttributes(): ?\ArrayObject /** * Various key/value attributes of the object, depending on its type. * - * @param string[] $attributes - * - * @return self + * @param array|null $attributes */ - public function setAttributes(?\ArrayObject $attributes): self + public function setAttributes(?iterable $attributes): self { + $this->initialized['attributes'] = true; $this->attributes = $attributes; return $this; diff --git a/src/Model/EventsGetResponse200.php b/src/Model/EventMessage.php similarity index 52% rename from src/Model/EventsGetResponse200.php rename to src/Model/EventMessage.php index 4f342cf7..531dd477 100644 --- a/src/Model/EventsGetResponse200.php +++ b/src/Model/EventMessage.php @@ -2,49 +2,60 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class EventsGetResponse200 +class EventMessage extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The type of object emitting the event. * - * @var string + * @var string|null */ protected $type; /** * The type of event. * - * @var string + * @var string|null */ protected $action; /** - * @var EventsGetResponse200Actor + * Actor describes something that generates events, like a container, network, + * or a volume. + * + * @var EventActor|null */ protected $actor; + /** + * Scope of the event. Engine events are `local` scope. Cluster (Swarm) + * events are `swarm` scope. + * + * @var string|null + */ + protected $scope; /** * Timestamp of event. * - * @var int + * @var int|null */ protected $time; /** * Timestamp of event, with nanosecond accuracy. * - * @var int + * @var int|null */ protected $timeNano; /** * The type of object emitting the event. - * - * @return string */ public function getType(): ?string { @@ -53,13 +64,10 @@ public function getType(): ?string /** * The type of object emitting the event. - * - * @param string $type - * - * @return self */ public function setType(?string $type): self { + $this->initialized['type'] = true; $this->type = $type; return $this; @@ -67,8 +75,6 @@ public function setType(?string $type): self /** * The type of event. - * - * @return string */ public function getAction(): ?string { @@ -77,42 +83,59 @@ public function getAction(): ?string /** * The type of event. - * - * @param string $action - * - * @return self */ public function setAction(?string $action): self { + $this->initialized['action'] = true; $this->action = $action; return $this; } /** - * @return EventsGetResponse200Actor + * Actor describes something that generates events, like a container, network, + * or a volume. */ - public function getActor(): ?EventsGetResponse200Actor + public function getActor(): ?EventActor { return $this->actor; } /** - * @param EventsGetResponse200Actor $actor - * - * @return self + * Actor describes something that generates events, like a container, network, + * or a volume. */ - public function setActor(?EventsGetResponse200Actor $actor): self + public function setActor(?EventActor $actor): self { + $this->initialized['actor'] = true; $this->actor = $actor; return $this; } + /** + * Scope of the event. Engine events are `local` scope. Cluster (Swarm) + * events are `swarm` scope. + */ + public function getScope(): ?string + { + return $this->scope; + } + + /** + * Scope of the event. Engine events are `local` scope. Cluster (Swarm) + * events are `swarm` scope. + */ + public function setScope(?string $scope): self + { + $this->initialized['scope'] = true; + $this->scope = $scope; + + return $this; + } + /** * Timestamp of event. - * - * @return int */ public function getTime(): ?int { @@ -121,13 +144,10 @@ public function getTime(): ?int /** * Timestamp of event. - * - * @param int $time - * - * @return self */ public function setTime(?int $time): self { + $this->initialized['time'] = true; $this->time = $time; return $this; @@ -135,8 +155,6 @@ public function setTime(?int $time): self /** * Timestamp of event, with nanosecond accuracy. - * - * @return int */ public function getTimeNano(): ?int { @@ -145,13 +163,10 @@ public function getTimeNano(): ?int /** * Timestamp of event, with nanosecond accuracy. - * - * @param int $timeNano - * - * @return self */ public function setTimeNano(?int $timeNano): self { + $this->initialized['timeNano'] = true; $this->timeNano = $timeNano; return $this; diff --git a/src/Model/ExecIdJsonGetResponse200.php b/src/Model/ExecIdJsonGetResponse200.php index 81267a39..e53dd482 100644 --- a/src/Model/ExecIdJsonGetResponse200.php +++ b/src/Model/ExecIdJsonGetResponse200.php @@ -2,258 +2,191 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ExecIdJsonGetResponse200 +class ExecIdJsonGetResponse200 extends \ArrayObject { /** - * @var bool + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var bool|null */ protected $canRemove; /** - * @var string + * @var string|null */ protected $detachKeys; /** - * @var string + * @var string|null */ protected $iD; /** - * @var bool + * @var bool|null */ protected $running; /** - * @var int + * @var int|null */ protected $exitCode; /** - * @var ProcessConfig + * @var ProcessConfig|null */ protected $processConfig; /** - * @var bool + * @var bool|null */ protected $openStdin; /** - * @var bool + * @var bool|null */ protected $openStderr; /** - * @var bool + * @var bool|null */ protected $openStdout; /** - * @var string + * @var string|null */ protected $containerID; /** * The system process ID for the exec process. * - * @var int + * @var int|null */ protected $pid; - /** - * @return bool - */ public function getCanRemove(): ?bool { return $this->canRemove; } - /** - * @param bool $canRemove - * - * @return self - */ public function setCanRemove(?bool $canRemove): self { + $this->initialized['canRemove'] = true; $this->canRemove = $canRemove; return $this; } - /** - * @return string - */ public function getDetachKeys(): ?string { return $this->detachKeys; } - /** - * @param string $detachKeys - * - * @return self - */ public function setDetachKeys(?string $detachKeys): self { + $this->initialized['detachKeys'] = true; $this->detachKeys = $detachKeys; return $this; } - /** - * @return string - */ public function getID(): ?string { return $this->iD; } - /** - * @param string $iD - * - * @return self - */ public function setID(?string $iD): self { + $this->initialized['iD'] = true; $this->iD = $iD; return $this; } - /** - * @return bool - */ public function getRunning(): ?bool { return $this->running; } - /** - * @param bool $running - * - * @return self - */ public function setRunning(?bool $running): self { + $this->initialized['running'] = true; $this->running = $running; return $this; } - /** - * @return int - */ public function getExitCode(): ?int { return $this->exitCode; } - /** - * @param int $exitCode - * - * @return self - */ public function setExitCode(?int $exitCode): self { + $this->initialized['exitCode'] = true; $this->exitCode = $exitCode; return $this; } - /** - * @return ProcessConfig - */ public function getProcessConfig(): ?ProcessConfig { return $this->processConfig; } - /** - * @param ProcessConfig $processConfig - * - * @return self - */ public function setProcessConfig(?ProcessConfig $processConfig): self { + $this->initialized['processConfig'] = true; $this->processConfig = $processConfig; return $this; } - /** - * @return bool - */ public function getOpenStdin(): ?bool { return $this->openStdin; } - /** - * @param bool $openStdin - * - * @return self - */ public function setOpenStdin(?bool $openStdin): self { + $this->initialized['openStdin'] = true; $this->openStdin = $openStdin; return $this; } - /** - * @return bool - */ public function getOpenStderr(): ?bool { return $this->openStderr; } - /** - * @param bool $openStderr - * - * @return self - */ public function setOpenStderr(?bool $openStderr): self { + $this->initialized['openStderr'] = true; $this->openStderr = $openStderr; return $this; } - /** - * @return bool - */ public function getOpenStdout(): ?bool { return $this->openStdout; } - /** - * @param bool $openStdout - * - * @return self - */ public function setOpenStdout(?bool $openStdout): self { + $this->initialized['openStdout'] = true; $this->openStdout = $openStdout; return $this; } - /** - * @return string - */ public function getContainerID(): ?string { return $this->containerID; } - /** - * @param string $containerID - * - * @return self - */ public function setContainerID(?string $containerID): self { + $this->initialized['containerID'] = true; $this->containerID = $containerID; return $this; @@ -261,8 +194,6 @@ public function setContainerID(?string $containerID): self /** * The system process ID for the exec process. - * - * @return int */ public function getPid(): ?int { @@ -271,13 +202,10 @@ public function getPid(): ?int /** * The system process ID for the exec process. - * - * @param int $pid - * - * @return self */ public function setPid(?int $pid): self { + $this->initialized['pid'] = true; $this->pid = $pid; return $this; diff --git a/src/Model/ExecIdStartPostBody.php b/src/Model/ExecIdStartPostBody.php index 044a7ab9..cb70cac8 100644 --- a/src/Model/ExecIdStartPostBody.php +++ b/src/Model/ExecIdStartPostBody.php @@ -2,33 +2,40 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ExecIdStartPostBody +class ExecIdStartPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Detach from the command. * - * @var bool + * @var bool|null */ protected $detach; /** * Allocate a pseudo-TTY. * - * @var bool + * @var bool|null */ protected $tty; + /** + * Initial console size, as an `[height, width]` array. + * + * @var list|null + */ + protected $consoleSize; /** * Detach from the command. - * - * @return bool */ public function getDetach(): ?bool { @@ -37,13 +44,10 @@ public function getDetach(): ?bool /** * Detach from the command. - * - * @param bool $detach - * - * @return self */ public function setDetach(?bool $detach): self { + $this->initialized['detach'] = true; $this->detach = $detach; return $this; @@ -51,8 +55,6 @@ public function setDetach(?bool $detach): self /** * Allocate a pseudo-TTY. - * - * @return bool */ public function getTty(): ?bool { @@ -61,15 +63,35 @@ public function getTty(): ?bool /** * Allocate a pseudo-TTY. - * - * @param bool $tty - * - * @return self */ public function setTty(?bool $tty): self { + $this->initialized['tty'] = true; $this->tty = $tty; return $this; } + + /** + * Initial console size, as an `[height, width]` array. + * + * @return list|null + */ + public function getConsoleSize(): ?array + { + return $this->consoleSize; + } + + /** + * Initial console size, as an `[height, width]` array. + * + * @param list|null $consoleSize + */ + public function setConsoleSize(?array $consoleSize): self + { + $this->initialized['consoleSize'] = true; + $this->consoleSize = $consoleSize; + + return $this; + } } diff --git a/src/Model/FilesystemChange.php b/src/Model/FilesystemChange.php new file mode 100644 index 00000000..74a5dbae --- /dev/null +++ b/src/Model/FilesystemChange.php @@ -0,0 +1,86 @@ +initialized); + } + /** + * Path to file or directory that has changed. + * + * @var string|null + */ + protected $path; + /** + * Kind of change. + * + * Can be one of: + * + * - `0`: Modified ("C") + * - `1`: Added ("A") + * - `2`: Deleted ("D") + * + * @var int|null + */ + protected $kind; + + /** + * Path to file or directory that has changed. + */ + public function getPath(): ?string + { + return $this->path; + } + + /** + * Path to file or directory that has changed. + */ + public function setPath(?string $path): self + { + $this->initialized['path'] = true; + $this->path = $path; + + return $this; + } + + /** + * Kind of change. + * + * Can be one of: + * + * - `0`: Modified ("C") + * - `1`: Added ("A") + * - `2`: Deleted ("D") + */ + public function getKind(): ?int + { + return $this->kind; + } + + /** + * Kind of change. + * + * Can be one of: + * + * - `0`: Modified ("C") + * - `1`: Added ("A") + * - `2`: Deleted ("D") + */ + public function setKind(?int $kind): self + { + $this->initialized['kind'] = true; + $this->kind = $kind; + + return $this; + } +} diff --git a/src/Model/GenericResourcesItem.php b/src/Model/GenericResourcesItem.php index 605ab71f..34ce73c7 100644 --- a/src/Model/GenericResourcesItem.php +++ b/src/Model/GenericResourcesItem.php @@ -2,60 +2,49 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class GenericResourcesItem +class GenericResourcesItem extends \ArrayObject { /** - * @var GenericResourcesItemNamedResourceSpec + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var GenericResourcesItemNamedResourceSpec|null */ protected $namedResourceSpec; /** - * @var GenericResourcesItemDiscreteResourceSpec + * @var GenericResourcesItemDiscreteResourceSpec|null */ protected $discreteResourceSpec; - /** - * @return GenericResourcesItemNamedResourceSpec - */ public function getNamedResourceSpec(): ?GenericResourcesItemNamedResourceSpec { return $this->namedResourceSpec; } - /** - * @param GenericResourcesItemNamedResourceSpec $namedResourceSpec - * - * @return self - */ public function setNamedResourceSpec(?GenericResourcesItemNamedResourceSpec $namedResourceSpec): self { + $this->initialized['namedResourceSpec'] = true; $this->namedResourceSpec = $namedResourceSpec; return $this; } - /** - * @return GenericResourcesItemDiscreteResourceSpec - */ public function getDiscreteResourceSpec(): ?GenericResourcesItemDiscreteResourceSpec { return $this->discreteResourceSpec; } - /** - * @param GenericResourcesItemDiscreteResourceSpec $discreteResourceSpec - * - * @return self - */ public function setDiscreteResourceSpec(?GenericResourcesItemDiscreteResourceSpec $discreteResourceSpec): self { + $this->initialized['discreteResourceSpec'] = true; $this->discreteResourceSpec = $discreteResourceSpec; return $this; diff --git a/src/Model/GenericResourcesItemDiscreteResourceSpec.php b/src/Model/GenericResourcesItemDiscreteResourceSpec.php index db108de8..c61834c2 100644 --- a/src/Model/GenericResourcesItemDiscreteResourceSpec.php +++ b/src/Model/GenericResourcesItemDiscreteResourceSpec.php @@ -2,60 +2,49 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class GenericResourcesItemDiscreteResourceSpec +class GenericResourcesItemDiscreteResourceSpec extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $kind; /** - * @var int + * @var int|null */ protected $value; - /** - * @return string - */ public function getKind(): ?string { return $this->kind; } - /** - * @param string $kind - * - * @return self - */ public function setKind(?string $kind): self { + $this->initialized['kind'] = true; $this->kind = $kind; return $this; } - /** - * @return int - */ public function getValue(): ?int { return $this->value; } - /** - * @param int $value - * - * @return self - */ public function setValue(?int $value): self { + $this->initialized['value'] = true; $this->value = $value; return $this; diff --git a/src/Model/GenericResourcesItemNamedResourceSpec.php b/src/Model/GenericResourcesItemNamedResourceSpec.php index 10a4c7bf..8ab815d1 100644 --- a/src/Model/GenericResourcesItemNamedResourceSpec.php +++ b/src/Model/GenericResourcesItemNamedResourceSpec.php @@ -2,60 +2,49 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class GenericResourcesItemNamedResourceSpec +class GenericResourcesItemNamedResourceSpec extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $kind; /** - * @var string + * @var string|null */ protected $value; - /** - * @return string - */ public function getKind(): ?string { return $this->kind; } - /** - * @param string $kind - * - * @return self - */ public function setKind(?string $kind): self { + $this->initialized['kind'] = true; $this->kind = $kind; return $this; } - /** - * @return string - */ public function getValue(): ?string { return $this->value; } - /** - * @param string $value - * - * @return self - */ public function setValue(?string $value): self { + $this->initialized['value'] = true; $this->value = $value; return $this; diff --git a/src/Model/GraphDriverData.php b/src/Model/GraphDriverData.php index d4169c73..be960cf6 100644 --- a/src/Model/GraphDriverData.php +++ b/src/Model/GraphDriverData.php @@ -2,27 +2,37 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class GraphDriverData +class GraphDriverData extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * Name of the storage driver. + * + * @var string|null */ protected $name; /** - * @var string[] + * Low-level storage metadata, provided as key/value pairs. + * + * This information is driver-specific, and depends on the storage-driver + * in use, and should be used for informational purposes only. + * + * @var array|null */ protected $data; /** - * @return string + * Name of the storage driver. */ public function getName(): ?string { @@ -30,32 +40,40 @@ public function getName(): ?string } /** - * @param string $name - * - * @return self + * Name of the storage driver. */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } /** - * @return string[] + * Low-level storage metadata, provided as key/value pairs. + * + * This information is driver-specific, and depends on the storage-driver + * in use, and should be used for informational purposes only. + * + * @return array|null */ - public function getData(): ?\ArrayObject + public function getData(): ?iterable { return $this->data; } /** - * @param string[] $data + * Low-level storage metadata, provided as key/value pairs. + * + * This information is driver-specific, and depends on the storage-driver + * in use, and should be used for informational purposes only. * - * @return self + * @param array|null $data */ - public function setData(?\ArrayObject $data): self + public function setData(?iterable $data): self { + $this->initialized['data'] = true; $this->data = $data; return $this; diff --git a/src/Model/Health.php b/src/Model/Health.php new file mode 100644 index 00000000..2cd36b6b --- /dev/null +++ b/src/Model/Health.php @@ -0,0 +1,112 @@ +initialized); + } + /** + * Status is one of `none`, `starting`, `healthy` or `unhealthy`. + * + * - "none" Indicates there is no healthcheck + * - "starting" Starting indicates that the container is not yet ready + * - "healthy" Healthy indicates that the container is running correctly + * - "unhealthy" Unhealthy indicates that the container has a problem + * + * @var string|null + */ + protected $status; + /** + * FailingStreak is the number of consecutive failures. + * + * @var int|null + */ + protected $failingStreak; + /** + * Log contains the last few results (oldest first). + * + * @var list|null + */ + protected $log; + + /** + * Status is one of `none`, `starting`, `healthy` or `unhealthy`. + * + * - "none" Indicates there is no healthcheck + * - "starting" Starting indicates that the container is not yet ready + * - "healthy" Healthy indicates that the container is running correctly + * - "unhealthy" Unhealthy indicates that the container has a problem + */ + public function getStatus(): ?string + { + return $this->status; + } + + /** + * Status is one of `none`, `starting`, `healthy` or `unhealthy`. + * + * - "none" Indicates there is no healthcheck + * - "starting" Starting indicates that the container is not yet ready + * - "healthy" Healthy indicates that the container is running correctly + * - "unhealthy" Unhealthy indicates that the container has a problem + */ + public function setStatus(?string $status): self + { + $this->initialized['status'] = true; + $this->status = $status; + + return $this; + } + + /** + * FailingStreak is the number of consecutive failures. + */ + public function getFailingStreak(): ?int + { + return $this->failingStreak; + } + + /** + * FailingStreak is the number of consecutive failures. + */ + public function setFailingStreak(?int $failingStreak): self + { + $this->initialized['failingStreak'] = true; + $this->failingStreak = $failingStreak; + + return $this; + } + + /** + * Log contains the last few results (oldest first). + * + * @return list|null + */ + public function getLog(): ?array + { + return $this->log; + } + + /** + * Log contains the last few results (oldest first). + * + * @param list|null $log + */ + public function setLog(?array $log): self + { + $this->initialized['log'] = true; + $this->log = $log; + + return $this; + } +} diff --git a/src/Model/HealthConfig.php b/src/Model/HealthConfig.php index 50b88589..4b61a21a 100644 --- a/src/Model/HealthConfig.php +++ b/src/Model/HealthConfig.php @@ -2,63 +2,76 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class HealthConfig +class HealthConfig extends \ArrayObject { /** - * The test to perform. Possible values are:. - - - `[]` inherit healthcheck from image or parent image - - `["NONE"]` disable healthcheck - - `["CMD", args...]` exec arguments directly - - `["CMD-SHELL", command]` run command with system's default shell + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * The test to perform. Possible values are: + * + * - `[]` inherit healthcheck from image or parent image + * - `["NONE"]` disable healthcheck + * - `["CMD", args...]` exec arguments directly + * - `["CMD-SHELL", command]` run command with system's default shell * - * @var string[] + * @var list|null */ protected $test; /** - * The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit. + * The time to wait between checks in nanoseconds. It should be 0 or at + * least 1000000 (1 ms). 0 means inherit. * - * @var int + * @var int|null */ protected $interval; /** - * The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. + * The time to wait before considering the check to have hung. It should + * be 0 or at least 1000000 (1 ms). 0 means inherit. * - * @var int + * @var int|null */ protected $timeout; /** - * The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit. + * The number of consecutive failures needed to consider a container as + * unhealthy. 0 means inherit. * - * @var int + * @var int|null */ protected $retries; /** - * Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit. + * Start period for the container to initialize before starting + * health-retries countdown in nanoseconds. It should be 0 or at least + * 1000000 (1 ms). 0 means inherit. * - * @var int + * @var int|null */ protected $startPeriod; - /** - * The test to perform. Possible values are:. - - - `[]` inherit healthcheck from image or parent image - - `["NONE"]` disable healthcheck - - `["CMD", args...]` exec arguments directly - - `["CMD-SHELL", command]` run command with system's default shell + * The time to wait between checks in nanoseconds during the start period. + * It should be 0 or at least 1000000 (1 ms). 0 means inherit. + * + * @var int|null + */ + protected $startInterval; + /** + * The test to perform. Possible values are: + * + * - `[]` inherit healthcheck from image or parent image + * - `["NONE"]` disable healthcheck + * - `["CMD", args...]` exec arguments directly + * - `["CMD-SHELL", command]` run command with system's default shell * - * @return string[] + * @return list|null */ public function getTest(): ?array { @@ -66,29 +79,26 @@ public function getTest(): ?array } /** - * The test to perform. Possible values are:. - - - `[]` inherit healthcheck from image or parent image - - `["NONE"]` disable healthcheck - - `["CMD", args...]` exec arguments directly - - `["CMD-SHELL", command]` run command with system's default shell - + * The test to perform. Possible values are: * - * @param string[] $test + * - `[]` inherit healthcheck from image or parent image + * - `["NONE"]` disable healthcheck + * - `["CMD", args...]` exec arguments directly + * - `["CMD-SHELL", command]` run command with system's default shell * - * @return self + * @param list|null $test */ public function setTest(?array $test): self { + $this->initialized['test'] = true; $this->test = $test; return $this; } /** - * The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit. - * - * @return int + * The time to wait between checks in nanoseconds. It should be 0 or at + * least 1000000 (1 ms). 0 means inherit. */ public function getInterval(): ?int { @@ -96,23 +106,20 @@ public function getInterval(): ?int } /** - * The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit. - * - * @param int $interval - * - * @return self + * The time to wait between checks in nanoseconds. It should be 0 or at + * least 1000000 (1 ms). 0 means inherit. */ public function setInterval(?int $interval): self { + $this->initialized['interval'] = true; $this->interval = $interval; return $this; } /** - * The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. - * - * @return int + * The time to wait before considering the check to have hung. It should + * be 0 or at least 1000000 (1 ms). 0 means inherit. */ public function getTimeout(): ?int { @@ -120,23 +127,20 @@ public function getTimeout(): ?int } /** - * The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. - * - * @param int $timeout - * - * @return self + * The time to wait before considering the check to have hung. It should + * be 0 or at least 1000000 (1 ms). 0 means inherit. */ public function setTimeout(?int $timeout): self { + $this->initialized['timeout'] = true; $this->timeout = $timeout; return $this; } /** - * The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit. - * - * @return int + * The number of consecutive failures needed to consider a container as + * unhealthy. 0 means inherit. */ public function getRetries(): ?int { @@ -144,23 +148,21 @@ public function getRetries(): ?int } /** - * The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit. - * - * @param int $retries - * - * @return self + * The number of consecutive failures needed to consider a container as + * unhealthy. 0 means inherit. */ public function setRetries(?int $retries): self { + $this->initialized['retries'] = true; $this->retries = $retries; return $this; } /** - * Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit. - * - * @return int + * Start period for the container to initialize before starting + * health-retries countdown in nanoseconds. It should be 0 or at least + * 1000000 (1 ms). 0 means inherit. */ public function getStartPeriod(): ?int { @@ -168,16 +170,36 @@ public function getStartPeriod(): ?int } /** - * Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit. - * - * @param int $startPeriod - * - * @return self + * Start period for the container to initialize before starting + * health-retries countdown in nanoseconds. It should be 0 or at least + * 1000000 (1 ms). 0 means inherit. */ public function setStartPeriod(?int $startPeriod): self { + $this->initialized['startPeriod'] = true; $this->startPeriod = $startPeriod; return $this; } + + /** + * The time to wait between checks in nanoseconds during the start period. + * It should be 0 or at least 1000000 (1 ms). 0 means inherit. + */ + public function getStartInterval(): ?int + { + return $this->startInterval; + } + + /** + * The time to wait between checks in nanoseconds during the start period. + * It should be 0 or at least 1000000 (1 ms). 0 means inherit. + */ + public function setStartInterval(?int $startInterval): self + { + $this->initialized['startInterval'] = true; + $this->startInterval = $startInterval; + + return $this; + } } diff --git a/src/Model/HealthcheckResult.php b/src/Model/HealthcheckResult.php new file mode 100644 index 00000000..f17350b6 --- /dev/null +++ b/src/Model/HealthcheckResult.php @@ -0,0 +1,139 @@ +initialized); + } + /** + * Date and time at which this check started in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + * + * @var \DateTimeInterface|null + */ + protected $start; + /** + * Date and time at which this check ended in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + * + * @var string|null + */ + protected $end; + /** + * ExitCode meanings: + * + * - `0` healthy + * - `1` unhealthy + * - `2` reserved (considered unhealthy) + * - other values: error running probe + * + * @var int|null + */ + protected $exitCode; + /** + * Output from last check. + * + * @var string|null + */ + protected $output; + + /** + * Date and time at which this check started in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + */ + public function getStart(): ?\DateTimeInterface + { + return $this->start; + } + + /** + * Date and time at which this check started in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + */ + public function setStart(?\DateTimeInterface $start): self + { + $this->initialized['start'] = true; + $this->start = $start; + + return $this; + } + + /** + * Date and time at which this check ended in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + */ + public function getEnd(): ?string + { + return $this->end; + } + + /** + * Date and time at which this check ended in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + */ + public function setEnd(?string $end): self + { + $this->initialized['end'] = true; + $this->end = $end; + + return $this; + } + + /** + * ExitCode meanings: + * + * - `0` healthy + * - `1` unhealthy + * - `2` reserved (considered unhealthy) + * - other values: error running probe + */ + public function getExitCode(): ?int + { + return $this->exitCode; + } + + /** + * ExitCode meanings: + * + * - `0` healthy + * - `1` unhealthy + * - `2` reserved (considered unhealthy) + * - other values: error running probe + */ + public function setExitCode(?int $exitCode): self + { + $this->initialized['exitCode'] = true; + $this->exitCode = $exitCode; + + return $this; + } + + /** + * Output from last check. + */ + public function getOutput(): ?string + { + return $this->output; + } + + /** + * Output from last check. + */ + public function setOutput(?string $output): self + { + $this->initialized['output'] = true; + $this->output = $output; + + return $this; + } +} diff --git a/src/Model/HostConfig.php b/src/Model/HostConfig.php index 32414fca..043e7cfa 100644 --- a/src/Model/HostConfig.php +++ b/src/Model/HostConfig.php @@ -2,454 +2,590 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class HostConfig +class HostConfig extends \ArrayObject { /** - * An integer value representing this container's relative CPU weight versus other containers. + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * An integer value representing this container's relative CPU weight + * versus other containers. * - * @var int + * @var int|null */ protected $cpuShares; /** * Memory limit in bytes. * - * @var int + * @var int|null */ - protected $memory; + protected $memory = 0; /** - * 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. + * 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. * - * @var string + * @var string|null */ protected $cgroupParent; /** * Block IO weight (relative weight). * - * @var int + * @var int|null */ protected $blkioWeight; /** - * Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. + * Block IO weight (relative device weight) in the form: + * + * ``` + * [{"Path": "device_path", "Weight": weight}] + * ``` * - * @var ResourcesBlkioWeightDeviceItem[] + * @var list|null */ protected $blkioWeightDevice; /** - * Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (bytes per second) from a device, in the form: + * + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @var ThrottleDevice[] + * @var list|null */ protected $blkioDeviceReadBps; /** - * Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (bytes per second) to a device, in the form: * - * @var ThrottleDevice[] + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` + * + * @var list|null */ protected $blkioDeviceWriteBps; /** - * Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (IO per second) from a device, in the form: + * + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @var ThrottleDevice[] + * @var list|null */ protected $blkioDeviceReadIOps; /** - * Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (IO per second) to a device, in the form: * - * @var ThrottleDevice[] + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` + * + * @var list|null */ protected $blkioDeviceWriteIOps; /** * The length of a CPU period in microseconds. * - * @var int + * @var int|null */ protected $cpuPeriod; /** * Microseconds of CPU time that the container can get in a CPU period. * - * @var int + * @var int|null */ protected $cpuQuota; /** - * The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks. + * The length of a CPU real-time period in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. * - * @var int + * @var int|null */ protected $cpuRealtimePeriod; /** - * The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks. + * The length of a CPU real-time runtime in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. * - * @var int + * @var int|null */ protected $cpuRealtimeRuntime; /** * CPUs in which to allow execution (e.g., `0-3`, `0,1`). * - * @var string + * @var string|null */ protected $cpusetCpus; /** - * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + * effective on NUMA systems. * - * @var string + * @var string|null */ protected $cpusetMems; /** * A list of devices to add to the container. * - * @var DeviceMapping[] + * @var list|null */ protected $devices; /** * a list of cgroup rules to apply to the container. * - * @var string[] + * @var list|null */ protected $deviceCgroupRules; /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @var int + * @var list|null */ - protected $diskQuota; + protected $deviceRequests; /** - * Kernel memory limit in bytes. + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + * OCI runtime in use, this option may be ignored. It is no longer supported + * by the default (runc) runtime. + * + * This field is omitted when empty. * - * @var int + * @var int|null */ - protected $kernelMemory; + protected $kernelMemoryTCP; /** * Memory soft limit in bytes. * - * @var int + * @var int|null */ protected $memoryReservation; /** - * Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + * swap. * - * @var int + * @var int|null */ protected $memorySwap; /** - * Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. + * Tune a container's memory swappiness behavior. Accepts an integer + * between 0 and 100. * - * @var int + * @var int|null */ protected $memorySwappiness; /** * CPU quota in units of 10-9 CPUs. * - * @var int + * @var int|null */ - protected $nanoCPUs; + protected $nanoCpus; /** * Disable OOM Killer for the container. * - * @var bool + * @var bool|null */ protected $oomKillDisable; /** - * Tune a container's pids limit. Set -1 for unlimited. + * Run an init inside the container that forwards signals and reaps + * processes. This field is omitted if empty, and the default (as + * configured on the daemon) is used. + * + * @var bool|null + */ + protected $init; + /** + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + * to not change. * - * @var int + * @var int|null */ protected $pidsLimit; /** - * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`". + * A list of resource limits to set in the container. For example: * - * @var ResourcesUlimitsItem[] + * ``` + * {"Name": "nofile", "Soft": 1024, "Hard": 2048} + * ``` + * + * @var list|null */ protected $ulimits; /** * The number of usable CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - * - * @var int + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. + * + * @var int|null */ protected $cpuCount; /** * The usable percentage of the available CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - * - * @var int + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. + * + * @var int|null */ protected $cpuPercent; /** * Maximum IOps for the container system drive (Windows only). * - * @var int + * @var int|null */ protected $iOMaximumIOps; /** - * Maximum IO in bytes per second for the container system drive (Windows only). + * Maximum IO in bytes per second for the container system drive + * (Windows only). * - * @var int + * @var int|null */ protected $iOMaximumBandwidth; /** - * A list of volume bindings for this container. Each volume binding is a string in one of these forms:. - - - `host-src:container-dest` to bind-mount a host path into the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `host-src:container-dest:ro` to make the bind mount read-only inside the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `volume-name:container-dest` to bind-mount a volume managed by a volume driver into the container. `container-dest` must be an _absolute_ path. - - `volume-name:container-dest:ro` to mount the volume read-only inside the container. `container-dest` must be an _absolute_ path. - - * - * @var string[] + * A list of volume bindings for this container. Each volume binding + * is a string in one of these forms: + * + * - `host-src:container-dest[:options]` to bind-mount a host path + * into the container. Both `host-src`, and `container-dest` must + * be an _absolute_ path. + * - `volume-name:container-dest[:options]` to bind-mount a volume + * managed by a volume driver into the container. `container-dest` + * must be an _absolute_ path. + * + * `options` is an optional, comma-delimited list of: + * + * - `nocopy` disables automatic copying of data from the container + * path to the volume. The `nocopy` flag only applies to named volumes. + * - `[ro|rw]` mounts a volume read-only or read-write, respectively. + * If omitted or set to `rw`, volumes are mounted read-write. + * - `[z|Z]` applies SELinux labels to allow or deny multiple containers + * to read and write to the same volume. + * - `z`: a _shared_ content label is applied to the content. This + * label indicates that multiple containers can share the volume + * content, for both reading and writing. + * - `Z`: a _private unshared_ label is applied to the content. + * This label indicates that only the current container can use + * a private volume. Labeling systems such as SELinux require + * proper labels to be placed on volume content that is mounted + * into a container. Without a label, the security system can + * prevent a container's processes from using the content. By + * default, the labels set by the host operating system are not + * modified. + * - `[[r]shared|[r]slave|[r]private]` specifies mount + * [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). + * This only applies to bind-mounted volumes, not internal volumes + * or named volumes. Mount propagation requires the source mount + * point (the location where the source directory is mounted in the + * host operating system) to have the correct propagation properties. + * For shared volumes, the source mount point must be set to `shared`. + * For slave volumes, the mount must be set to either `shared` or + * `slave`. + * + * @var list|null */ protected $binds; /** * Path to a file where the container ID is written. * - * @var string + * @var string|null */ protected $containerIDFile; /** * The logging configuration for this container. * - * @var HostConfigLogConfig + * @var HostConfigLogConfig|null */ protected $logConfig; /** - * Network mode to use for this container. Supported standard values are: `bridge`, `host`, `none`, and `container:`. Any other value is taken as a custom network's name to which this container should connect to. + * Network mode to use for this container. Supported standard values + * are: `bridge`, `host`, `none`, and `container:`. Any + * other value is taken as a custom network's name to which this + * container should connect to. * - * @var string + * @var string|null */ protected $networkMode; /** - * PortMap describes the mapping of container ports to host ports, using the. - container's port-number and protocol as key in the format `/`, - for example, `80/udp`. - - If a container's port is mapped for both `tcp` and `udp`, two separate - entries are added to the mapping table. - + * PortMap describes the mapping of container ports to host ports, using the + * container's port-number and protocol as key in the format `/`, + * for example, `80/udp`. + * + * If a container's port is mapped for multiple protocols, separate entries + * are added to the mapping table. * - * @var PortBinding[][] + * @var array>|null */ protected $portBindings; /** - * The behavior to apply when the container exits. The default is not to restart. - - An ever increasing delay (double the previous delay, starting at 100ms) is added before each restart to prevent flooding the server. - + * The behavior to apply when the container exits. The default is not to + * restart. * - * @var RestartPolicy + * An ever increasing delay (double the previous delay, starting at 100ms) is + * added before each restart to prevent flooding the server. + * + * @var RestartPolicy|null */ protected $restartPolicy; /** - * Automatically remove the container when the container's process exits. This has no effect if `RestartPolicy` is set. + * Automatically remove the container when the container's process + * exits. This has no effect if `RestartPolicy` is set. * - * @var bool + * @var bool|null */ protected $autoRemove; /** * Driver that this container uses to mount volumes. * - * @var string + * @var string|null */ protected $volumeDriver; /** - * A list of volumes to inherit from another container, specified in the form `[:]`. + * A list of volumes to inherit from another container, specified in + * the form `[:]`. * - * @var string[] + * @var list|null */ protected $volumesFrom; /** * Specification for mounts to be added to the container. * - * @var Mount[] + * @var list|null */ protected $mounts; /** - * A list of kernel capabilities to add to the container. + * Initial console size, as an `[height, width]` array. + * + * @var list|null + */ + protected $consoleSize; + /** + * Arbitrary non-identifying metadata attached to container and + * provided to the runtime when the container is started. * - * @var string[] + * @var array|null + */ + protected $annotations; + /** + * A list of kernel capabilities to add to the container. Conflicts + * with option 'Capabilities'. + * + * @var list|null */ protected $capAdd; /** - * A list of kernel capabilities to drop from the container. + * A list of kernel capabilities to drop from the container. Conflicts + * with option 'Capabilities'. * - * @var string[] + * @var list|null */ protected $capDrop; + /** + * cgroup namespace mode for the container. Possible values are: + * + * - `"private"`: the container runs in its own private cgroup namespace + * - `"host"`: use the host system's cgroup namespace + * + * If not specified, the daemon default is used, which can either be `"private"` + * or `"host"`, depending on daemon version, kernel support and configuration. + * + * @var string|null + */ + protected $cgroupnsMode; /** * A list of DNS servers for the container to use. * - * @var string[] + * @var list|null */ protected $dns; /** * A list of DNS options. * - * @var string[] + * @var list|null */ protected $dnsOptions; /** * A list of DNS search domains. * - * @var string[] + * @var list|null */ protected $dnsSearch; /** - * A list of hostnames/IP mappings to add to the container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. + * A list of hostnames/IP mappings to add to the container's `/etc/hosts` + * file. Specified in the form `["hostname:IP"]`. * - * @var string[] + * @var list|null */ protected $extraHosts; /** * A list of additional groups that the container process will run as. * - * @var string[] + * @var list|null */ protected $groupAdd; /** - * IPC sharing mode for the container. Possible values are:. - - - `"none"`: own private IPC namespace, with /dev/shm not mounted - - `"private"`: own private IPC namespace - - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers - - `"container:"`: join another (shareable) container's IPC namespace - - `"host"`: use the host system's IPC namespace - - If not specified, daemon default is used, which can either be `"private"` - or `"shareable"`, depending on daemon version and configuration. - + * IPC sharing mode for the container. Possible values are: + * + * - `"none"`: own private IPC namespace, with /dev/shm not mounted + * - `"private"`: own private IPC namespace + * - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers + * - `"container:"`: join another (shareable) container's IPC namespace + * - `"host"`: use the host system's IPC namespace + * + * If not specified, daemon default is used, which can either be `"private"` + * or `"shareable"`, depending on daemon version and configuration. * - * @var string + * @var string|null */ protected $ipcMode; /** * Cgroup to use for the container. * - * @var string + * @var string|null */ protected $cgroup; /** * A list of links for the container in the form `container_name:alias`. * - * @var string[] + * @var list|null */ protected $links; /** - * An integer value containing the score given to the container in order to tune OOM killer preferences. + * An integer value containing the score given to the container in + * order to tune OOM killer preferences. * - * @var int + * @var int|null */ protected $oomScoreAdj; /** - * Set the PID (Process) Namespace mode for the container. It can be either:. - - - `"container:"`: joins another container's PID namespace - - `"host"`: use the host's PID namespace inside the container - + * Set the PID (Process) Namespace mode for the container. It can be + * either: * - * @var string + * - `"container:"`: joins another container's PID namespace + * - `"host"`: use the host's PID namespace inside the container + * + * @var string|null */ protected $pidMode; /** * Gives the container full access to the host. * - * @var bool + * @var bool|null */ protected $privileged; /** - * Allocates an ephemeral host port for all of a container's. - exposed ports. - - Ports are de-allocated when the container stops and allocated when the container starts. - The allocated port might be changed when restarting the container. - - The port is selected from the ephemeral port range that depends on the kernel. - For example, on Linux the range is defined by `/proc/sys/net/ipv4/ip_local_port_range`. - + * Allocates an ephemeral host port for all of a container's + * exposed ports. + * + * Ports are de-allocated when the container stops and allocated when + * the container starts. The allocated port might be changed when + * restarting the container. * - * @var bool + * The port is selected from the ephemeral port range that depends on + * the kernel. For example, on Linux the range is defined by + * `/proc/sys/net/ipv4/ip_local_port_range`. + * + * @var bool|null */ protected $publishAllPorts; /** * Mount the container's root filesystem as read only. * - * @var bool + * @var bool|null */ protected $readonlyRootfs; /** - * A list of string values to customize labels for MLS systems, such as SELinux. + * A list of string values to customize labels for MLS systems, such + * as SELinux. * - * @var string[] + * @var list|null */ protected $securityOpt; /** * Storage driver options for this container, in the form `{"size": "120G"}`. * - * @var string[] + * @var array|null */ protected $storageOpt; /** - * 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" }`. + * 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" } + * ``` * - * @var string[] + * @var array|null */ protected $tmpfs; /** * UTS namespace to use for the container. * - * @var string + * @var string|null */ protected $uTSMode; /** - * Sets the usernamespace mode for the container when usernamespace remapping option is enabled. + * Sets the usernamespace mode for the container when usernamespace + * remapping option is enabled. * - * @var string + * @var string|null */ protected $usernsMode; /** * Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. * - * @var int + * @var int|null */ protected $shmSize; /** - * A list of kernel parameters (sysctls) to set in the container. For example: `{"net.ipv4.ip_forward": "1"}`. + * A list of kernel parameters (sysctls) to set in the container. + * For example: + * + * ``` + * {"net.ipv4.ip_forward": "1"} + * ``` * - * @var string[] + * @var array|null */ protected $sysctls; /** * Runtime to use with this container. * - * @var string + * @var string|null */ protected $runtime; /** - * Initial console size, as an `[height, width]` array. (Windows only). + * Isolation technology of the container. (Windows only). * - * @var int[] + * @var string|null */ - protected $consoleSize; + protected $isolation; /** - * Isolation technology of the container. (Windows only). + * The list of paths to be masked inside the container (this overrides + * the default set of paths). * - * @var string + * @var list|null */ - protected $isolation; - + protected $maskedPaths; /** - * An integer value representing this container's relative CPU weight versus other containers. + * The list of paths to be set as read-only inside the container + * (this overrides the default set of paths). * - * @return int + * @var list|null + */ + protected $readonlyPaths; + + /** + * An integer value representing this container's relative CPU weight + * versus other containers. */ public function getCpuShares(): ?int { @@ -457,14 +593,12 @@ public function getCpuShares(): ?int } /** - * An integer value representing this container's relative CPU weight versus other containers. - * - * @param int $cpuShares - * - * @return self + * An integer value representing this container's relative CPU weight + * versus other containers. */ public function setCpuShares(?int $cpuShares): self { + $this->initialized['cpuShares'] = true; $this->cpuShares = $cpuShares; return $this; @@ -472,8 +606,6 @@ public function setCpuShares(?int $cpuShares): self /** * Memory limit in bytes. - * - * @return int */ public function getMemory(): ?int { @@ -482,22 +614,20 @@ public function getMemory(): ?int /** * Memory limit in bytes. - * - * @param int $memory - * - * @return self */ public function setMemory(?int $memory): self { + $this->initialized['memory'] = true; $this->memory = $memory; return $this; } /** - * 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. - * - * @return string + * 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. */ public function getCgroupParent(): ?string { @@ -505,14 +635,14 @@ public function getCgroupParent(): ?string } /** - * 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. - * - * @param string $cgroupParent - * - * @return self + * 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. */ public function setCgroupParent(?string $cgroupParent): self { + $this->initialized['cgroupParent'] = true; $this->cgroupParent = $cgroupParent; return $this; @@ -520,8 +650,6 @@ public function setCgroupParent(?string $cgroupParent): self /** * Block IO weight (relative weight). - * - * @return int */ public function getBlkioWeight(): ?int { @@ -530,22 +658,23 @@ public function getBlkioWeight(): ?int /** * Block IO weight (relative weight). - * - * @param int $blkioWeight - * - * @return self */ public function setBlkioWeight(?int $blkioWeight): self { + $this->initialized['blkioWeight'] = true; $this->blkioWeight = $blkioWeight; return $this; } /** - * Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. + * Block IO weight (relative device weight) in the form: * - * @return ResourcesBlkioWeightDeviceItem[] + * ``` + * [{"Path": "device_path", "Weight": weight}] + * ``` + * + * @return list|null */ public function getBlkioWeightDevice(): ?array { @@ -553,23 +682,30 @@ public function getBlkioWeightDevice(): ?array } /** - * Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. + * Block IO weight (relative device weight) in the form: * - * @param ResourcesBlkioWeightDeviceItem[] $blkioWeightDevice + * ``` + * [{"Path": "device_path", "Weight": weight}] + * ``` * - * @return self + * @param list|null $blkioWeightDevice */ public function setBlkioWeightDevice(?array $blkioWeightDevice): self { + $this->initialized['blkioWeightDevice'] = true; $this->blkioWeightDevice = $blkioWeightDevice; return $this; } /** - * Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (bytes per second) from a device, in the form: + * + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return ThrottleDevice[] + * @return list|null */ public function getBlkioDeviceReadBps(): ?array { @@ -577,23 +713,30 @@ public function getBlkioDeviceReadBps(): ?array } /** - * Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (bytes per second) from a device, in the form: * - * @param ThrottleDevice[] $blkioDeviceReadBps + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return self + * @param list|null $blkioDeviceReadBps */ public function setBlkioDeviceReadBps(?array $blkioDeviceReadBps): self { + $this->initialized['blkioDeviceReadBps'] = true; $this->blkioDeviceReadBps = $blkioDeviceReadBps; return $this; } /** - * Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (bytes per second) to a device, in the form: * - * @return ThrottleDevice[] + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` + * + * @return list|null */ public function getBlkioDeviceWriteBps(): ?array { @@ -601,23 +744,30 @@ public function getBlkioDeviceWriteBps(): ?array } /** - * Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (bytes per second) to a device, in the form: * - * @param ThrottleDevice[] $blkioDeviceWriteBps + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return self + * @param list|null $blkioDeviceWriteBps */ public function setBlkioDeviceWriteBps(?array $blkioDeviceWriteBps): self { + $this->initialized['blkioDeviceWriteBps'] = true; $this->blkioDeviceWriteBps = $blkioDeviceWriteBps; return $this; } /** - * Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (IO per second) from a device, in the form: + * + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return ThrottleDevice[] + * @return list|null */ public function getBlkioDeviceReadIOps(): ?array { @@ -625,23 +775,30 @@ public function getBlkioDeviceReadIOps(): ?array } /** - * Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (IO per second) from a device, in the form: * - * @param ThrottleDevice[] $blkioDeviceReadIOps + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return self + * @param list|null $blkioDeviceReadIOps */ public function setBlkioDeviceReadIOps(?array $blkioDeviceReadIOps): self { + $this->initialized['blkioDeviceReadIOps'] = true; $this->blkioDeviceReadIOps = $blkioDeviceReadIOps; return $this; } /** - * Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (IO per second) to a device, in the form: + * + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return ThrottleDevice[] + * @return list|null */ public function getBlkioDeviceWriteIOps(): ?array { @@ -649,14 +806,17 @@ public function getBlkioDeviceWriteIOps(): ?array } /** - * Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (IO per second) to a device, in the form: * - * @param ThrottleDevice[] $blkioDeviceWriteIOps + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return self + * @param list|null $blkioDeviceWriteIOps */ public function setBlkioDeviceWriteIOps(?array $blkioDeviceWriteIOps): self { + $this->initialized['blkioDeviceWriteIOps'] = true; $this->blkioDeviceWriteIOps = $blkioDeviceWriteIOps; return $this; @@ -664,8 +824,6 @@ public function setBlkioDeviceWriteIOps(?array $blkioDeviceWriteIOps): self /** * The length of a CPU period in microseconds. - * - * @return int */ public function getCpuPeriod(): ?int { @@ -674,13 +832,10 @@ public function getCpuPeriod(): ?int /** * The length of a CPU period in microseconds. - * - * @param int $cpuPeriod - * - * @return self */ public function setCpuPeriod(?int $cpuPeriod): self { + $this->initialized['cpuPeriod'] = true; $this->cpuPeriod = $cpuPeriod; return $this; @@ -688,8 +843,6 @@ public function setCpuPeriod(?int $cpuPeriod): self /** * Microseconds of CPU time that the container can get in a CPU period. - * - * @return int */ public function getCpuQuota(): ?int { @@ -698,22 +851,18 @@ public function getCpuQuota(): ?int /** * Microseconds of CPU time that the container can get in a CPU period. - * - * @param int $cpuQuota - * - * @return self */ public function setCpuQuota(?int $cpuQuota): self { + $this->initialized['cpuQuota'] = true; $this->cpuQuota = $cpuQuota; return $this; } /** - * The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks. - * - * @return int + * The length of a CPU real-time period in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. */ public function getCpuRealtimePeriod(): ?int { @@ -721,23 +870,20 @@ public function getCpuRealtimePeriod(): ?int } /** - * The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks. - * - * @param int $cpuRealtimePeriod - * - * @return self + * The length of a CPU real-time period in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. */ public function setCpuRealtimePeriod(?int $cpuRealtimePeriod): self { + $this->initialized['cpuRealtimePeriod'] = true; $this->cpuRealtimePeriod = $cpuRealtimePeriod; return $this; } /** - * The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks. - * - * @return int + * The length of a CPU real-time runtime in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. */ public function getCpuRealtimeRuntime(): ?int { @@ -745,14 +891,12 @@ public function getCpuRealtimeRuntime(): ?int } /** - * The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks. - * - * @param int $cpuRealtimeRuntime - * - * @return self + * The length of a CPU real-time runtime in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. */ public function setCpuRealtimeRuntime(?int $cpuRealtimeRuntime): self { + $this->initialized['cpuRealtimeRuntime'] = true; $this->cpuRealtimeRuntime = $cpuRealtimeRuntime; return $this; @@ -760,8 +904,6 @@ public function setCpuRealtimeRuntime(?int $cpuRealtimeRuntime): self /** * CPUs in which to allow execution (e.g., `0-3`, `0,1`). - * - * @return string */ public function getCpusetCpus(): ?string { @@ -770,22 +912,18 @@ public function getCpusetCpus(): ?string /** * CPUs in which to allow execution (e.g., `0-3`, `0,1`). - * - * @param string $cpusetCpus - * - * @return self */ public function setCpusetCpus(?string $cpusetCpus): self { + $this->initialized['cpusetCpus'] = true; $this->cpusetCpus = $cpusetCpus; return $this; } /** - * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. - * - * @return string + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + * effective on NUMA systems. */ public function getCpusetMems(): ?string { @@ -793,14 +931,12 @@ public function getCpusetMems(): ?string } /** - * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. - * - * @param string $cpusetMems - * - * @return self + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + * effective on NUMA systems. */ public function setCpusetMems(?string $cpusetMems): self { + $this->initialized['cpusetMems'] = true; $this->cpusetMems = $cpusetMems; return $this; @@ -809,7 +945,7 @@ public function setCpusetMems(?string $cpusetMems): self /** * A list of devices to add to the container. * - * @return DeviceMapping[] + * @return list|null */ public function getDevices(): ?array { @@ -819,12 +955,11 @@ public function getDevices(): ?array /** * A list of devices to add to the container. * - * @param DeviceMapping[] $devices - * - * @return self + * @param list|null $devices */ public function setDevices(?array $devices): self { + $this->initialized['devices'] = true; $this->devices = $devices; return $this; @@ -833,7 +968,7 @@ public function setDevices(?array $devices): self /** * a list of cgroup rules to apply to the container. * - * @return string[] + * @return list|null */ public function getDeviceCgroupRules(): ?array { @@ -843,69 +978,68 @@ public function getDeviceCgroupRules(): ?array /** * a list of cgroup rules to apply to the container. * - * @param string[] $deviceCgroupRules - * - * @return self + * @param list|null $deviceCgroupRules */ public function setDeviceCgroupRules(?array $deviceCgroupRules): self { + $this->initialized['deviceCgroupRules'] = true; $this->deviceCgroupRules = $deviceCgroupRules; return $this; } /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @return int + * @return list|null */ - public function getDiskQuota(): ?int + public function getDeviceRequests(): ?array { - return $this->diskQuota; + return $this->deviceRequests; } /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @param int $diskQuota - * - * @return self + * @param list|null $deviceRequests */ - public function setDiskQuota(?int $diskQuota): self + public function setDeviceRequests(?array $deviceRequests): self { - $this->diskQuota = $diskQuota; + $this->initialized['deviceRequests'] = true; + $this->deviceRequests = $deviceRequests; return $this; } /** - * Kernel memory limit in bytes. + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + * OCI runtime in use, this option may be ignored. It is no longer supported + * by the default (runc) runtime. * - * @return int + * This field is omitted when empty. */ - public function getKernelMemory(): ?int + public function getKernelMemoryTCP(): ?int { - return $this->kernelMemory; + return $this->kernelMemoryTCP; } /** - * Kernel memory limit in bytes. - * - * @param int $kernelMemory + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + * OCI runtime in use, this option may be ignored. It is no longer supported + * by the default (runc) runtime. * - * @return self + * This field is omitted when empty. */ - public function setKernelMemory(?int $kernelMemory): self + public function setKernelMemoryTCP(?int $kernelMemoryTCP): self { - $this->kernelMemory = $kernelMemory; + $this->initialized['kernelMemoryTCP'] = true; + $this->kernelMemoryTCP = $kernelMemoryTCP; return $this; } /** * Memory soft limit in bytes. - * - * @return int */ public function getMemoryReservation(): ?int { @@ -914,22 +1048,18 @@ public function getMemoryReservation(): ?int /** * Memory soft limit in bytes. - * - * @param int $memoryReservation - * - * @return self */ public function setMemoryReservation(?int $memoryReservation): self { + $this->initialized['memoryReservation'] = true; $this->memoryReservation = $memoryReservation; return $this; } /** - * Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. - * - * @return int + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + * swap. */ public function getMemorySwap(): ?int { @@ -937,23 +1067,20 @@ public function getMemorySwap(): ?int } /** - * Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. - * - * @param int $memorySwap - * - * @return self + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + * swap. */ public function setMemorySwap(?int $memorySwap): self { + $this->initialized['memorySwap'] = true; $this->memorySwap = $memorySwap; return $this; } /** - * Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. - * - * @return int + * Tune a container's memory swappiness behavior. Accepts an integer + * between 0 and 100. */ public function getMemorySwappiness(): ?int { @@ -961,14 +1088,12 @@ public function getMemorySwappiness(): ?int } /** - * Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. - * - * @param int $memorySwappiness - * - * @return self + * Tune a container's memory swappiness behavior. Accepts an integer + * between 0 and 100. */ public function setMemorySwappiness(?int $memorySwappiness): self { + $this->initialized['memorySwappiness'] = true; $this->memorySwappiness = $memorySwappiness; return $this; @@ -976,32 +1101,25 @@ public function setMemorySwappiness(?int $memorySwappiness): self /** * CPU quota in units of 10-9 CPUs. - * - * @return int */ - public function getNanoCPUs(): ?int + public function getNanoCpus(): ?int { - return $this->nanoCPUs; + return $this->nanoCpus; } /** * CPU quota in units of 10-9 CPUs. - * - * @param int $nanoCPUs - * - * @return self */ - public function setNanoCPUs(?int $nanoCPUs): self + public function setNanoCpus(?int $nanoCpus): self { - $this->nanoCPUs = $nanoCPUs; + $this->initialized['nanoCpus'] = true; + $this->nanoCpus = $nanoCpus; return $this; } /** * Disable OOM Killer for the container. - * - * @return bool */ public function getOomKillDisable(): ?bool { @@ -1010,22 +1128,41 @@ public function getOomKillDisable(): ?bool /** * Disable OOM Killer for the container. - * - * @param bool $oomKillDisable - * - * @return self */ public function setOomKillDisable(?bool $oomKillDisable): self { + $this->initialized['oomKillDisable'] = true; $this->oomKillDisable = $oomKillDisable; return $this; } /** - * Tune a container's pids limit. Set -1 for unlimited. - * - * @return int + * Run an init inside the container that forwards signals and reaps + * processes. This field is omitted if empty, and the default (as + * configured on the daemon) is used. + */ + public function getInit(): ?bool + { + return $this->init; + } + + /** + * Run an init inside the container that forwards signals and reaps + * processes. This field is omitted if empty, and the default (as + * configured on the daemon) is used. + */ + public function setInit(?bool $init): self + { + $this->initialized['init'] = true; + $this->init = $init; + + return $this; + } + + /** + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + * to not change. */ public function getPidsLimit(): ?int { @@ -1033,23 +1170,25 @@ public function getPidsLimit(): ?int } /** - * Tune a container's pids limit. Set -1 for unlimited. - * - * @param int $pidsLimit - * - * @return self + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + * to not change. */ public function setPidsLimit(?int $pidsLimit): self { + $this->initialized['pidsLimit'] = true; $this->pidsLimit = $pidsLimit; return $this; } /** - * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`". + * A list of resource limits to set in the container. For example: * - * @return ResourcesUlimitsItem[] + * ``` + * {"Name": "nofile", "Soft": 1024, "Hard": 2048} + * ``` + * + * @return list|null */ public function getUlimits(): ?array { @@ -1057,14 +1196,17 @@ public function getUlimits(): ?array } /** - * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`". + * A list of resource limits to set in the container. For example: * - * @param ResourcesUlimitsItem[] $ulimits + * ``` + * {"Name": "nofile", "Soft": 1024, "Hard": 2048} + * ``` * - * @return self + * @param list|null $ulimits */ public function setUlimits(?array $ulimits): self { + $this->initialized['ulimits'] = true; $this->ulimits = $ulimits; return $this; @@ -1072,11 +1214,10 @@ public function setUlimits(?array $ulimits): self /** * The number of usable CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - * - * @return int + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. */ public function getCpuCount(): ?int { @@ -1085,16 +1226,14 @@ public function getCpuCount(): ?int /** * The number of usable CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - * - * @param int $cpuCount - * - * @return self + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. */ public function setCpuCount(?int $cpuCount): self { + $this->initialized['cpuCount'] = true; $this->cpuCount = $cpuCount; return $this; @@ -1102,11 +1241,10 @@ public function setCpuCount(?int $cpuCount): self /** * The usable percentage of the available CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - * - * @return int + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. */ public function getCpuPercent(): ?int { @@ -1115,16 +1253,14 @@ public function getCpuPercent(): ?int /** * The usable percentage of the available CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - * - * @param int $cpuPercent - * - * @return self + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. */ public function setCpuPercent(?int $cpuPercent): self { + $this->initialized['cpuPercent'] = true; $this->cpuPercent = $cpuPercent; return $this; @@ -1132,8 +1268,6 @@ public function setCpuPercent(?int $cpuPercent): self /** * Maximum IOps for the container system drive (Windows only). - * - * @return int */ public function getIOMaximumIOps(): ?int { @@ -1142,22 +1276,18 @@ public function getIOMaximumIOps(): ?int /** * Maximum IOps for the container system drive (Windows only). - * - * @param int $iOMaximumIOps - * - * @return self */ public function setIOMaximumIOps(?int $iOMaximumIOps): self { + $this->initialized['iOMaximumIOps'] = true; $this->iOMaximumIOps = $iOMaximumIOps; return $this; } /** - * Maximum IO in bytes per second for the container system drive (Windows only). - * - * @return int + * Maximum IO in bytes per second for the container system drive + * (Windows only). */ public function getIOMaximumBandwidth(): ?int { @@ -1165,29 +1295,58 @@ public function getIOMaximumBandwidth(): ?int } /** - * Maximum IO in bytes per second for the container system drive (Windows only). - * - * @param int $iOMaximumBandwidth - * - * @return self + * Maximum IO in bytes per second for the container system drive + * (Windows only). */ public function setIOMaximumBandwidth(?int $iOMaximumBandwidth): self { + $this->initialized['iOMaximumBandwidth'] = true; $this->iOMaximumBandwidth = $iOMaximumBandwidth; return $this; } /** - * A list of volume bindings for this container. Each volume binding is a string in one of these forms:. - - - `host-src:container-dest` to bind-mount a host path into the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `host-src:container-dest:ro` to make the bind mount read-only inside the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `volume-name:container-dest` to bind-mount a volume managed by a volume driver into the container. `container-dest` must be an _absolute_ path. - - `volume-name:container-dest:ro` to mount the volume read-only inside the container. `container-dest` must be an _absolute_ path. - - * - * @return string[] + * A list of volume bindings for this container. Each volume binding + * is a string in one of these forms: + * + * - `host-src:container-dest[:options]` to bind-mount a host path + * into the container. Both `host-src`, and `container-dest` must + * be an _absolute_ path. + * - `volume-name:container-dest[:options]` to bind-mount a volume + * managed by a volume driver into the container. `container-dest` + * must be an _absolute_ path. + * + * `options` is an optional, comma-delimited list of: + * + * - `nocopy` disables automatic copying of data from the container + * path to the volume. The `nocopy` flag only applies to named volumes. + * - `[ro|rw]` mounts a volume read-only or read-write, respectively. + * If omitted or set to `rw`, volumes are mounted read-write. + * - `[z|Z]` applies SELinux labels to allow or deny multiple containers + * to read and write to the same volume. + * - `z`: a _shared_ content label is applied to the content. This + * label indicates that multiple containers can share the volume + * content, for both reading and writing. + * - `Z`: a _private unshared_ label is applied to the content. + * This label indicates that only the current container can use + * a private volume. Labeling systems such as SELinux require + * proper labels to be placed on volume content that is mounted + * into a container. Without a label, the security system can + * prevent a container's processes from using the content. By + * default, the labels set by the host operating system are not + * modified. + * - `[[r]shared|[r]slave|[r]private]` specifies mount + * [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). + * This only applies to bind-mounted volumes, not internal volumes + * or named volumes. Mount propagation requires the source mount + * point (the location where the source directory is mounted in the + * host operating system) to have the correct propagation properties. + * For shared volumes, the source mount point must be set to `shared`. + * For slave volumes, the mount must be set to either `shared` or + * `slave`. + * + * @return list|null */ public function getBinds(): ?array { @@ -1195,20 +1354,50 @@ public function getBinds(): ?array } /** - * A list of volume bindings for this container. Each volume binding is a string in one of these forms:. - - - `host-src:container-dest` to bind-mount a host path into the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `host-src:container-dest:ro` to make the bind mount read-only inside the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - - `volume-name:container-dest` to bind-mount a volume managed by a volume driver into the container. `container-dest` must be an _absolute_ path. - - `volume-name:container-dest:ro` to mount the volume read-only inside the container. `container-dest` must be an _absolute_ path. - - * - * @param string[] $binds - * - * @return self + * A list of volume bindings for this container. Each volume binding + * is a string in one of these forms: + * + * - `host-src:container-dest[:options]` to bind-mount a host path + * into the container. Both `host-src`, and `container-dest` must + * be an _absolute_ path. + * - `volume-name:container-dest[:options]` to bind-mount a volume + * managed by a volume driver into the container. `container-dest` + * must be an _absolute_ path. + * + * `options` is an optional, comma-delimited list of: + * + * - `nocopy` disables automatic copying of data from the container + * path to the volume. The `nocopy` flag only applies to named volumes. + * - `[ro|rw]` mounts a volume read-only or read-write, respectively. + * If omitted or set to `rw`, volumes are mounted read-write. + * - `[z|Z]` applies SELinux labels to allow or deny multiple containers + * to read and write to the same volume. + * - `z`: a _shared_ content label is applied to the content. This + * label indicates that multiple containers can share the volume + * content, for both reading and writing. + * - `Z`: a _private unshared_ label is applied to the content. + * This label indicates that only the current container can use + * a private volume. Labeling systems such as SELinux require + * proper labels to be placed on volume content that is mounted + * into a container. Without a label, the security system can + * prevent a container's processes from using the content. By + * default, the labels set by the host operating system are not + * modified. + * - `[[r]shared|[r]slave|[r]private]` specifies mount + * [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). + * This only applies to bind-mounted volumes, not internal volumes + * or named volumes. Mount propagation requires the source mount + * point (the location where the source directory is mounted in the + * host operating system) to have the correct propagation properties. + * For shared volumes, the source mount point must be set to `shared`. + * For slave volumes, the mount must be set to either `shared` or + * `slave`. + * + * @param list|null $binds */ public function setBinds(?array $binds): self { + $this->initialized['binds'] = true; $this->binds = $binds; return $this; @@ -1216,8 +1405,6 @@ public function setBinds(?array $binds): self /** * Path to a file where the container ID is written. - * - * @return string */ public function getContainerIDFile(): ?string { @@ -1226,13 +1413,10 @@ public function getContainerIDFile(): ?string /** * Path to a file where the container ID is written. - * - * @param string $containerIDFile - * - * @return self */ public function setContainerIDFile(?string $containerIDFile): self { + $this->initialized['containerIDFile'] = true; $this->containerIDFile = $containerIDFile; return $this; @@ -1240,8 +1424,6 @@ public function setContainerIDFile(?string $containerIDFile): self /** * The logging configuration for this container. - * - * @return HostConfigLogConfig */ public function getLogConfig(): ?HostConfigLogConfig { @@ -1250,22 +1432,20 @@ public function getLogConfig(): ?HostConfigLogConfig /** * The logging configuration for this container. - * - * @param HostConfigLogConfig $logConfig - * - * @return self */ public function setLogConfig(?HostConfigLogConfig $logConfig): self { + $this->initialized['logConfig'] = true; $this->logConfig = $logConfig; return $this; } /** - * Network mode to use for this container. Supported standard values are: `bridge`, `host`, `none`, and `container:`. Any other value is taken as a custom network's name to which this container should connect to. - * - * @return string + * Network mode to use for this container. Supported standard values + * are: `bridge`, `host`, `none`, and `container:`. Any + * other value is taken as a custom network's name to which this + * container should connect to. */ public function getNetworkMode(): ?string { @@ -1273,62 +1453,58 @@ public function getNetworkMode(): ?string } /** - * Network mode to use for this container. Supported standard values are: `bridge`, `host`, `none`, and `container:`. Any other value is taken as a custom network's name to which this container should connect to. - * - * @param string $networkMode - * - * @return self + * Network mode to use for this container. Supported standard values + * are: `bridge`, `host`, `none`, and `container:`. Any + * other value is taken as a custom network's name to which this + * container should connect to. */ public function setNetworkMode(?string $networkMode): self { + $this->initialized['networkMode'] = true; $this->networkMode = $networkMode; return $this; } /** - * PortMap describes the mapping of container ports to host ports, using the. - container's port-number and protocol as key in the format `/`, - for example, `80/udp`. - - If a container's port is mapped for both `tcp` and `udp`, two separate - entries are added to the mapping table. - + * PortMap describes the mapping of container ports to host ports, using the + * container's port-number and protocol as key in the format `/`, + * for example, `80/udp`. * - * @return PortBinding[][] + * If a container's port is mapped for multiple protocols, separate entries + * are added to the mapping table. + * + * @return array>|null */ - public function getPortBindings(): ?\ArrayObject + public function getPortBindings(): ?iterable { return $this->portBindings; } /** - * PortMap describes the mapping of container ports to host ports, using the. - container's port-number and protocol as key in the format `/`, - for example, `80/udp`. - - If a container's port is mapped for both `tcp` and `udp`, two separate - entries are added to the mapping table. - + * PortMap describes the mapping of container ports to host ports, using the + * container's port-number and protocol as key in the format `/`, + * for example, `80/udp`. * - * @param PortBinding[][] $portBindings + * If a container's port is mapped for multiple protocols, separate entries + * are added to the mapping table. * - * @return self + * @param array>|null $portBindings */ - public function setPortBindings(?\ArrayObject $portBindings): self + public function setPortBindings(?iterable $portBindings): self { + $this->initialized['portBindings'] = true; $this->portBindings = $portBindings; return $this; } /** - * The behavior to apply when the container exits. The default is not to restart. - - An ever increasing delay (double the previous delay, starting at 100ms) is added before each restart to prevent flooding the server. - + * The behavior to apply when the container exits. The default is not to + * restart. * - * @return RestartPolicy + * An ever increasing delay (double the previous delay, starting at 100ms) is + * added before each restart to prevent flooding the server. */ public function getRestartPolicy(): ?RestartPolicy { @@ -1336,26 +1512,23 @@ public function getRestartPolicy(): ?RestartPolicy } /** - * The behavior to apply when the container exits. The default is not to restart. - - An ever increasing delay (double the previous delay, starting at 100ms) is added before each restart to prevent flooding the server. - - * - * @param RestartPolicy $restartPolicy + * The behavior to apply when the container exits. The default is not to + * restart. * - * @return self + * An ever increasing delay (double the previous delay, starting at 100ms) is + * added before each restart to prevent flooding the server. */ public function setRestartPolicy(?RestartPolicy $restartPolicy): self { + $this->initialized['restartPolicy'] = true; $this->restartPolicy = $restartPolicy; return $this; } /** - * Automatically remove the container when the container's process exits. This has no effect if `RestartPolicy` is set. - * - * @return bool + * Automatically remove the container when the container's process + * exits. This has no effect if `RestartPolicy` is set. */ public function getAutoRemove(): ?bool { @@ -1363,14 +1536,12 @@ public function getAutoRemove(): ?bool } /** - * Automatically remove the container when the container's process exits. This has no effect if `RestartPolicy` is set. - * - * @param bool $autoRemove - * - * @return self + * Automatically remove the container when the container's process + * exits. This has no effect if `RestartPolicy` is set. */ public function setAutoRemove(?bool $autoRemove): self { + $this->initialized['autoRemove'] = true; $this->autoRemove = $autoRemove; return $this; @@ -1378,8 +1549,6 @@ public function setAutoRemove(?bool $autoRemove): self /** * Driver that this container uses to mount volumes. - * - * @return string */ public function getVolumeDriver(): ?string { @@ -1388,22 +1557,20 @@ public function getVolumeDriver(): ?string /** * Driver that this container uses to mount volumes. - * - * @param string $volumeDriver - * - * @return self */ public function setVolumeDriver(?string $volumeDriver): self { + $this->initialized['volumeDriver'] = true; $this->volumeDriver = $volumeDriver; return $this; } /** - * A list of volumes to inherit from another container, specified in the form `[:]`. + * A list of volumes to inherit from another container, specified in + * the form `[:]`. * - * @return string[] + * @return list|null */ public function getVolumesFrom(): ?array { @@ -1411,14 +1578,14 @@ public function getVolumesFrom(): ?array } /** - * A list of volumes to inherit from another container, specified in the form `[:]`. - * - * @param string[] $volumesFrom + * A list of volumes to inherit from another container, specified in + * the form `[:]`. * - * @return self + * @param list|null $volumesFrom */ public function setVolumesFrom(?array $volumesFrom): self { + $this->initialized['volumesFrom'] = true; $this->volumesFrom = $volumesFrom; return $this; @@ -1427,7 +1594,7 @@ public function setVolumesFrom(?array $volumesFrom): self /** * Specification for mounts to be added to the container. * - * @return Mount[] + * @return list|null */ public function getMounts(): ?array { @@ -1437,21 +1604,69 @@ public function getMounts(): ?array /** * Specification for mounts to be added to the container. * - * @param Mount[] $mounts - * - * @return self + * @param list|null $mounts */ public function setMounts(?array $mounts): self { + $this->initialized['mounts'] = true; $this->mounts = $mounts; return $this; } /** - * A list of kernel capabilities to add to the container. + * Initial console size, as an `[height, width]` array. + * + * @return list|null + */ + public function getConsoleSize(): ?array + { + return $this->consoleSize; + } + + /** + * Initial console size, as an `[height, width]` array. + * + * @param list|null $consoleSize + */ + public function setConsoleSize(?array $consoleSize): self + { + $this->initialized['consoleSize'] = true; + $this->consoleSize = $consoleSize; + + return $this; + } + + /** + * Arbitrary non-identifying metadata attached to container and + * provided to the runtime when the container is started. + * + * @return array|null + */ + public function getAnnotations(): ?iterable + { + return $this->annotations; + } + + /** + * Arbitrary non-identifying metadata attached to container and + * provided to the runtime when the container is started. + * + * @param array|null $annotations + */ + public function setAnnotations(?iterable $annotations): self + { + $this->initialized['annotations'] = true; + $this->annotations = $annotations; + + return $this; + } + + /** + * A list of kernel capabilities to add to the container. Conflicts + * with option 'Capabilities'. * - * @return string[] + * @return list|null */ public function getCapAdd(): ?array { @@ -1459,23 +1674,24 @@ public function getCapAdd(): ?array } /** - * A list of kernel capabilities to add to the container. + * A list of kernel capabilities to add to the container. Conflicts + * with option 'Capabilities'. * - * @param string[] $capAdd - * - * @return self + * @param list|null $capAdd */ public function setCapAdd(?array $capAdd): self { + $this->initialized['capAdd'] = true; $this->capAdd = $capAdd; return $this; } /** - * A list of kernel capabilities to drop from the container. + * A list of kernel capabilities to drop from the container. Conflicts + * with option 'Capabilities'. * - * @return string[] + * @return list|null */ public function getCapDrop(): ?array { @@ -1483,23 +1699,54 @@ public function getCapDrop(): ?array } /** - * A list of kernel capabilities to drop from the container. - * - * @param string[] $capDrop + * A list of kernel capabilities to drop from the container. Conflicts + * with option 'Capabilities'. * - * @return self + * @param list|null $capDrop */ public function setCapDrop(?array $capDrop): self { + $this->initialized['capDrop'] = true; $this->capDrop = $capDrop; return $this; } + /** + * cgroup namespace mode for the container. Possible values are: + * + * - `"private"`: the container runs in its own private cgroup namespace + * - `"host"`: use the host system's cgroup namespace + * + * If not specified, the daemon default is used, which can either be `"private"` + * or `"host"`, depending on daemon version, kernel support and configuration. + */ + public function getCgroupnsMode(): ?string + { + return $this->cgroupnsMode; + } + + /** + * cgroup namespace mode for the container. Possible values are: + * + * - `"private"`: the container runs in its own private cgroup namespace + * - `"host"`: use the host system's cgroup namespace + * + * If not specified, the daemon default is used, which can either be `"private"` + * or `"host"`, depending on daemon version, kernel support and configuration. + */ + public function setCgroupnsMode(?string $cgroupnsMode): self + { + $this->initialized['cgroupnsMode'] = true; + $this->cgroupnsMode = $cgroupnsMode; + + return $this; + } + /** * A list of DNS servers for the container to use. * - * @return string[] + * @return list|null */ public function getDns(): ?array { @@ -1509,12 +1756,11 @@ public function getDns(): ?array /** * A list of DNS servers for the container to use. * - * @param string[] $dns - * - * @return self + * @param list|null $dns */ public function setDns(?array $dns): self { + $this->initialized['dns'] = true; $this->dns = $dns; return $this; @@ -1523,7 +1769,7 @@ public function setDns(?array $dns): self /** * A list of DNS options. * - * @return string[] + * @return list|null */ public function getDnsOptions(): ?array { @@ -1533,12 +1779,11 @@ public function getDnsOptions(): ?array /** * A list of DNS options. * - * @param string[] $dnsOptions - * - * @return self + * @param list|null $dnsOptions */ public function setDnsOptions(?array $dnsOptions): self { + $this->initialized['dnsOptions'] = true; $this->dnsOptions = $dnsOptions; return $this; @@ -1547,7 +1792,7 @@ public function setDnsOptions(?array $dnsOptions): self /** * A list of DNS search domains. * - * @return string[] + * @return list|null */ public function getDnsSearch(): ?array { @@ -1557,21 +1802,21 @@ public function getDnsSearch(): ?array /** * A list of DNS search domains. * - * @param string[] $dnsSearch - * - * @return self + * @param list|null $dnsSearch */ public function setDnsSearch(?array $dnsSearch): self { + $this->initialized['dnsSearch'] = true; $this->dnsSearch = $dnsSearch; return $this; } /** - * A list of hostnames/IP mappings to add to the container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. + * A list of hostnames/IP mappings to add to the container's `/etc/hosts` + * file. Specified in the form `["hostname:IP"]`. * - * @return string[] + * @return list|null */ public function getExtraHosts(): ?array { @@ -1579,14 +1824,14 @@ public function getExtraHosts(): ?array } /** - * A list of hostnames/IP mappings to add to the container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. - * - * @param string[] $extraHosts + * A list of hostnames/IP mappings to add to the container's `/etc/hosts` + * file. Specified in the form `["hostname:IP"]`. * - * @return self + * @param list|null $extraHosts */ public function setExtraHosts(?array $extraHosts): self { + $this->initialized['extraHosts'] = true; $this->extraHosts = $extraHosts; return $this; @@ -1595,7 +1840,7 @@ public function setExtraHosts(?array $extraHosts): self /** * A list of additional groups that the container process will run as. * - * @return string[] + * @return list|null */ public function getGroupAdd(): ?array { @@ -1605,31 +1850,27 @@ public function getGroupAdd(): ?array /** * A list of additional groups that the container process will run as. * - * @param string[] $groupAdd - * - * @return self + * @param list|null $groupAdd */ public function setGroupAdd(?array $groupAdd): self { + $this->initialized['groupAdd'] = true; $this->groupAdd = $groupAdd; return $this; } /** - * IPC sharing mode for the container. Possible values are:. - - - `"none"`: own private IPC namespace, with /dev/shm not mounted - - `"private"`: own private IPC namespace - - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers - - `"container:"`: join another (shareable) container's IPC namespace - - `"host"`: use the host system's IPC namespace - - If not specified, daemon default is used, which can either be `"private"` - or `"shareable"`, depending on daemon version and configuration. - + * IPC sharing mode for the container. Possible values are: + * + * - `"none"`: own private IPC namespace, with /dev/shm not mounted + * - `"private"`: own private IPC namespace + * - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers + * - `"container:"`: join another (shareable) container's IPC namespace + * - `"host"`: use the host system's IPC namespace * - * @return string + * If not specified, daemon default is used, which can either be `"private"` + * or `"shareable"`, depending on daemon version and configuration. */ public function getIpcMode(): ?string { @@ -1637,24 +1878,20 @@ public function getIpcMode(): ?string } /** - * IPC sharing mode for the container. Possible values are:. - - - `"none"`: own private IPC namespace, with /dev/shm not mounted - - `"private"`: own private IPC namespace - - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers - - `"container:"`: join another (shareable) container's IPC namespace - - `"host"`: use the host system's IPC namespace - - If not specified, daemon default is used, which can either be `"private"` - or `"shareable"`, depending on daemon version and configuration. - + * IPC sharing mode for the container. Possible values are: * - * @param string $ipcMode + * - `"none"`: own private IPC namespace, with /dev/shm not mounted + * - `"private"`: own private IPC namespace + * - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers + * - `"container:"`: join another (shareable) container's IPC namespace + * - `"host"`: use the host system's IPC namespace * - * @return self + * If not specified, daemon default is used, which can either be `"private"` + * or `"shareable"`, depending on daemon version and configuration. */ public function setIpcMode(?string $ipcMode): self { + $this->initialized['ipcMode'] = true; $this->ipcMode = $ipcMode; return $this; @@ -1662,8 +1899,6 @@ public function setIpcMode(?string $ipcMode): self /** * Cgroup to use for the container. - * - * @return string */ public function getCgroup(): ?string { @@ -1672,13 +1907,10 @@ public function getCgroup(): ?string /** * Cgroup to use for the container. - * - * @param string $cgroup - * - * @return self */ public function setCgroup(?string $cgroup): self { + $this->initialized['cgroup'] = true; $this->cgroup = $cgroup; return $this; @@ -1687,7 +1919,7 @@ public function setCgroup(?string $cgroup): self /** * A list of links for the container in the form `container_name:alias`. * - * @return string[] + * @return list|null */ public function getLinks(): ?array { @@ -1697,21 +1929,19 @@ public function getLinks(): ?array /** * A list of links for the container in the form `container_name:alias`. * - * @param string[] $links - * - * @return self + * @param list|null $links */ public function setLinks(?array $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; } /** - * An integer value containing the score given to the container in order to tune OOM killer preferences. - * - * @return int + * An integer value containing the score given to the container in + * order to tune OOM killer preferences. */ public function getOomScoreAdj(): ?int { @@ -1719,27 +1949,23 @@ public function getOomScoreAdj(): ?int } /** - * An integer value containing the score given to the container in order to tune OOM killer preferences. - * - * @param int $oomScoreAdj - * - * @return self + * An integer value containing the score given to the container in + * order to tune OOM killer preferences. */ public function setOomScoreAdj(?int $oomScoreAdj): self { + $this->initialized['oomScoreAdj'] = true; $this->oomScoreAdj = $oomScoreAdj; return $this; } /** - * Set the PID (Process) Namespace mode for the container. It can be either:. - - - `"container:"`: joins another container's PID namespace - - `"host"`: use the host's PID namespace inside the container - + * Set the PID (Process) Namespace mode for the container. It can be + * either: * - * @return string + * - `"container:"`: joins another container's PID namespace + * - `"host"`: use the host's PID namespace inside the container */ public function getPidMode(): ?string { @@ -1747,18 +1973,15 @@ public function getPidMode(): ?string } /** - * Set the PID (Process) Namespace mode for the container. It can be either:. - - - `"container:"`: joins another container's PID namespace - - `"host"`: use the host's PID namespace inside the container - - * - * @param string $pidMode + * Set the PID (Process) Namespace mode for the container. It can be + * either: * - * @return self + * - `"container:"`: joins another container's PID namespace + * - `"host"`: use the host's PID namespace inside the container */ public function setPidMode(?string $pidMode): self { + $this->initialized['pidMode'] = true; $this->pidMode = $pidMode; return $this; @@ -1766,8 +1989,6 @@ public function setPidMode(?string $pidMode): self /** * Gives the container full access to the host. - * - * @return bool */ public function getPrivileged(): ?bool { @@ -1776,30 +1997,26 @@ public function getPrivileged(): ?bool /** * Gives the container full access to the host. - * - * @param bool $privileged - * - * @return self */ public function setPrivileged(?bool $privileged): self { + $this->initialized['privileged'] = true; $this->privileged = $privileged; return $this; } /** - * Allocates an ephemeral host port for all of a container's. - exposed ports. - - Ports are de-allocated when the container stops and allocated when the container starts. - The allocated port might be changed when restarting the container. - - The port is selected from the ephemeral port range that depends on the kernel. - For example, on Linux the range is defined by `/proc/sys/net/ipv4/ip_local_port_range`. - + * Allocates an ephemeral host port for all of a container's + * exposed ports. + * + * Ports are de-allocated when the container stops and allocated when + * the container starts. The allocated port might be changed when + * restarting the container. * - * @return bool + * The port is selected from the ephemeral port range that depends on + * the kernel. For example, on Linux the range is defined by + * `/proc/sys/net/ipv4/ip_local_port_range`. */ public function getPublishAllPorts(): ?bool { @@ -1807,22 +2024,20 @@ public function getPublishAllPorts(): ?bool } /** - * Allocates an ephemeral host port for all of a container's. - exposed ports. - - Ports are de-allocated when the container stops and allocated when the container starts. - The allocated port might be changed when restarting the container. - - The port is selected from the ephemeral port range that depends on the kernel. - For example, on Linux the range is defined by `/proc/sys/net/ipv4/ip_local_port_range`. - + * Allocates an ephemeral host port for all of a container's + * exposed ports. * - * @param bool $publishAllPorts + * Ports are de-allocated when the container stops and allocated when + * the container starts. The allocated port might be changed when + * restarting the container. * - * @return self + * The port is selected from the ephemeral port range that depends on + * the kernel. For example, on Linux the range is defined by + * `/proc/sys/net/ipv4/ip_local_port_range`. */ public function setPublishAllPorts(?bool $publishAllPorts): self { + $this->initialized['publishAllPorts'] = true; $this->publishAllPorts = $publishAllPorts; return $this; @@ -1830,8 +2045,6 @@ public function setPublishAllPorts(?bool $publishAllPorts): self /** * Mount the container's root filesystem as read only. - * - * @return bool */ public function getReadonlyRootfs(): ?bool { @@ -1840,22 +2053,20 @@ public function getReadonlyRootfs(): ?bool /** * Mount the container's root filesystem as read only. - * - * @param bool $readonlyRootfs - * - * @return self */ public function setReadonlyRootfs(?bool $readonlyRootfs): self { + $this->initialized['readonlyRootfs'] = true; $this->readonlyRootfs = $readonlyRootfs; return $this; } /** - * A list of string values to customize labels for MLS systems, such as SELinux. + * A list of string values to customize labels for MLS systems, such + * as SELinux. * - * @return string[] + * @return list|null */ public function getSecurityOpt(): ?array { @@ -1863,14 +2074,14 @@ public function getSecurityOpt(): ?array } /** - * A list of string values to customize labels for MLS systems, such as SELinux. + * A list of string values to customize labels for MLS systems, such + * as SELinux. * - * @param string[] $securityOpt - * - * @return self + * @param list|null $securityOpt */ public function setSecurityOpt(?array $securityOpt): self { + $this->initialized['securityOpt'] = true; $this->securityOpt = $securityOpt; return $this; @@ -1879,9 +2090,9 @@ public function setSecurityOpt(?array $securityOpt): self /** * Storage driver options for this container, in the form `{"size": "120G"}`. * - * @return string[] + * @return array|null */ - public function getStorageOpt(): ?\ArrayObject + public function getStorageOpt(): ?iterable { return $this->storageOpt; } @@ -1889,36 +2100,44 @@ public function getStorageOpt(): ?\ArrayObject /** * Storage driver options for this container, in the form `{"size": "120G"}`. * - * @param string[] $storageOpt - * - * @return self + * @param array|null $storageOpt */ - public function setStorageOpt(?\ArrayObject $storageOpt): self + public function setStorageOpt(?iterable $storageOpt): self { + $this->initialized['storageOpt'] = true; $this->storageOpt = $storageOpt; return $this; } /** - * 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" }`. + * A map of container directories which should be replaced by tmpfs + * mounts, and their corresponding mount options. For example: * - * @return string[] + * ``` + * { "/run": "rw,noexec,nosuid,size=65536k" } + * ``` + * + * @return array|null */ - public function getTmpfs(): ?\ArrayObject + public function getTmpfs(): ?iterable { return $this->tmpfs; } /** - * 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" }`. + * A map of container directories which should be replaced by tmpfs + * mounts, and their corresponding mount options. For example: * - * @param string[] $tmpfs + * ``` + * { "/run": "rw,noexec,nosuid,size=65536k" } + * ``` * - * @return self + * @param array|null $tmpfs */ - public function setTmpfs(?\ArrayObject $tmpfs): self + public function setTmpfs(?iterable $tmpfs): self { + $this->initialized['tmpfs'] = true; $this->tmpfs = $tmpfs; return $this; @@ -1926,8 +2145,6 @@ public function setTmpfs(?\ArrayObject $tmpfs): self /** * UTS namespace to use for the container. - * - * @return string */ public function getUTSMode(): ?string { @@ -1936,22 +2153,18 @@ public function getUTSMode(): ?string /** * UTS namespace to use for the container. - * - * @param string $uTSMode - * - * @return self */ public function setUTSMode(?string $uTSMode): self { + $this->initialized['uTSMode'] = true; $this->uTSMode = $uTSMode; return $this; } /** - * Sets the usernamespace mode for the container when usernamespace remapping option is enabled. - * - * @return string + * Sets the usernamespace mode for the container when usernamespace + * remapping option is enabled. */ public function getUsernsMode(): ?string { @@ -1959,14 +2172,12 @@ public function getUsernsMode(): ?string } /** - * Sets the usernamespace mode for the container when usernamespace remapping option is enabled. - * - * @param string $usernsMode - * - * @return self + * Sets the usernamespace mode for the container when usernamespace + * remapping option is enabled. */ public function setUsernsMode(?string $usernsMode): self { + $this->initialized['usernsMode'] = true; $this->usernsMode = $usernsMode; return $this; @@ -1974,8 +2185,6 @@ public function setUsernsMode(?string $usernsMode): self /** * Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. - * - * @return int */ public function getShmSize(): ?int { @@ -1984,37 +2193,43 @@ public function getShmSize(): ?int /** * Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. - * - * @param int $shmSize - * - * @return self */ public function setShmSize(?int $shmSize): self { + $this->initialized['shmSize'] = true; $this->shmSize = $shmSize; return $this; } /** - * A list of kernel parameters (sysctls) to set in the container. For example: `{"net.ipv4.ip_forward": "1"}`. + * A list of kernel parameters (sysctls) to set in the container. + * For example: * - * @return string[] + * ``` + * {"net.ipv4.ip_forward": "1"} + * ``` + * + * @return array|null */ - public function getSysctls(): ?\ArrayObject + public function getSysctls(): ?iterable { return $this->sysctls; } /** - * A list of kernel parameters (sysctls) to set in the container. For example: `{"net.ipv4.ip_forward": "1"}`. + * A list of kernel parameters (sysctls) to set in the container. + * For example: * - * @param string[] $sysctls + * ``` + * {"net.ipv4.ip_forward": "1"} + * ``` * - * @return self + * @param array|null $sysctls */ - public function setSysctls(?\ArrayObject $sysctls): self + public function setSysctls(?iterable $sysctls): self { + $this->initialized['sysctls'] = true; $this->sysctls = $sysctls; return $this; @@ -2022,8 +2237,6 @@ public function setSysctls(?\ArrayObject $sysctls): self /** * Runtime to use with this container. - * - * @return string */ public function getRuntime(): ?string { @@ -2032,62 +2245,80 @@ public function getRuntime(): ?string /** * Runtime to use with this container. - * - * @param string $runtime - * - * @return self */ public function setRuntime(?string $runtime): self { + $this->initialized['runtime'] = true; $this->runtime = $runtime; return $this; } /** - * Initial console size, as an `[height, width]` array. (Windows only). - * - * @return int[] + * Isolation technology of the container. (Windows only). */ - public function getConsoleSize(): ?array + public function getIsolation(): ?string { - return $this->consoleSize; + return $this->isolation; } /** - * Initial console size, as an `[height, width]` array. (Windows only). + * Isolation technology of the container. (Windows only). + */ + public function setIsolation(?string $isolation): self + { + $this->initialized['isolation'] = true; + $this->isolation = $isolation; + + return $this; + } + + /** + * The list of paths to be masked inside the container (this overrides + * the default set of paths). * - * @param int[] $consoleSize + * @return list|null + */ + public function getMaskedPaths(): ?array + { + return $this->maskedPaths; + } + + /** + * The list of paths to be masked inside the container (this overrides + * the default set of paths). * - * @return self + * @param list|null $maskedPaths */ - public function setConsoleSize(?array $consoleSize): self + public function setMaskedPaths(?array $maskedPaths): self { - $this->consoleSize = $consoleSize; + $this->initialized['maskedPaths'] = true; + $this->maskedPaths = $maskedPaths; return $this; } /** - * Isolation technology of the container. (Windows only). + * The list of paths to be set as read-only inside the container + * (this overrides the default set of paths). * - * @return string + * @return list|null */ - public function getIsolation(): ?string + public function getReadonlyPaths(): ?array { - return $this->isolation; + return $this->readonlyPaths; } /** - * Isolation technology of the container. (Windows only). - * - * @param string $isolation + * The list of paths to be set as read-only inside the container + * (this overrides the default set of paths). * - * @return self + * @param list|null $readonlyPaths */ - public function setIsolation(?string $isolation): self + public function setReadonlyPaths(?array $readonlyPaths): self { - $this->isolation = $isolation; + $this->initialized['readonlyPaths'] = true; + $this->readonlyPaths = $readonlyPaths; return $this; } diff --git a/src/Model/HostConfigLogConfig.php b/src/Model/HostConfigLogConfig.php index bf5a5951..c6ac50df 100644 --- a/src/Model/HostConfigLogConfig.php +++ b/src/Model/HostConfigLogConfig.php @@ -2,60 +2,55 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class HostConfigLogConfig +class HostConfigLogConfig extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $type; /** - * @var string[] + * @var array|null */ protected $config; - /** - * @return string - */ public function getType(): ?string { return $this->type; } - /** - * @param string $type - * - * @return self - */ public function setType(?string $type): self { + $this->initialized['type'] = true; $this->type = $type; return $this; } /** - * @return string[] + * @return array|null */ - public function getConfig(): ?\ArrayObject + public function getConfig(): ?iterable { return $this->config; } /** - * @param string[] $config - * - * @return self + * @param array|null $config */ - public function setConfig(?\ArrayObject $config): self + public function setConfig(?iterable $config): self { + $this->initialized['config'] = true; $this->config = $config; return $this; diff --git a/src/Model/IPAM.php b/src/Model/IPAM.php index 16748ff1..668daa2b 100644 --- a/src/Model/IPAM.php +++ b/src/Model/IPAM.php @@ -2,39 +2,44 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class IPAM +class IPAM extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Name of the IPAM driver to use. * - * @var string + * @var string|null */ - protected $driver; + protected $driver = 'default'; /** - * List of IPAM configuration options, specified as a map: `{"Subnet": , "IPRange": , "Gateway": , "AuxAddress": }`. + * List of IPAM configuration options, specified as a map: * - * @var string[][] + * ``` + * {"Subnet": , "IPRange": , "Gateway": , "AuxAddress": } + * ``` + * + * @var list|null */ protected $config; /** * Driver-specific options, specified as a map. * - * @var string[][] + * @var array|null */ protected $options; /** * Name of the IPAM driver to use. - * - * @return string */ public function getDriver(): ?string { @@ -43,22 +48,23 @@ public function getDriver(): ?string /** * Name of the IPAM driver to use. - * - * @param string $driver - * - * @return self */ public function setDriver(?string $driver): self { + $this->initialized['driver'] = true; $this->driver = $driver; return $this; } /** - * List of IPAM configuration options, specified as a map: `{"Subnet": , "IPRange": , "Gateway": , "AuxAddress": }`. + * List of IPAM configuration options, specified as a map: + * + * ``` + * {"Subnet": , "IPRange": , "Gateway": , "AuxAddress": } + * ``` * - * @return string[][] + * @return list|null */ public function getConfig(): ?array { @@ -66,14 +72,17 @@ public function getConfig(): ?array } /** - * List of IPAM configuration options, specified as a map: `{"Subnet": , "IPRange": , "Gateway": , "AuxAddress": }`. + * List of IPAM configuration options, specified as a map: * - * @param string[][] $config + * ``` + * {"Subnet": , "IPRange": , "Gateway": , "AuxAddress": } + * ``` * - * @return self + * @param list|null $config */ public function setConfig(?array $config): self { + $this->initialized['config'] = true; $this->config = $config; return $this; @@ -82,9 +91,9 @@ public function setConfig(?array $config): self /** * Driver-specific options, specified as a map. * - * @return string[][] + * @return array|null */ - public function getOptions(): ?array + public function getOptions(): ?iterable { return $this->options; } @@ -92,12 +101,11 @@ public function getOptions(): ?array /** * Driver-specific options, specified as a map. * - * @param string[][] $options - * - * @return self + * @param array|null $options */ - public function setOptions(?array $options): self + public function setOptions(?iterable $options): self { + $this->initialized['options'] = true; $this->options = $options; return $this; diff --git a/src/Model/IPAMConfig.php b/src/Model/IPAMConfig.php new file mode 100644 index 00000000..f231a366 --- /dev/null +++ b/src/Model/IPAMConfig.php @@ -0,0 +1,92 @@ +initialized); + } + /** + * @var string|null + */ + protected $subnet; + /** + * @var string|null + */ + protected $iPRange; + /** + * @var string|null + */ + protected $gateway; + /** + * @var array|null + */ + protected $auxiliaryAddresses; + + public function getSubnet(): ?string + { + return $this->subnet; + } + + public function setSubnet(?string $subnet): self + { + $this->initialized['subnet'] = true; + $this->subnet = $subnet; + + return $this; + } + + public function getIPRange(): ?string + { + return $this->iPRange; + } + + public function setIPRange(?string $iPRange): self + { + $this->initialized['iPRange'] = true; + $this->iPRange = $iPRange; + + return $this; + } + + public function getGateway(): ?string + { + return $this->gateway; + } + + public function setGateway(?string $gateway): self + { + $this->initialized['gateway'] = true; + $this->gateway = $gateway; + + return $this; + } + + /** + * @return array|null + */ + public function getAuxiliaryAddresses(): ?iterable + { + return $this->auxiliaryAddresses; + } + + /** + * @param array|null $auxiliaryAddresses + */ + public function setAuxiliaryAddresses(?iterable $auxiliaryAddresses): self + { + $this->initialized['auxiliaryAddresses'] = true; + $this->auxiliaryAddresses = $auxiliaryAddresses; + + return $this; + } +} diff --git a/src/Model/IdResponse.php b/src/Model/IdResponse.php index 776c0fd5..6abf667c 100644 --- a/src/Model/IdResponse.php +++ b/src/Model/IdResponse.php @@ -2,27 +2,28 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class IdResponse +class IdResponse extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The id of the newly created object. * - * @var string + * @var string|null */ protected $id; /** * The id of the newly created object. - * - * @return string */ public function getId(): ?string { @@ -31,13 +32,10 @@ public function getId(): ?string /** * The id of the newly created object. - * - * @param string $id - * - * @return self */ public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; diff --git a/src/Model/Image.php b/src/Model/Image.php deleted file mode 100644 index 56385858..00000000 --- a/src/Model/Image.php +++ /dev/null @@ -1,489 +0,0 @@ -id; - } - - /** - * @param string $id - * - * @return self - */ - public function setId(?string $id): self - { - $this->id = $id; - - return $this; - } - - /** - * @return string[] - */ - public function getRepoTags(): ?array - { - return $this->repoTags; - } - - /** - * @param string[] $repoTags - * - * @return self - */ - public function setRepoTags(?array $repoTags): self - { - $this->repoTags = $repoTags; - - return $this; - } - - /** - * @return string[] - */ - public function getRepoDigests(): ?array - { - return $this->repoDigests; - } - - /** - * @param string[] $repoDigests - * - * @return self - */ - public function setRepoDigests(?array $repoDigests): self - { - $this->repoDigests = $repoDigests; - - return $this; - } - - /** - * @return string - */ - public function getParent(): ?string - { - return $this->parent; - } - - /** - * @param string $parent - * - * @return self - */ - public function setParent(?string $parent): self - { - $this->parent = $parent; - - return $this; - } - - /** - * @return string - */ - public function getComment(): ?string - { - return $this->comment; - } - - /** - * @param string $comment - * - * @return self - */ - public function setComment(?string $comment): self - { - $this->comment = $comment; - - return $this; - } - - /** - * @return string - */ - public function getCreated(): ?string - { - return $this->created; - } - - /** - * @param string $created - * - * @return self - */ - public function setCreated(?string $created): self - { - $this->created = $created; - - return $this; - } - - /** - * @return string - */ - public function getContainer(): ?string - { - return $this->container; - } - - /** - * @param string $container - * - * @return self - */ - public function setContainer(?string $container): self - { - $this->container = $container; - - return $this; - } - - /** - * Configuration for a container that is portable between hosts. - * - * @return ContainerConfig - */ - public function getContainerConfig(): ?ContainerConfig - { - return $this->containerConfig; - } - - /** - * Configuration for a container that is portable between hosts. - * - * @param ContainerConfig $containerConfig - * - * @return self - */ - public function setContainerConfig(?ContainerConfig $containerConfig): self - { - $this->containerConfig = $containerConfig; - - return $this; - } - - /** - * @return string - */ - public function getDockerVersion(): ?string - { - return $this->dockerVersion; - } - - /** - * @param string $dockerVersion - * - * @return self - */ - public function setDockerVersion(?string $dockerVersion): self - { - $this->dockerVersion = $dockerVersion; - - return $this; - } - - /** - * @return string - */ - public function getAuthor(): ?string - { - return $this->author; - } - - /** - * @param string $author - * - * @return self - */ - public function setAuthor(?string $author): self - { - $this->author = $author; - - return $this; - } - - /** - * Configuration for a container that is portable between hosts. - * - * @return ContainerConfig - */ - public function getConfig(): ?ContainerConfig - { - return $this->config; - } - - /** - * Configuration for a container that is portable between hosts. - * - * @param ContainerConfig $config - * - * @return self - */ - public function setConfig(?ContainerConfig $config): self - { - $this->config = $config; - - return $this; - } - - /** - * @return string - */ - public function getArchitecture(): ?string - { - return $this->architecture; - } - - /** - * @param string $architecture - * - * @return self - */ - public function setArchitecture(?string $architecture): self - { - $this->architecture = $architecture; - - return $this; - } - - /** - * @return string - */ - public function getOs(): ?string - { - return $this->os; - } - - /** - * @param string $os - * - * @return self - */ - public function setOs(?string $os): self - { - $this->os = $os; - - return $this; - } - - /** - * @return string - */ - public function getOsVersion(): ?string - { - return $this->osVersion; - } - - /** - * @param string $osVersion - * - * @return self - */ - public function setOsVersion(?string $osVersion): self - { - $this->osVersion = $osVersion; - - return $this; - } - - /** - * @return int - */ - public function getSize(): ?int - { - return $this->size; - } - - /** - * @param int $size - * - * @return self - */ - public function setSize(?int $size): self - { - $this->size = $size; - - return $this; - } - - /** - * @return int - */ - public function getVirtualSize(): ?int - { - return $this->virtualSize; - } - - /** - * @param int $virtualSize - * - * @return self - */ - public function setVirtualSize(?int $virtualSize): self - { - $this->virtualSize = $virtualSize; - - return $this; - } - - /** - * Information about a container's graph driver. - * - * @return GraphDriverData - */ - public function getGraphDriver(): ?GraphDriverData - { - return $this->graphDriver; - } - - /** - * Information about a container's graph driver. - * - * @param GraphDriverData $graphDriver - * - * @return self - */ - public function setGraphDriver(?GraphDriverData $graphDriver): self - { - $this->graphDriver = $graphDriver; - - return $this; - } - - /** - * @return ImageRootFS - */ - public function getRootFS(): ?ImageRootFS - { - return $this->rootFS; - } - - /** - * @param ImageRootFS $rootFS - * - * @return self - */ - public function setRootFS(?ImageRootFS $rootFS): self - { - $this->rootFS = $rootFS; - - return $this; - } - - /** - * @return ImageMetadata - */ - public function getMetadata(): ?ImageMetadata - { - return $this->metadata; - } - - /** - * @param ImageMetadata $metadata - * - * @return self - */ - public function setMetadata(?ImageMetadata $metadata): self - { - $this->metadata = $metadata; - - return $this; - } -} diff --git a/src/Model/ImageDeleteResponseItem.php b/src/Model/ImageDeleteResponseItem.php index 2ef278d1..14542514 100644 --- a/src/Model/ImageDeleteResponseItem.php +++ b/src/Model/ImageDeleteResponseItem.php @@ -2,33 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ImageDeleteResponseItem +class ImageDeleteResponseItem extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The image ID of an image that was untagged. * - * @var string + * @var string|null */ protected $untagged; /** * The image ID of an image that was deleted. * - * @var string + * @var string|null */ protected $deleted; /** * The image ID of an image that was untagged. - * - * @return string */ public function getUntagged(): ?string { @@ -37,13 +38,10 @@ public function getUntagged(): ?string /** * The image ID of an image that was untagged. - * - * @param string $untagged - * - * @return self */ public function setUntagged(?string $untagged): self { + $this->initialized['untagged'] = true; $this->untagged = $untagged; return $this; @@ -51,8 +49,6 @@ public function setUntagged(?string $untagged): self /** * The image ID of an image that was deleted. - * - * @return string */ public function getDeleted(): ?string { @@ -61,13 +57,10 @@ public function getDeleted(): ?string /** * The image ID of an image that was deleted. - * - * @param string $deleted - * - * @return self */ public function setDeleted(?string $deleted): self { + $this->initialized['deleted'] = true; $this->deleted = $deleted; return $this; diff --git a/src/Model/ImageID.php b/src/Model/ImageID.php index c398e6d5..21c4511c 100644 --- a/src/Model/ImageID.php +++ b/src/Model/ImageID.php @@ -2,36 +2,32 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ImageID +class ImageID extends \ArrayObject { /** - * @var string + * @var array */ - protected $iD; + protected $initialized = []; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** - * @return string + * @var string|null */ + protected $iD; + public function getID(): ?string { return $this->iD; } - /** - * @param string $iD - * - * @return self - */ public function setID(?string $iD): self { + $this->initialized['iD'] = true; $this->iD = $iD; return $this; diff --git a/src/Model/ImageInspect.php b/src/Model/ImageInspect.php new file mode 100644 index 00000000..ad16df12 --- /dev/null +++ b/src/Model/ImageInspect.php @@ -0,0 +1,685 @@ +initialized); + } + /** + * ID is the content-addressable ID of an image. + * + * This identifier is a content-addressable digest calculated from the + * image's configuration (which includes the digests of layers used by + * the image). + * + * Note that this digest differs from the `RepoDigests` below, which + * holds digests of image manifests that reference the image. + * + * @var string|null + */ + protected $id; + /** + * List of image names/tags in the local image cache that reference this + * image. + * + * Multiple image tags can refer to the same image, and this list may be + * empty if no tags reference the image, in which case the image is + * "untagged", in which case it can still be referenced by its ID. + * + * @var list|null + */ + protected $repoTags; + /** + * List of content-addressable digests of locally available image manifests + * that the image is referenced from. Multiple manifests can refer to the + * same image. + * + * These digests are usually only available if the image was either pulled + * from a registry, or if the image was pushed to a registry, which is when + * the manifest is generated and its digest calculated. + * + * @var list|null + */ + protected $repoDigests; + /** + * ID of the parent image. + * + * Depending on how the image was created, this field may be empty and + * is only set for images that were built/created locally. This field + * is empty if the image was pulled from an image registry. + * + * @var string|null + */ + protected $parent; + /** + * Optional message that was set when committing or importing the image. + * + * @var string|null + */ + protected $comment; + /** + * Date and time at which the image was created, formatted in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + * + * This information is only available if present in the image, + * and omitted otherwise. + * + * @var string|null + */ + protected $created; + /** + * The ID of the container that was used to create the image. + * + * Depending on how the image was created, this field may be empty. + * + **Deprecated**: this field is kept for backward compatibility, but + * will be removed in API v1.45. + * + * @var string|null + */ + protected $container; + /** + * Configuration for a container that is portable between hosts. + * + * When used as `ContainerConfig` field in an image, `ContainerConfig` is an + * optional field containing the configuration of the container that was last + * committed when creating the image. + * + * Previous versions of Docker builder used this field to store build cache, + * and it is not in active use anymore. + * + * @var ContainerConfig|null + */ + protected $containerConfig; + /** + * The version of Docker that was used to build the image. + * + * Depending on how the image was created, this field may be empty. + * + * @var string|null + */ + protected $dockerVersion; + /** + * Name of the author that was specified when committing the image, or as + * specified through MAINTAINER (deprecated) in the Dockerfile. + * + * @var string|null + */ + protected $author; + /** + * Configuration for a container that is portable between hosts. + * + * When used as `ContainerConfig` field in an image, `ContainerConfig` is an + * optional field containing the configuration of the container that was last + * committed when creating the image. + * + * Previous versions of Docker builder used this field to store build cache, + * and it is not in active use anymore. + * + * @var ContainerConfig|null + */ + protected $config; + /** + * Hardware CPU architecture that the image runs on. + * + * @var string|null + */ + protected $architecture; + /** + * CPU architecture variant (presently ARM-only). + * + * @var string|null + */ + protected $variant; + /** + * Operating System the image is built to run on. + * + * @var string|null + */ + protected $os; + /** + * Operating System version the image is built to run on (especially + * for Windows). + * + * @var string|null + */ + protected $osVersion; + /** + * Total size of the image including all layers it is composed of. + * + * @var int|null + */ + protected $size; + /** + * Total size of the image including all layers it is composed of. + * + * Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. + * + * @var int|null + */ + protected $virtualSize; + /** + * Information about the storage driver used to store the container's and + * image's filesystem. + * + * @var GraphDriverData|null + */ + protected $graphDriver; + /** + * Information about the image's RootFS, including the layer IDs. + * + * @var ImageInspectRootFS|null + */ + protected $rootFS; + /** + * Additional metadata of the image in the local cache. This information + * is local to the daemon, and not part of the image itself. + * + * @var ImageInspectMetadata|null + */ + protected $metadata; + + /** + * ID is the content-addressable ID of an image. + * + * This identifier is a content-addressable digest calculated from the + * image's configuration (which includes the digests of layers used by + * the image). + * + * Note that this digest differs from the `RepoDigests` below, which + * holds digests of image manifests that reference the image. + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * ID is the content-addressable ID of an image. + * + * This identifier is a content-addressable digest calculated from the + * image's configuration (which includes the digests of layers used by + * the image). + * + * Note that this digest differs from the `RepoDigests` below, which + * holds digests of image manifests that reference the image. + */ + public function setId(?string $id): self + { + $this->initialized['id'] = true; + $this->id = $id; + + return $this; + } + + /** + * List of image names/tags in the local image cache that reference this + * image. + * + * Multiple image tags can refer to the same image, and this list may be + * empty if no tags reference the image, in which case the image is + * "untagged", in which case it can still be referenced by its ID. + * + * @return list|null + */ + public function getRepoTags(): ?array + { + return $this->repoTags; + } + + /** + * List of image names/tags in the local image cache that reference this + * image. + * + * Multiple image tags can refer to the same image, and this list may be + * empty if no tags reference the image, in which case the image is + * "untagged", in which case it can still be referenced by its ID. + * + * @param list|null $repoTags + */ + public function setRepoTags(?array $repoTags): self + { + $this->initialized['repoTags'] = true; + $this->repoTags = $repoTags; + + return $this; + } + + /** + * List of content-addressable digests of locally available image manifests + * that the image is referenced from. Multiple manifests can refer to the + * same image. + * + * These digests are usually only available if the image was either pulled + * from a registry, or if the image was pushed to a registry, which is when + * the manifest is generated and its digest calculated. + * + * @return list|null + */ + public function getRepoDigests(): ?array + { + return $this->repoDigests; + } + + /** + * List of content-addressable digests of locally available image manifests + * that the image is referenced from. Multiple manifests can refer to the + * same image. + * + * These digests are usually only available if the image was either pulled + * from a registry, or if the image was pushed to a registry, which is when + * the manifest is generated and its digest calculated. + * + * @param list|null $repoDigests + */ + public function setRepoDigests(?array $repoDigests): self + { + $this->initialized['repoDigests'] = true; + $this->repoDigests = $repoDigests; + + return $this; + } + + /** + * ID of the parent image. + * + * Depending on how the image was created, this field may be empty and + * is only set for images that were built/created locally. This field + * is empty if the image was pulled from an image registry. + */ + public function getParent(): ?string + { + return $this->parent; + } + + /** + * ID of the parent image. + * + * Depending on how the image was created, this field may be empty and + * is only set for images that were built/created locally. This field + * is empty if the image was pulled from an image registry. + */ + public function setParent(?string $parent): self + { + $this->initialized['parent'] = true; + $this->parent = $parent; + + return $this; + } + + /** + * Optional message that was set when committing or importing the image. + */ + public function getComment(): ?string + { + return $this->comment; + } + + /** + * Optional message that was set when committing or importing the image. + */ + public function setComment(?string $comment): self + { + $this->initialized['comment'] = true; + $this->comment = $comment; + + return $this; + } + + /** + * Date and time at which the image was created, formatted in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + * + * This information is only available if present in the image, + * and omitted otherwise. + */ + public function getCreated(): ?string + { + return $this->created; + } + + /** + * Date and time at which the image was created, formatted in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + * + * This information is only available if present in the image, + * and omitted otherwise. + */ + public function setCreated(?string $created): self + { + $this->initialized['created'] = true; + $this->created = $created; + + return $this; + } + + /** + * The ID of the container that was used to create the image. + * + * Depending on how the image was created, this field may be empty. + * + **Deprecated**: this field is kept for backward compatibility, but + * will be removed in API v1.45. + */ + public function getContainer(): ?string + { + return $this->container; + } + + /** + * The ID of the container that was used to create the image. + * + * Depending on how the image was created, this field may be empty. + * + **Deprecated**: this field is kept for backward compatibility, but + * will be removed in API v1.45. + */ + public function setContainer(?string $container): self + { + $this->initialized['container'] = true; + $this->container = $container; + + return $this; + } + + /** + * Configuration for a container that is portable between hosts. + * + * When used as `ContainerConfig` field in an image, `ContainerConfig` is an + * optional field containing the configuration of the container that was last + * committed when creating the image. + * + * Previous versions of Docker builder used this field to store build cache, + * and it is not in active use anymore. + */ + public function getContainerConfig(): ?ContainerConfig + { + return $this->containerConfig; + } + + /** + * Configuration for a container that is portable between hosts. + * + * When used as `ContainerConfig` field in an image, `ContainerConfig` is an + * optional field containing the configuration of the container that was last + * committed when creating the image. + * + * Previous versions of Docker builder used this field to store build cache, + * and it is not in active use anymore. + */ + public function setContainerConfig(?ContainerConfig $containerConfig): self + { + $this->initialized['containerConfig'] = true; + $this->containerConfig = $containerConfig; + + return $this; + } + + /** + * The version of Docker that was used to build the image. + * + * Depending on how the image was created, this field may be empty. + */ + public function getDockerVersion(): ?string + { + return $this->dockerVersion; + } + + /** + * The version of Docker that was used to build the image. + * + * Depending on how the image was created, this field may be empty. + */ + public function setDockerVersion(?string $dockerVersion): self + { + $this->initialized['dockerVersion'] = true; + $this->dockerVersion = $dockerVersion; + + return $this; + } + + /** + * Name of the author that was specified when committing the image, or as + * specified through MAINTAINER (deprecated) in the Dockerfile. + */ + public function getAuthor(): ?string + { + return $this->author; + } + + /** + * Name of the author that was specified when committing the image, or as + * specified through MAINTAINER (deprecated) in the Dockerfile. + */ + public function setAuthor(?string $author): self + { + $this->initialized['author'] = true; + $this->author = $author; + + return $this; + } + + /** + * Configuration for a container that is portable between hosts. + * + * When used as `ContainerConfig` field in an image, `ContainerConfig` is an + * optional field containing the configuration of the container that was last + * committed when creating the image. + * + * Previous versions of Docker builder used this field to store build cache, + * and it is not in active use anymore. + */ + public function getConfig(): ?ContainerConfig + { + return $this->config; + } + + /** + * Configuration for a container that is portable between hosts. + * + * When used as `ContainerConfig` field in an image, `ContainerConfig` is an + * optional field containing the configuration of the container that was last + * committed when creating the image. + * + * Previous versions of Docker builder used this field to store build cache, + * and it is not in active use anymore. + */ + public function setConfig(?ContainerConfig $config): self + { + $this->initialized['config'] = true; + $this->config = $config; + + return $this; + } + + /** + * Hardware CPU architecture that the image runs on. + */ + public function getArchitecture(): ?string + { + return $this->architecture; + } + + /** + * Hardware CPU architecture that the image runs on. + */ + public function setArchitecture(?string $architecture): self + { + $this->initialized['architecture'] = true; + $this->architecture = $architecture; + + return $this; + } + + /** + * CPU architecture variant (presently ARM-only). + */ + public function getVariant(): ?string + { + return $this->variant; + } + + /** + * CPU architecture variant (presently ARM-only). + */ + public function setVariant(?string $variant): self + { + $this->initialized['variant'] = true; + $this->variant = $variant; + + return $this; + } + + /** + * Operating System the image is built to run on. + */ + public function getOs(): ?string + { + return $this->os; + } + + /** + * Operating System the image is built to run on. + */ + public function setOs(?string $os): self + { + $this->initialized['os'] = true; + $this->os = $os; + + return $this; + } + + /** + * Operating System version the image is built to run on (especially + * for Windows). + */ + public function getOsVersion(): ?string + { + return $this->osVersion; + } + + /** + * Operating System version the image is built to run on (especially + * for Windows). + */ + public function setOsVersion(?string $osVersion): self + { + $this->initialized['osVersion'] = true; + $this->osVersion = $osVersion; + + return $this; + } + + /** + * Total size of the image including all layers it is composed of. + */ + public function getSize(): ?int + { + return $this->size; + } + + /** + * Total size of the image including all layers it is composed of. + */ + public function setSize(?int $size): self + { + $this->initialized['size'] = true; + $this->size = $size; + + return $this; + } + + /** + * Total size of the image including all layers it is composed of. + * + * Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. + */ + public function getVirtualSize(): ?int + { + return $this->virtualSize; + } + + /** + * Total size of the image including all layers it is composed of. + * + * Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. + */ + public function setVirtualSize(?int $virtualSize): self + { + $this->initialized['virtualSize'] = true; + $this->virtualSize = $virtualSize; + + return $this; + } + + /** + * Information about the storage driver used to store the container's and + * image's filesystem. + */ + public function getGraphDriver(): ?GraphDriverData + { + return $this->graphDriver; + } + + /** + * Information about the storage driver used to store the container's and + * image's filesystem. + */ + public function setGraphDriver(?GraphDriverData $graphDriver): self + { + $this->initialized['graphDriver'] = true; + $this->graphDriver = $graphDriver; + + return $this; + } + + /** + * Information about the image's RootFS, including the layer IDs. + */ + public function getRootFS(): ?ImageInspectRootFS + { + return $this->rootFS; + } + + /** + * Information about the image's RootFS, including the layer IDs. + */ + public function setRootFS(?ImageInspectRootFS $rootFS): self + { + $this->initialized['rootFS'] = true; + $this->rootFS = $rootFS; + + return $this; + } + + /** + * Additional metadata of the image in the local cache. This information + * is local to the daemon, and not part of the image itself. + */ + public function getMetadata(): ?ImageInspectMetadata + { + return $this->metadata; + } + + /** + * Additional metadata of the image in the local cache. This information + * is local to the daemon, and not part of the image itself. + */ + public function setMetadata(?ImageInspectMetadata $metadata): self + { + $this->initialized['metadata'] = true; + $this->metadata = $metadata; + + return $this; + } +} diff --git a/src/Model/ImageInspectMetadata.php b/src/Model/ImageInspectMetadata.php new file mode 100644 index 00000000..a448fa4d --- /dev/null +++ b/src/Model/ImageInspectMetadata.php @@ -0,0 +1,55 @@ +initialized); + } + /** + * Date and time at which the image was last tagged in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + * + * This information is only available if the image was tagged locally, + * and omitted otherwise. + * + * @var string|null + */ + protected $lastTagTime; + + /** + * Date and time at which the image was last tagged in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + * + * This information is only available if the image was tagged locally, + * and omitted otherwise. + */ + public function getLastTagTime(): ?string + { + return $this->lastTagTime; + } + + /** + * Date and time at which the image was last tagged in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + * + * This information is only available if the image was tagged locally, + * and omitted otherwise. + */ + public function setLastTagTime(?string $lastTagTime): self + { + $this->initialized['lastTagTime'] = true; + $this->lastTagTime = $lastTagTime; + + return $this; + } +} diff --git a/src/Model/ImageInspectRootFS.php b/src/Model/ImageInspectRootFS.php new file mode 100644 index 00000000..9ba242a5 --- /dev/null +++ b/src/Model/ImageInspectRootFS.php @@ -0,0 +1,58 @@ +initialized); + } + /** + * @var string|null + */ + protected $type; + /** + * @var list|null + */ + protected $layers; + + public function getType(): ?string + { + return $this->type; + } + + public function setType(?string $type): self + { + $this->initialized['type'] = true; + $this->type = $type; + + return $this; + } + + /** + * @return list|null + */ + public function getLayers(): ?array + { + return $this->layers; + } + + /** + * @param list|null $layers + */ + public function setLayers(?array $layers): self + { + $this->initialized['layers'] = true; + $this->layers = $layers; + + return $this; + } +} diff --git a/src/Model/ImageMetadata.php b/src/Model/ImageMetadata.php deleted file mode 100644 index 755df0a0..00000000 --- a/src/Model/ImageMetadata.php +++ /dev/null @@ -1,39 +0,0 @@ -lastTagTime; - } - - /** - * @param string $lastTagTime - * - * @return self - */ - public function setLastTagTime(?string $lastTagTime): self - { - $this->lastTagTime = $lastTagTime; - - return $this; - } -} diff --git a/src/Model/ImageRootFS.php b/src/Model/ImageRootFS.php deleted file mode 100644 index 99e1d618..00000000 --- a/src/Model/ImageRootFS.php +++ /dev/null @@ -1,87 +0,0 @@ -type; - } - - /** - * @param string $type - * - * @return self - */ - public function setType(?string $type): self - { - $this->type = $type; - - return $this; - } - - /** - * @return string[] - */ - public function getLayers(): ?array - { - return $this->layers; - } - - /** - * @param string[] $layers - * - * @return self - */ - public function setLayers(?array $layers): self - { - $this->layers = $layers; - - return $this; - } - - /** - * @return string - */ - public function getBaseLayer(): ?string - { - return $this->baseLayer; - } - - /** - * @param string $baseLayer - * - * @return self - */ - public function setBaseLayer(?string $baseLayer): self - { - $this->baseLayer = $baseLayer; - - return $this; - } -} diff --git a/src/Model/ImageSummary.php b/src/Model/ImageSummary.php index 12cba8db..210712c1 100644 --- a/src/Model/ImageSummary.php +++ b/src/Model/ImageSummary.php @@ -2,59 +2,122 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ImageSummary +class ImageSummary extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * ID is the content-addressable ID of an image. + * + * This identifier is a content-addressable digest calculated from the + * image's configuration (which includes the digests of layers used by + * the image). + * + * Note that this digest differs from the `RepoDigests` below, which + * holds digests of image manifests that reference the image. + * + * @var string|null */ protected $id; /** - * @var string + * ID of the parent image. + * + * Depending on how the image was created, this field may be empty and + * is only set for images that were built/created locally. This field + * is empty if the image was pulled from an image registry. + * + * @var string|null */ protected $parentId; /** - * @var string[] + * List of image names/tags in the local image cache that reference this + * image. + * + * Multiple image tags can refer to the same image, and this list may be + * empty if no tags reference the image, in which case the image is + * "untagged", in which case it can still be referenced by its ID. + * + * @var list|null */ protected $repoTags; /** - * @var string[] + * List of content-addressable digests of locally available image manifests + * that the image is referenced from. Multiple manifests can refer to the + * same image. + * + * These digests are usually only available if the image was either pulled + * from a registry, or if the image was pushed to a registry, which is when + * the manifest is generated and its digest calculated. + * + * @var list|null */ protected $repoDigests; /** - * @var int + * Date and time at which the image was created as a Unix timestamp + * (number of seconds sinds EPOCH). + * + * @var int|null */ protected $created; /** - * @var int + * Total size of the image including all layers it is composed of. + * + * @var int|null */ protected $size; /** - * @var int + * Total size of image layers that are shared between this image and other + * images. + * + * This size is not calculated by default. `-1` indicates that the value + * has not been set / calculated. + * + * @var int|null */ protected $sharedSize; /** - * @var int + * Total size of the image including all layers it is composed of. + * + * Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. + * + * @var int|null */ protected $virtualSize; /** - * @var string[] + * User-defined key/value metadata. + * + * @var array|null */ protected $labels; /** - * @var int + * Number of containers using this image. Includes both stopped and running + * containers. + * + * This size is not calculated by default, and depends on which API endpoint + * is used. `-1` indicates that the value has not been set / calculated. + * + * @var int|null */ protected $containers; /** - * @return string + * ID is the content-addressable ID of an image. + * + * This identifier is a content-addressable digest calculated from the + * image's configuration (which includes the digests of layers used by + * the image). + * + * Note that this digest differs from the `RepoDigests` below, which + * holds digests of image manifests that reference the image. */ public function getId(): ?string { @@ -62,19 +125,29 @@ public function getId(): ?string } /** - * @param string $id + * ID is the content-addressable ID of an image. + * + * This identifier is a content-addressable digest calculated from the + * image's configuration (which includes the digests of layers used by + * the image). * - * @return self + * Note that this digest differs from the `RepoDigests` below, which + * holds digests of image manifests that reference the image. */ public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; } /** - * @return string + * ID of the parent image. + * + * Depending on how the image was created, this field may be empty and + * is only set for images that were built/created locally. This field + * is empty if the image was pulled from an image registry. */ public function getParentId(): ?string { @@ -82,19 +155,29 @@ public function getParentId(): ?string } /** - * @param string $parentId + * ID of the parent image. * - * @return self + * Depending on how the image was created, this field may be empty and + * is only set for images that were built/created locally. This field + * is empty if the image was pulled from an image registry. */ public function setParentId(?string $parentId): self { + $this->initialized['parentId'] = true; $this->parentId = $parentId; return $this; } /** - * @return string[] + * List of image names/tags in the local image cache that reference this + * image. + * + * Multiple image tags can refer to the same image, and this list may be + * empty if no tags reference the image, in which case the image is + * "untagged", in which case it can still be referenced by its ID. + * + * @return list|null */ public function getRepoTags(): ?array { @@ -102,19 +185,33 @@ public function getRepoTags(): ?array } /** - * @param string[] $repoTags + * List of image names/tags in the local image cache that reference this + * image. * - * @return self + * Multiple image tags can refer to the same image, and this list may be + * empty if no tags reference the image, in which case the image is + * "untagged", in which case it can still be referenced by its ID. + * + * @param list|null $repoTags */ public function setRepoTags(?array $repoTags): self { + $this->initialized['repoTags'] = true; $this->repoTags = $repoTags; return $this; } /** - * @return string[] + * List of content-addressable digests of locally available image manifests + * that the image is referenced from. Multiple manifests can refer to the + * same image. + * + * These digests are usually only available if the image was either pulled + * from a registry, or if the image was pushed to a registry, which is when + * the manifest is generated and its digest calculated. + * + * @return list|null */ public function getRepoDigests(): ?array { @@ -122,19 +219,27 @@ public function getRepoDigests(): ?array } /** - * @param string[] $repoDigests + * List of content-addressable digests of locally available image manifests + * that the image is referenced from. Multiple manifests can refer to the + * same image. * - * @return self + * These digests are usually only available if the image was either pulled + * from a registry, or if the image was pushed to a registry, which is when + * the manifest is generated and its digest calculated. + * + * @param list|null $repoDigests */ public function setRepoDigests(?array $repoDigests): self { + $this->initialized['repoDigests'] = true; $this->repoDigests = $repoDigests; return $this; } /** - * @return int + * Date and time at which the image was created as a Unix timestamp + * (number of seconds sinds EPOCH). */ public function getCreated(): ?int { @@ -142,19 +247,19 @@ public function getCreated(): ?int } /** - * @param int $created - * - * @return self + * Date and time at which the image was created as a Unix timestamp + * (number of seconds sinds EPOCH). */ public function setCreated(?int $created): self { + $this->initialized['created'] = true; $this->created = $created; return $this; } /** - * @return int + * Total size of the image including all layers it is composed of. */ public function getSize(): ?int { @@ -162,19 +267,22 @@ public function getSize(): ?int } /** - * @param int $size - * - * @return self + * Total size of the image including all layers it is composed of. */ public function setSize(?int $size): self { + $this->initialized['size'] = true; $this->size = $size; return $this; } /** - * @return int + * Total size of image layers that are shared between this image and other + * images. + * + * This size is not calculated by default. `-1` indicates that the value + * has not been set / calculated. */ public function getSharedSize(): ?int { @@ -182,19 +290,24 @@ public function getSharedSize(): ?int } /** - * @param int $sharedSize + * Total size of image layers that are shared between this image and other + * images. * - * @return self + * This size is not calculated by default. `-1` indicates that the value + * has not been set / calculated. */ public function setSharedSize(?int $sharedSize): self { + $this->initialized['sharedSize'] = true; $this->sharedSize = $sharedSize; return $this; } /** - * @return int + * Total size of the image including all layers it is composed of. + * + * Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. */ public function getVirtualSize(): ?int { @@ -202,39 +315,47 @@ public function getVirtualSize(): ?int } /** - * @param int $virtualSize + * Total size of the image including all layers it is composed of. * - * @return self + * Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. */ public function setVirtualSize(?int $virtualSize): self { + $this->initialized['virtualSize'] = true; $this->virtualSize = $virtualSize; return $this; } /** - * @return string[] + * User-defined key/value metadata. + * + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } /** - * @param string[] $labels + * User-defined key/value metadata. * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; } /** - * @return int + * Number of containers using this image. Includes both stopped and running + * containers. + * + * This size is not calculated by default, and depends on which API endpoint + * is used. `-1` indicates that the value has not been set / calculated. */ public function getContainers(): ?int { @@ -242,12 +363,15 @@ public function getContainers(): ?int } /** - * @param int $containers + * Number of containers using this image. Includes both stopped and running + * containers. * - * @return self + * This size is not calculated by default, and depends on which API endpoint + * is used. `-1` indicates that the value has not been set / calculated. */ public function setContainers(?int $containers): self { + $this->initialized['containers'] = true; $this->containers = $containers; return $this; diff --git a/src/Model/ImagesNameHistoryGetResponse200Item.php b/src/Model/ImagesNameHistoryGetResponse200Item.php index 8da36732..3f35e45a 100644 --- a/src/Model/ImagesNameHistoryGetResponse200Item.php +++ b/src/Model/ImagesNameHistoryGetResponse200Item.php @@ -2,103 +2,85 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ImagesNameHistoryGetResponse200Item +class ImagesNameHistoryGetResponse200Item extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $id; /** - * @var int + * @var int|null */ protected $created; /** - * @var string + * @var string|null */ protected $createdBy; /** - * @var string[] + * @var list|null */ protected $tags; /** - * @var int + * @var int|null */ protected $size; /** - * @var string + * @var string|null */ protected $comment; - /** - * @return string - */ public function getId(): ?string { return $this->id; } - /** - * @param string $id - * - * @return self - */ public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; } - /** - * @return int - */ public function getCreated(): ?int { return $this->created; } - /** - * @param int $created - * - * @return self - */ public function setCreated(?int $created): self { + $this->initialized['created'] = true; $this->created = $created; return $this; } - /** - * @return string - */ public function getCreatedBy(): ?string { return $this->createdBy; } - /** - * @param string $createdBy - * - * @return self - */ public function setCreatedBy(?string $createdBy): self { + $this->initialized['createdBy'] = true; $this->createdBy = $createdBy; return $this; } /** - * @return string[] + * @return list|null */ public function getTags(): ?array { @@ -106,52 +88,37 @@ public function getTags(): ?array } /** - * @param string[] $tags - * - * @return self + * @param list|null $tags */ public function setTags(?array $tags): self { + $this->initialized['tags'] = true; $this->tags = $tags; return $this; } - /** - * @return int - */ public function getSize(): ?int { return $this->size; } - /** - * @param int $size - * - * @return self - */ public function setSize(?int $size): self { + $this->initialized['size'] = true; $this->size = $size; return $this; } - /** - * @return string - */ public function getComment(): ?string { return $this->comment; } - /** - * @param string $comment - * - * @return self - */ public function setComment(?string $comment): self { + $this->initialized['comment'] = true; $this->comment = $comment; return $this; diff --git a/src/Model/ImagesPrunePostResponse200.php b/src/Model/ImagesPrunePostResponse200.php index 2562781e..f936cc64 100644 --- a/src/Model/ImagesPrunePostResponse200.php +++ b/src/Model/ImagesPrunePostResponse200.php @@ -2,33 +2,36 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ImagesPrunePostResponse200 +class ImagesPrunePostResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Images that were deleted. * - * @var ImageDeleteResponseItem[] + * @var list|null */ protected $imagesDeleted; /** * Disk space reclaimed in bytes. * - * @var int + * @var int|null */ protected $spaceReclaimed; /** * Images that were deleted. * - * @return ImageDeleteResponseItem[] + * @return list|null */ public function getImagesDeleted(): ?array { @@ -38,12 +41,11 @@ public function getImagesDeleted(): ?array /** * Images that were deleted. * - * @param ImageDeleteResponseItem[] $imagesDeleted - * - * @return self + * @param list|null $imagesDeleted */ public function setImagesDeleted(?array $imagesDeleted): self { + $this->initialized['imagesDeleted'] = true; $this->imagesDeleted = $imagesDeleted; return $this; @@ -51,8 +53,6 @@ public function setImagesDeleted(?array $imagesDeleted): self /** * Disk space reclaimed in bytes. - * - * @return int */ public function getSpaceReclaimed(): ?int { @@ -61,13 +61,10 @@ public function getSpaceReclaimed(): ?int /** * Disk space reclaimed in bytes. - * - * @param int $spaceReclaimed - * - * @return self */ public function setSpaceReclaimed(?int $spaceReclaimed): self { + $this->initialized['spaceReclaimed'] = true; $this->spaceReclaimed = $spaceReclaimed; return $this; diff --git a/src/Model/ImagesSearchGetResponse200Item.php b/src/Model/ImagesSearchGetResponse200Item.php index 186076bc..e7cfd2c2 100644 --- a/src/Model/ImagesSearchGetResponse200Item.php +++ b/src/Model/ImagesSearchGetResponse200Item.php @@ -2,79 +2,78 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ImagesSearchGetResponse200Item +class ImagesSearchGetResponse200Item extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $description; /** - * @var bool + * @var bool|null */ protected $isOfficial; /** - * @var bool + * Whether this repository has automated builds enabled. + * + *


+ * + * > **Deprecated**: This field is deprecated and will always be "false". + * + * @var bool|null */ protected $isAutomated; /** - * @var string + * @var string|null */ protected $name; /** - * @var int + * @var int|null */ protected $starCount; - /** - * @return string - */ public function getDescription(): ?string { return $this->description; } - /** - * @param string $description - * - * @return self - */ public function setDescription(?string $description): self { + $this->initialized['description'] = true; $this->description = $description; return $this; } - /** - * @return bool - */ public function getIsOfficial(): ?bool { return $this->isOfficial; } - /** - * @param bool $isOfficial - * - * @return self - */ public function setIsOfficial(?bool $isOfficial): self { + $this->initialized['isOfficial'] = true; $this->isOfficial = $isOfficial; return $this; } /** - * @return bool + * Whether this repository has automated builds enabled. + * + *


+ * + * > **Deprecated**: This field is deprecated and will always be "false". */ public function getIsAutomated(): ?bool { @@ -82,52 +81,41 @@ public function getIsAutomated(): ?bool } /** - * @param bool $isAutomated + * Whether this repository has automated builds enabled. + * + *


* - * @return self + * > **Deprecated**: This field is deprecated and will always be "false". */ public function setIsAutomated(?bool $isAutomated): self { + $this->initialized['isAutomated'] = true; $this->isAutomated = $isAutomated; return $this; } - /** - * @return string - */ public function getName(): ?string { return $this->name; } - /** - * @param string $name - * - * @return self - */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } - /** - * @return int - */ public function getStarCount(): ?int { return $this->starCount; } - /** - * @param int $starCount - * - * @return self - */ public function setStarCount(?int $starCount): self { + $this->initialized['starCount'] = true; $this->starCount = $starCount; return $this; diff --git a/src/Model/IndexInfo.php b/src/Model/IndexInfo.php index 0744d216..aa822f8b 100644 --- a/src/Model/IndexInfo.php +++ b/src/Model/IndexInfo.php @@ -2,57 +2,57 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class IndexInfo +class IndexInfo extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Name of the registry, such as "docker.io". * - * @var string + * @var string|null */ protected $name; /** * List of mirrors, expressed as URIs. * - * @var string[] + * @var list|null */ protected $mirrors; /** - * Indicates if the the registry is part of the list of insecure. - registries. - - If `false`, the registry is insecure. Insecure registries accept - un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from - unknown CAs) communication. - - > **Warning**: Insecure registries can be useful when running a local - > registry. However, because its use creates security vulnerabilities - > it should ONLY be enabled for testing purposes. For increased - > security, users should add their CA to their system's list of - > trusted CAs instead of enabling this option. - + * Indicates if the registry is part of the list of insecure + * registries. + * + * If `false`, the registry is insecure. Insecure registries accept + * un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from + * unknown CAs) communication. + * + * > **Warning**: Insecure registries can be useful when running a local + * > registry. However, because its use creates security vulnerabilities + * > it should ONLY be enabled for testing purposes. For increased + * > security, users should add their CA to their system's list of + * > trusted CAs instead of enabling this option. * - * @var bool + * @var bool|null */ protected $secure; /** * Indicates whether this is an official registry (i.e., Docker Hub / docker.io). * - * @var bool + * @var bool|null */ protected $official; /** * Name of the registry, such as "docker.io". - * - * @return string */ public function getName(): ?string { @@ -61,13 +61,10 @@ public function getName(): ?string /** * Name of the registry, such as "docker.io". - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -76,7 +73,7 @@ public function setName(?string $name): self /** * List of mirrors, expressed as URIs. * - * @return string[] + * @return list|null */ public function getMirrors(): ?array { @@ -86,33 +83,29 @@ public function getMirrors(): ?array /** * List of mirrors, expressed as URIs. * - * @param string[] $mirrors - * - * @return self + * @param list|null $mirrors */ public function setMirrors(?array $mirrors): self { + $this->initialized['mirrors'] = true; $this->mirrors = $mirrors; return $this; } /** - * Indicates if the the registry is part of the list of insecure. - registries. - - If `false`, the registry is insecure. Insecure registries accept - un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from - unknown CAs) communication. - - > **Warning**: Insecure registries can be useful when running a local - > registry. However, because its use creates security vulnerabilities - > it should ONLY be enabled for testing purposes. For increased - > security, users should add their CA to their system's list of - > trusted CAs instead of enabling this option. - - * - * @return bool + * Indicates if the registry is part of the list of insecure + * registries. + * + * If `false`, the registry is insecure. Insecure registries accept + * un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from + * unknown CAs) communication. + * + * > **Warning**: Insecure registries can be useful when running a local + * > registry. However, because its use creates security vulnerabilities + * > it should ONLY be enabled for testing purposes. For increased + * > security, users should add their CA to their system's list of + * > trusted CAs instead of enabling this option. */ public function getSecure(): ?bool { @@ -120,26 +113,22 @@ public function getSecure(): ?bool } /** - * Indicates if the the registry is part of the list of insecure. - registries. - - If `false`, the registry is insecure. Insecure registries accept - un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from - unknown CAs) communication. - - > **Warning**: Insecure registries can be useful when running a local - > registry. However, because its use creates security vulnerabilities - > it should ONLY be enabled for testing purposes. For increased - > security, users should add their CA to their system's list of - > trusted CAs instead of enabling this option. - - * - * @param bool $secure - * - * @return self + * Indicates if the registry is part of the list of insecure + * registries. + * + * If `false`, the registry is insecure. Insecure registries accept + * un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from + * unknown CAs) communication. + * + * > **Warning**: Insecure registries can be useful when running a local + * > registry. However, because its use creates security vulnerabilities + * > it should ONLY be enabled for testing purposes. For increased + * > security, users should add their CA to their system's list of + * > trusted CAs instead of enabling this option. */ public function setSecure(?bool $secure): self { + $this->initialized['secure'] = true; $this->secure = $secure; return $this; @@ -147,8 +136,6 @@ public function setSecure(?bool $secure): self /** * Indicates whether this is an official registry (i.e., Docker Hub / docker.io). - * - * @return bool */ public function getOfficial(): ?bool { @@ -157,13 +144,10 @@ public function getOfficial(): ?bool /** * Indicates whether this is an official registry (i.e., Docker Hub / docker.io). - * - * @param bool $official - * - * @return self */ public function setOfficial(?bool $official): self { + $this->initialized['official'] = true; $this->official = $official; return $this; diff --git a/src/Model/JoinTokens.php b/src/Model/JoinTokens.php index e17c2513..6ee4ba89 100644 --- a/src/Model/JoinTokens.php +++ b/src/Model/JoinTokens.php @@ -2,33 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class JoinTokens +class JoinTokens extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The token workers can use to join the swarm. * - * @var string + * @var string|null */ protected $worker; /** * The token managers can use to join the swarm. * - * @var string + * @var string|null */ protected $manager; /** * The token workers can use to join the swarm. - * - * @return string */ public function getWorker(): ?string { @@ -37,13 +38,10 @@ public function getWorker(): ?string /** * The token workers can use to join the swarm. - * - * @param string $worker - * - * @return self */ public function setWorker(?string $worker): self { + $this->initialized['worker'] = true; $this->worker = $worker; return $this; @@ -51,8 +49,6 @@ public function setWorker(?string $worker): self /** * The token managers can use to join the swarm. - * - * @return string */ public function getManager(): ?string { @@ -61,13 +57,10 @@ public function getManager(): ?string /** * The token managers can use to join the swarm. - * - * @param string $manager - * - * @return self */ public function setManager(?string $manager): self { + $this->initialized['manager'] = true; $this->manager = $manager; return $this; diff --git a/src/Model/Limit.php b/src/Model/Limit.php new file mode 100644 index 00000000..1c8c6e08 --- /dev/null +++ b/src/Model/Limit.php @@ -0,0 +1,77 @@ +initialized); + } + /** + * @var int|null + */ + protected $nanoCPUs; + /** + * @var int|null + */ + protected $memoryBytes; + /** + * Limits the maximum number of PIDs in the container. Set `0` for unlimited. + * + * @var int|null + */ + protected $pids = 0; + + public function getNanoCPUs(): ?int + { + return $this->nanoCPUs; + } + + public function setNanoCPUs(?int $nanoCPUs): self + { + $this->initialized['nanoCPUs'] = true; + $this->nanoCPUs = $nanoCPUs; + + return $this; + } + + public function getMemoryBytes(): ?int + { + return $this->memoryBytes; + } + + public function setMemoryBytes(?int $memoryBytes): self + { + $this->initialized['memoryBytes'] = true; + $this->memoryBytes = $memoryBytes; + + return $this; + } + + /** + * Limits the maximum number of PIDs in the container. Set `0` for unlimited. + */ + public function getPids(): ?int + { + return $this->pids; + } + + /** + * Limits the maximum number of PIDs in the container. Set `0` for unlimited. + */ + public function setPids(?int $pids): self + { + $this->initialized['pids'] = true; + $this->pids = $pids; + + return $this; + } +} diff --git a/src/Model/ManagerStatus.php b/src/Model/ManagerStatus.php index cc829635..9616948b 100644 --- a/src/Model/ManagerStatus.php +++ b/src/Model/ManagerStatus.php @@ -2,48 +2,44 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ManagerStatus +class ManagerStatus extends \ArrayObject { /** - * @var bool + * @var array */ - protected $leader; + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var bool|null + */ + protected $leader = false; /** * Reachability represents the reachability of a node. * - * @var string + * @var string|null */ protected $reachability; /** * The IP address and port at which the manager is reachable. * - * @var string + * @var string|null */ protected $addr; - /** - * @return bool - */ public function getLeader(): ?bool { return $this->leader; } - /** - * @param bool $leader - * - * @return self - */ public function setLeader(?bool $leader): self { + $this->initialized['leader'] = true; $this->leader = $leader; return $this; @@ -51,8 +47,6 @@ public function setLeader(?bool $leader): self /** * Reachability represents the reachability of a node. - * - * @return string */ public function getReachability(): ?string { @@ -61,13 +55,10 @@ public function getReachability(): ?string /** * Reachability represents the reachability of a node. - * - * @param string $reachability - * - * @return self */ public function setReachability(?string $reachability): self { + $this->initialized['reachability'] = true; $this->reachability = $reachability; return $this; @@ -75,8 +66,6 @@ public function setReachability(?string $reachability): self /** * The IP address and port at which the manager is reachable. - * - * @return string */ public function getAddr(): ?string { @@ -85,13 +74,10 @@ public function getAddr(): ?string /** * The IP address and port at which the manager is reachable. - * - * @param string $addr - * - * @return self */ public function setAddr(?string $addr): self { + $this->initialized['addr'] = true; $this->addr = $addr; return $this; diff --git a/src/Model/Mount.php b/src/Model/Mount.php index c710aba8..6cdc3038 100644 --- a/src/Model/Mount.php +++ b/src/Model/Mount.php @@ -2,74 +2,76 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Mount +class Mount extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Container path. * - * @var string + * @var string|null */ protected $target; /** * Mount source (e.g. a volume name, a host path). * - * @var string + * @var string|null */ protected $source; /** - * The mount type. Available types:. - - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. - - `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. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - + * The mount type. Available types: + * + * - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + * - `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. + * - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. + * - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. + * - `cluster` a Swarm cluster volume * - * @var string + * @var string|null */ protected $type; /** * Whether the mount should be read-only. * - * @var bool + * @var bool|null */ protected $readOnly; /** * The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`. * - * @var string + * @var string|null */ protected $consistency; /** * Optional configuration for the `bind` type. * - * @var MountBindOptions + * @var MountBindOptions|null */ protected $bindOptions; /** * Optional configuration for the `volume` type. * - * @var MountVolumeOptions + * @var MountVolumeOptions|null */ protected $volumeOptions; /** * Optional configuration for the `tmpfs` type. * - * @var MountTmpfsOptions + * @var MountTmpfsOptions|null */ protected $tmpfsOptions; /** * Container path. - * - * @return string */ public function getTarget(): ?string { @@ -78,13 +80,10 @@ public function getTarget(): ?string /** * Container path. - * - * @param string $target - * - * @return self */ public function setTarget(?string $target): self { + $this->initialized['target'] = true; $this->target = $target; return $this; @@ -92,8 +91,6 @@ public function setTarget(?string $target): self /** * Mount source (e.g. a volume name, a host path). - * - * @return string */ public function getSource(): ?string { @@ -102,27 +99,23 @@ public function getSource(): ?string /** * Mount source (e.g. a volume name, a host path). - * - * @param string $source - * - * @return self */ public function setSource(?string $source): self { + $this->initialized['source'] = true; $this->source = $source; return $this; } /** - * The mount type. Available types:. - - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. - - `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. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - + * The mount type. Available types: * - * @return string + * - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + * - `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. + * - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. + * - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. + * - `cluster` a Swarm cluster volume */ public function getType(): ?string { @@ -130,19 +123,17 @@ public function getType(): ?string } /** - * The mount type. Available types:. - - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. - - `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. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - - * - * @param string $type + * The mount type. Available types: * - * @return self + * - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + * - `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. + * - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. + * - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. + * - `cluster` a Swarm cluster volume */ public function setType(?string $type): self { + $this->initialized['type'] = true; $this->type = $type; return $this; @@ -150,8 +141,6 @@ public function setType(?string $type): self /** * Whether the mount should be read-only. - * - * @return bool */ public function getReadOnly(): ?bool { @@ -160,13 +149,10 @@ public function getReadOnly(): ?bool /** * Whether the mount should be read-only. - * - * @param bool $readOnly - * - * @return self */ public function setReadOnly(?bool $readOnly): self { + $this->initialized['readOnly'] = true; $this->readOnly = $readOnly; return $this; @@ -174,8 +160,6 @@ public function setReadOnly(?bool $readOnly): self /** * The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`. - * - * @return string */ public function getConsistency(): ?string { @@ -184,13 +168,10 @@ public function getConsistency(): ?string /** * The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`. - * - * @param string $consistency - * - * @return self */ public function setConsistency(?string $consistency): self { + $this->initialized['consistency'] = true; $this->consistency = $consistency; return $this; @@ -198,8 +179,6 @@ public function setConsistency(?string $consistency): self /** * Optional configuration for the `bind` type. - * - * @return MountBindOptions */ public function getBindOptions(): ?MountBindOptions { @@ -208,13 +187,10 @@ public function getBindOptions(): ?MountBindOptions /** * Optional configuration for the `bind` type. - * - * @param MountBindOptions $bindOptions - * - * @return self */ public function setBindOptions(?MountBindOptions $bindOptions): self { + $this->initialized['bindOptions'] = true; $this->bindOptions = $bindOptions; return $this; @@ -222,8 +198,6 @@ public function setBindOptions(?MountBindOptions $bindOptions): self /** * Optional configuration for the `volume` type. - * - * @return MountVolumeOptions */ public function getVolumeOptions(): ?MountVolumeOptions { @@ -232,13 +206,10 @@ public function getVolumeOptions(): ?MountVolumeOptions /** * Optional configuration for the `volume` type. - * - * @param MountVolumeOptions $volumeOptions - * - * @return self */ public function setVolumeOptions(?MountVolumeOptions $volumeOptions): self { + $this->initialized['volumeOptions'] = true; $this->volumeOptions = $volumeOptions; return $this; @@ -246,8 +217,6 @@ public function setVolumeOptions(?MountVolumeOptions $volumeOptions): self /** * Optional configuration for the `tmpfs` type. - * - * @return MountTmpfsOptions */ public function getTmpfsOptions(): ?MountTmpfsOptions { @@ -256,13 +225,10 @@ public function getTmpfsOptions(): ?MountTmpfsOptions /** * Optional configuration for the `tmpfs` type. - * - * @param MountTmpfsOptions $tmpfsOptions - * - * @return self */ public function setTmpfsOptions(?MountTmpfsOptions $tmpfsOptions): self { + $this->initialized['tmpfsOptions'] = true; $this->tmpfsOptions = $tmpfsOptions; return $this; diff --git a/src/Model/MountBindOptions.php b/src/Model/MountBindOptions.php index a4f5bef1..9af63fe6 100644 --- a/src/Model/MountBindOptions.php +++ b/src/Model/MountBindOptions.php @@ -2,27 +2,57 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class MountBindOptions +class MountBindOptions extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`. * - * @var string + * @var string|null */ protected $propagation; + /** + * Disable recursive bind mount. + * + * @var bool|null + */ + protected $nonRecursive = false; + /** + * Create mount point on host if missing. + * + * @var bool|null + */ + protected $createMountpoint = false; + /** + * Make the mount non-recursively read-only, but still leave the mount recursive + * (unless NonRecursive is set to `true` in conjunction). + * + * Addded in v1.44, before that version all read-only mounts were + * non-recursive by default. To match the previous behaviour this + * will default to `true` for clients on versions prior to v1.44. + * + * @var bool|null + */ + protected $readOnlyNonRecursive = false; + /** + * Raise an error if the mount cannot be made recursively read-only. + * + * @var bool|null + */ + protected $readOnlyForceRecursive = false; /** * A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`. - * - * @return string */ public function getPropagation(): ?string { @@ -31,15 +61,98 @@ public function getPropagation(): ?string /** * A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`. - * - * @param string $propagation - * - * @return self */ public function setPropagation(?string $propagation): self { + $this->initialized['propagation'] = true; $this->propagation = $propagation; return $this; } + + /** + * Disable recursive bind mount. + */ + public function getNonRecursive(): ?bool + { + return $this->nonRecursive; + } + + /** + * Disable recursive bind mount. + */ + public function setNonRecursive(?bool $nonRecursive): self + { + $this->initialized['nonRecursive'] = true; + $this->nonRecursive = $nonRecursive; + + return $this; + } + + /** + * Create mount point on host if missing. + */ + public function getCreateMountpoint(): ?bool + { + return $this->createMountpoint; + } + + /** + * Create mount point on host if missing. + */ + public function setCreateMountpoint(?bool $createMountpoint): self + { + $this->initialized['createMountpoint'] = true; + $this->createMountpoint = $createMountpoint; + + return $this; + } + + /** + * Make the mount non-recursively read-only, but still leave the mount recursive + * (unless NonRecursive is set to `true` in conjunction). + * + * Addded in v1.44, before that version all read-only mounts were + * non-recursive by default. To match the previous behaviour this + * will default to `true` for clients on versions prior to v1.44. + */ + public function getReadOnlyNonRecursive(): ?bool + { + return $this->readOnlyNonRecursive; + } + + /** + * Make the mount non-recursively read-only, but still leave the mount recursive + * (unless NonRecursive is set to `true` in conjunction). + * + * Addded in v1.44, before that version all read-only mounts were + * non-recursive by default. To match the previous behaviour this + * will default to `true` for clients on versions prior to v1.44. + */ + public function setReadOnlyNonRecursive(?bool $readOnlyNonRecursive): self + { + $this->initialized['readOnlyNonRecursive'] = true; + $this->readOnlyNonRecursive = $readOnlyNonRecursive; + + return $this; + } + + /** + * Raise an error if the mount cannot be made recursively read-only. + */ + public function getReadOnlyForceRecursive(): ?bool + { + return $this->readOnlyForceRecursive; + } + + /** + * Raise an error if the mount cannot be made recursively read-only. + */ + public function setReadOnlyForceRecursive(?bool $readOnlyForceRecursive): self + { + $this->initialized['readOnlyForceRecursive'] = true; + $this->readOnlyForceRecursive = $readOnlyForceRecursive; + + return $this; + } } diff --git a/src/Model/MountPoint.php b/src/Model/MountPoint.php index e0dcdac7..51b8ce2f 100644 --- a/src/Model/MountPoint.php +++ b/src/Model/MountPoint.php @@ -2,51 +2,94 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class MountPoint +class MountPoint extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * The mount type: + * + * - `bind` a mount of a file or directory from the host into the container. + * - `volume` a docker volume with the given `Name`. + * - `tmpfs` a `tmpfs`. + * - `npipe` a named pipe from the host into the container. + * - `cluster` a Swarm cluster volume + * + * @var string|null */ protected $type; /** - * @var string + * Name is the name reference to the underlying data defined by `Source` + * e.g., the volume name. + * + * @var string|null */ protected $name; /** - * @var string + * Source location of the mount. + * + * For volumes, this contains the storage location of the volume (within + * `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains + * the source (host) part of the bind-mount. For `tmpfs` mount points, this + * field is empty. + * + * @var string|null */ protected $source; /** - * @var string + * Destination is the path relative to the container root (`/`) where + * the `Source` is mounted inside the container. + * + * @var string|null */ protected $destination; /** - * @var string + * Driver is the volume driver used to create the volume (if it is a volume). + * + * @var string|null */ protected $driver; /** - * @var string + * Mode is a comma separated list of options supplied by the user when + * creating the bind/volume mount. + * + * The default is platform-specific (`"z"` on Linux, empty on Windows). + * + * @var string|null */ protected $mode; /** - * @var bool + * Whether the mount is mounted writable (read-write). + * + * @var bool|null */ protected $rW; /** - * @var string + * Propagation describes how mounts are propagated from the host into the + * mount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) + * for details. This field is not used on Windows. + * + * @var string|null */ protected $propagation; /** - * @return string + * The mount type: + * + * - `bind` a mount of a file or directory from the host into the container. + * - `volume` a docker volume with the given `Name`. + * - `tmpfs` a `tmpfs`. + * - `npipe` a named pipe from the host into the container. + * - `cluster` a Swarm cluster volume */ public function getType(): ?string { @@ -54,19 +97,25 @@ public function getType(): ?string } /** - * @param string $type + * The mount type: * - * @return self + * - `bind` a mount of a file or directory from the host into the container. + * - `volume` a docker volume with the given `Name`. + * - `tmpfs` a `tmpfs`. + * - `npipe` a named pipe from the host into the container. + * - `cluster` a Swarm cluster volume */ public function setType(?string $type): self { + $this->initialized['type'] = true; $this->type = $type; return $this; } /** - * @return string + * Name is the name reference to the underlying data defined by `Source` + * e.g., the volume name. */ public function getName(): ?string { @@ -74,19 +123,24 @@ public function getName(): ?string } /** - * @param string $name - * - * @return self + * Name is the name reference to the underlying data defined by `Source` + * e.g., the volume name. */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } /** - * @return string + * Source location of the mount. + * + * For volumes, this contains the storage location of the volume (within + * `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains + * the source (host) part of the bind-mount. For `tmpfs` mount points, this + * field is empty. */ public function getSource(): ?string { @@ -94,19 +148,24 @@ public function getSource(): ?string } /** - * @param string $source + * Source location of the mount. * - * @return self + * For volumes, this contains the storage location of the volume (within + * `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains + * the source (host) part of the bind-mount. For `tmpfs` mount points, this + * field is empty. */ public function setSource(?string $source): self { + $this->initialized['source'] = true; $this->source = $source; return $this; } /** - * @return string + * Destination is the path relative to the container root (`/`) where + * the `Source` is mounted inside the container. */ public function getDestination(): ?string { @@ -114,19 +173,19 @@ public function getDestination(): ?string } /** - * @param string $destination - * - * @return self + * Destination is the path relative to the container root (`/`) where + * the `Source` is mounted inside the container. */ public function setDestination(?string $destination): self { + $this->initialized['destination'] = true; $this->destination = $destination; return $this; } /** - * @return string + * Driver is the volume driver used to create the volume (if it is a volume). */ public function getDriver(): ?string { @@ -134,19 +193,21 @@ public function getDriver(): ?string } /** - * @param string $driver - * - * @return self + * Driver is the volume driver used to create the volume (if it is a volume). */ public function setDriver(?string $driver): self { + $this->initialized['driver'] = true; $this->driver = $driver; return $this; } /** - * @return string + * Mode is a comma separated list of options supplied by the user when + * creating the bind/volume mount. + * + * The default is platform-specific (`"z"` on Linux, empty on Windows). */ public function getMode(): ?string { @@ -154,19 +215,21 @@ public function getMode(): ?string } /** - * @param string $mode + * Mode is a comma separated list of options supplied by the user when + * creating the bind/volume mount. * - * @return self + * The default is platform-specific (`"z"` on Linux, empty on Windows). */ public function setMode(?string $mode): self { + $this->initialized['mode'] = true; $this->mode = $mode; return $this; } /** - * @return bool + * Whether the mount is mounted writable (read-write). */ public function getRW(): ?bool { @@ -174,19 +237,20 @@ public function getRW(): ?bool } /** - * @param bool $rW - * - * @return self + * Whether the mount is mounted writable (read-write). */ public function setRW(?bool $rW): self { + $this->initialized['rW'] = true; $this->rW = $rW; return $this; } /** - * @return string + * Propagation describes how mounts are propagated from the host into the + * mount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) + * for details. This field is not used on Windows. */ public function getPropagation(): ?string { @@ -194,12 +258,13 @@ public function getPropagation(): ?string } /** - * @param string $propagation - * - * @return self + * Propagation describes how mounts are propagated from the host into the + * mount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) + * for details. This field is not used on Windows. */ public function setPropagation(?string $propagation): self { + $this->initialized['propagation'] = true; $this->propagation = $propagation; return $this; diff --git a/src/Model/MountTmpfsOptions.php b/src/Model/MountTmpfsOptions.php index c33ef140..f10c5421 100644 --- a/src/Model/MountTmpfsOptions.php +++ b/src/Model/MountTmpfsOptions.php @@ -2,33 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class MountTmpfsOptions +class MountTmpfsOptions extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The size for the tmpfs mount in bytes. * - * @var int + * @var int|null */ protected $sizeBytes; /** * The permission mode for the tmpfs mount in an integer. * - * @var int + * @var int|null */ protected $mode; /** * The size for the tmpfs mount in bytes. - * - * @return int */ public function getSizeBytes(): ?int { @@ -37,13 +38,10 @@ public function getSizeBytes(): ?int /** * The size for the tmpfs mount in bytes. - * - * @param int $sizeBytes - * - * @return self */ public function setSizeBytes(?int $sizeBytes): self { + $this->initialized['sizeBytes'] = true; $this->sizeBytes = $sizeBytes; return $this; @@ -51,8 +49,6 @@ public function setSizeBytes(?int $sizeBytes): self /** * The permission mode for the tmpfs mount in an integer. - * - * @return int */ public function getMode(): ?int { @@ -61,13 +57,10 @@ public function getMode(): ?int /** * The permission mode for the tmpfs mount in an integer. - * - * @param int $mode - * - * @return self */ public function setMode(?int $mode): self { + $this->initialized['mode'] = true; $this->mode = $mode; return $this; diff --git a/src/Model/MountVolumeOptions.php b/src/Model/MountVolumeOptions.php index 678f133b..e0dc199f 100644 --- a/src/Model/MountVolumeOptions.php +++ b/src/Model/MountVolumeOptions.php @@ -2,39 +2,46 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class MountVolumeOptions +class MountVolumeOptions extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Populate volume with data from the target. * - * @var bool + * @var bool|null */ - protected $noCopy; + protected $noCopy = false; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * Map of driver specific options. * - * @var MountVolumeOptionsDriverConfig + * @var MountVolumeOptionsDriverConfig|null */ protected $driverConfig; + /** + * Source path inside the volume. Must be relative without any back traversals. + * + * @var string|null + */ + protected $subpath; /** * Populate volume with data from the target. - * - * @return bool */ public function getNoCopy(): ?bool { @@ -43,13 +50,10 @@ public function getNoCopy(): ?bool /** * Populate volume with data from the target. - * - * @param bool $noCopy - * - * @return self */ public function setNoCopy(?bool $noCopy): self { + $this->initialized['noCopy'] = true; $this->noCopy = $noCopy; return $this; @@ -58,9 +62,9 @@ public function setNoCopy(?bool $noCopy): self /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -68,12 +72,11 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value metadata. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; @@ -81,8 +84,6 @@ public function setLabels(?\ArrayObject $labels): self /** * Map of driver specific options. - * - * @return MountVolumeOptionsDriverConfig */ public function getDriverConfig(): ?MountVolumeOptionsDriverConfig { @@ -91,15 +92,31 @@ public function getDriverConfig(): ?MountVolumeOptionsDriverConfig /** * Map of driver specific options. - * - * @param MountVolumeOptionsDriverConfig $driverConfig - * - * @return self */ public function setDriverConfig(?MountVolumeOptionsDriverConfig $driverConfig): self { + $this->initialized['driverConfig'] = true; $this->driverConfig = $driverConfig; return $this; } + + /** + * Source path inside the volume. Must be relative without any back traversals. + */ + public function getSubpath(): ?string + { + return $this->subpath; + } + + /** + * Source path inside the volume. Must be relative without any back traversals. + */ + public function setSubpath(?string $subpath): self + { + $this->initialized['subpath'] = true; + $this->subpath = $subpath; + + return $this; + } } diff --git a/src/Model/MountVolumeOptionsDriverConfig.php b/src/Model/MountVolumeOptionsDriverConfig.php index 624c1370..bbf48149 100644 --- a/src/Model/MountVolumeOptionsDriverConfig.php +++ b/src/Model/MountVolumeOptionsDriverConfig.php @@ -2,33 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class MountVolumeOptionsDriverConfig +class MountVolumeOptionsDriverConfig extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Name of the driver to use to create the volume. * - * @var string + * @var string|null */ protected $name; /** * key/value map of driver specific options. * - * @var string[] + * @var array|null */ protected $options; /** * Name of the driver to use to create the volume. - * - * @return string */ public function getName(): ?string { @@ -37,13 +38,10 @@ public function getName(): ?string /** * Name of the driver to use to create the volume. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -52,9 +50,9 @@ public function setName(?string $name): self /** * key/value map of driver specific options. * - * @return string[] + * @return array|null */ - public function getOptions(): ?\ArrayObject + public function getOptions(): ?iterable { return $this->options; } @@ -62,12 +60,11 @@ public function getOptions(): ?\ArrayObject /** * key/value map of driver specific options. * - * @param string[] $options - * - * @return self + * @param array|null $options */ - public function setOptions(?\ArrayObject $options): self + public function setOptions(?iterable $options): self { + $this->initialized['options'] = true; $this->options = $options; return $this; diff --git a/src/Model/Network.php b/src/Model/Network.php index c0e2700f..0e03e5f0 100644 --- a/src/Model/Network.php +++ b/src/Model/Network.php @@ -2,324 +2,254 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Network +class Network extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $name; /** - * @var string + * @var string|null */ protected $id; /** - * @var string + * @var string|null */ protected $created; /** - * @var string + * @var string|null */ protected $scope; /** - * @var string + * @var string|null */ protected $driver; /** - * @var bool + * @var bool|null */ protected $enableIPv6; /** - * @var IPAM + * @var IPAM|null */ protected $iPAM; /** - * @var bool + * @var bool|null */ protected $internal; /** - * @var bool + * @var bool|null */ protected $attachable; /** - * @var bool + * @var bool|null */ protected $ingress; /** - * @var NetworkContainer[] + * @var array|null */ protected $containers; /** - * @var string[] + * @var array|null */ protected $options; /** - * @var string[] + * @var array|null */ protected $labels; - /** - * @return string - */ public function getName(): ?string { return $this->name; } - /** - * @param string $name - * - * @return self - */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } - /** - * @return string - */ public function getId(): ?string { return $this->id; } - /** - * @param string $id - * - * @return self - */ public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; } - /** - * @return string - */ public function getCreated(): ?string { return $this->created; } - /** - * @param string $created - * - * @return self - */ public function setCreated(?string $created): self { + $this->initialized['created'] = true; $this->created = $created; return $this; } - /** - * @return string - */ public function getScope(): ?string { return $this->scope; } - /** - * @param string $scope - * - * @return self - */ public function setScope(?string $scope): self { + $this->initialized['scope'] = true; $this->scope = $scope; return $this; } - /** - * @return string - */ public function getDriver(): ?string { return $this->driver; } - /** - * @param string $driver - * - * @return self - */ public function setDriver(?string $driver): self { + $this->initialized['driver'] = true; $this->driver = $driver; return $this; } - /** - * @return bool - */ public function getEnableIPv6(): ?bool { return $this->enableIPv6; } - /** - * @param bool $enableIPv6 - * - * @return self - */ public function setEnableIPv6(?bool $enableIPv6): self { + $this->initialized['enableIPv6'] = true; $this->enableIPv6 = $enableIPv6; return $this; } - /** - * @return IPAM - */ public function getIPAM(): ?IPAM { return $this->iPAM; } - /** - * @param IPAM $iPAM - * - * @return self - */ public function setIPAM(?IPAM $iPAM): self { + $this->initialized['iPAM'] = true; $this->iPAM = $iPAM; return $this; } - /** - * @return bool - */ public function getInternal(): ?bool { return $this->internal; } - /** - * @param bool $internal - * - * @return self - */ public function setInternal(?bool $internal): self { + $this->initialized['internal'] = true; $this->internal = $internal; return $this; } - /** - * @return bool - */ public function getAttachable(): ?bool { return $this->attachable; } - /** - * @param bool $attachable - * - * @return self - */ public function setAttachable(?bool $attachable): self { + $this->initialized['attachable'] = true; $this->attachable = $attachable; return $this; } - /** - * @return bool - */ public function getIngress(): ?bool { return $this->ingress; } - /** - * @param bool $ingress - * - * @return self - */ public function setIngress(?bool $ingress): self { + $this->initialized['ingress'] = true; $this->ingress = $ingress; return $this; } /** - * @return NetworkContainer[] + * @return array|null */ - public function getContainers(): ?\ArrayObject + public function getContainers(): ?iterable { return $this->containers; } /** - * @param NetworkContainer[] $containers - * - * @return self + * @param array|null $containers */ - public function setContainers(?\ArrayObject $containers): self + public function setContainers(?iterable $containers): self { + $this->initialized['containers'] = true; $this->containers = $containers; return $this; } /** - * @return string[] + * @return array|null */ - public function getOptions(): ?\ArrayObject + public function getOptions(): ?iterable { return $this->options; } /** - * @param string[] $options - * - * @return self + * @param array|null $options */ - public function setOptions(?\ArrayObject $options): self + public function setOptions(?iterable $options): self { + $this->initialized['options'] = true; $this->options = $options; return $this; } /** - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } /** - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; diff --git a/src/Model/NetworkAttachmentConfig.php b/src/Model/NetworkAttachmentConfig.php new file mode 100644 index 00000000..d5a2ed0b --- /dev/null +++ b/src/Model/NetworkAttachmentConfig.php @@ -0,0 +1,101 @@ +initialized); + } + /** + * The target network for attachment. Must be a network name or ID. + * + * @var string|null + */ + protected $target; + /** + * Discoverable alternate names for the service on this network. + * + * @var list|null + */ + protected $aliases; + /** + * Driver attachment options for the network target. + * + * @var array|null + */ + protected $driverOpts; + + /** + * The target network for attachment. Must be a network name or ID. + */ + public function getTarget(): ?string + { + return $this->target; + } + + /** + * The target network for attachment. Must be a network name or ID. + */ + public function setTarget(?string $target): self + { + $this->initialized['target'] = true; + $this->target = $target; + + return $this; + } + + /** + * Discoverable alternate names for the service on this network. + * + * @return list|null + */ + public function getAliases(): ?array + { + return $this->aliases; + } + + /** + * Discoverable alternate names for the service on this network. + * + * @param list|null $aliases + */ + public function setAliases(?array $aliases): self + { + $this->initialized['aliases'] = true; + $this->aliases = $aliases; + + return $this; + } + + /** + * Driver attachment options for the network target. + * + * @return array|null + */ + public function getDriverOpts(): ?iterable + { + return $this->driverOpts; + } + + /** + * Driver attachment options for the network target. + * + * @param array|null $driverOpts + */ + public function setDriverOpts(?iterable $driverOpts): self + { + $this->initialized['driverOpts'] = true; + $this->driverOpts = $driverOpts; + + return $this; + } +} diff --git a/src/Model/NetworkContainer.php b/src/Model/NetworkContainer.php index 0af36861..28fe5442 100644 --- a/src/Model/NetworkContainer.php +++ b/src/Model/NetworkContainer.php @@ -2,132 +2,100 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class NetworkContainer +class NetworkContainer extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $name; /** - * @var string + * @var string|null */ protected $endpointID; /** - * @var string + * @var string|null */ protected $macAddress; /** - * @var string + * @var string|null */ protected $iPv4Address; /** - * @var string + * @var string|null */ protected $iPv6Address; - /** - * @return string - */ public function getName(): ?string { return $this->name; } - /** - * @param string $name - * - * @return self - */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } - /** - * @return string - */ public function getEndpointID(): ?string { return $this->endpointID; } - /** - * @param string $endpointID - * - * @return self - */ public function setEndpointID(?string $endpointID): self { + $this->initialized['endpointID'] = true; $this->endpointID = $endpointID; return $this; } - /** - * @return string - */ public function getMacAddress(): ?string { return $this->macAddress; } - /** - * @param string $macAddress - * - * @return self - */ public function setMacAddress(?string $macAddress): self { + $this->initialized['macAddress'] = true; $this->macAddress = $macAddress; return $this; } - /** - * @return string - */ public function getIPv4Address(): ?string { return $this->iPv4Address; } - /** - * @param string $iPv4Address - * - * @return self - */ public function setIPv4Address(?string $iPv4Address): self { + $this->initialized['iPv4Address'] = true; $this->iPv4Address = $iPv4Address; return $this; } - /** - * @return string - */ public function getIPv6Address(): ?string { return $this->iPv6Address; } - /** - * @param string $iPv6Address - * - * @return self - */ public function setIPv6Address(?string $iPv6Address): self { + $this->initialized['iPv6Address'] = true; $this->iPv6Address = $iPv6Address; return $this; diff --git a/src/Model/NetworkSettings.php b/src/Model/NetworkSettings.php index 37b71730..6e15371d 100644 --- a/src/Model/NetworkSettings.php +++ b/src/Model/NetworkSettings.php @@ -2,203 +2,205 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class NetworkSettings +class NetworkSettings extends \ArrayObject { /** - * Name of the network'a bridge (for example, `docker0`). + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * Name of the default bridge interface when dockerd's --bridge flag is set. * - * @var string + * @var string|null */ protected $bridge; /** * SandboxID uniquely represents a container's network stack. * - * @var string + * @var string|null */ protected $sandboxID; /** * Indicates if hairpin NAT should be enabled on the virtual interface. * - * @var bool + * Deprecated: This field is never set and will be removed in a future release. + * + * @var bool|null */ protected $hairpinMode; /** * IPv6 unicast address using the link-local prefix. * - * @var string + * Deprecated: This field is never set and will be removed in a future release. + * + * @var string|null */ protected $linkLocalIPv6Address; /** * Prefix length of the IPv6 unicast address. * - * @var int + * Deprecated: This field is never set and will be removed in a future release. + * + * @var int|null */ protected $linkLocalIPv6PrefixLen; /** - * PortMap describes the mapping of container ports to host ports, using the. - container's port-number and protocol as key in the format `/`, - for example, `80/udp`. - - If a container's port is mapped for both `tcp` and `udp`, two separate - entries are added to the mapping table. - + * PortMap describes the mapping of container ports to host ports, using the + * container's port-number and protocol as key in the format `/`, + * for example, `80/udp`. * - * @var PortBinding[][] + * If a container's port is mapped for multiple protocols, separate entries + * are added to the mapping table. + * + * @var array>|null */ protected $ports; /** - * SandboxKey identifies the sandbox. + * SandboxKey is the full path of the netns handle. * - * @var string + * @var string|null */ protected $sandboxKey; /** - * @var Address[] + * Deprecated: This field is never set and will be removed in a future release. + * + * @var list
|null */ protected $secondaryIPAddresses; /** - * @var Address[] + * Deprecated: This field is never set and will be removed in a future release. + * + * @var list
|null */ protected $secondaryIPv6Addresses; /** * EndpointID uniquely represents a service endpoint in a Sandbox. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @var string + *


+ * + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 + * + * @var string|null */ protected $endpointID; /** * Gateway address for the default "bridge" network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @var string + *


+ * + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 + * + * @var string|null */ protected $gateway; /** * Global IPv6 address for the default "bridge" network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @var string + *


+ * + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 + * + * @var string|null */ protected $globalIPv6Address; /** * Mask length of the global IPv6 address. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @var int + *


+ * + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 + * + * @var int|null */ protected $globalIPv6PrefixLen; /** * IPv4 address for the default "bridge" network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @var string + *


+ * + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 + * + * @var string|null */ protected $iPAddress; /** * Mask length of the IPv4 address. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @var int + *


+ * + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 + * + * @var int|null */ protected $iPPrefixLen; /** * IPv6 gateway address for this network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @var string + *


+ * + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 + * + * @var string|null */ protected $iPv6Gateway; /** * MAC address for the container on the default "bridge" network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @var string + *


+ * + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 + * + * @var string|null */ protected $macAddress; /** * Information about all networks that the container is connected to. * - * @var EndpointSettings[] + * @var array|null */ protected $networks; /** - * Name of the network'a bridge (for example, `docker0`). - * - * @return string + * Name of the default bridge interface when dockerd's --bridge flag is set. */ public function getBridge(): ?string { @@ -206,14 +208,11 @@ public function getBridge(): ?string } /** - * Name of the network'a bridge (for example, `docker0`). - * - * @param string $bridge - * - * @return self + * Name of the default bridge interface when dockerd's --bridge flag is set. */ public function setBridge(?string $bridge): self { + $this->initialized['bridge'] = true; $this->bridge = $bridge; return $this; @@ -221,8 +220,6 @@ public function setBridge(?string $bridge): self /** * SandboxID uniquely represents a container's network stack. - * - * @return string */ public function getSandboxID(): ?string { @@ -231,13 +228,10 @@ public function getSandboxID(): ?string /** * SandboxID uniquely represents a container's network stack. - * - * @param string $sandboxID - * - * @return self */ public function setSandboxID(?string $sandboxID): self { + $this->initialized['sandboxID'] = true; $this->sandboxID = $sandboxID; return $this; @@ -246,7 +240,7 @@ public function setSandboxID(?string $sandboxID): self /** * Indicates if hairpin NAT should be enabled on the virtual interface. * - * @return bool + * Deprecated: This field is never set and will be removed in a future release. */ public function getHairpinMode(): ?bool { @@ -256,12 +250,11 @@ public function getHairpinMode(): ?bool /** * Indicates if hairpin NAT should be enabled on the virtual interface. * - * @param bool $hairpinMode - * - * @return self + * Deprecated: This field is never set and will be removed in a future release. */ public function setHairpinMode(?bool $hairpinMode): self { + $this->initialized['hairpinMode'] = true; $this->hairpinMode = $hairpinMode; return $this; @@ -270,7 +263,7 @@ public function setHairpinMode(?bool $hairpinMode): self /** * IPv6 unicast address using the link-local prefix. * - * @return string + * Deprecated: This field is never set and will be removed in a future release. */ public function getLinkLocalIPv6Address(): ?string { @@ -280,12 +273,11 @@ public function getLinkLocalIPv6Address(): ?string /** * IPv6 unicast address using the link-local prefix. * - * @param string $linkLocalIPv6Address - * - * @return self + * Deprecated: This field is never set and will be removed in a future release. */ public function setLinkLocalIPv6Address(?string $linkLocalIPv6Address): self { + $this->initialized['linkLocalIPv6Address'] = true; $this->linkLocalIPv6Address = $linkLocalIPv6Address; return $this; @@ -294,7 +286,7 @@ public function setLinkLocalIPv6Address(?string $linkLocalIPv6Address): self /** * Prefix length of the IPv6 unicast address. * - * @return int + * Deprecated: This field is never set and will be removed in a future release. */ public function getLinkLocalIPv6PrefixLen(): ?int { @@ -304,57 +296,51 @@ public function getLinkLocalIPv6PrefixLen(): ?int /** * Prefix length of the IPv6 unicast address. * - * @param int $linkLocalIPv6PrefixLen - * - * @return self + * Deprecated: This field is never set and will be removed in a future release. */ public function setLinkLocalIPv6PrefixLen(?int $linkLocalIPv6PrefixLen): self { + $this->initialized['linkLocalIPv6PrefixLen'] = true; $this->linkLocalIPv6PrefixLen = $linkLocalIPv6PrefixLen; return $this; } /** - * PortMap describes the mapping of container ports to host ports, using the. - container's port-number and protocol as key in the format `/`, - for example, `80/udp`. - - If a container's port is mapped for both `tcp` and `udp`, two separate - entries are added to the mapping table. - + * PortMap describes the mapping of container ports to host ports, using the + * container's port-number and protocol as key in the format `/`, + * for example, `80/udp`. * - * @return PortBinding[][] + * If a container's port is mapped for multiple protocols, separate entries + * are added to the mapping table. + * + * @return array>|null */ - public function getPorts(): ?\ArrayObject + public function getPorts(): ?iterable { return $this->ports; } /** - * PortMap describes the mapping of container ports to host ports, using the. - container's port-number and protocol as key in the format `/`, - for example, `80/udp`. - - If a container's port is mapped for both `tcp` and `udp`, two separate - entries are added to the mapping table. - + * PortMap describes the mapping of container ports to host ports, using the + * container's port-number and protocol as key in the format `/`, + * for example, `80/udp`. * - * @param PortBinding[][] $ports + * If a container's port is mapped for multiple protocols, separate entries + * are added to the mapping table. * - * @return self + * @param array>|null $ports */ - public function setPorts(?\ArrayObject $ports): self + public function setPorts(?iterable $ports): self { + $this->initialized['ports'] = true; $this->ports = $ports; return $this; } /** - * SandboxKey identifies the sandbox. - * - * @return string + * SandboxKey is the full path of the netns handle. */ public function getSandboxKey(): ?string { @@ -362,21 +348,20 @@ public function getSandboxKey(): ?string } /** - * SandboxKey identifies the sandbox. - * - * @param string $sandboxKey - * - * @return self + * SandboxKey is the full path of the netns handle. */ public function setSandboxKey(?string $sandboxKey): self { + $this->initialized['sandboxKey'] = true; $this->sandboxKey = $sandboxKey; return $this; } /** - * @return Address[] + * Deprecated: This field is never set and will be removed in a future release. + * + * @return list
|null */ public function getSecondaryIPAddresses(): ?array { @@ -384,19 +369,22 @@ public function getSecondaryIPAddresses(): ?array } /** - * @param Address[] $secondaryIPAddresses + * Deprecated: This field is never set and will be removed in a future release. * - * @return self + * @param list
|null $secondaryIPAddresses */ public function setSecondaryIPAddresses(?array $secondaryIPAddresses): self { + $this->initialized['secondaryIPAddresses'] = true; $this->secondaryIPAddresses = $secondaryIPAddresses; return $this; } /** - * @return Address[] + * Deprecated: This field is never set and will be removed in a future release. + * + * @return list
|null */ public function getSecondaryIPv6Addresses(): ?array { @@ -404,12 +392,13 @@ public function getSecondaryIPv6Addresses(): ?array } /** - * @param Address[] $secondaryIPv6Addresses + * Deprecated: This field is never set and will be removed in a future release. * - * @return self + * @param list
|null $secondaryIPv6Addresses */ public function setSecondaryIPv6Addresses(?array $secondaryIPv6Addresses): self { + $this->initialized['secondaryIPv6Addresses'] = true; $this->secondaryIPv6Addresses = $secondaryIPv6Addresses; return $this; @@ -417,17 +406,14 @@ public function setSecondaryIPv6Addresses(?array $secondaryIPv6Addresses): self /** * EndpointID uniquely represents a service endpoint in a Sandbox. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @return string + *


+ * + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 */ public function getEndpointID(): ?string { @@ -436,22 +422,18 @@ public function getEndpointID(): ?string /** * EndpointID uniquely represents a service endpoint in a Sandbox. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @param string $endpointID + *


* - * @return self + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 */ public function setEndpointID(?string $endpointID): self { + $this->initialized['endpointID'] = true; $this->endpointID = $endpointID; return $this; @@ -459,17 +441,14 @@ public function setEndpointID(?string $endpointID): self /** * Gateway address for the default "bridge" network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @return string + *


+ * + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 */ public function getGateway(): ?string { @@ -478,22 +457,18 @@ public function getGateway(): ?string /** * Gateway address for the default "bridge" network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @param string $gateway + *


* - * @return self + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 */ public function setGateway(?string $gateway): self { + $this->initialized['gateway'] = true; $this->gateway = $gateway; return $this; @@ -501,17 +476,14 @@ public function setGateway(?string $gateway): self /** * Global IPv6 address for the default "bridge" network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @return string + *


+ * + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 */ public function getGlobalIPv6Address(): ?string { @@ -520,22 +492,18 @@ public function getGlobalIPv6Address(): ?string /** * Global IPv6 address for the default "bridge" network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @param string $globalIPv6Address + *


* - * @return self + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 */ public function setGlobalIPv6Address(?string $globalIPv6Address): self { + $this->initialized['globalIPv6Address'] = true; $this->globalIPv6Address = $globalIPv6Address; return $this; @@ -543,17 +511,14 @@ public function setGlobalIPv6Address(?string $globalIPv6Address): self /** * Mask length of the global IPv6 address. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @return int + *


+ * + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 */ public function getGlobalIPv6PrefixLen(): ?int { @@ -562,22 +527,18 @@ public function getGlobalIPv6PrefixLen(): ?int /** * Mask length of the global IPv6 address. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @param int $globalIPv6PrefixLen + *


* - * @return self + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 */ public function setGlobalIPv6PrefixLen(?int $globalIPv6PrefixLen): self { + $this->initialized['globalIPv6PrefixLen'] = true; $this->globalIPv6PrefixLen = $globalIPv6PrefixLen; return $this; @@ -585,17 +546,14 @@ public function setGlobalIPv6PrefixLen(?int $globalIPv6PrefixLen): self /** * IPv4 address for the default "bridge" network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @return string + *


+ * + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 */ public function getIPAddress(): ?string { @@ -604,22 +562,18 @@ public function getIPAddress(): ?string /** * IPv4 address for the default "bridge" network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @param string $iPAddress + *


* - * @return self + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 */ public function setIPAddress(?string $iPAddress): self { + $this->initialized['iPAddress'] = true; $this->iPAddress = $iPAddress; return $this; @@ -627,17 +581,14 @@ public function setIPAddress(?string $iPAddress): self /** * Mask length of the IPv4 address. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @return int + *


+ * + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 */ public function getIPPrefixLen(): ?int { @@ -646,22 +597,18 @@ public function getIPPrefixLen(): ?int /** * Mask length of the IPv4 address. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @param int $iPPrefixLen + *


* - * @return self + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 */ public function setIPPrefixLen(?int $iPPrefixLen): self { + $this->initialized['iPPrefixLen'] = true; $this->iPPrefixLen = $iPPrefixLen; return $this; @@ -669,17 +616,14 @@ public function setIPPrefixLen(?int $iPPrefixLen): self /** * IPv6 gateway address for this network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @return string + *


+ * + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 */ public function getIPv6Gateway(): ?string { @@ -688,22 +632,18 @@ public function getIPv6Gateway(): ?string /** * IPv6 gateway address for this network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @param string $iPv6Gateway + *


* - * @return self + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 */ public function setIPv6Gateway(?string $iPv6Gateway): self { + $this->initialized['iPv6Gateway'] = true; $this->iPv6Gateway = $iPv6Gateway; return $this; @@ -711,17 +651,14 @@ public function setIPv6Gateway(?string $iPv6Gateway): self /** * MAC address for the container on the default "bridge" network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @return string + *


+ * + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 */ public function getMacAddress(): ?string { @@ -730,22 +667,18 @@ public function getMacAddress(): ?string /** * MAC address for the container on the default "bridge" network. - -


- - > **Deprecated**: This field is only propagated when attached to the - > default "bridge" network. Use the information from the "bridge" - > network inside the `Networks` map instead, which contains the same - > information. This field was deprecated in Docker 1.9 and is scheduled - > to be removed in Docker 17.12.0 - * - * @param string $macAddress + *


* - * @return self + * > **Deprecated**: This field is only propagated when attached to the + * > default "bridge" network. Use the information from the "bridge" + * > network inside the `Networks` map instead, which contains the same + * > information. This field was deprecated in Docker 1.9 and is scheduled + * > to be removed in Docker 17.12.0 */ public function setMacAddress(?string $macAddress): self { + $this->initialized['macAddress'] = true; $this->macAddress = $macAddress; return $this; @@ -754,9 +687,9 @@ public function setMacAddress(?string $macAddress): self /** * Information about all networks that the container is connected to. * - * @return EndpointSettings[] + * @return array|null */ - public function getNetworks(): ?\ArrayObject + public function getNetworks(): ?iterable { return $this->networks; } @@ -764,12 +697,11 @@ public function getNetworks(): ?\ArrayObject /** * Information about all networks that the container is connected to. * - * @param EndpointSettings[] $networks - * - * @return self + * @param array|null $networks */ - public function setNetworks(?\ArrayObject $networks): self + public function setNetworks(?iterable $networks): self { + $this->initialized['networks'] = true; $this->networks = $networks; return $this; diff --git a/src/Model/NetworkingConfig.php b/src/Model/NetworkingConfig.php new file mode 100644 index 00000000..86fb767f --- /dev/null +++ b/src/Model/NetworkingConfig.php @@ -0,0 +1,53 @@ +initialized); + } + /** + * A mapping of network name to endpoint configuration for that network. + * The endpoint configuration can be left empty to connect to that + * network with no particular endpoint configuration. + * + * @var array|null + */ + protected $endpointsConfig; + + /** + * A mapping of network name to endpoint configuration for that network. + * The endpoint configuration can be left empty to connect to that + * network with no particular endpoint configuration. + * + * @return array|null + */ + public function getEndpointsConfig(): ?iterable + { + return $this->endpointsConfig; + } + + /** + * A mapping of network name to endpoint configuration for that network. + * The endpoint configuration can be left empty to connect to that + * network with no particular endpoint configuration. + * + * @param array|null $endpointsConfig + */ + public function setEndpointsConfig(?iterable $endpointsConfig): self + { + $this->initialized['endpointsConfig'] = true; + $this->endpointsConfig = $endpointsConfig; + + return $this; + } +} diff --git a/src/Model/NetworksCreatePostBody.php b/src/Model/NetworksCreatePostBody.php index c45486c8..be4f27ae 100644 --- a/src/Model/NetworksCreatePostBody.php +++ b/src/Model/NetworksCreatePostBody.php @@ -2,79 +2,82 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class NetworksCreatePostBody +class NetworksCreatePostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The network's name. * - * @var string + * @var string|null */ protected $name; /** - * Check for networks with duplicate names. Since Network is primarily keyed based on a random ID and not on the name, and network name is strictly a user-friendly alias to the network which is uniquely identified using ID, there is no guaranteed way to check for duplicates. CheckDuplicate is there to provide a best effort checking of any networks which has the same name but it is not guaranteed to catch all name collisions. + * Deprecated: CheckDuplicate is now always enabled. * - * @var bool + * @var bool|null */ protected $checkDuplicate; /** * Name of the network driver plugin to use. * - * @var string + * @var string|null */ - protected $driver; + protected $driver = 'bridge'; /** * Restrict external access to the network. * - * @var bool + * @var bool|null */ protected $internal; /** - * Globally scoped network is manually attachable by regular containers from workers in swarm mode. + * Globally scoped network is manually attachable by regular + * containers from workers in swarm mode. * - * @var bool + * @var bool|null */ protected $attachable; /** - * Ingress network is the network which provides the routing-mesh in swarm mode. + * Ingress network is the network which provides the routing-mesh + * in swarm mode. * - * @var bool + * @var bool|null */ protected $ingress; /** - * @var IPAM + * @var IPAM|null */ protected $iPAM; /** * Enable IPv6 on the network. * - * @var bool + * @var bool|null */ protected $enableIPv6; /** * Network specific options to be used by the drivers. * - * @var string[] + * @var array|null */ protected $options; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * The network's name. - * - * @return string */ public function getName(): ?string { @@ -83,22 +86,17 @@ public function getName(): ?string /** * The network's name. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } /** - * Check for networks with duplicate names. Since Network is primarily keyed based on a random ID and not on the name, and network name is strictly a user-friendly alias to the network which is uniquely identified using ID, there is no guaranteed way to check for duplicates. CheckDuplicate is there to provide a best effort checking of any networks which has the same name but it is not guaranteed to catch all name collisions. - * - * @return bool + * Deprecated: CheckDuplicate is now always enabled. */ public function getCheckDuplicate(): ?bool { @@ -106,14 +104,11 @@ public function getCheckDuplicate(): ?bool } /** - * Check for networks with duplicate names. Since Network is primarily keyed based on a random ID and not on the name, and network name is strictly a user-friendly alias to the network which is uniquely identified using ID, there is no guaranteed way to check for duplicates. CheckDuplicate is there to provide a best effort checking of any networks which has the same name but it is not guaranteed to catch all name collisions. - * - * @param bool $checkDuplicate - * - * @return self + * Deprecated: CheckDuplicate is now always enabled. */ public function setCheckDuplicate(?bool $checkDuplicate): self { + $this->initialized['checkDuplicate'] = true; $this->checkDuplicate = $checkDuplicate; return $this; @@ -121,8 +116,6 @@ public function setCheckDuplicate(?bool $checkDuplicate): self /** * Name of the network driver plugin to use. - * - * @return string */ public function getDriver(): ?string { @@ -131,13 +124,10 @@ public function getDriver(): ?string /** * Name of the network driver plugin to use. - * - * @param string $driver - * - * @return self */ public function setDriver(?string $driver): self { + $this->initialized['driver'] = true; $this->driver = $driver; return $this; @@ -145,8 +135,6 @@ public function setDriver(?string $driver): self /** * Restrict external access to the network. - * - * @return bool */ public function getInternal(): ?bool { @@ -155,22 +143,18 @@ public function getInternal(): ?bool /** * Restrict external access to the network. - * - * @param bool $internal - * - * @return self */ public function setInternal(?bool $internal): self { + $this->initialized['internal'] = true; $this->internal = $internal; return $this; } /** - * Globally scoped network is manually attachable by regular containers from workers in swarm mode. - * - * @return bool + * Globally scoped network is manually attachable by regular + * containers from workers in swarm mode. */ public function getAttachable(): ?bool { @@ -178,23 +162,20 @@ public function getAttachable(): ?bool } /** - * Globally scoped network is manually attachable by regular containers from workers in swarm mode. - * - * @param bool $attachable - * - * @return self + * Globally scoped network is manually attachable by regular + * containers from workers in swarm mode. */ public function setAttachable(?bool $attachable): self { + $this->initialized['attachable'] = true; $this->attachable = $attachable; return $this; } /** - * Ingress network is the network which provides the routing-mesh in swarm mode. - * - * @return bool + * Ingress network is the network which provides the routing-mesh + * in swarm mode. */ public function getIngress(): ?bool { @@ -202,34 +183,25 @@ public function getIngress(): ?bool } /** - * Ingress network is the network which provides the routing-mesh in swarm mode. - * - * @param bool $ingress - * - * @return self + * Ingress network is the network which provides the routing-mesh + * in swarm mode. */ public function setIngress(?bool $ingress): self { + $this->initialized['ingress'] = true; $this->ingress = $ingress; return $this; } - /** - * @return IPAM - */ public function getIPAM(): ?IPAM { return $this->iPAM; } - /** - * @param IPAM $iPAM - * - * @return self - */ public function setIPAM(?IPAM $iPAM): self { + $this->initialized['iPAM'] = true; $this->iPAM = $iPAM; return $this; @@ -237,8 +209,6 @@ public function setIPAM(?IPAM $iPAM): self /** * Enable IPv6 on the network. - * - * @return bool */ public function getEnableIPv6(): ?bool { @@ -247,13 +217,10 @@ public function getEnableIPv6(): ?bool /** * Enable IPv6 on the network. - * - * @param bool $enableIPv6 - * - * @return self */ public function setEnableIPv6(?bool $enableIPv6): self { + $this->initialized['enableIPv6'] = true; $this->enableIPv6 = $enableIPv6; return $this; @@ -262,9 +229,9 @@ public function setEnableIPv6(?bool $enableIPv6): self /** * Network specific options to be used by the drivers. * - * @return string[] + * @return array|null */ - public function getOptions(): ?\ArrayObject + public function getOptions(): ?iterable { return $this->options; } @@ -272,12 +239,11 @@ public function getOptions(): ?\ArrayObject /** * Network specific options to be used by the drivers. * - * @param string[] $options - * - * @return self + * @param array|null $options */ - public function setOptions(?\ArrayObject $options): self + public function setOptions(?iterable $options): self { + $this->initialized['options'] = true; $this->options = $options; return $this; @@ -286,9 +252,9 @@ public function setOptions(?\ArrayObject $options): self /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -296,12 +262,11 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value metadata. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; diff --git a/src/Model/NetworksCreatePostResponse201.php b/src/Model/NetworksCreatePostResponse201.php index 31ecdee1..13377303 100644 --- a/src/Model/NetworksCreatePostResponse201.php +++ b/src/Model/NetworksCreatePostResponse201.php @@ -2,31 +2,32 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class NetworksCreatePostResponse201 +class NetworksCreatePostResponse201 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The ID of the created network. * - * @var string + * @var string|null */ protected $id; /** - * @var string + * @var string|null */ protected $warning; /** * The ID of the created network. - * - * @return string */ public function getId(): ?string { @@ -35,33 +36,23 @@ public function getId(): ?string /** * The ID of the created network. - * - * @param string $id - * - * @return self */ public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; } - /** - * @return string - */ public function getWarning(): ?string { return $this->warning; } - /** - * @param string $warning - * - * @return self - */ public function setWarning(?string $warning): self { + $this->initialized['warning'] = true; $this->warning = $warning; return $this; diff --git a/src/Model/NetworksIdConnectPostBody.php b/src/Model/NetworksIdConnectPostBody.php index 0f7d7ac3..115c3859 100644 --- a/src/Model/NetworksIdConnectPostBody.php +++ b/src/Model/NetworksIdConnectPostBody.php @@ -2,33 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class NetworksIdConnectPostBody +class NetworksIdConnectPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The ID or name of the container to connect to the network. * - * @var string + * @var string|null */ protected $container; /** * Configuration for a network endpoint. * - * @var EndpointSettings + * @var EndpointSettings|null */ protected $endpointConfig; /** * The ID or name of the container to connect to the network. - * - * @return string */ public function getContainer(): ?string { @@ -37,13 +38,10 @@ public function getContainer(): ?string /** * The ID or name of the container to connect to the network. - * - * @param string $container - * - * @return self */ public function setContainer(?string $container): self { + $this->initialized['container'] = true; $this->container = $container; return $this; @@ -51,8 +49,6 @@ public function setContainer(?string $container): self /** * Configuration for a network endpoint. - * - * @return EndpointSettings */ public function getEndpointConfig(): ?EndpointSettings { @@ -61,13 +57,10 @@ public function getEndpointConfig(): ?EndpointSettings /** * Configuration for a network endpoint. - * - * @param EndpointSettings $endpointConfig - * - * @return self */ public function setEndpointConfig(?EndpointSettings $endpointConfig): self { + $this->initialized['endpointConfig'] = true; $this->endpointConfig = $endpointConfig; return $this; diff --git a/src/Model/NetworksIdDisconnectPostBody.php b/src/Model/NetworksIdDisconnectPostBody.php index a2486356..76345a30 100644 --- a/src/Model/NetworksIdDisconnectPostBody.php +++ b/src/Model/NetworksIdDisconnectPostBody.php @@ -2,33 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class NetworksIdDisconnectPostBody +class NetworksIdDisconnectPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The ID or name of the container to disconnect from the network. * - * @var string + * @var string|null */ protected $container; /** * Force the container to disconnect from the network. * - * @var bool + * @var bool|null */ protected $force; /** * The ID or name of the container to disconnect from the network. - * - * @return string */ public function getContainer(): ?string { @@ -37,13 +38,10 @@ public function getContainer(): ?string /** * The ID or name of the container to disconnect from the network. - * - * @param string $container - * - * @return self */ public function setContainer(?string $container): self { + $this->initialized['container'] = true; $this->container = $container; return $this; @@ -51,8 +49,6 @@ public function setContainer(?string $container): self /** * Force the container to disconnect from the network. - * - * @return bool */ public function getForce(): ?bool { @@ -61,13 +57,10 @@ public function getForce(): ?bool /** * Force the container to disconnect from the network. - * - * @param bool $force - * - * @return self */ public function setForce(?bool $force): self { + $this->initialized['force'] = true; $this->force = $force; return $this; diff --git a/src/Model/NetworksPrunePostResponse200.php b/src/Model/NetworksPrunePostResponse200.php index 44db2e05..225cf157 100644 --- a/src/Model/NetworksPrunePostResponse200.php +++ b/src/Model/NetworksPrunePostResponse200.php @@ -2,27 +2,30 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class NetworksPrunePostResponse200 +class NetworksPrunePostResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Networks that were deleted. * - * @var string[] + * @var list|null */ protected $networksDeleted; /** * Networks that were deleted. * - * @return string[] + * @return list|null */ public function getNetworksDeleted(): ?array { @@ -32,12 +35,11 @@ public function getNetworksDeleted(): ?array /** * Networks that were deleted. * - * @param string[] $networksDeleted - * - * @return self + * @param list|null $networksDeleted */ public function setNetworksDeleted(?array $networksDeleted): self { + $this->initialized['networksDeleted'] = true; $this->networksDeleted = $networksDeleted; return $this; diff --git a/src/Model/Node.php b/src/Model/Node.php index 46fcf97d..7120bebe 100644 --- a/src/Model/Node.php +++ b/src/Model/Node.php @@ -2,112 +2,105 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Node +class Node extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $iD; /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. * - * @var ObjectVersion + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. + * + * @var ObjectVersion|null */ protected $version; /** - * Date and time at which the node was added to the swarm in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - + * Date and time at which the node was added to the swarm in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. * - * @var string + * @var string|null */ protected $createdAt; /** - * Date and time at which the node was last updated in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - + * Date and time at which the node was last updated in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. * - * @var string + * @var string|null */ protected $updatedAt; /** - * @var NodeSpec + * @var NodeSpec|null */ protected $spec; /** - * NodeDescription encapsulates the properties of the Node as reported by the. - agent. - + * NodeDescription encapsulates the properties of the Node as reported by the + * agent. * - * @var NodeDescription + * @var NodeDescription|null */ protected $description; /** * NodeStatus represents the status of a node. - - It provides the current status of the node, as seen by the manager. - * - * @var NodeStatus + * It provides the current status of the node, as seen by the manager. + * + * @var NodeStatus|null */ protected $status; /** * ManagerStatus represents the status of a manager. - - It provides the current status of a node's manager component, if the node - is a manager. - * - * @var ManagerStatus + * It provides the current status of a node's manager component, if the node + * is a manager. + * + * @var ManagerStatus|null */ protected $managerStatus; - /** - * @return string - */ public function getID(): ?string { return $this->iD; } - /** - * @param string $iD - * - * @return self - */ public function setID(?string $iD): self { + $this->initialized['iD'] = true; $this->iD = $iD; return $this; } /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. * - * @return ObjectVersion + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. */ public function getVersion(): ?ObjectVersion { @@ -115,32 +108,28 @@ public function getVersion(): ?ObjectVersion } /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - - * - * @param ObjectVersion $version + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. * - * @return self + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. */ public function setVersion(?ObjectVersion $version): self { + $this->initialized['version'] = true; $this->version = $version; return $this; } /** - * Date and time at which the node was added to the swarm in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - - * - * @return string + * Date and time at which the node was added to the swarm in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. */ public function getCreatedAt(): ?string { @@ -148,27 +137,20 @@ public function getCreatedAt(): ?string } /** - * Date and time at which the node was added to the swarm in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - - * - * @param string $createdAt - * - * @return self + * Date and time at which the node was added to the swarm in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. */ public function setCreatedAt(?string $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; } /** - * Date and time at which the node was last updated in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - - * - * @return string + * Date and time at which the node was last updated in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. */ public function getUpdatedAt(): ?string { @@ -176,47 +158,33 @@ public function getUpdatedAt(): ?string } /** - * Date and time at which the node was last updated in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - - * - * @param string $updatedAt - * - * @return self + * Date and time at which the node was last updated in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. */ public function setUpdatedAt(?string $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; } - /** - * @return NodeSpec - */ public function getSpec(): ?NodeSpec { return $this->spec; } - /** - * @param NodeSpec $spec - * - * @return self - */ public function setSpec(?NodeSpec $spec): self { + $this->initialized['spec'] = true; $this->spec = $spec; return $this; } /** - * NodeDescription encapsulates the properties of the Node as reported by the. - agent. - - * - * @return NodeDescription + * NodeDescription encapsulates the properties of the Node as reported by the + * agent. */ public function getDescription(): ?NodeDescription { @@ -224,16 +192,12 @@ public function getDescription(): ?NodeDescription } /** - * NodeDescription encapsulates the properties of the Node as reported by the. - agent. - - * - * @param NodeDescription $description - * - * @return self + * NodeDescription encapsulates the properties of the Node as reported by the + * agent. */ public function setDescription(?NodeDescription $description): self { + $this->initialized['description'] = true; $this->description = $description; return $this; @@ -241,11 +205,8 @@ public function setDescription(?NodeDescription $description): self /** * NodeStatus represents the status of a node. - - It provides the current status of the node, as seen by the manager. - * - * @return NodeStatus + * It provides the current status of the node, as seen by the manager. */ public function getStatus(): ?NodeStatus { @@ -254,16 +215,12 @@ public function getStatus(): ?NodeStatus /** * NodeStatus represents the status of a node. - - It provides the current status of the node, as seen by the manager. - * - * @param NodeStatus $status - * - * @return self + * It provides the current status of the node, as seen by the manager. */ public function setStatus(?NodeStatus $status): self { + $this->initialized['status'] = true; $this->status = $status; return $this; @@ -271,12 +228,9 @@ public function setStatus(?NodeStatus $status): self /** * ManagerStatus represents the status of a manager. - - It provides the current status of a node's manager component, if the node - is a manager. - * - * @return ManagerStatus + * It provides the current status of a node's manager component, if the node + * is a manager. */ public function getManagerStatus(): ?ManagerStatus { @@ -285,17 +239,13 @@ public function getManagerStatus(): ?ManagerStatus /** * ManagerStatus represents the status of a manager. - - It provides the current status of a node's manager component, if the node - is a manager. - - * - * @param ManagerStatus $managerStatus * - * @return self + * It provides the current status of a node's manager component, if the node + * is a manager. */ public function setManagerStatus(?ManagerStatus $managerStatus): self { + $this->initialized['managerStatus'] = true; $this->managerStatus = $managerStatus; return $this; diff --git a/src/Model/NodeDescription.php b/src/Model/NodeDescription.php index 37657aaf..8229020e 100644 --- a/src/Model/NodeDescription.php +++ b/src/Model/NodeDescription.php @@ -2,60 +2,58 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class NodeDescription +class NodeDescription extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $hostname; /** * Platform represents the platform (Arch/OS). * - * @var Platform + * @var Platform|null */ protected $platform; /** - * An object describing the resources which can be advertised by a node and requested by a task. + * An object describing the resources which can be advertised by a node and + * requested by a task. * - * @var ResourceObject + * @var ResourceObject|null */ protected $resources; /** * EngineDescription provides information about an engine. * - * @var EngineDescription + * @var EngineDescription|null */ protected $engine; /** - * Information about the issuer of leaf TLS certificates and the trusted root CA certificate. + * Information about the issuer of leaf TLS certificates and the trusted root + * CA certificate. * - * @var TLSInfo + * @var TLSInfo|null */ protected $tLSInfo; - /** - * @return string - */ public function getHostname(): ?string { return $this->hostname; } - /** - * @param string $hostname - * - * @return self - */ public function setHostname(?string $hostname): self { + $this->initialized['hostname'] = true; $this->hostname = $hostname; return $this; @@ -63,8 +61,6 @@ public function setHostname(?string $hostname): self /** * Platform represents the platform (Arch/OS). - * - * @return Platform */ public function getPlatform(): ?Platform { @@ -73,22 +69,18 @@ public function getPlatform(): ?Platform /** * Platform represents the platform (Arch/OS). - * - * @param Platform $platform - * - * @return self */ public function setPlatform(?Platform $platform): self { + $this->initialized['platform'] = true; $this->platform = $platform; return $this; } /** - * An object describing the resources which can be advertised by a node and requested by a task. - * - * @return ResourceObject + * An object describing the resources which can be advertised by a node and + * requested by a task. */ public function getResources(): ?ResourceObject { @@ -96,14 +88,12 @@ public function getResources(): ?ResourceObject } /** - * An object describing the resources which can be advertised by a node and requested by a task. - * - * @param ResourceObject $resources - * - * @return self + * An object describing the resources which can be advertised by a node and + * requested by a task. */ public function setResources(?ResourceObject $resources): self { + $this->initialized['resources'] = true; $this->resources = $resources; return $this; @@ -111,8 +101,6 @@ public function setResources(?ResourceObject $resources): self /** * EngineDescription provides information about an engine. - * - * @return EngineDescription */ public function getEngine(): ?EngineDescription { @@ -121,22 +109,18 @@ public function getEngine(): ?EngineDescription /** * EngineDescription provides information about an engine. - * - * @param EngineDescription $engine - * - * @return self */ public function setEngine(?EngineDescription $engine): self { + $this->initialized['engine'] = true; $this->engine = $engine; return $this; } /** - * Information about the issuer of leaf TLS certificates and the trusted root CA certificate. - * - * @return TLSInfo + * Information about the issuer of leaf TLS certificates and the trusted root + * CA certificate. */ public function getTLSInfo(): ?TLSInfo { @@ -144,14 +128,12 @@ public function getTLSInfo(): ?TLSInfo } /** - * Information about the issuer of leaf TLS certificates and the trusted root CA certificate. - * - * @param TLSInfo $tLSInfo - * - * @return self + * Information about the issuer of leaf TLS certificates and the trusted root + * CA certificate. */ public function setTLSInfo(?TLSInfo $tLSInfo): self { + $this->initialized['tLSInfo'] = true; $this->tLSInfo = $tLSInfo; return $this; diff --git a/src/Model/NodeSpec.php b/src/Model/NodeSpec.php index 1c7d9f17..784eb2e3 100644 --- a/src/Model/NodeSpec.php +++ b/src/Model/NodeSpec.php @@ -2,45 +2,46 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class NodeSpec +class NodeSpec extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Name for the node. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * Role of the node. * - * @var string + * @var string|null */ protected $role; /** * Availability of the node. * - * @var string + * @var string|null */ protected $availability; /** * Name for the node. - * - * @return string */ public function getName(): ?string { @@ -49,13 +50,10 @@ public function getName(): ?string /** * Name for the node. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -64,9 +62,9 @@ public function setName(?string $name): self /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -74,12 +72,11 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value metadata. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; @@ -87,8 +84,6 @@ public function setLabels(?\ArrayObject $labels): self /** * Role of the node. - * - * @return string */ public function getRole(): ?string { @@ -97,13 +92,10 @@ public function getRole(): ?string /** * Role of the node. - * - * @param string $role - * - * @return self */ public function setRole(?string $role): self { + $this->initialized['role'] = true; $this->role = $role; return $this; @@ -111,8 +103,6 @@ public function setRole(?string $role): self /** * Availability of the node. - * - * @return string */ public function getAvailability(): ?string { @@ -121,13 +111,10 @@ public function getAvailability(): ?string /** * Availability of the node. - * - * @param string $availability - * - * @return self */ public function setAvailability(?string $availability): self { + $this->initialized['availability'] = true; $this->availability = $availability; return $this; diff --git a/src/Model/NodeStatus.php b/src/Model/NodeStatus.php index ea23e91f..b811d0fd 100644 --- a/src/Model/NodeStatus.php +++ b/src/Model/NodeStatus.php @@ -2,37 +2,38 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class NodeStatus +class NodeStatus extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * NodeState represents the state of a node. * - * @var string + * @var string|null */ protected $state; /** - * @var string + * @var string|null */ protected $message; /** * IP address of the node. * - * @var string + * @var string|null */ protected $addr; /** * NodeState represents the state of a node. - * - * @return string */ public function getState(): ?string { @@ -41,33 +42,23 @@ public function getState(): ?string /** * NodeState represents the state of a node. - * - * @param string $state - * - * @return self */ public function setState(?string $state): self { + $this->initialized['state'] = true; $this->state = $state; return $this; } - /** - * @return string - */ public function getMessage(): ?string { return $this->message; } - /** - * @param string $message - * - * @return self - */ public function setMessage(?string $message): self { + $this->initialized['message'] = true; $this->message = $message; return $this; @@ -75,8 +66,6 @@ public function setMessage(?string $message): self /** * IP address of the node. - * - * @return string */ public function getAddr(): ?string { @@ -85,13 +74,10 @@ public function getAddr(): ?string /** * IP address of the node. - * - * @param string $addr - * - * @return self */ public function setAddr(?string $addr): self { + $this->initialized['addr'] = true; $this->addr = $addr; return $this; diff --git a/src/Model/DistributionNameJsonGetResponse200Descriptor.php b/src/Model/OCIDescriptor.php similarity index 53% rename from src/Model/DistributionNameJsonGetResponse200Descriptor.php rename to src/Model/OCIDescriptor.php index b7e53fa7..5ead5f3c 100644 --- a/src/Model/DistributionNameJsonGetResponse200Descriptor.php +++ b/src/Model/OCIDescriptor.php @@ -2,35 +2,40 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class DistributionNameJsonGetResponse200Descriptor +class OCIDescriptor extends \ArrayObject { /** - * @var string + * @var array */ - protected $mediaType; + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** - * @var int + * The media type of the object this schema refers to. + * + * @var string|null */ - protected $size; + protected $mediaType; /** - * @var string + * The digest of the targeted content. + * + * @var string|null */ protected $digest; /** - * @var string[] + * The size in bytes of the blob. + * + * @var int|null */ - protected $uRLs; + protected $size; /** - * @return string + * The media type of the object this schema refers to. */ public function getMediaType(): ?string { @@ -38,39 +43,18 @@ public function getMediaType(): ?string } /** - * @param string $mediaType - * - * @return self + * The media type of the object this schema refers to. */ public function setMediaType(?string $mediaType): self { + $this->initialized['mediaType'] = true; $this->mediaType = $mediaType; return $this; } /** - * @return int - */ - public function getSize(): ?int - { - return $this->size; - } - - /** - * @param int $size - * - * @return self - */ - public function setSize(?int $size): self - { - $this->size = $size; - - return $this; - } - - /** - * @return string + * The digest of the targeted content. */ public function getDigest(): ?string { @@ -78,33 +62,31 @@ public function getDigest(): ?string } /** - * @param string $digest - * - * @return self + * The digest of the targeted content. */ public function setDigest(?string $digest): self { + $this->initialized['digest'] = true; $this->digest = $digest; return $this; } /** - * @return string[] + * The size in bytes of the blob. */ - public function getURLs(): ?array + public function getSize(): ?int { - return $this->uRLs; + return $this->size; } /** - * @param string[] $uRLs - * - * @return self + * The size in bytes of the blob. */ - public function setURLs(?array $uRLs): self + public function setSize(?int $size): self { - $this->uRLs = $uRLs; + $this->initialized['size'] = true; + $this->size = $size; return $this; } diff --git a/src/Model/OCIPlatform.php b/src/Model/OCIPlatform.php new file mode 100644 index 00000000..49d5198d --- /dev/null +++ b/src/Model/OCIPlatform.php @@ -0,0 +1,156 @@ +initialized); + } + /** + * The CPU architecture, for example `amd64` or `ppc64`. + * + * @var string|null + */ + protected $architecture; + /** + * The operating system, for example `linux` or `windows`. + * + * @var string|null + */ + protected $os; + /** + * Optional field specifying the operating system version, for example on + * Windows `10.0.19041.1165`. + * + * @var string|null + */ + protected $osVersion; + /** + * Optional field specifying an array of strings, each listing a required + * OS feature (for example on Windows `win32k`). + * + * @var list|null + */ + protected $osFeatures; + /** + * Optional field specifying a variant of the CPU, for example `v7` to + * specify ARMv7 when architecture is `arm`. + * + * @var string|null + */ + protected $variant; + + /** + * The CPU architecture, for example `amd64` or `ppc64`. + */ + public function getArchitecture(): ?string + { + return $this->architecture; + } + + /** + * The CPU architecture, for example `amd64` or `ppc64`. + */ + public function setArchitecture(?string $architecture): self + { + $this->initialized['architecture'] = true; + $this->architecture = $architecture; + + return $this; + } + + /** + * The operating system, for example `linux` or `windows`. + */ + public function getOs(): ?string + { + return $this->os; + } + + /** + * The operating system, for example `linux` or `windows`. + */ + public function setOs(?string $os): self + { + $this->initialized['os'] = true; + $this->os = $os; + + return $this; + } + + /** + * Optional field specifying the operating system version, for example on + * Windows `10.0.19041.1165`. + */ + public function getOsVersion(): ?string + { + return $this->osVersion; + } + + /** + * Optional field specifying the operating system version, for example on + * Windows `10.0.19041.1165`. + */ + public function setOsVersion(?string $osVersion): self + { + $this->initialized['osVersion'] = true; + $this->osVersion = $osVersion; + + return $this; + } + + /** + * Optional field specifying an array of strings, each listing a required + * OS feature (for example on Windows `win32k`). + * + * @return list|null + */ + public function getOsFeatures(): ?array + { + return $this->osFeatures; + } + + /** + * Optional field specifying an array of strings, each listing a required + * OS feature (for example on Windows `win32k`). + * + * @param list|null $osFeatures + */ + public function setOsFeatures(?array $osFeatures): self + { + $this->initialized['osFeatures'] = true; + $this->osFeatures = $osFeatures; + + return $this; + } + + /** + * Optional field specifying a variant of the CPU, for example `v7` to + * specify ARMv7 when architecture is `arm`. + */ + public function getVariant(): ?string + { + return $this->variant; + } + + /** + * Optional field specifying a variant of the CPU, for example `v7` to + * specify ARMv7 when architecture is `arm`. + */ + public function setVariant(?string $variant): self + { + $this->initialized['variant'] = true; + $this->variant = $variant; + + return $this; + } +} diff --git a/src/Model/ObjectVersion.php b/src/Model/ObjectVersion.php index 3516edb3..bc75b1b6 100644 --- a/src/Model/ObjectVersion.php +++ b/src/Model/ObjectVersion.php @@ -2,36 +2,32 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ObjectVersion +class ObjectVersion extends \ArrayObject { /** - * @var int + * @var array */ - protected $index; + protected $initialized = []; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** - * @return int + * @var int|null */ + protected $index; + public function getIndex(): ?int { return $this->index; } - /** - * @param int $index - * - * @return self - */ public function setIndex(?int $index): self { + $this->initialized['index'] = true; $this->index = $index; return $this; diff --git a/src/Model/PeerNode.php b/src/Model/PeerNode.php index 719da214..8355cd59 100644 --- a/src/Model/PeerNode.php +++ b/src/Model/PeerNode.php @@ -2,33 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class PeerNode +class PeerNode extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Unique identifier of for this node in the swarm. * - * @var string + * @var string|null */ protected $nodeID; /** * IP address and ports at which this node can be reached. * - * @var string + * @var string|null */ protected $addr; /** * Unique identifier of for this node in the swarm. - * - * @return string */ public function getNodeID(): ?string { @@ -37,13 +38,10 @@ public function getNodeID(): ?string /** * Unique identifier of for this node in the swarm. - * - * @param string $nodeID - * - * @return self */ public function setNodeID(?string $nodeID): self { + $this->initialized['nodeID'] = true; $this->nodeID = $nodeID; return $this; @@ -51,8 +49,6 @@ public function setNodeID(?string $nodeID): self /** * IP address and ports at which this node can be reached. - * - * @return string */ public function getAddr(): ?string { @@ -61,13 +57,10 @@ public function getAddr(): ?string /** * IP address and ports at which this node can be reached. - * - * @param string $addr - * - * @return self */ public function setAddr(?string $addr): self { + $this->initialized['addr'] = true; $this->addr = $addr; return $this; diff --git a/src/Model/Platform.php b/src/Model/Platform.php index cf508a6d..4c9899f7 100644 --- a/src/Model/Platform.php +++ b/src/Model/Platform.php @@ -2,37 +2,36 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Platform +class Platform extends \ArrayObject { /** - * Architecture represents the hardware architecture (for example,. - `x86_64`). + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * Architecture represents the hardware architecture (for example, + * `x86_64`). * - * @var string + * @var string|null */ protected $architecture; /** * OS represents the Operating System (for example, `linux` or `windows`). * - * @var string + * @var string|null */ protected $oS; /** - * Architecture represents the hardware architecture (for example,. - `x86_64`). - - * - * @return string + * Architecture represents the hardware architecture (for example, + * `x86_64`). */ public function getArchitecture(): ?string { @@ -40,16 +39,12 @@ public function getArchitecture(): ?string } /** - * Architecture represents the hardware architecture (for example,. - `x86_64`). - - * - * @param string $architecture - * - * @return self + * Architecture represents the hardware architecture (for example, + * `x86_64`). */ public function setArchitecture(?string $architecture): self { + $this->initialized['architecture'] = true; $this->architecture = $architecture; return $this; @@ -57,8 +52,6 @@ public function setArchitecture(?string $architecture): self /** * OS represents the Operating System (for example, `linux` or `windows`). - * - * @return string */ public function getOS(): ?string { @@ -67,13 +60,10 @@ public function getOS(): ?string /** * OS represents the Operating System (for example, `linux` or `windows`). - * - * @param string $oS - * - * @return self */ public function setOS(?string $oS): self { + $this->initialized['oS'] = true; $this->oS = $oS; return $this; diff --git a/src/Model/Plugin.php b/src/Model/Plugin.php index 89c70d5c..23f35058 100644 --- a/src/Model/Plugin.php +++ b/src/Model/Plugin.php @@ -2,84 +2,73 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Plugin +class Plugin extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $id; /** - * @var string + * @var string|null */ protected $name; /** * True if the plugin is running. False if the plugin is not running, only installed. * - * @var bool + * @var bool|null */ protected $enabled; /** * Settings that can be modified by users. * - * @var PluginSettings + * @var PluginSettings|null */ protected $settings; /** * plugin remote reference used to push/pull the plugin. * - * @var string + * @var string|null */ protected $pluginReference; /** * The config of a plugin. * - * @var PluginConfig + * @var PluginConfig|null */ protected $config; - /** - * @return string - */ public function getId(): ?string { return $this->id; } - /** - * @param string $id - * - * @return self - */ public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; } - /** - * @return string - */ public function getName(): ?string { return $this->name; } - /** - * @param string $name - * - * @return self - */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -87,8 +76,6 @@ public function setName(?string $name): self /** * True if the plugin is running. False if the plugin is not running, only installed. - * - * @return bool */ public function getEnabled(): ?bool { @@ -97,13 +84,10 @@ public function getEnabled(): ?bool /** * True if the plugin is running. False if the plugin is not running, only installed. - * - * @param bool $enabled - * - * @return self */ public function setEnabled(?bool $enabled): self { + $this->initialized['enabled'] = true; $this->enabled = $enabled; return $this; @@ -111,8 +95,6 @@ public function setEnabled(?bool $enabled): self /** * Settings that can be modified by users. - * - * @return PluginSettings */ public function getSettings(): ?PluginSettings { @@ -121,13 +103,10 @@ public function getSettings(): ?PluginSettings /** * Settings that can be modified by users. - * - * @param PluginSettings $settings - * - * @return self */ public function setSettings(?PluginSettings $settings): self { + $this->initialized['settings'] = true; $this->settings = $settings; return $this; @@ -135,8 +114,6 @@ public function setSettings(?PluginSettings $settings): self /** * plugin remote reference used to push/pull the plugin. - * - * @return string */ public function getPluginReference(): ?string { @@ -145,13 +122,10 @@ public function getPluginReference(): ?string /** * plugin remote reference used to push/pull the plugin. - * - * @param string $pluginReference - * - * @return self */ public function setPluginReference(?string $pluginReference): self { + $this->initialized['pluginReference'] = true; $this->pluginReference = $pluginReference; return $this; @@ -159,8 +133,6 @@ public function setPluginReference(?string $pluginReference): self /** * The config of a plugin. - * - * @return PluginConfig */ public function getConfig(): ?PluginConfig { @@ -169,13 +141,10 @@ public function getConfig(): ?PluginConfig /** * The config of a plugin. - * - * @param PluginConfig $config - * - * @return self */ public function setConfig(?PluginConfig $config): self { + $this->initialized['config'] = true; $this->config = $config; return $this; diff --git a/src/Model/PluginConfig.php b/src/Model/PluginConfig.php index 6f3d0c04..a2af9f0d 100644 --- a/src/Model/PluginConfig.php +++ b/src/Model/PluginConfig.php @@ -2,89 +2,90 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class PluginConfig +class PluginConfig extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Docker Version used to create the plugin. * - * @var string + * @var string|null */ protected $dockerVersion; /** - * @var string + * @var string|null */ protected $description; /** - * @var string + * @var string|null */ protected $documentation; /** * The interface between Docker and the plugin. * - * @var PluginConfigInterface + * @var PluginConfigInterface|null */ protected $interface; /** - * @var string[] + * @var list|null */ protected $entrypoint; /** - * @var string + * @var string|null */ protected $workDir; /** - * @var PluginConfigUser + * @var PluginConfigUser|null */ protected $user; /** - * @var PluginConfigNetwork + * @var PluginConfigNetwork|null */ protected $network; /** - * @var PluginConfigLinux + * @var PluginConfigLinux|null */ protected $linux; /** - * @var string + * @var string|null */ protected $propagatedMount; /** - * @var bool + * @var bool|null */ protected $ipcHost; /** - * @var bool + * @var bool|null */ protected $pidHost; /** - * @var PluginMount[] + * @var list|null */ protected $mounts; /** - * @var PluginEnv[] + * @var list|null */ protected $env; /** - * @var PluginConfigArgs + * @var PluginConfigArgs|null */ protected $args; /** - * @var PluginConfigRootfs + * @var PluginConfigRootfs|null */ protected $rootfs; /** * Docker Version used to create the plugin. - * - * @return string */ public function getDockerVersion(): ?string { @@ -93,53 +94,36 @@ public function getDockerVersion(): ?string /** * Docker Version used to create the plugin. - * - * @param string $dockerVersion - * - * @return self */ public function setDockerVersion(?string $dockerVersion): self { + $this->initialized['dockerVersion'] = true; $this->dockerVersion = $dockerVersion; return $this; } - /** - * @return string - */ public function getDescription(): ?string { return $this->description; } - /** - * @param string $description - * - * @return self - */ public function setDescription(?string $description): self { + $this->initialized['description'] = true; $this->description = $description; return $this; } - /** - * @return string - */ public function getDocumentation(): ?string { return $this->documentation; } - /** - * @param string $documentation - * - * @return self - */ public function setDocumentation(?string $documentation): self { + $this->initialized['documentation'] = true; $this->documentation = $documentation; return $this; @@ -147,8 +131,6 @@ public function setDocumentation(?string $documentation): self /** * The interface between Docker and the plugin. - * - * @return PluginConfigInterface */ public function getInterface(): ?PluginConfigInterface { @@ -157,20 +139,17 @@ public function getInterface(): ?PluginConfigInterface /** * The interface between Docker and the plugin. - * - * @param PluginConfigInterface $interface - * - * @return self */ public function setInterface(?PluginConfigInterface $interface): self { + $this->initialized['interface'] = true; $this->interface = $interface; return $this; } /** - * @return string[] + * @return list|null */ public function getEntrypoint(): ?array { @@ -178,159 +157,109 @@ public function getEntrypoint(): ?array } /** - * @param string[] $entrypoint - * - * @return self + * @param list|null $entrypoint */ public function setEntrypoint(?array $entrypoint): self { + $this->initialized['entrypoint'] = true; $this->entrypoint = $entrypoint; return $this; } - /** - * @return string - */ public function getWorkDir(): ?string { return $this->workDir; } - /** - * @param string $workDir - * - * @return self - */ public function setWorkDir(?string $workDir): self { + $this->initialized['workDir'] = true; $this->workDir = $workDir; return $this; } - /** - * @return PluginConfigUser - */ public function getUser(): ?PluginConfigUser { return $this->user; } - /** - * @param PluginConfigUser $user - * - * @return self - */ public function setUser(?PluginConfigUser $user): self { + $this->initialized['user'] = true; $this->user = $user; return $this; } - /** - * @return PluginConfigNetwork - */ public function getNetwork(): ?PluginConfigNetwork { return $this->network; } - /** - * @param PluginConfigNetwork $network - * - * @return self - */ public function setNetwork(?PluginConfigNetwork $network): self { + $this->initialized['network'] = true; $this->network = $network; return $this; } - /** - * @return PluginConfigLinux - */ public function getLinux(): ?PluginConfigLinux { return $this->linux; } - /** - * @param PluginConfigLinux $linux - * - * @return self - */ public function setLinux(?PluginConfigLinux $linux): self { + $this->initialized['linux'] = true; $this->linux = $linux; return $this; } - /** - * @return string - */ public function getPropagatedMount(): ?string { return $this->propagatedMount; } - /** - * @param string $propagatedMount - * - * @return self - */ public function setPropagatedMount(?string $propagatedMount): self { + $this->initialized['propagatedMount'] = true; $this->propagatedMount = $propagatedMount; return $this; } - /** - * @return bool - */ public function getIpcHost(): ?bool { return $this->ipcHost; } - /** - * @param bool $ipcHost - * - * @return self - */ public function setIpcHost(?bool $ipcHost): self { + $this->initialized['ipcHost'] = true; $this->ipcHost = $ipcHost; return $this; } - /** - * @return bool - */ public function getPidHost(): ?bool { return $this->pidHost; } - /** - * @param bool $pidHost - * - * @return self - */ public function setPidHost(?bool $pidHost): self { + $this->initialized['pidHost'] = true; $this->pidHost = $pidHost; return $this; } /** - * @return PluginMount[] + * @return list|null */ public function getMounts(): ?array { @@ -338,19 +267,18 @@ public function getMounts(): ?array } /** - * @param PluginMount[] $mounts - * - * @return self + * @param list|null $mounts */ public function setMounts(?array $mounts): self { + $this->initialized['mounts'] = true; $this->mounts = $mounts; return $this; } /** - * @return PluginEnv[] + * @return list|null */ public function getEnv(): ?array { @@ -358,52 +286,37 @@ public function getEnv(): ?array } /** - * @param PluginEnv[] $env - * - * @return self + * @param list|null $env */ public function setEnv(?array $env): self { + $this->initialized['env'] = true; $this->env = $env; return $this; } - /** - * @return PluginConfigArgs - */ public function getArgs(): ?PluginConfigArgs { return $this->args; } - /** - * @param PluginConfigArgs $args - * - * @return self - */ public function setArgs(?PluginConfigArgs $args): self { + $this->initialized['args'] = true; $this->args = $args; return $this; } - /** - * @return PluginConfigRootfs - */ public function getRootfs(): ?PluginConfigRootfs { return $this->rootfs; } - /** - * @param PluginConfigRootfs $rootfs - * - * @return self - */ public function setRootfs(?PluginConfigRootfs $rootfs): self { + $this->initialized['rootfs'] = true; $this->rootfs = $rootfs; return $this; diff --git a/src/Model/PluginConfigArgs.php b/src/Model/PluginConfigArgs.php index f28f4a2a..32e482c0 100644 --- a/src/Model/PluginConfigArgs.php +++ b/src/Model/PluginConfigArgs.php @@ -2,75 +2,64 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class PluginConfigArgs +class PluginConfigArgs extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $name; /** - * @var string + * @var string|null */ protected $description; /** - * @var string[] + * @var list|null */ protected $settable; /** - * @var string[] + * @var list|null */ protected $value; - /** - * @return string - */ public function getName(): ?string { return $this->name; } - /** - * @param string $name - * - * @return self - */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } - /** - * @return string - */ public function getDescription(): ?string { return $this->description; } - /** - * @param string $description - * - * @return self - */ public function setDescription(?string $description): self { + $this->initialized['description'] = true; $this->description = $description; return $this; } /** - * @return string[] + * @return list|null */ public function getSettable(): ?array { @@ -78,19 +67,18 @@ public function getSettable(): ?array } /** - * @param string[] $settable - * - * @return self + * @param list|null $settable */ public function setSettable(?array $settable): self { + $this->initialized['settable'] = true; $this->settable = $settable; return $this; } /** - * @return string[] + * @return list|null */ public function getValue(): ?array { @@ -98,12 +86,11 @@ public function getValue(): ?array } /** - * @param string[] $value - * - * @return self + * @param list|null $value */ public function setValue(?array $value): self { + $this->initialized['value'] = true; $this->value = $value; return $this; diff --git a/src/Model/PluginConfigInterface.php b/src/Model/PluginConfigInterface.php index e5021ea1..e2443eda 100644 --- a/src/Model/PluginConfigInterface.php +++ b/src/Model/PluginConfigInterface.php @@ -2,27 +2,36 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class PluginConfigInterface +class PluginConfigInterface extends \ArrayObject { /** - * @var PluginInterfaceType[] + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var list|null */ protected $types; /** - * @var string + * @var string|null */ protected $socket; + /** + * Protocol to use for clients connecting to the plugin. + * + * @var string|null + */ + protected $protocolScheme; /** - * @return PluginInterfaceType[] + * @return list|null */ public function getTypes(): ?array { @@ -30,34 +39,45 @@ public function getTypes(): ?array } /** - * @param PluginInterfaceType[] $types - * - * @return self + * @param list|null $types */ public function setTypes(?array $types): self { + $this->initialized['types'] = true; $this->types = $types; return $this; } - /** - * @return string - */ public function getSocket(): ?string { return $this->socket; } - /** - * @param string $socket - * - * @return self - */ public function setSocket(?string $socket): self { + $this->initialized['socket'] = true; $this->socket = $socket; return $this; } + + /** + * Protocol to use for clients connecting to the plugin. + */ + public function getProtocolScheme(): ?string + { + return $this->protocolScheme; + } + + /** + * Protocol to use for clients connecting to the plugin. + */ + public function setProtocolScheme(?string $protocolScheme): self + { + $this->initialized['protocolScheme'] = true; + $this->protocolScheme = $protocolScheme; + + return $this; + } } diff --git a/src/Model/PluginConfigLinux.php b/src/Model/PluginConfigLinux.php index c32b8806..201d8c37 100644 --- a/src/Model/PluginConfigLinux.php +++ b/src/Model/PluginConfigLinux.php @@ -2,31 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class PluginConfigLinux +class PluginConfigLinux extends \ArrayObject { /** - * @var string[] + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var list|null */ protected $capabilities; /** - * @var bool + * @var bool|null */ protected $allowAllDevices; /** - * @var PluginDevice[] + * @var list|null */ protected $devices; /** - * @return string[] + * @return list|null */ public function getCapabilities(): ?array { @@ -34,39 +37,31 @@ public function getCapabilities(): ?array } /** - * @param string[] $capabilities - * - * @return self + * @param list|null $capabilities */ public function setCapabilities(?array $capabilities): self { + $this->initialized['capabilities'] = true; $this->capabilities = $capabilities; return $this; } - /** - * @return bool - */ public function getAllowAllDevices(): ?bool { return $this->allowAllDevices; } - /** - * @param bool $allowAllDevices - * - * @return self - */ public function setAllowAllDevices(?bool $allowAllDevices): self { + $this->initialized['allowAllDevices'] = true; $this->allowAllDevices = $allowAllDevices; return $this; } /** - * @return PluginDevice[] + * @return list|null */ public function getDevices(): ?array { @@ -74,12 +69,11 @@ public function getDevices(): ?array } /** - * @param PluginDevice[] $devices - * - * @return self + * @param list|null $devices */ public function setDevices(?array $devices): self { + $this->initialized['devices'] = true; $this->devices = $devices; return $this; diff --git a/src/Model/PluginConfigNetwork.php b/src/Model/PluginConfigNetwork.php index a1b8630f..a2cb9dc8 100644 --- a/src/Model/PluginConfigNetwork.php +++ b/src/Model/PluginConfigNetwork.php @@ -2,36 +2,32 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class PluginConfigNetwork +class PluginConfigNetwork extends \ArrayObject { /** - * @var string + * @var array */ - protected $type; + protected $initialized = []; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** - * @return string + * @var string|null */ + protected $type; + public function getType(): ?string { return $this->type; } - /** - * @param string $type - * - * @return self - */ public function setType(?string $type): self { + $this->initialized['type'] = true; $this->type = $type; return $this; diff --git a/src/Model/PluginConfigRootfs.php b/src/Model/PluginConfigRootfs.php index af60a93e..28caa4b3 100644 --- a/src/Model/PluginConfigRootfs.php +++ b/src/Model/PluginConfigRootfs.php @@ -2,47 +2,43 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class PluginConfigRootfs +class PluginConfigRootfs extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $type; /** - * @var string[] + * @var list|null */ protected $diffIds; - /** - * @return string - */ public function getType(): ?string { return $this->type; } - /** - * @param string $type - * - * @return self - */ public function setType(?string $type): self { + $this->initialized['type'] = true; $this->type = $type; return $this; } /** - * @return string[] + * @return list|null */ public function getDiffIds(): ?array { @@ -50,12 +46,11 @@ public function getDiffIds(): ?array } /** - * @param string[] $diffIds - * - * @return self + * @param list|null $diffIds */ public function setDiffIds(?array $diffIds): self { + $this->initialized['diffIds'] = true; $this->diffIds = $diffIds; return $this; diff --git a/src/Model/PluginConfigUser.php b/src/Model/PluginConfigUser.php index 7195b4f3..788ccbad 100644 --- a/src/Model/PluginConfigUser.php +++ b/src/Model/PluginConfigUser.php @@ -2,60 +2,49 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class PluginConfigUser +class PluginConfigUser extends \ArrayObject { /** - * @var int + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var int|null */ protected $uID; /** - * @var int + * @var int|null */ protected $gID; - /** - * @return int - */ public function getUID(): ?int { return $this->uID; } - /** - * @param int $uID - * - * @return self - */ public function setUID(?int $uID): self { + $this->initialized['uID'] = true; $this->uID = $uID; return $this; } - /** - * @return int - */ public function getGID(): ?int { return $this->gID; } - /** - * @param int $gID - * - * @return self - */ public function setGID(?int $gID): self { + $this->initialized['gID'] = true; $this->gID = $gID; return $this; diff --git a/src/Model/PluginDevice.php b/src/Model/PluginDevice.php index 60cea592..a2dfe134 100644 --- a/src/Model/PluginDevice.php +++ b/src/Model/PluginDevice.php @@ -2,75 +2,64 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class PluginDevice +class PluginDevice extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $name; /** - * @var string + * @var string|null */ protected $description; /** - * @var string[] + * @var list|null */ protected $settable; /** - * @var string + * @var string|null */ protected $path; - /** - * @return string - */ public function getName(): ?string { return $this->name; } - /** - * @param string $name - * - * @return self - */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } - /** - * @return string - */ public function getDescription(): ?string { return $this->description; } - /** - * @param string $description - * - * @return self - */ public function setDescription(?string $description): self { + $this->initialized['description'] = true; $this->description = $description; return $this; } /** - * @return string[] + * @return list|null */ public function getSettable(): ?array { @@ -78,32 +67,24 @@ public function getSettable(): ?array } /** - * @param string[] $settable - * - * @return self + * @param list|null $settable */ public function setSettable(?array $settable): self { + $this->initialized['settable'] = true; $this->settable = $settable; return $this; } - /** - * @return string - */ public function getPath(): ?string { return $this->path; } - /** - * @param string $path - * - * @return self - */ public function setPath(?string $path): self { + $this->initialized['path'] = true; $this->path = $path; return $this; diff --git a/src/Model/PluginEnv.php b/src/Model/PluginEnv.php index b76ba9ba..f9f4bd0a 100644 --- a/src/Model/PluginEnv.php +++ b/src/Model/PluginEnv.php @@ -2,75 +2,64 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class PluginEnv +class PluginEnv extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $name; /** - * @var string + * @var string|null */ protected $description; /** - * @var string[] + * @var list|null */ protected $settable; /** - * @var string + * @var string|null */ protected $value; - /** - * @return string - */ public function getName(): ?string { return $this->name; } - /** - * @param string $name - * - * @return self - */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } - /** - * @return string - */ public function getDescription(): ?string { return $this->description; } - /** - * @param string $description - * - * @return self - */ public function setDescription(?string $description): self { + $this->initialized['description'] = true; $this->description = $description; return $this; } /** - * @return string[] + * @return list|null */ public function getSettable(): ?array { @@ -78,32 +67,24 @@ public function getSettable(): ?array } /** - * @param string[] $settable - * - * @return self + * @param list|null $settable */ public function setSettable(?array $settable): self { + $this->initialized['settable'] = true; $this->settable = $settable; return $this; } - /** - * @return string - */ public function getValue(): ?string { return $this->value; } - /** - * @param string $value - * - * @return self - */ public function setValue(?string $value): self { + $this->initialized['value'] = true; $this->value = $value; return $this; diff --git a/src/Model/PluginInterfaceType.php b/src/Model/PluginInterfaceType.php index e110e099..a5e5ac43 100644 --- a/src/Model/PluginInterfaceType.php +++ b/src/Model/PluginInterfaceType.php @@ -2,84 +2,66 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class PluginInterfaceType +class PluginInterfaceType extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $prefix; /** - * @var string + * @var string|null */ protected $capability; /** - * @var string + * @var string|null */ protected $version; - /** - * @return string - */ public function getPrefix(): ?string { return $this->prefix; } - /** - * @param string $prefix - * - * @return self - */ public function setPrefix(?string $prefix): self { + $this->initialized['prefix'] = true; $this->prefix = $prefix; return $this; } - /** - * @return string - */ public function getCapability(): ?string { return $this->capability; } - /** - * @param string $capability - * - * @return self - */ public function setCapability(?string $capability): self { + $this->initialized['capability'] = true; $this->capability = $capability; return $this; } - /** - * @return string - */ public function getVersion(): ?string { return $this->version; } - /** - * @param string $version - * - * @return self - */ public function setVersion(?string $version): self { + $this->initialized['version'] = true; $this->version = $version; return $this; diff --git a/src/Model/PluginMount.php b/src/Model/PluginMount.php index 9717af42..541cb040 100644 --- a/src/Model/PluginMount.php +++ b/src/Model/PluginMount.php @@ -2,87 +2,76 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class PluginMount +class PluginMount extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $name; /** - * @var string + * @var string|null */ protected $description; /** - * @var string[] + * @var list|null */ protected $settable; /** - * @var string + * @var string|null */ protected $source; /** - * @var string + * @var string|null */ protected $destination; /** - * @var string + * @var string|null */ protected $type; /** - * @var string[] + * @var list|null */ protected $options; - /** - * @return string - */ public function getName(): ?string { return $this->name; } - /** - * @param string $name - * - * @return self - */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } - /** - * @return string - */ public function getDescription(): ?string { return $this->description; } - /** - * @param string $description - * - * @return self - */ public function setDescription(?string $description): self { + $this->initialized['description'] = true; $this->description = $description; return $this; } /** - * @return string[] + * @return list|null */ public function getSettable(): ?array { @@ -90,79 +79,57 @@ public function getSettable(): ?array } /** - * @param string[] $settable - * - * @return self + * @param list|null $settable */ public function setSettable(?array $settable): self { + $this->initialized['settable'] = true; $this->settable = $settable; return $this; } - /** - * @return string - */ public function getSource(): ?string { return $this->source; } - /** - * @param string $source - * - * @return self - */ public function setSource(?string $source): self { + $this->initialized['source'] = true; $this->source = $source; return $this; } - /** - * @return string - */ public function getDestination(): ?string { return $this->destination; } - /** - * @param string $destination - * - * @return self - */ public function setDestination(?string $destination): self { + $this->initialized['destination'] = true; $this->destination = $destination; return $this; } - /** - * @return string - */ public function getType(): ?string { return $this->type; } - /** - * @param string $type - * - * @return self - */ public function setType(?string $type): self { + $this->initialized['type'] = true; $this->type = $type; return $this; } /** - * @return string[] + * @return list|null */ public function getOptions(): ?array { @@ -170,12 +137,11 @@ public function getOptions(): ?array } /** - * @param string[] $options - * - * @return self + * @param list|null $options */ public function setOptions(?array $options): self { + $this->initialized['options'] = true; $this->options = $options; return $this; diff --git a/src/Model/TaskSpecPluginSpecPluginPrivilegeItem.php b/src/Model/PluginPrivilege.php similarity index 62% rename from src/Model/TaskSpecPluginSpecPluginPrivilegeItem.php rename to src/Model/PluginPrivilege.php index 25e9eb98..557af43b 100644 --- a/src/Model/TaskSpecPluginSpecPluginPrivilegeItem.php +++ b/src/Model/PluginPrivilege.php @@ -2,71 +2,60 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecPluginSpecPluginPrivilegeItem +class PluginPrivilege extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $name; /** - * @var string + * @var string|null */ protected $description; /** - * @var string[] + * @var list|null */ protected $value; - /** - * @return string - */ public function getName(): ?string { return $this->name; } - /** - * @param string $name - * - * @return self - */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } - /** - * @return string - */ public function getDescription(): ?string { return $this->description; } - /** - * @param string $description - * - * @return self - */ public function setDescription(?string $description): self { + $this->initialized['description'] = true; $this->description = $description; return $this; } /** - * @return string[] + * @return list|null */ public function getValue(): ?array { @@ -74,12 +63,11 @@ public function getValue(): ?array } /** - * @param string[] $value - * - * @return self + * @param list|null $value */ public function setValue(?array $value): self { + $this->initialized['value'] = true; $this->value = $value; return $this; diff --git a/src/Model/PluginSettings.php b/src/Model/PluginSettings.php index 51e33474..543ecf60 100644 --- a/src/Model/PluginSettings.php +++ b/src/Model/PluginSettings.php @@ -2,35 +2,38 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class PluginSettings +class PluginSettings extends \ArrayObject { /** - * @var PluginMount[] + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var list|null */ protected $mounts; /** - * @var string[] + * @var list|null */ protected $env; /** - * @var string[] + * @var list|null */ protected $args; /** - * @var PluginDevice[] + * @var list|null */ protected $devices; /** - * @return PluginMount[] + * @return list|null */ public function getMounts(): ?array { @@ -38,19 +41,18 @@ public function getMounts(): ?array } /** - * @param PluginMount[] $mounts - * - * @return self + * @param list|null $mounts */ public function setMounts(?array $mounts): self { + $this->initialized['mounts'] = true; $this->mounts = $mounts; return $this; } /** - * @return string[] + * @return list|null */ public function getEnv(): ?array { @@ -58,19 +60,18 @@ public function getEnv(): ?array } /** - * @param string[] $env - * - * @return self + * @param list|null $env */ public function setEnv(?array $env): self { + $this->initialized['env'] = true; $this->env = $env; return $this; } /** - * @return string[] + * @return list|null */ public function getArgs(): ?array { @@ -78,19 +79,18 @@ public function getArgs(): ?array } /** - * @param string[] $args - * - * @return self + * @param list|null $args */ public function setArgs(?array $args): self { + $this->initialized['args'] = true; $this->args = $args; return $this; } /** - * @return PluginDevice[] + * @return list|null */ public function getDevices(): ?array { @@ -98,12 +98,11 @@ public function getDevices(): ?array } /** - * @param PluginDevice[] $devices - * - * @return self + * @param list|null $devices */ public function setDevices(?array $devices): self { + $this->initialized['devices'] = true; $this->devices = $devices; return $this; diff --git a/src/Model/PluginsInfo.php b/src/Model/PluginsInfo.php index 7dc58983..41c73db2 100644 --- a/src/Model/PluginsInfo.php +++ b/src/Model/PluginsInfo.php @@ -2,45 +2,48 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class PluginsInfo +class PluginsInfo extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Names of available volume-drivers, and network-driver plugins. * - * @var string[] + * @var list|null */ protected $volume; /** * Names of available network-drivers, and network-driver plugins. * - * @var string[] + * @var list|null */ protected $network; /** * Names of available authorization plugins. * - * @var string[] + * @var list|null */ protected $authorization; /** * Names of available logging-drivers, and logging-driver plugins. * - * @var string[] + * @var list|null */ protected $log; /** * Names of available volume-drivers, and network-driver plugins. * - * @return string[] + * @return list|null */ public function getVolume(): ?array { @@ -50,12 +53,11 @@ public function getVolume(): ?array /** * Names of available volume-drivers, and network-driver plugins. * - * @param string[] $volume - * - * @return self + * @param list|null $volume */ public function setVolume(?array $volume): self { + $this->initialized['volume'] = true; $this->volume = $volume; return $this; @@ -64,7 +66,7 @@ public function setVolume(?array $volume): self /** * Names of available network-drivers, and network-driver plugins. * - * @return string[] + * @return list|null */ public function getNetwork(): ?array { @@ -74,12 +76,11 @@ public function getNetwork(): ?array /** * Names of available network-drivers, and network-driver plugins. * - * @param string[] $network - * - * @return self + * @param list|null $network */ public function setNetwork(?array $network): self { + $this->initialized['network'] = true; $this->network = $network; return $this; @@ -88,7 +89,7 @@ public function setNetwork(?array $network): self /** * Names of available authorization plugins. * - * @return string[] + * @return list|null */ public function getAuthorization(): ?array { @@ -98,12 +99,11 @@ public function getAuthorization(): ?array /** * Names of available authorization plugins. * - * @param string[] $authorization - * - * @return self + * @param list|null $authorization */ public function setAuthorization(?array $authorization): self { + $this->initialized['authorization'] = true; $this->authorization = $authorization; return $this; @@ -112,7 +112,7 @@ public function setAuthorization(?array $authorization): self /** * Names of available logging-drivers, and logging-driver plugins. * - * @return string[] + * @return list|null */ public function getLog(): ?array { @@ -122,12 +122,11 @@ public function getLog(): ?array /** * Names of available logging-drivers, and logging-driver plugins. * - * @param string[] $log - * - * @return self + * @param list|null $log */ public function setLog(?array $log): self { + $this->initialized['log'] = true; $this->log = $log; return $this; diff --git a/src/Model/PluginsNameUpgradePostBodyItem.php b/src/Model/PluginsNameUpgradePostBodyItem.php deleted file mode 100644 index 5a9073b4..00000000 --- a/src/Model/PluginsNameUpgradePostBodyItem.php +++ /dev/null @@ -1,87 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName(?string $name): self - { - $this->name = $name; - - return $this; - } - - /** - * @return string - */ - public function getDescription(): ?string - { - return $this->description; - } - - /** - * @param string $description - * - * @return self - */ - public function setDescription(?string $description): self - { - $this->description = $description; - - return $this; - } - - /** - * @return string[] - */ - public function getValue(): ?array - { - return $this->value; - } - - /** - * @param string[] $value - * - * @return self - */ - public function setValue(?array $value): self - { - $this->value = $value; - - return $this; - } -} diff --git a/src/Model/PluginsPrivilegesGetResponse200Item.php b/src/Model/PluginsPrivilegesGetResponse200Item.php deleted file mode 100644 index 49a10a0c..00000000 --- a/src/Model/PluginsPrivilegesGetResponse200Item.php +++ /dev/null @@ -1,87 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName(?string $name): self - { - $this->name = $name; - - return $this; - } - - /** - * @return string - */ - public function getDescription(): ?string - { - return $this->description; - } - - /** - * @param string $description - * - * @return self - */ - public function setDescription(?string $description): self - { - $this->description = $description; - - return $this; - } - - /** - * @return string[] - */ - public function getValue(): ?array - { - return $this->value; - } - - /** - * @param string[] $value - * - * @return self - */ - public function setValue(?array $value): self - { - $this->value = $value; - - return $this; - } -} diff --git a/src/Model/PluginsPullPostBodyItem.php b/src/Model/PluginsPullPostBodyItem.php deleted file mode 100644 index ea478a53..00000000 --- a/src/Model/PluginsPullPostBodyItem.php +++ /dev/null @@ -1,87 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName(?string $name): self - { - $this->name = $name; - - return $this; - } - - /** - * @return string - */ - public function getDescription(): ?string - { - return $this->description; - } - - /** - * @param string $description - * - * @return self - */ - public function setDescription(?string $description): self - { - $this->description = $description; - - return $this; - } - - /** - * @return string[] - */ - public function getValue(): ?array - { - return $this->value; - } - - /** - * @param string[] $value - * - * @return self - */ - public function setValue(?array $value): self - { - $this->value = $value; - - return $this; - } -} diff --git a/src/Model/Port.php b/src/Model/Port.php index 4a53824f..cde2781c 100644 --- a/src/Model/Port.php +++ b/src/Model/Port.php @@ -2,39 +2,44 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Port +class Port extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * Host IP address that the container's port is mapped to. + * + * @var string|null */ protected $iP; /** * Port on the container. * - * @var int + * @var int|null */ protected $privatePort; /** * Port exposed on the host. * - * @var int + * @var int|null */ protected $publicPort; /** - * @var string + * @var string|null */ protected $type; /** - * @return string + * Host IP address that the container's port is mapped to. */ public function getIP(): ?string { @@ -42,12 +47,11 @@ public function getIP(): ?string } /** - * @param string $iP - * - * @return self + * Host IP address that the container's port is mapped to. */ public function setIP(?string $iP): self { + $this->initialized['iP'] = true; $this->iP = $iP; return $this; @@ -55,8 +59,6 @@ public function setIP(?string $iP): self /** * Port on the container. - * - * @return int */ public function getPrivatePort(): ?int { @@ -65,13 +67,10 @@ public function getPrivatePort(): ?int /** * Port on the container. - * - * @param int $privatePort - * - * @return self */ public function setPrivatePort(?int $privatePort): self { + $this->initialized['privatePort'] = true; $this->privatePort = $privatePort; return $this; @@ -79,8 +78,6 @@ public function setPrivatePort(?int $privatePort): self /** * Port exposed on the host. - * - * @return int */ public function getPublicPort(): ?int { @@ -89,33 +86,23 @@ public function getPublicPort(): ?int /** * Port exposed on the host. - * - * @param int $publicPort - * - * @return self */ public function setPublicPort(?int $publicPort): self { + $this->initialized['publicPort'] = true; $this->publicPort = $publicPort; return $this; } - /** - * @return string - */ public function getType(): ?string { return $this->type; } - /** - * @param string $type - * - * @return self - */ public function setType(?string $type): self { + $this->initialized['type'] = true; $this->type = $type; return $this; diff --git a/src/Model/PortBinding.php b/src/Model/PortBinding.php index 108d6796..038cfbfb 100644 --- a/src/Model/PortBinding.php +++ b/src/Model/PortBinding.php @@ -2,33 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class PortBinding +class PortBinding extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Host IP address that the container's port is mapped to. * - * @var string + * @var string|null */ protected $hostIp; /** * Host port number that the container's port is mapped to. * - * @var string + * @var string|null */ protected $hostPort; /** * Host IP address that the container's port is mapped to. - * - * @return string */ public function getHostIp(): ?string { @@ -37,13 +38,10 @@ public function getHostIp(): ?string /** * Host IP address that the container's port is mapped to. - * - * @param string $hostIp - * - * @return self */ public function setHostIp(?string $hostIp): self { + $this->initialized['hostIp'] = true; $this->hostIp = $hostIp; return $this; @@ -51,8 +49,6 @@ public function setHostIp(?string $hostIp): self /** * Host port number that the container's port is mapped to. - * - * @return string */ public function getHostPort(): ?string { @@ -61,13 +57,10 @@ public function getHostPort(): ?string /** * Host port number that the container's port is mapped to. - * - * @param string $hostPort - * - * @return self */ public function setHostPort(?string $hostPort): self { + $this->initialized['hostPort'] = true; $this->hostPort = $hostPort; return $this; diff --git a/src/Model/PortStatus.php b/src/Model/PortStatus.php new file mode 100644 index 00000000..af7d5237 --- /dev/null +++ b/src/Model/PortStatus.php @@ -0,0 +1,41 @@ +initialized); + } + /** + * @var list|null + */ + protected $ports; + + /** + * @return list|null + */ + public function getPorts(): ?array + { + return $this->ports; + } + + /** + * @param list|null $ports + */ + public function setPorts(?array $ports): self + { + $this->initialized['ports'] = true; + $this->ports = $ports; + + return $this; + } +} diff --git a/src/Model/ProcessConfig.php b/src/Model/ProcessConfig.php index b59c92d3..65ba9c3b 100644 --- a/src/Model/ProcessConfig.php +++ b/src/Model/ProcessConfig.php @@ -2,119 +2,94 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ProcessConfig +class ProcessConfig extends \ArrayObject { /** - * @var bool + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var bool|null */ protected $privileged; /** - * @var string + * @var string|null */ protected $user; /** - * @var bool + * @var bool|null */ protected $tty; /** - * @var string + * @var string|null */ protected $entrypoint; /** - * @var string[] + * @var list|null */ protected $arguments; - /** - * @return bool - */ public function getPrivileged(): ?bool { return $this->privileged; } - /** - * @param bool $privileged - * - * @return self - */ public function setPrivileged(?bool $privileged): self { + $this->initialized['privileged'] = true; $this->privileged = $privileged; return $this; } - /** - * @return string - */ public function getUser(): ?string { return $this->user; } - /** - * @param string $user - * - * @return self - */ public function setUser(?string $user): self { + $this->initialized['user'] = true; $this->user = $user; return $this; } - /** - * @return bool - */ public function getTty(): ?bool { return $this->tty; } - /** - * @param bool $tty - * - * @return self - */ public function setTty(?bool $tty): self { + $this->initialized['tty'] = true; $this->tty = $tty; return $this; } - /** - * @return string - */ public function getEntrypoint(): ?string { return $this->entrypoint; } - /** - * @param string $entrypoint - * - * @return self - */ public function setEntrypoint(?string $entrypoint): self { + $this->initialized['entrypoint'] = true; $this->entrypoint = $entrypoint; return $this; } /** - * @return string[] + * @return list|null */ public function getArguments(): ?array { @@ -122,12 +97,11 @@ public function getArguments(): ?array } /** - * @param string[] $arguments - * - * @return self + * @param list|null $arguments */ public function setArguments(?array $arguments): self { + $this->initialized['arguments'] = true; $this->arguments = $arguments; return $this; diff --git a/src/Model/ProgressDetail.php b/src/Model/ProgressDetail.php index b3078ba7..61584344 100644 --- a/src/Model/ProgressDetail.php +++ b/src/Model/ProgressDetail.php @@ -2,60 +2,49 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ProgressDetail +class ProgressDetail extends \ArrayObject { /** - * @var int + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var int|null */ protected $current; /** - * @var int + * @var int|null */ protected $total; - /** - * @return int - */ public function getCurrent(): ?int { return $this->current; } - /** - * @param int $current - * - * @return self - */ public function setCurrent(?int $current): self { + $this->initialized['current'] = true; $this->current = $current; return $this; } - /** - * @return int - */ public function getTotal(): ?int { return $this->total; } - /** - * @param int $total - * - * @return self - */ public function setTotal(?int $total): self { + $this->initialized['total'] = true; $this->total = $total; return $this; diff --git a/src/Model/PushImageInfo.php b/src/Model/PushImageInfo.php index 898307dd..662938a2 100644 --- a/src/Model/PushImageInfo.php +++ b/src/Model/PushImageInfo.php @@ -2,108 +2,83 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class PushImageInfo +class PushImageInfo extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $error; /** - * @var string + * @var string|null */ protected $status; /** - * @var string + * @var string|null */ protected $progress; /** - * @var ProgressDetail + * @var ProgressDetail|null */ protected $progressDetail; - /** - * @return string - */ public function getError(): ?string { return $this->error; } - /** - * @param string $error - * - * @return self - */ public function setError(?string $error): self { + $this->initialized['error'] = true; $this->error = $error; return $this; } - /** - * @return string - */ public function getStatus(): ?string { return $this->status; } - /** - * @param string $status - * - * @return self - */ public function setStatus(?string $status): self { + $this->initialized['status'] = true; $this->status = $status; return $this; } - /** - * @return string - */ public function getProgress(): ?string { return $this->progress; } - /** - * @param string $progress - * - * @return self - */ public function setProgress(?string $progress): self { + $this->initialized['progress'] = true; $this->progress = $progress; return $this; } - /** - * @return ProgressDetail - */ public function getProgressDetail(): ?ProgressDetail { return $this->progressDetail; } - /** - * @param ProgressDetail $progressDetail - * - * @return self - */ public function setProgressDetail(?ProgressDetail $progressDetail): self { + $this->initialized['progressDetail'] = true; $this->progressDetail = $progressDetail; return $this; diff --git a/src/Model/RegistryServiceConfig.php b/src/Model/RegistryServiceConfig.php index e8ed0c79..bda10c0a 100644 --- a/src/Model/RegistryServiceConfig.php +++ b/src/Model/RegistryServiceConfig.php @@ -2,136 +2,134 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class RegistryServiceConfig +class RegistryServiceConfig extends \ArrayObject { /** - * List of IP ranges to which nondistributable artifacts can be pushed,. - using the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632). - - Some images (for example, Windows base images) contain artifacts - whose distribution is restricted by license. When these images are - pushed to a registry, restricted artifacts are not included. - - This configuration override this behavior, and enables the daemon to - push nondistributable artifacts to all registries whose resolved IP - address is within the subnet described by the CIDR syntax. - - This option is useful when pushing images containing - nondistributable artifacts to a registry on an air-gapped network so - hosts on that network can pull the images without connecting to - another server. - - > **Warning**: Nondistributable artifacts typically have restrictions - > on how and where they can be distributed and shared. Only use this - > feature to push artifacts to private registries and ensure that you - > are in compliance with any terms that cover redistributing - > nondistributable artifacts. + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * List of IP ranges to which nondistributable artifacts can be pushed, + * using the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632). + * + * Some images (for example, Windows base images) contain artifacts + * whose distribution is restricted by license. When these images are + * pushed to a registry, restricted artifacts are not included. + * + * This configuration override this behavior, and enables the daemon to + * push nondistributable artifacts to all registries whose resolved IP + * address is within the subnet described by the CIDR syntax. * - * @var string[] + * This option is useful when pushing images containing + * nondistributable artifacts to a registry on an air-gapped network so + * hosts on that network can pull the images without connecting to + * another server. + * + * > **Warning**: Nondistributable artifacts typically have restrictions + * > on how and where they can be distributed and shared. Only use this + * > feature to push artifacts to private registries and ensure that you + * > are in compliance with any terms that cover redistributing + * > nondistributable artifacts. + * + * @var list|null */ protected $allowNondistributableArtifactsCIDRs; /** - * List of registry hostnames to which nondistributable artifacts can be. - pushed, using the format `[:]` or `[:]`. - - Some images (for example, Windows base images) contain artifacts - whose distribution is restricted by license. When these images are - pushed to a registry, restricted artifacts are not included. - - This configuration override this behavior for the specified - registries. - - This option is useful when pushing images containing - nondistributable artifacts to a registry on an air-gapped network so - hosts on that network can pull the images without connecting to - another server. - - > **Warning**: Nondistributable artifacts typically have restrictions - > on how and where they can be distributed and shared. Only use this - > feature to push artifacts to private registries and ensure that you - > are in compliance with any terms that cover redistributing - > nondistributable artifacts. - + * List of registry hostnames to which nondistributable artifacts can be + * pushed, using the format `[:]` or `[:]`. + * + * Some images (for example, Windows base images) contain artifacts + * whose distribution is restricted by license. When these images are + * pushed to a registry, restricted artifacts are not included. + * + * This configuration override this behavior for the specified + * registries. + * + * This option is useful when pushing images containing + * nondistributable artifacts to a registry on an air-gapped network so + * hosts on that network can pull the images without connecting to + * another server. + * + * > **Warning**: Nondistributable artifacts typically have restrictions + * > on how and where they can be distributed and shared. Only use this + * > feature to push artifacts to private registries and ensure that you + * > are in compliance with any terms that cover redistributing + * > nondistributable artifacts. * - * @var string[] + * @var list|null */ protected $allowNondistributableArtifactsHostnames; /** - * List of IP ranges of insecure registries, using the CIDR syntax. - ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries - accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates - from unknown CAs) communication. - - By default, local registries (`127.0.0.0/8`) are configured as - insecure. All other registries are secure. Communicating with an - insecure registry is not possible if the daemon assumes that registry - is secure. - - This configuration override this behavior, insecure communication with - registries whose resolved IP address is within the subnet described by - the CIDR syntax. - - Registries can also be marked insecure by hostname. Those registries - are listed under `IndexConfigs` and have their `Secure` field set to - `false`. - - > **Warning**: Using this option can be useful when running a local - > registry, but introduces security vulnerabilities. This option - > should therefore ONLY be used for testing purposes. For increased - > security, users should add their CA to their system's list of trusted - > CAs instead of enabling this option. - + * List of IP ranges of insecure registries, using the CIDR syntax + * ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries + * accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates + * from unknown CAs) communication. + * + * By default, local registries (`127.0.0.0/8`) are configured as + * insecure. All other registries are secure. Communicating with an + * insecure registry is not possible if the daemon assumes that registry + * is secure. * - * @var string[] + * This configuration override this behavior, insecure communication with + * registries whose resolved IP address is within the subnet described by + * the CIDR syntax. + * + * Registries can also be marked insecure by hostname. Those registries + * are listed under `IndexConfigs` and have their `Secure` field set to + * `false`. + * + * > **Warning**: Using this option can be useful when running a local + * > registry, but introduces security vulnerabilities. This option + * > should therefore ONLY be used for testing purposes. For increased + * > security, users should add their CA to their system's list of trusted + * > CAs instead of enabling this option. + * + * @var list|null */ protected $insecureRegistryCIDRs; /** - * @var IndexInfo[] + * @var array|null */ protected $indexConfigs; /** - * List of registry URLs that act as a mirror for the official. - (`docker.io`) registry. - + * List of registry URLs that act as a mirror for the official + * (`docker.io`) registry. * - * @var string[] + * @var list|null */ protected $mirrors; /** - * List of IP ranges to which nondistributable artifacts can be pushed,. - using the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632). - - Some images (for example, Windows base images) contain artifacts - whose distribution is restricted by license. When these images are - pushed to a registry, restricted artifacts are not included. - - This configuration override this behavior, and enables the daemon to - push nondistributable artifacts to all registries whose resolved IP - address is within the subnet described by the CIDR syntax. - - This option is useful when pushing images containing - nondistributable artifacts to a registry on an air-gapped network so - hosts on that network can pull the images without connecting to - another server. - - > **Warning**: Nondistributable artifacts typically have restrictions - > on how and where they can be distributed and shared. Only use this - > feature to push artifacts to private registries and ensure that you - > are in compliance with any terms that cover redistributing - > nondistributable artifacts. - + * List of IP ranges to which nondistributable artifacts can be pushed, + * using the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632). + * + * Some images (for example, Windows base images) contain artifacts + * whose distribution is restricted by license. When these images are + * pushed to a registry, restricted artifacts are not included. + * + * This configuration override this behavior, and enables the daemon to + * push nondistributable artifacts to all registries whose resolved IP + * address is within the subnet described by the CIDR syntax. * - * @return string[] + * This option is useful when pushing images containing + * nondistributable artifacts to a registry on an air-gapped network so + * hosts on that network can pull the images without connecting to + * another server. + * + * > **Warning**: Nondistributable artifacts typically have restrictions + * > on how and where they can be distributed and shared. Only use this + * > feature to push artifacts to private registries and ensure that you + * > are in compliance with any terms that cover redistributing + * > nondistributable artifacts. + * + * @return list|null */ public function getAllowNondistributableArtifactsCIDRs(): ?array { @@ -139,64 +137,61 @@ public function getAllowNondistributableArtifactsCIDRs(): ?array } /** - * List of IP ranges to which nondistributable artifacts can be pushed,. - using the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632). - - Some images (for example, Windows base images) contain artifacts - whose distribution is restricted by license. When these images are - pushed to a registry, restricted artifacts are not included. - - This configuration override this behavior, and enables the daemon to - push nondistributable artifacts to all registries whose resolved IP - address is within the subnet described by the CIDR syntax. - - This option is useful when pushing images containing - nondistributable artifacts to a registry on an air-gapped network so - hosts on that network can pull the images without connecting to - another server. - - > **Warning**: Nondistributable artifacts typically have restrictions - > on how and where they can be distributed and shared. Only use this - > feature to push artifacts to private registries and ensure that you - > are in compliance with any terms that cover redistributing - > nondistributable artifacts. - + * List of IP ranges to which nondistributable artifacts can be pushed, + * using the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632). + * + * Some images (for example, Windows base images) contain artifacts + * whose distribution is restricted by license. When these images are + * pushed to a registry, restricted artifacts are not included. * - * @param string[] $allowNondistributableArtifactsCIDRs + * This configuration override this behavior, and enables the daemon to + * push nondistributable artifacts to all registries whose resolved IP + * address is within the subnet described by the CIDR syntax. * - * @return self + * This option is useful when pushing images containing + * nondistributable artifacts to a registry on an air-gapped network so + * hosts on that network can pull the images without connecting to + * another server. + * + * > **Warning**: Nondistributable artifacts typically have restrictions + * > on how and where they can be distributed and shared. Only use this + * > feature to push artifacts to private registries and ensure that you + * > are in compliance with any terms that cover redistributing + * > nondistributable artifacts. + * + * @param list|null $allowNondistributableArtifactsCIDRs */ public function setAllowNondistributableArtifactsCIDRs(?array $allowNondistributableArtifactsCIDRs): self { + $this->initialized['allowNondistributableArtifactsCIDRs'] = true; $this->allowNondistributableArtifactsCIDRs = $allowNondistributableArtifactsCIDRs; return $this; } /** - * List of registry hostnames to which nondistributable artifacts can be. - pushed, using the format `[:]` or `[:]`. - - Some images (for example, Windows base images) contain artifacts - whose distribution is restricted by license. When these images are - pushed to a registry, restricted artifacts are not included. - - This configuration override this behavior for the specified - registries. - - This option is useful when pushing images containing - nondistributable artifacts to a registry on an air-gapped network so - hosts on that network can pull the images without connecting to - another server. - - > **Warning**: Nondistributable artifacts typically have restrictions - > on how and where they can be distributed and shared. Only use this - > feature to push artifacts to private registries and ensure that you - > are in compliance with any terms that cover redistributing - > nondistributable artifacts. - + * List of registry hostnames to which nondistributable artifacts can be + * pushed, using the format `[:]` or `[:]`. + * + * Some images (for example, Windows base images) contain artifacts + * whose distribution is restricted by license. When these images are + * pushed to a registry, restricted artifacts are not included. * - * @return string[] + * This configuration override this behavior for the specified + * registries. + * + * This option is useful when pushing images containing + * nondistributable artifacts to a registry on an air-gapped network so + * hosts on that network can pull the images without connecting to + * another server. + * + * > **Warning**: Nondistributable artifacts typically have restrictions + * > on how and where they can be distributed and shared. Only use this + * > feature to push artifacts to private registries and ensure that you + * > are in compliance with any terms that cover redistributing + * > nondistributable artifacts. + * + * @return list|null */ public function getAllowNondistributableArtifactsHostnames(): ?array { @@ -204,66 +199,63 @@ public function getAllowNondistributableArtifactsHostnames(): ?array } /** - * List of registry hostnames to which nondistributable artifacts can be. - pushed, using the format `[:]` or `[:]`. - - Some images (for example, Windows base images) contain artifacts - whose distribution is restricted by license. When these images are - pushed to a registry, restricted artifacts are not included. - - This configuration override this behavior for the specified - registries. - - This option is useful when pushing images containing - nondistributable artifacts to a registry on an air-gapped network so - hosts on that network can pull the images without connecting to - another server. - - > **Warning**: Nondistributable artifacts typically have restrictions - > on how and where they can be distributed and shared. Only use this - > feature to push artifacts to private registries and ensure that you - > are in compliance with any terms that cover redistributing - > nondistributable artifacts. - + * List of registry hostnames to which nondistributable artifacts can be + * pushed, using the format `[:]` or `[:]`. + * + * Some images (for example, Windows base images) contain artifacts + * whose distribution is restricted by license. When these images are + * pushed to a registry, restricted artifacts are not included. + * + * This configuration override this behavior for the specified + * registries. + * + * This option is useful when pushing images containing + * nondistributable artifacts to a registry on an air-gapped network so + * hosts on that network can pull the images without connecting to + * another server. * - * @param string[] $allowNondistributableArtifactsHostnames + * > **Warning**: Nondistributable artifacts typically have restrictions + * > on how and where they can be distributed and shared. Only use this + * > feature to push artifacts to private registries and ensure that you + * > are in compliance with any terms that cover redistributing + * > nondistributable artifacts. * - * @return self + * @param list|null $allowNondistributableArtifactsHostnames */ public function setAllowNondistributableArtifactsHostnames(?array $allowNondistributableArtifactsHostnames): self { + $this->initialized['allowNondistributableArtifactsHostnames'] = true; $this->allowNondistributableArtifactsHostnames = $allowNondistributableArtifactsHostnames; return $this; } /** - * List of IP ranges of insecure registries, using the CIDR syntax. - ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries - accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates - from unknown CAs) communication. - - By default, local registries (`127.0.0.0/8`) are configured as - insecure. All other registries are secure. Communicating with an - insecure registry is not possible if the daemon assumes that registry - is secure. - - This configuration override this behavior, insecure communication with - registries whose resolved IP address is within the subnet described by - the CIDR syntax. - - Registries can also be marked insecure by hostname. Those registries - are listed under `IndexConfigs` and have their `Secure` field set to - `false`. - - > **Warning**: Using this option can be useful when running a local - > registry, but introduces security vulnerabilities. This option - > should therefore ONLY be used for testing purposes. For increased - > security, users should add their CA to their system's list of trusted - > CAs instead of enabling this option. - + * List of IP ranges of insecure registries, using the CIDR syntax + * ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries + * accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates + * from unknown CAs) communication. + * + * By default, local registries (`127.0.0.0/8`) are configured as + * insecure. All other registries are secure. Communicating with an + * insecure registry is not possible if the daemon assumes that registry + * is secure. * - * @return string[] + * This configuration override this behavior, insecure communication with + * registries whose resolved IP address is within the subnet described by + * the CIDR syntax. + * + * Registries can also be marked insecure by hostname. Those registries + * are listed under `IndexConfigs` and have their `Secure` field set to + * `false`. + * + * > **Warning**: Using this option can be useful when running a local + * > registry, but introduces security vulnerabilities. This option + * > should therefore ONLY be used for testing purposes. For increased + * > security, users should add their CA to their system's list of trusted + * > CAs instead of enabling this option. + * + * @return list|null */ public function getInsecureRegistryCIDRs(): ?array { @@ -271,68 +263,64 @@ public function getInsecureRegistryCIDRs(): ?array } /** - * List of IP ranges of insecure registries, using the CIDR syntax. - ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries - accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates - from unknown CAs) communication. - - By default, local registries (`127.0.0.0/8`) are configured as - insecure. All other registries are secure. Communicating with an - insecure registry is not possible if the daemon assumes that registry - is secure. - - This configuration override this behavior, insecure communication with - registries whose resolved IP address is within the subnet described by - the CIDR syntax. - - Registries can also be marked insecure by hostname. Those registries - are listed under `IndexConfigs` and have their `Secure` field set to - `false`. - - > **Warning**: Using this option can be useful when running a local - > registry, but introduces security vulnerabilities. This option - > should therefore ONLY be used for testing purposes. For increased - > security, users should add their CA to their system's list of trusted - > CAs instead of enabling this option. - + * List of IP ranges of insecure registries, using the CIDR syntax + * ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries + * accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates + * from unknown CAs) communication. + * + * By default, local registries (`127.0.0.0/8`) are configured as + * insecure. All other registries are secure. Communicating with an + * insecure registry is not possible if the daemon assumes that registry + * is secure. + * + * This configuration override this behavior, insecure communication with + * registries whose resolved IP address is within the subnet described by + * the CIDR syntax. * - * @param string[] $insecureRegistryCIDRs + * Registries can also be marked insecure by hostname. Those registries + * are listed under `IndexConfigs` and have their `Secure` field set to + * `false`. * - * @return self + * > **Warning**: Using this option can be useful when running a local + * > registry, but introduces security vulnerabilities. This option + * > should therefore ONLY be used for testing purposes. For increased + * > security, users should add their CA to their system's list of trusted + * > CAs instead of enabling this option. + * + * @param list|null $insecureRegistryCIDRs */ public function setInsecureRegistryCIDRs(?array $insecureRegistryCIDRs): self { + $this->initialized['insecureRegistryCIDRs'] = true; $this->insecureRegistryCIDRs = $insecureRegistryCIDRs; return $this; } /** - * @return IndexInfo[] + * @return array|null */ - public function getIndexConfigs(): ?\ArrayObject + public function getIndexConfigs(): ?iterable { return $this->indexConfigs; } /** - * @param IndexInfo[] $indexConfigs - * - * @return self + * @param array|null $indexConfigs */ - public function setIndexConfigs(?\ArrayObject $indexConfigs): self + public function setIndexConfigs(?iterable $indexConfigs): self { + $this->initialized['indexConfigs'] = true; $this->indexConfigs = $indexConfigs; return $this; } /** - * List of registry URLs that act as a mirror for the official. - (`docker.io`) registry. - + * List of registry URLs that act as a mirror for the official + * (`docker.io`) registry. * - * @return string[] + * @return list|null */ public function getMirrors(): ?array { @@ -340,16 +328,14 @@ public function getMirrors(): ?array } /** - * List of registry URLs that act as a mirror for the official. - (`docker.io`) registry. - - * - * @param string[] $mirrors + * List of registry URLs that act as a mirror for the official + * (`docker.io`) registry. * - * @return self + * @param list|null $mirrors */ public function setMirrors(?array $mirrors): self { + $this->initialized['mirrors'] = true; $this->mirrors = $mirrors; return $this; diff --git a/src/Model/ResourceObject.php b/src/Model/ResourceObject.php index 4b839c74..b8b1ec65 100644 --- a/src/Model/ResourceObject.php +++ b/src/Model/ResourceObject.php @@ -2,75 +2,66 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ResourceObject +class ResourceObject extends \ArrayObject { /** - * @var int + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var int|null */ protected $nanoCPUs; /** - * @var int + * @var int|null */ protected $memoryBytes; /** - * User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`). + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + * String resources (e.g, `GPU=UUID1`). * - * @var GenericResourcesItem[] + * @var list|null */ protected $genericResources; - /** - * @return int - */ public function getNanoCPUs(): ?int { return $this->nanoCPUs; } - /** - * @param int $nanoCPUs - * - * @return self - */ public function setNanoCPUs(?int $nanoCPUs): self { + $this->initialized['nanoCPUs'] = true; $this->nanoCPUs = $nanoCPUs; return $this; } - /** - * @return int - */ public function getMemoryBytes(): ?int { return $this->memoryBytes; } - /** - * @param int $memoryBytes - * - * @return self - */ public function setMemoryBytes(?int $memoryBytes): self { + $this->initialized['memoryBytes'] = true; $this->memoryBytes = $memoryBytes; return $this; } /** - * User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`). + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + * String resources (e.g, `GPU=UUID1`). * - * @return GenericResourcesItem[] + * @return list|null */ public function getGenericResources(): ?array { @@ -78,14 +69,14 @@ public function getGenericResources(): ?array } /** - * User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`). - * - * @param GenericResourcesItem[] $genericResources + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + * String resources (e.g, `GPU=UUID1`). * - * @return self + * @param list|null $genericResources */ public function setGenericResources(?array $genericResources): self { + $this->initialized['genericResources'] = true; $this->genericResources = $genericResources; return $this; diff --git a/src/Model/Resources.php b/src/Model/Resources.php index 2568c5c2..ac83f6c4 100644 --- a/src/Model/Resources.php +++ b/src/Model/Resources.php @@ -2,207 +2,258 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Resources +class Resources extends \ArrayObject { /** - * An integer value representing this container's relative CPU weight versus other containers. + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * An integer value representing this container's relative CPU weight + * versus other containers. * - * @var int + * @var int|null */ protected $cpuShares; /** * Memory limit in bytes. * - * @var int + * @var int|null */ - protected $memory; + protected $memory = 0; /** - * 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. + * 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. * - * @var string + * @var string|null */ protected $cgroupParent; /** * Block IO weight (relative weight). * - * @var int + * @var int|null */ protected $blkioWeight; /** - * Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. + * Block IO weight (relative device weight) in the form: + * + * ``` + * [{"Path": "device_path", "Weight": weight}] + * ``` * - * @var ResourcesBlkioWeightDeviceItem[] + * @var list|null */ protected $blkioWeightDevice; /** - * Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (bytes per second) from a device, in the form: * - * @var ThrottleDevice[] + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` + * + * @var list|null */ protected $blkioDeviceReadBps; /** - * Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (bytes per second) to a device, in the form: + * + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @var ThrottleDevice[] + * @var list|null */ protected $blkioDeviceWriteBps; /** - * Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (IO per second) from a device, in the form: * - * @var ThrottleDevice[] + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` + * + * @var list|null */ protected $blkioDeviceReadIOps; /** - * Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (IO per second) to a device, in the form: + * + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @var ThrottleDevice[] + * @var list|null */ protected $blkioDeviceWriteIOps; /** * The length of a CPU period in microseconds. * - * @var int + * @var int|null */ protected $cpuPeriod; /** * Microseconds of CPU time that the container can get in a CPU period. * - * @var int + * @var int|null */ protected $cpuQuota; /** - * The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks. + * The length of a CPU real-time period in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. * - * @var int + * @var int|null */ protected $cpuRealtimePeriod; /** - * The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks. + * The length of a CPU real-time runtime in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. * - * @var int + * @var int|null */ protected $cpuRealtimeRuntime; /** * CPUs in which to allow execution (e.g., `0-3`, `0,1`). * - * @var string + * @var string|null */ protected $cpusetCpus; /** - * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + * effective on NUMA systems. * - * @var string + * @var string|null */ protected $cpusetMems; /** * A list of devices to add to the container. * - * @var DeviceMapping[] + * @var list|null */ protected $devices; /** * a list of cgroup rules to apply to the container. * - * @var string[] + * @var list|null */ protected $deviceCgroupRules; /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @var int + * @var list|null */ - protected $diskQuota; + protected $deviceRequests; /** - * Kernel memory limit in bytes. + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + * OCI runtime in use, this option may be ignored. It is no longer supported + * by the default (runc) runtime. * - * @var int + * This field is omitted when empty. + * + * @var int|null */ - protected $kernelMemory; + protected $kernelMemoryTCP; /** * Memory soft limit in bytes. * - * @var int + * @var int|null */ protected $memoryReservation; /** - * Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + * swap. * - * @var int + * @var int|null */ protected $memorySwap; /** - * Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. + * Tune a container's memory swappiness behavior. Accepts an integer + * between 0 and 100. * - * @var int + * @var int|null */ protected $memorySwappiness; /** * CPU quota in units of 10-9 CPUs. * - * @var int + * @var int|null */ - protected $nanoCPUs; + protected $nanoCpus; /** * Disable OOM Killer for the container. * - * @var bool + * @var bool|null */ protected $oomKillDisable; /** - * Tune a container's pids limit. Set -1 for unlimited. + * Run an init inside the container that forwards signals and reaps + * processes. This field is omitted if empty, and the default (as + * configured on the daemon) is used. * - * @var int + * @var bool|null + */ + protected $init; + /** + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + * to not change. + * + * @var int|null */ protected $pidsLimit; /** - * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`". + * A list of resource limits to set in the container. For example: + * + * ``` + * {"Name": "nofile", "Soft": 1024, "Hard": 2048} + * ``` * - * @var ResourcesUlimitsItem[] + * @var list|null */ protected $ulimits; /** * The number of usable CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - * - * @var int + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. + * + * @var int|null */ protected $cpuCount; /** * The usable percentage of the available CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - * - * @var int + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. + * + * @var int|null */ protected $cpuPercent; /** * Maximum IOps for the container system drive (Windows only). * - * @var int + * @var int|null */ protected $iOMaximumIOps; /** - * Maximum IO in bytes per second for the container system drive (Windows only). + * Maximum IO in bytes per second for the container system drive + * (Windows only). * - * @var int + * @var int|null */ protected $iOMaximumBandwidth; /** - * An integer value representing this container's relative CPU weight versus other containers. - * - * @return int + * An integer value representing this container's relative CPU weight + * versus other containers. */ public function getCpuShares(): ?int { @@ -210,14 +261,12 @@ public function getCpuShares(): ?int } /** - * An integer value representing this container's relative CPU weight versus other containers. - * - * @param int $cpuShares - * - * @return self + * An integer value representing this container's relative CPU weight + * versus other containers. */ public function setCpuShares(?int $cpuShares): self { + $this->initialized['cpuShares'] = true; $this->cpuShares = $cpuShares; return $this; @@ -225,8 +274,6 @@ public function setCpuShares(?int $cpuShares): self /** * Memory limit in bytes. - * - * @return int */ public function getMemory(): ?int { @@ -235,22 +282,20 @@ public function getMemory(): ?int /** * Memory limit in bytes. - * - * @param int $memory - * - * @return self */ public function setMemory(?int $memory): self { + $this->initialized['memory'] = true; $this->memory = $memory; return $this; } /** - * 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. - * - * @return string + * 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. */ public function getCgroupParent(): ?string { @@ -258,14 +303,14 @@ public function getCgroupParent(): ?string } /** - * 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. - * - * @param string $cgroupParent - * - * @return self + * 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. */ public function setCgroupParent(?string $cgroupParent): self { + $this->initialized['cgroupParent'] = true; $this->cgroupParent = $cgroupParent; return $this; @@ -273,8 +318,6 @@ public function setCgroupParent(?string $cgroupParent): self /** * Block IO weight (relative weight). - * - * @return int */ public function getBlkioWeight(): ?int { @@ -283,22 +326,23 @@ public function getBlkioWeight(): ?int /** * Block IO weight (relative weight). - * - * @param int $blkioWeight - * - * @return self */ public function setBlkioWeight(?int $blkioWeight): self { + $this->initialized['blkioWeight'] = true; $this->blkioWeight = $blkioWeight; return $this; } /** - * Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. + * Block IO weight (relative device weight) in the form: * - * @return ResourcesBlkioWeightDeviceItem[] + * ``` + * [{"Path": "device_path", "Weight": weight}] + * ``` + * + * @return list|null */ public function getBlkioWeightDevice(): ?array { @@ -306,23 +350,30 @@ public function getBlkioWeightDevice(): ?array } /** - * Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`. + * Block IO weight (relative device weight) in the form: * - * @param ResourcesBlkioWeightDeviceItem[] $blkioWeightDevice + * ``` + * [{"Path": "device_path", "Weight": weight}] + * ``` * - * @return self + * @param list|null $blkioWeightDevice */ public function setBlkioWeightDevice(?array $blkioWeightDevice): self { + $this->initialized['blkioWeightDevice'] = true; $this->blkioWeightDevice = $blkioWeightDevice; return $this; } /** - * Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (bytes per second) from a device, in the form: + * + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return ThrottleDevice[] + * @return list|null */ public function getBlkioDeviceReadBps(): ?array { @@ -330,23 +381,30 @@ public function getBlkioDeviceReadBps(): ?array } /** - * Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (bytes per second) from a device, in the form: * - * @param ThrottleDevice[] $blkioDeviceReadBps + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return self + * @param list|null $blkioDeviceReadBps */ public function setBlkioDeviceReadBps(?array $blkioDeviceReadBps): self { + $this->initialized['blkioDeviceReadBps'] = true; $this->blkioDeviceReadBps = $blkioDeviceReadBps; return $this; } /** - * Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (bytes per second) to a device, in the form: * - * @return ThrottleDevice[] + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` + * + * @return list|null */ public function getBlkioDeviceWriteBps(): ?array { @@ -354,23 +412,30 @@ public function getBlkioDeviceWriteBps(): ?array } /** - * Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (bytes per second) to a device, in the form: * - * @param ThrottleDevice[] $blkioDeviceWriteBps + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return self + * @param list|null $blkioDeviceWriteBps */ public function setBlkioDeviceWriteBps(?array $blkioDeviceWriteBps): self { + $this->initialized['blkioDeviceWriteBps'] = true; $this->blkioDeviceWriteBps = $blkioDeviceWriteBps; return $this; } /** - * Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (IO per second) from a device, in the form: + * + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return ThrottleDevice[] + * @return list|null */ public function getBlkioDeviceReadIOps(): ?array { @@ -378,23 +443,30 @@ public function getBlkioDeviceReadIOps(): ?array } /** - * Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit read rate (IO per second) from a device, in the form: * - * @param ThrottleDevice[] $blkioDeviceReadIOps + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return self + * @param list|null $blkioDeviceReadIOps */ public function setBlkioDeviceReadIOps(?array $blkioDeviceReadIOps): self { + $this->initialized['blkioDeviceReadIOps'] = true; $this->blkioDeviceReadIOps = $blkioDeviceReadIOps; return $this; } /** - * Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (IO per second) to a device, in the form: * - * @return ThrottleDevice[] + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` + * + * @return list|null */ public function getBlkioDeviceWriteIOps(): ?array { @@ -402,14 +474,17 @@ public function getBlkioDeviceWriteIOps(): ?array } /** - * Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`. + * Limit write rate (IO per second) to a device, in the form: * - * @param ThrottleDevice[] $blkioDeviceWriteIOps + * ``` + * [{"Path": "device_path", "Rate": rate}] + * ``` * - * @return self + * @param list|null $blkioDeviceWriteIOps */ public function setBlkioDeviceWriteIOps(?array $blkioDeviceWriteIOps): self { + $this->initialized['blkioDeviceWriteIOps'] = true; $this->blkioDeviceWriteIOps = $blkioDeviceWriteIOps; return $this; @@ -417,8 +492,6 @@ public function setBlkioDeviceWriteIOps(?array $blkioDeviceWriteIOps): self /** * The length of a CPU period in microseconds. - * - * @return int */ public function getCpuPeriod(): ?int { @@ -427,13 +500,10 @@ public function getCpuPeriod(): ?int /** * The length of a CPU period in microseconds. - * - * @param int $cpuPeriod - * - * @return self */ public function setCpuPeriod(?int $cpuPeriod): self { + $this->initialized['cpuPeriod'] = true; $this->cpuPeriod = $cpuPeriod; return $this; @@ -441,8 +511,6 @@ public function setCpuPeriod(?int $cpuPeriod): self /** * Microseconds of CPU time that the container can get in a CPU period. - * - * @return int */ public function getCpuQuota(): ?int { @@ -451,22 +519,18 @@ public function getCpuQuota(): ?int /** * Microseconds of CPU time that the container can get in a CPU period. - * - * @param int $cpuQuota - * - * @return self */ public function setCpuQuota(?int $cpuQuota): self { + $this->initialized['cpuQuota'] = true; $this->cpuQuota = $cpuQuota; return $this; } /** - * The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks. - * - * @return int + * The length of a CPU real-time period in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. */ public function getCpuRealtimePeriod(): ?int { @@ -474,23 +538,20 @@ public function getCpuRealtimePeriod(): ?int } /** - * The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks. - * - * @param int $cpuRealtimePeriod - * - * @return self + * The length of a CPU real-time period in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. */ public function setCpuRealtimePeriod(?int $cpuRealtimePeriod): self { + $this->initialized['cpuRealtimePeriod'] = true; $this->cpuRealtimePeriod = $cpuRealtimePeriod; return $this; } /** - * The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks. - * - * @return int + * The length of a CPU real-time runtime in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. */ public function getCpuRealtimeRuntime(): ?int { @@ -498,14 +559,12 @@ public function getCpuRealtimeRuntime(): ?int } /** - * The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks. - * - * @param int $cpuRealtimeRuntime - * - * @return self + * The length of a CPU real-time runtime in microseconds. Set to 0 to + * allocate no time allocated to real-time tasks. */ public function setCpuRealtimeRuntime(?int $cpuRealtimeRuntime): self { + $this->initialized['cpuRealtimeRuntime'] = true; $this->cpuRealtimeRuntime = $cpuRealtimeRuntime; return $this; @@ -513,8 +572,6 @@ public function setCpuRealtimeRuntime(?int $cpuRealtimeRuntime): self /** * CPUs in which to allow execution (e.g., `0-3`, `0,1`). - * - * @return string */ public function getCpusetCpus(): ?string { @@ -523,22 +580,18 @@ public function getCpusetCpus(): ?string /** * CPUs in which to allow execution (e.g., `0-3`, `0,1`). - * - * @param string $cpusetCpus - * - * @return self */ public function setCpusetCpus(?string $cpusetCpus): self { + $this->initialized['cpusetCpus'] = true; $this->cpusetCpus = $cpusetCpus; return $this; } /** - * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. - * - * @return string + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + * effective on NUMA systems. */ public function getCpusetMems(): ?string { @@ -546,14 +599,12 @@ public function getCpusetMems(): ?string } /** - * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. - * - * @param string $cpusetMems - * - * @return self + * Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + * effective on NUMA systems. */ public function setCpusetMems(?string $cpusetMems): self { + $this->initialized['cpusetMems'] = true; $this->cpusetMems = $cpusetMems; return $this; @@ -562,7 +613,7 @@ public function setCpusetMems(?string $cpusetMems): self /** * A list of devices to add to the container. * - * @return DeviceMapping[] + * @return list|null */ public function getDevices(): ?array { @@ -572,12 +623,11 @@ public function getDevices(): ?array /** * A list of devices to add to the container. * - * @param DeviceMapping[] $devices - * - * @return self + * @param list|null $devices */ public function setDevices(?array $devices): self { + $this->initialized['devices'] = true; $this->devices = $devices; return $this; @@ -586,7 +636,7 @@ public function setDevices(?array $devices): self /** * a list of cgroup rules to apply to the container. * - * @return string[] + * @return list|null */ public function getDeviceCgroupRules(): ?array { @@ -596,69 +646,68 @@ public function getDeviceCgroupRules(): ?array /** * a list of cgroup rules to apply to the container. * - * @param string[] $deviceCgroupRules - * - * @return self + * @param list|null $deviceCgroupRules */ public function setDeviceCgroupRules(?array $deviceCgroupRules): self { + $this->initialized['deviceCgroupRules'] = true; $this->deviceCgroupRules = $deviceCgroupRules; return $this; } /** - * Disk limit (in bytes). + * A list of requests for devices to be sent to device drivers. * - * @return int + * @return list|null */ - public function getDiskQuota(): ?int + public function getDeviceRequests(): ?array { - return $this->diskQuota; + return $this->deviceRequests; } /** - * Disk limit (in bytes). - * - * @param int $diskQuota + * A list of requests for devices to be sent to device drivers. * - * @return self + * @param list|null $deviceRequests */ - public function setDiskQuota(?int $diskQuota): self + public function setDeviceRequests(?array $deviceRequests): self { - $this->diskQuota = $diskQuota; + $this->initialized['deviceRequests'] = true; + $this->deviceRequests = $deviceRequests; return $this; } /** - * Kernel memory limit in bytes. + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + * OCI runtime in use, this option may be ignored. It is no longer supported + * by the default (runc) runtime. * - * @return int + * This field is omitted when empty. */ - public function getKernelMemory(): ?int + public function getKernelMemoryTCP(): ?int { - return $this->kernelMemory; + return $this->kernelMemoryTCP; } /** - * Kernel memory limit in bytes. - * - * @param int $kernelMemory + * Hard limit for kernel TCP buffer memory (in bytes). Depending on the + * OCI runtime in use, this option may be ignored. It is no longer supported + * by the default (runc) runtime. * - * @return self + * This field is omitted when empty. */ - public function setKernelMemory(?int $kernelMemory): self + public function setKernelMemoryTCP(?int $kernelMemoryTCP): self { - $this->kernelMemory = $kernelMemory; + $this->initialized['kernelMemoryTCP'] = true; + $this->kernelMemoryTCP = $kernelMemoryTCP; return $this; } /** * Memory soft limit in bytes. - * - * @return int */ public function getMemoryReservation(): ?int { @@ -667,22 +716,18 @@ public function getMemoryReservation(): ?int /** * Memory soft limit in bytes. - * - * @param int $memoryReservation - * - * @return self */ public function setMemoryReservation(?int $memoryReservation): self { + $this->initialized['memoryReservation'] = true; $this->memoryReservation = $memoryReservation; return $this; } /** - * Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. - * - * @return int + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + * swap. */ public function getMemorySwap(): ?int { @@ -690,23 +735,20 @@ public function getMemorySwap(): ?int } /** - * Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. - * - * @param int $memorySwap - * - * @return self + * Total memory limit (memory + swap). Set as `-1` to enable unlimited + * swap. */ public function setMemorySwap(?int $memorySwap): self { + $this->initialized['memorySwap'] = true; $this->memorySwap = $memorySwap; return $this; } /** - * Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. - * - * @return int + * Tune a container's memory swappiness behavior. Accepts an integer + * between 0 and 100. */ public function getMemorySwappiness(): ?int { @@ -714,14 +756,12 @@ public function getMemorySwappiness(): ?int } /** - * Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. - * - * @param int $memorySwappiness - * - * @return self + * Tune a container's memory swappiness behavior. Accepts an integer + * between 0 and 100. */ public function setMemorySwappiness(?int $memorySwappiness): self { + $this->initialized['memorySwappiness'] = true; $this->memorySwappiness = $memorySwappiness; return $this; @@ -729,32 +769,25 @@ public function setMemorySwappiness(?int $memorySwappiness): self /** * CPU quota in units of 10-9 CPUs. - * - * @return int */ - public function getNanoCPUs(): ?int + public function getNanoCpus(): ?int { - return $this->nanoCPUs; + return $this->nanoCpus; } /** * CPU quota in units of 10-9 CPUs. - * - * @param int $nanoCPUs - * - * @return self */ - public function setNanoCPUs(?int $nanoCPUs): self + public function setNanoCpus(?int $nanoCpus): self { - $this->nanoCPUs = $nanoCPUs; + $this->initialized['nanoCpus'] = true; + $this->nanoCpus = $nanoCpus; return $this; } /** * Disable OOM Killer for the container. - * - * @return bool */ public function getOomKillDisable(): ?bool { @@ -763,22 +796,41 @@ public function getOomKillDisable(): ?bool /** * Disable OOM Killer for the container. - * - * @param bool $oomKillDisable - * - * @return self */ public function setOomKillDisable(?bool $oomKillDisable): self { + $this->initialized['oomKillDisable'] = true; $this->oomKillDisable = $oomKillDisable; return $this; } /** - * Tune a container's pids limit. Set -1 for unlimited. - * - * @return int + * Run an init inside the container that forwards signals and reaps + * processes. This field is omitted if empty, and the default (as + * configured on the daemon) is used. + */ + public function getInit(): ?bool + { + return $this->init; + } + + /** + * Run an init inside the container that forwards signals and reaps + * processes. This field is omitted if empty, and the default (as + * configured on the daemon) is used. + */ + public function setInit(?bool $init): self + { + $this->initialized['init'] = true; + $this->init = $init; + + return $this; + } + + /** + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + * to not change. */ public function getPidsLimit(): ?int { @@ -786,23 +838,25 @@ public function getPidsLimit(): ?int } /** - * Tune a container's pids limit. Set -1 for unlimited. - * - * @param int $pidsLimit - * - * @return self + * Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + * to not change. */ public function setPidsLimit(?int $pidsLimit): self { + $this->initialized['pidsLimit'] = true; $this->pidsLimit = $pidsLimit; return $this; } /** - * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`". + * A list of resource limits to set in the container. For example: + * + * ``` + * {"Name": "nofile", "Soft": 1024, "Hard": 2048} + * ``` * - * @return ResourcesUlimitsItem[] + * @return list|null */ public function getUlimits(): ?array { @@ -810,14 +864,17 @@ public function getUlimits(): ?array } /** - * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`". + * A list of resource limits to set in the container. For example: * - * @param ResourcesUlimitsItem[] $ulimits + * ``` + * {"Name": "nofile", "Soft": 1024, "Hard": 2048} + * ``` * - * @return self + * @param list|null $ulimits */ public function setUlimits(?array $ulimits): self { + $this->initialized['ulimits'] = true; $this->ulimits = $ulimits; return $this; @@ -825,11 +882,10 @@ public function setUlimits(?array $ulimits): self /** * The number of usable CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - * - * @return int + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. */ public function getCpuCount(): ?int { @@ -838,16 +894,14 @@ public function getCpuCount(): ?int /** * The number of usable CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - - * - * @param int $cpuCount * - * @return self + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. */ public function setCpuCount(?int $cpuCount): self { + $this->initialized['cpuCount'] = true; $this->cpuCount = $cpuCount; return $this; @@ -855,11 +909,10 @@ public function setCpuCount(?int $cpuCount): self /** * The usable percentage of the available CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - * - * @return int + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. */ public function getCpuPercent(): ?int { @@ -868,16 +921,14 @@ public function getCpuPercent(): ?int /** * The usable percentage of the available CPUs (Windows only). - - On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. - - * - * @param int $cpuPercent * - * @return self + * On Windows Server containers, the processor resource controls are + * mutually exclusive. The order of precedence is `CPUCount` first, then + * `CPUShares`, and `CPUPercent` last. */ public function setCpuPercent(?int $cpuPercent): self { + $this->initialized['cpuPercent'] = true; $this->cpuPercent = $cpuPercent; return $this; @@ -885,8 +936,6 @@ public function setCpuPercent(?int $cpuPercent): self /** * Maximum IOps for the container system drive (Windows only). - * - * @return int */ public function getIOMaximumIOps(): ?int { @@ -895,22 +944,18 @@ public function getIOMaximumIOps(): ?int /** * Maximum IOps for the container system drive (Windows only). - * - * @param int $iOMaximumIOps - * - * @return self */ public function setIOMaximumIOps(?int $iOMaximumIOps): self { + $this->initialized['iOMaximumIOps'] = true; $this->iOMaximumIOps = $iOMaximumIOps; return $this; } /** - * Maximum IO in bytes per second for the container system drive (Windows only). - * - * @return int + * Maximum IO in bytes per second for the container system drive + * (Windows only). */ public function getIOMaximumBandwidth(): ?int { @@ -918,14 +963,12 @@ public function getIOMaximumBandwidth(): ?int } /** - * Maximum IO in bytes per second for the container system drive (Windows only). - * - * @param int $iOMaximumBandwidth - * - * @return self + * Maximum IO in bytes per second for the container system drive + * (Windows only). */ public function setIOMaximumBandwidth(?int $iOMaximumBandwidth): self { + $this->initialized['iOMaximumBandwidth'] = true; $this->iOMaximumBandwidth = $iOMaximumBandwidth; return $this; diff --git a/src/Model/ResourcesBlkioWeightDeviceItem.php b/src/Model/ResourcesBlkioWeightDeviceItem.php index 9ec9aba4..9cfccfe3 100644 --- a/src/Model/ResourcesBlkioWeightDeviceItem.php +++ b/src/Model/ResourcesBlkioWeightDeviceItem.php @@ -2,60 +2,49 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ResourcesBlkioWeightDeviceItem +class ResourcesBlkioWeightDeviceItem extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $path; /** - * @var int + * @var int|null */ protected $weight; - /** - * @return string - */ public function getPath(): ?string { return $this->path; } - /** - * @param string $path - * - * @return self - */ public function setPath(?string $path): self { + $this->initialized['path'] = true; $this->path = $path; return $this; } - /** - * @return int - */ public function getWeight(): ?int { return $this->weight; } - /** - * @param int $weight - * - * @return self - */ public function setWeight(?int $weight): self { + $this->initialized['weight'] = true; $this->weight = $weight; return $this; diff --git a/src/Model/ResourcesUlimitsItem.php b/src/Model/ResourcesUlimitsItem.php index fdf51001..c457dc25 100644 --- a/src/Model/ResourcesUlimitsItem.php +++ b/src/Model/ResourcesUlimitsItem.php @@ -2,39 +2,40 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ResourcesUlimitsItem +class ResourcesUlimitsItem extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Name of ulimit. * - * @var string + * @var string|null */ protected $name; /** * Soft limit. * - * @var int + * @var int|null */ protected $soft; /** * Hard limit. * - * @var int + * @var int|null */ protected $hard; /** * Name of ulimit. - * - * @return string */ public function getName(): ?string { @@ -43,13 +44,10 @@ public function getName(): ?string /** * Name of ulimit. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -57,8 +55,6 @@ public function setName(?string $name): self /** * Soft limit. - * - * @return int */ public function getSoft(): ?int { @@ -67,13 +63,10 @@ public function getSoft(): ?int /** * Soft limit. - * - * @param int $soft - * - * @return self */ public function setSoft(?int $soft): self { + $this->initialized['soft'] = true; $this->soft = $soft; return $this; @@ -81,8 +74,6 @@ public function setSoft(?int $soft): self /** * Hard limit. - * - * @return int */ public function getHard(): ?int { @@ -91,13 +82,10 @@ public function getHard(): ?int /** * Hard limit. - * - * @param int $hard - * - * @return self */ public function setHard(?int $hard): self { + $this->initialized['hard'] = true; $this->hard = $hard; return $this; diff --git a/src/Model/RestartPolicy.php b/src/Model/RestartPolicy.php index 88d3b5e1..f77a821d 100644 --- a/src/Model/RestartPolicy.php +++ b/src/Model/RestartPolicy.php @@ -2,41 +2,42 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class RestartPolicy +class RestartPolicy extends \ArrayObject { /** - * - Empty string means not to restart. - - `always` Always restart - - `unless-stopped` Restart always except when the user has manually stopped the container - - `on-failure` Restart only when the container exit code is non-zero + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * - Empty string means not to restart + * - `no` Do not automatically restart + * - `always` Always restart + * - `unless-stopped` Restart always except when the user has manually stopped the container + * - `on-failure` Restart only when the container exit code is non-zero. * - * @var string + * @var string|null */ protected $name; /** * If `on-failure` is used, the number of times to retry before giving up. * - * @var int + * @var int|null */ protected $maximumRetryCount; /** - * - Empty string means not to restart. - - `always` Always restart - - `unless-stopped` Restart always except when the user has manually stopped the container - - `on-failure` Restart only when the container exit code is non-zero - - * - * @return string + * - Empty string means not to restart + * - `no` Do not automatically restart + * - `always` Always restart + * - `unless-stopped` Restart always except when the user has manually stopped the container + * - `on-failure` Restart only when the container exit code is non-zero. */ public function getName(): ?string { @@ -44,18 +45,15 @@ public function getName(): ?string } /** - * - Empty string means not to restart. - - `always` Always restart - - `unless-stopped` Restart always except when the user has manually stopped the container - - `on-failure` Restart only when the container exit code is non-zero - - * - * @param string $name - * - * @return self + * - Empty string means not to restart + * - `no` Do not automatically restart + * - `always` Always restart + * - `unless-stopped` Restart always except when the user has manually stopped the container + * - `on-failure` Restart only when the container exit code is non-zero. */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -63,8 +61,6 @@ public function setName(?string $name): self /** * If `on-failure` is used, the number of times to retry before giving up. - * - * @return int */ public function getMaximumRetryCount(): ?int { @@ -73,13 +69,10 @@ public function getMaximumRetryCount(): ?int /** * If `on-failure` is used, the number of times to retry before giving up. - * - * @param int $maximumRetryCount - * - * @return self */ public function setMaximumRetryCount(?int $maximumRetryCount): self { + $this->initialized['maximumRetryCount'] = true; $this->maximumRetryCount = $maximumRetryCount; return $this; diff --git a/src/Model/Runtime.php b/src/Model/Runtime.php index 5ce83d96..3def6b74 100644 --- a/src/Model/Runtime.php +++ b/src/Model/Runtime.php @@ -2,41 +2,59 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Runtime +class Runtime extends \ArrayObject { /** - * Name and, optional, path, of the OCI executable binary. - - If the path is omitted, the daemon searches the host's `$PATH` for the - binary and uses the first result. + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * Name and, optional, path, of the OCI executable binary. + * + * If the path is omitted, the daemon searches the host's `$PATH` for the + * binary and uses the first result. * - * @var string + * @var string|null */ protected $path; /** * List of command-line arguments to pass to the runtime when invoked. * - * @var string[] + * @var list|null */ protected $runtimeArgs; + /** + * Information specific to the runtime. + * + * While this API specification does not define data provided by runtimes, + * the following well-known properties may be provided by runtimes: + * + * `org.opencontainers.runtime-spec.features`: features structure as defined + * in the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md), + * in a JSON string representation. + * + *


+ * + * > **Note**: The information returned in this field, including the + * > formatting of values and labels, should not be considered stable, + * > and may change without notice. + * + * @var array|null + */ + protected $status; /** * Name and, optional, path, of the OCI executable binary. - - If the path is omitted, the daemon searches the host's `$PATH` for the - binary and uses the first result. - * - * @return string + * If the path is omitted, the daemon searches the host's `$PATH` for the + * binary and uses the first result. */ public function getPath(): ?string { @@ -45,17 +63,13 @@ public function getPath(): ?string /** * Name and, optional, path, of the OCI executable binary. - - If the path is omitted, the daemon searches the host's `$PATH` for the - binary and uses the first result. - * - * @param string $path - * - * @return self + * If the path is omitted, the daemon searches the host's `$PATH` for the + * binary and uses the first result. */ public function setPath(?string $path): self { + $this->initialized['path'] = true; $this->path = $path; return $this; @@ -64,7 +78,7 @@ public function setPath(?string $path): self /** * List of command-line arguments to pass to the runtime when invoked. * - * @return string[] + * @return list|null */ public function getRuntimeArgs(): ?array { @@ -74,14 +88,62 @@ public function getRuntimeArgs(): ?array /** * List of command-line arguments to pass to the runtime when invoked. * - * @param string[] $runtimeArgs - * - * @return self + * @param list|null $runtimeArgs */ public function setRuntimeArgs(?array $runtimeArgs): self { + $this->initialized['runtimeArgs'] = true; $this->runtimeArgs = $runtimeArgs; return $this; } + + /** + * Information specific to the runtime. + * + * While this API specification does not define data provided by runtimes, + * the following well-known properties may be provided by runtimes: + * + * `org.opencontainers.runtime-spec.features`: features structure as defined + * in the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md), + * in a JSON string representation. + * + *


+ * + * > **Note**: The information returned in this field, including the + * > formatting of values and labels, should not be considered stable, + * > and may change without notice. + * + * @return array|null + */ + public function getStatus(): ?iterable + { + return $this->status; + } + + /** + * Information specific to the runtime. + * + * While this API specification does not define data provided by runtimes, + * the following well-known properties may be provided by runtimes: + * + * `org.opencontainers.runtime-spec.features`: features structure as defined + * in the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md), + * in a JSON string representation. + * + *


+ * + * > **Note**: The information returned in this field, including the + * > formatting of values and labels, should not be considered stable, + * > and may change without notice. + * + * @param array|null $status + */ + public function setStatus(?iterable $status): self + { + $this->initialized['status'] = true; + $this->status = $status; + + return $this; + } } diff --git a/src/Model/Secret.php b/src/Model/Secret.php index 009b55e6..6cb7d8b2 100644 --- a/src/Model/Secret.php +++ b/src/Model/Secret.php @@ -2,77 +2,75 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Secret +class Secret extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $iD; /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. + * + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. * - * @var ObjectVersion + * @var ObjectVersion|null */ protected $version; /** - * @var string + * @var string|null */ protected $createdAt; /** - * @var string + * @var string|null */ protected $updatedAt; /** - * @var SecretSpec + * @var SecretSpec|null */ protected $spec; - /** - * @return string - */ public function getID(): ?string { return $this->iD; } - /** - * @param string $iD - * - * @return self - */ public function setID(?string $iD): self { + $this->initialized['iD'] = true; $this->iD = $iD; return $this; } /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. * - * @return ObjectVersion + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. */ public function getVersion(): ?ObjectVersion { @@ -80,81 +78,59 @@ public function getVersion(): ?ObjectVersion } /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - - * - * @param ObjectVersion $version + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. * - * @return self + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. */ public function setVersion(?ObjectVersion $version): self { + $this->initialized['version'] = true; $this->version = $version; return $this; } - /** - * @return string - */ public function getCreatedAt(): ?string { return $this->createdAt; } - /** - * @param string $createdAt - * - * @return self - */ public function setCreatedAt(?string $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; } - /** - * @return string - */ public function getUpdatedAt(): ?string { return $this->updatedAt; } - /** - * @param string $updatedAt - * - * @return self - */ public function setUpdatedAt(?string $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; } - /** - * @return SecretSpec - */ public function getSpec(): ?SecretSpec { return $this->spec; } - /** - * @param SecretSpec $spec - * - * @return self - */ public function setSpec(?SecretSpec $spec): self { + $this->initialized['spec'] = true; $this->spec = $spec; return $this; diff --git a/src/Model/SecretSpec.php b/src/Model/SecretSpec.php index 8fb8941f..324ef660 100644 --- a/src/Model/SecretSpec.php +++ b/src/Model/SecretSpec.php @@ -2,50 +2,56 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SecretSpec +class SecretSpec extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * User-defined name of the secret. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). - data to store as secret. - - This field is only used to _create_ a secret, and is not returned by - other endpoints. - + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + * data to store as secret. * - * @var string + * This field is only used to _create_ a secret, and is not returned by + * other endpoints. + * + * @var string|null */ protected $data; /** * Driver represents a driver (network, logging, secrets). * - * @var Driver + * @var Driver|null */ protected $driver; + /** + * Driver represents a driver (network, logging, secrets). + * + * @var Driver|null + */ + protected $templating; /** * User-defined name of the secret. - * - * @return string */ public function getName(): ?string { @@ -54,13 +60,10 @@ public function getName(): ?string /** * User-defined name of the secret. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -69,9 +72,9 @@ public function setName(?string $name): self /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -79,26 +82,22 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value metadata. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; } /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). - data to store as secret. - - This field is only used to _create_ a secret, and is not returned by - other endpoints. - + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + * data to store as secret. * - * @return string + * This field is only used to _create_ a secret, and is not returned by + * other endpoints. */ public function getData(): ?string { @@ -106,19 +105,15 @@ public function getData(): ?string } /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). - data to store as secret. - - This field is only used to _create_ a secret, and is not returned by - other endpoints. - - * - * @param string $data + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + * data to store as secret. * - * @return self + * This field is only used to _create_ a secret, and is not returned by + * other endpoints. */ public function setData(?string $data): self { + $this->initialized['data'] = true; $this->data = $data; return $this; @@ -126,8 +121,6 @@ public function setData(?string $data): self /** * Driver represents a driver (network, logging, secrets). - * - * @return Driver */ public function getDriver(): ?Driver { @@ -136,15 +129,31 @@ public function getDriver(): ?Driver /** * Driver represents a driver (network, logging, secrets). - * - * @param Driver $driver - * - * @return self */ public function setDriver(?Driver $driver): self { + $this->initialized['driver'] = true; $this->driver = $driver; return $this; } + + /** + * Driver represents a driver (network, logging, secrets). + */ + public function getTemplating(): ?Driver + { + return $this->templating; + } + + /** + * Driver represents a driver (network, logging, secrets). + */ + public function setTemplating(?Driver $templating): self + { + $this->initialized['templating'] = true; + $this->templating = $templating; + + return $this; + } } diff --git a/src/Model/SecretsCreatePostBody.php b/src/Model/SecretsCreatePostBody.php index 0f85b194..2545eecd 100644 --- a/src/Model/SecretsCreatePostBody.php +++ b/src/Model/SecretsCreatePostBody.php @@ -2,50 +2,56 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SecretsCreatePostBody +class SecretsCreatePostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * User-defined name of the secret. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). - data to store as secret. - - This field is only used to _create_ a secret, and is not returned by - other endpoints. - + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + * data to store as secret. * - * @var string + * This field is only used to _create_ a secret, and is not returned by + * other endpoints. + * + * @var string|null */ protected $data; /** * Driver represents a driver (network, logging, secrets). * - * @var Driver + * @var Driver|null */ protected $driver; + /** + * Driver represents a driver (network, logging, secrets). + * + * @var Driver|null + */ + protected $templating; /** * User-defined name of the secret. - * - * @return string */ public function getName(): ?string { @@ -54,13 +60,10 @@ public function getName(): ?string /** * User-defined name of the secret. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -69,9 +72,9 @@ public function setName(?string $name): self /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -79,26 +82,22 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value metadata. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; } /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). - data to store as secret. - - This field is only used to _create_ a secret, and is not returned by - other endpoints. - + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + * data to store as secret. * - * @return string + * This field is only used to _create_ a secret, and is not returned by + * other endpoints. */ public function getData(): ?string { @@ -106,19 +105,15 @@ public function getData(): ?string } /** - * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2)). - data to store as secret. - - This field is only used to _create_ a secret, and is not returned by - other endpoints. - - * - * @param string $data + * Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) + * data to store as secret. * - * @return self + * This field is only used to _create_ a secret, and is not returned by + * other endpoints. */ public function setData(?string $data): self { + $this->initialized['data'] = true; $this->data = $data; return $this; @@ -126,8 +121,6 @@ public function setData(?string $data): self /** * Driver represents a driver (network, logging, secrets). - * - * @return Driver */ public function getDriver(): ?Driver { @@ -136,15 +129,31 @@ public function getDriver(): ?Driver /** * Driver represents a driver (network, logging, secrets). - * - * @param Driver $driver - * - * @return self */ public function setDriver(?Driver $driver): self { + $this->initialized['driver'] = true; $this->driver = $driver; return $this; } + + /** + * Driver represents a driver (network, logging, secrets). + */ + public function getTemplating(): ?Driver + { + return $this->templating; + } + + /** + * Driver represents a driver (network, logging, secrets). + */ + public function setTemplating(?Driver $templating): self + { + $this->initialized['templating'] = true; + $this->templating = $templating; + + return $this; + } } diff --git a/src/Model/Service.php b/src/Model/Service.php index c0a5bfe5..334cb307 100644 --- a/src/Model/Service.php +++ b/src/Model/Service.php @@ -2,89 +2,103 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Service +class Service extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $iD; /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. * - * @var ObjectVersion + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. + * + * @var ObjectVersion|null */ protected $version; /** - * @var string + * @var string|null */ protected $createdAt; /** - * @var string + * @var string|null */ protected $updatedAt; /** * User modifiable configuration for a service. * - * @var ServiceSpec + * @var ServiceSpec|null */ protected $spec; /** - * @var ServiceEndpoint + * @var ServiceEndpoint|null */ protected $endpoint; /** * The status of a service update. * - * @var ServiceUpdateStatus + * @var ServiceUpdateStatus|null */ protected $updateStatus; - /** - * @return string + * The status of the service's tasks. Provided only when requested as + * part of a ServiceList operation. + * + * @var ServiceServiceStatus|null + */ + protected $serviceStatus; + /** + * The status of the service when it is in one of ReplicatedJob or + * GlobalJob modes. Absent on Replicated and Global mode services. The + * JobIteration is an ObjectVersion, but unlike the Service's version, + * does not need to be sent with an update request. + * + * @var ServiceJobStatus|null */ + protected $jobStatus; + public function getID(): ?string { return $this->iD; } - /** - * @param string $iD - * - * @return self - */ public function setID(?string $iD): self { + $this->initialized['iD'] = true; $this->iD = $iD; return $this; } /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. * - * @return ObjectVersion + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. */ public function getVersion(): ?ObjectVersion { @@ -92,61 +106,46 @@ public function getVersion(): ?ObjectVersion } /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. * - * @param ObjectVersion $version - * - * @return self + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. */ public function setVersion(?ObjectVersion $version): self { + $this->initialized['version'] = true; $this->version = $version; return $this; } - /** - * @return string - */ public function getCreatedAt(): ?string { return $this->createdAt; } - /** - * @param string $createdAt - * - * @return self - */ public function setCreatedAt(?string $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; } - /** - * @return string - */ public function getUpdatedAt(): ?string { return $this->updatedAt; } - /** - * @param string $updatedAt - * - * @return self - */ public function setUpdatedAt(?string $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; @@ -154,8 +153,6 @@ public function setUpdatedAt(?string $updatedAt): self /** * User modifiable configuration for a service. - * - * @return ServiceSpec */ public function getSpec(): ?ServiceSpec { @@ -164,33 +161,23 @@ public function getSpec(): ?ServiceSpec /** * User modifiable configuration for a service. - * - * @param ServiceSpec $spec - * - * @return self */ public function setSpec(?ServiceSpec $spec): self { + $this->initialized['spec'] = true; $this->spec = $spec; return $this; } - /** - * @return ServiceEndpoint - */ public function getEndpoint(): ?ServiceEndpoint { return $this->endpoint; } - /** - * @param ServiceEndpoint $endpoint - * - * @return self - */ public function setEndpoint(?ServiceEndpoint $endpoint): self { + $this->initialized['endpoint'] = true; $this->endpoint = $endpoint; return $this; @@ -198,8 +185,6 @@ public function setEndpoint(?ServiceEndpoint $endpoint): self /** * The status of a service update. - * - * @return ServiceUpdateStatus */ public function getUpdateStatus(): ?ServiceUpdateStatus { @@ -208,15 +193,58 @@ public function getUpdateStatus(): ?ServiceUpdateStatus /** * The status of a service update. - * - * @param ServiceUpdateStatus $updateStatus - * - * @return self */ public function setUpdateStatus(?ServiceUpdateStatus $updateStatus): self { + $this->initialized['updateStatus'] = true; $this->updateStatus = $updateStatus; return $this; } + + /** + * The status of the service's tasks. Provided only when requested as + * part of a ServiceList operation. + */ + public function getServiceStatus(): ?ServiceServiceStatus + { + return $this->serviceStatus; + } + + /** + * The status of the service's tasks. Provided only when requested as + * part of a ServiceList operation. + */ + public function setServiceStatus(?ServiceServiceStatus $serviceStatus): self + { + $this->initialized['serviceStatus'] = true; + $this->serviceStatus = $serviceStatus; + + return $this; + } + + /** + * The status of the service when it is in one of ReplicatedJob or + * GlobalJob modes. Absent on Replicated and Global mode services. The + * JobIteration is an ObjectVersion, but unlike the Service's version, + * does not need to be sent with an update request. + */ + public function getJobStatus(): ?ServiceJobStatus + { + return $this->jobStatus; + } + + /** + * The status of the service when it is in one of ReplicatedJob or + * GlobalJob modes. Absent on Replicated and Global mode services. The + * JobIteration is an ObjectVersion, but unlike the Service's version, + * does not need to be sent with an update request. + */ + public function setJobStatus(?ServiceJobStatus $jobStatus): self + { + $this->initialized['jobStatus'] = true; + $this->jobStatus = $jobStatus; + + return $this; + } } diff --git a/src/Model/ServiceCreateResponse.php b/src/Model/ServiceCreateResponse.php new file mode 100644 index 00000000..ed60b267 --- /dev/null +++ b/src/Model/ServiceCreateResponse.php @@ -0,0 +1,78 @@ +initialized); + } + /** + * The ID of the created service. + * + * @var string|null + */ + protected $iD; + /** + * Optional warning message. + * + * FIXME(thaJeztah): this should have "omitempty" in the generated type. + * + * @var list|null + */ + protected $warnings; + + /** + * The ID of the created service. + */ + public function getID(): ?string + { + return $this->iD; + } + + /** + * The ID of the created service. + */ + public function setID(?string $iD): self + { + $this->initialized['iD'] = true; + $this->iD = $iD; + + return $this; + } + + /** + * Optional warning message. + * + * FIXME(thaJeztah): this should have "omitempty" in the generated type. + * + * @return list|null + */ + public function getWarnings(): ?array + { + return $this->warnings; + } + + /** + * Optional warning message. + * + * FIXME(thaJeztah): this should have "omitempty" in the generated type. + * + * @param list|null $warnings + */ + public function setWarnings(?array $warnings): self + { + $this->initialized['warnings'] = true; + $this->warnings = $warnings; + + return $this; + } +} diff --git a/src/Model/ServiceEndpoint.php b/src/Model/ServiceEndpoint.php index ae67f3cc..0c070487 100644 --- a/src/Model/ServiceEndpoint.php +++ b/src/Model/ServiceEndpoint.php @@ -2,35 +2,36 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ServiceEndpoint +class ServiceEndpoint extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Properties that can be configured to access and load balance a service. * - * @var EndpointSpec + * @var EndpointSpec|null */ protected $spec; /** - * @var EndpointPortConfig[] + * @var list|null */ protected $ports; /** - * @var ServiceEndpointVirtualIPsItem[] + * @var list|null */ protected $virtualIPs; /** * Properties that can be configured to access and load balance a service. - * - * @return EndpointSpec */ public function getSpec(): ?EndpointSpec { @@ -39,20 +40,17 @@ public function getSpec(): ?EndpointSpec /** * Properties that can be configured to access and load balance a service. - * - * @param EndpointSpec $spec - * - * @return self */ public function setSpec(?EndpointSpec $spec): self { + $this->initialized['spec'] = true; $this->spec = $spec; return $this; } /** - * @return EndpointPortConfig[] + * @return list|null */ public function getPorts(): ?array { @@ -60,19 +58,18 @@ public function getPorts(): ?array } /** - * @param EndpointPortConfig[] $ports - * - * @return self + * @param list|null $ports */ public function setPorts(?array $ports): self { + $this->initialized['ports'] = true; $this->ports = $ports; return $this; } /** - * @return ServiceEndpointVirtualIPsItem[] + * @return list|null */ public function getVirtualIPs(): ?array { @@ -80,12 +77,11 @@ public function getVirtualIPs(): ?array } /** - * @param ServiceEndpointVirtualIPsItem[] $virtualIPs - * - * @return self + * @param list|null $virtualIPs */ public function setVirtualIPs(?array $virtualIPs): self { + $this->initialized['virtualIPs'] = true; $this->virtualIPs = $virtualIPs; return $this; diff --git a/src/Model/ServiceEndpointVirtualIPsItem.php b/src/Model/ServiceEndpointVirtualIPsItem.php index 2221ceaf..6b8c510b 100644 --- a/src/Model/ServiceEndpointVirtualIPsItem.php +++ b/src/Model/ServiceEndpointVirtualIPsItem.php @@ -2,60 +2,49 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ServiceEndpointVirtualIPsItem +class ServiceEndpointVirtualIPsItem extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $networkID; /** - * @var string + * @var string|null */ protected $addr; - /** - * @return string - */ public function getNetworkID(): ?string { return $this->networkID; } - /** - * @param string $networkID - * - * @return self - */ public function setNetworkID(?string $networkID): self { + $this->initialized['networkID'] = true; $this->networkID = $networkID; return $this; } - /** - * @return string - */ public function getAddr(): ?string { return $this->addr; } - /** - * @param string $addr - * - * @return self - */ public function setAddr(?string $addr): self { + $this->initialized['addr'] = true; $this->addr = $addr; return $this; diff --git a/src/Model/ServiceJobStatus.php b/src/Model/ServiceJobStatus.php new file mode 100644 index 00000000..f77d6e55 --- /dev/null +++ b/src/Model/ServiceJobStatus.php @@ -0,0 +1,98 @@ +initialized); + } + /** + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. + * + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. + * + * @var ObjectVersion|null + */ + protected $jobIteration; + /** + * The last time, as observed by the server, that this job was + * started. + * + * @var string|null + */ + protected $lastExecution; + + /** + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. + * + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. + */ + public function getJobIteration(): ?ObjectVersion + { + return $this->jobIteration; + } + + /** + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. + * + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. + */ + public function setJobIteration(?ObjectVersion $jobIteration): self + { + $this->initialized['jobIteration'] = true; + $this->jobIteration = $jobIteration; + + return $this; + } + + /** + * The last time, as observed by the server, that this job was + * started. + */ + public function getLastExecution(): ?string + { + return $this->lastExecution; + } + + /** + * The last time, as observed by the server, that this job was + * started. + */ + public function setLastExecution(?string $lastExecution): self + { + $this->initialized['lastExecution'] = true; + $this->lastExecution = $lastExecution; + + return $this; + } +} diff --git a/src/Model/ServiceServiceStatus.php b/src/Model/ServiceServiceStatus.php new file mode 100644 index 00000000..dd464106 --- /dev/null +++ b/src/Model/ServiceServiceStatus.php @@ -0,0 +1,114 @@ +initialized); + } + /** + * The number of tasks for the service currently in the Running state. + * + * @var int|null + */ + protected $runningTasks; + /** + * The number of tasks for the service desired to be running. + * For replicated services, this is the replica count from the + * service spec. For global services, this is computed by taking + * count of all tasks for the service with a Desired State other + * than Shutdown. + * + * @var int|null + */ + protected $desiredTasks; + /** + * The number of tasks for a job that are in the Completed state. + * This field must be cross-referenced with the service type, as the + * value of 0 may mean the service is not in a job mode, or it may + * mean the job-mode service has no tasks yet Completed. + * + * @var int|null + */ + protected $completedTasks; + + /** + * The number of tasks for the service currently in the Running state. + */ + public function getRunningTasks(): ?int + { + return $this->runningTasks; + } + + /** + * The number of tasks for the service currently in the Running state. + */ + public function setRunningTasks(?int $runningTasks): self + { + $this->initialized['runningTasks'] = true; + $this->runningTasks = $runningTasks; + + return $this; + } + + /** + * The number of tasks for the service desired to be running. + * For replicated services, this is the replica count from the + * service spec. For global services, this is computed by taking + * count of all tasks for the service with a Desired State other + * than Shutdown. + */ + public function getDesiredTasks(): ?int + { + return $this->desiredTasks; + } + + /** + * The number of tasks for the service desired to be running. + * For replicated services, this is the replica count from the + * service spec. For global services, this is computed by taking + * count of all tasks for the service with a Desired State other + * than Shutdown. + */ + public function setDesiredTasks(?int $desiredTasks): self + { + $this->initialized['desiredTasks'] = true; + $this->desiredTasks = $desiredTasks; + + return $this; + } + + /** + * The number of tasks for a job that are in the Completed state. + * This field must be cross-referenced with the service type, as the + * value of 0 may mean the service is not in a job mode, or it may + * mean the job-mode service has no tasks yet Completed. + */ + public function getCompletedTasks(): ?int + { + return $this->completedTasks; + } + + /** + * The number of tasks for a job that are in the Completed state. + * This field must be cross-referenced with the service type, as the + * value of 0 may mean the service is not in a job mode, or it may + * mean the job-mode service has no tasks yet Completed. + */ + public function setCompletedTasks(?int $completedTasks): self + { + $this->initialized['completedTasks'] = true; + $this->completedTasks = $completedTasks; + + return $this; + } +} diff --git a/src/Model/ServiceSpec.php b/src/Model/ServiceSpec.php index 4416800e..0c09c857 100644 --- a/src/Model/ServiceSpec.php +++ b/src/Model/ServiceSpec.php @@ -2,69 +2,72 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ServiceSpec +class ServiceSpec extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Name of the service. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * User modifiable task configuration. * - * @var TaskSpec + * @var TaskSpec|null */ protected $taskTemplate; /** * Scheduling mode for the service. * - * @var ServiceSpecMode + * @var ServiceSpecMode|null */ protected $mode; /** * Specification for the update strategy of the service. * - * @var ServiceSpecUpdateConfig + * @var ServiceSpecUpdateConfig|null */ protected $updateConfig; /** * Specification for the rollback strategy of the service. * - * @var ServiceSpecRollbackConfig + * @var ServiceSpecRollbackConfig|null */ protected $rollbackConfig; /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. + * + * Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. * - * @var ServiceSpecNetworksItem[] + * @var list|null */ protected $networks; /** * Properties that can be configured to access and load balance a service. * - * @var EndpointSpec + * @var EndpointSpec|null */ protected $endpointSpec; /** * Name of the service. - * - * @return string */ public function getName(): ?string { @@ -73,13 +76,10 @@ public function getName(): ?string /** * Name of the service. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -88,9 +88,9 @@ public function setName(?string $name): self /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -98,12 +98,11 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value metadata. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; @@ -111,8 +110,6 @@ public function setLabels(?\ArrayObject $labels): self /** * User modifiable task configuration. - * - * @return TaskSpec */ public function getTaskTemplate(): ?TaskSpec { @@ -121,13 +118,10 @@ public function getTaskTemplate(): ?TaskSpec /** * User modifiable task configuration. - * - * @param TaskSpec $taskTemplate - * - * @return self */ public function setTaskTemplate(?TaskSpec $taskTemplate): self { + $this->initialized['taskTemplate'] = true; $this->taskTemplate = $taskTemplate; return $this; @@ -135,8 +129,6 @@ public function setTaskTemplate(?TaskSpec $taskTemplate): self /** * Scheduling mode for the service. - * - * @return ServiceSpecMode */ public function getMode(): ?ServiceSpecMode { @@ -145,13 +137,10 @@ public function getMode(): ?ServiceSpecMode /** * Scheduling mode for the service. - * - * @param ServiceSpecMode $mode - * - * @return self */ public function setMode(?ServiceSpecMode $mode): self { + $this->initialized['mode'] = true; $this->mode = $mode; return $this; @@ -159,8 +148,6 @@ public function setMode(?ServiceSpecMode $mode): self /** * Specification for the update strategy of the service. - * - * @return ServiceSpecUpdateConfig */ public function getUpdateConfig(): ?ServiceSpecUpdateConfig { @@ -169,13 +156,10 @@ public function getUpdateConfig(): ?ServiceSpecUpdateConfig /** * Specification for the update strategy of the service. - * - * @param ServiceSpecUpdateConfig $updateConfig - * - * @return self */ public function setUpdateConfig(?ServiceSpecUpdateConfig $updateConfig): self { + $this->initialized['updateConfig'] = true; $this->updateConfig = $updateConfig; return $this; @@ -183,8 +167,6 @@ public function setUpdateConfig(?ServiceSpecUpdateConfig $updateConfig): self /** * Specification for the rollback strategy of the service. - * - * @return ServiceSpecRollbackConfig */ public function getRollbackConfig(): ?ServiceSpecRollbackConfig { @@ -193,22 +175,21 @@ public function getRollbackConfig(): ?ServiceSpecRollbackConfig /** * Specification for the rollback strategy of the service. - * - * @param ServiceSpecRollbackConfig $rollbackConfig - * - * @return self */ public function setRollbackConfig(?ServiceSpecRollbackConfig $rollbackConfig): self { + $this->initialized['rollbackConfig'] = true; $this->rollbackConfig = $rollbackConfig; return $this; } /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. + * + * Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. * - * @return ServiceSpecNetworksItem[] + * @return list|null */ public function getNetworks(): ?array { @@ -216,14 +197,15 @@ public function getNetworks(): ?array } /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. * - * @param ServiceSpecNetworksItem[] $networks + * Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. * - * @return self + * @param list|null $networks */ public function setNetworks(?array $networks): self { + $this->initialized['networks'] = true; $this->networks = $networks; return $this; @@ -231,8 +213,6 @@ public function setNetworks(?array $networks): self /** * Properties that can be configured to access and load balance a service. - * - * @return EndpointSpec */ public function getEndpointSpec(): ?EndpointSpec { @@ -241,13 +221,10 @@ public function getEndpointSpec(): ?EndpointSpec /** * Properties that can be configured to access and load balance a service. - * - * @param EndpointSpec $endpointSpec - * - * @return self */ public function setEndpointSpec(?EndpointSpec $endpointSpec): self { + $this->initialized['endpointSpec'] = true; $this->endpointSpec = $endpointSpec; return $this; diff --git a/src/Model/ServiceSpecMode.php b/src/Model/ServiceSpecMode.php index a04731fb..72a8185b 100644 --- a/src/Model/ServiceSpecMode.php +++ b/src/Model/ServiceSpecMode.php @@ -2,61 +2,106 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ServiceSpecMode +class ServiceSpecMode extends \ArrayObject { /** - * @var ServiceSpecModeReplicated + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var ServiceSpecModeReplicated|null */ protected $replicated; /** - * @var mixed + * @var ServiceSpecModeGlobal|null */ protected $global; - /** - * @return ServiceSpecModeReplicated + * The mode used for services with a finite number of tasks that run + * to a completed state. + * + * @var ServiceSpecModeReplicatedJob|null + */ + protected $replicatedJob; + /** + * The mode used for services which run a task to the completed state + * on each valid node. + * + * @var ServiceSpecModeGlobalJob|null */ + protected $globalJob; + public function getReplicated(): ?ServiceSpecModeReplicated { return $this->replicated; } - /** - * @param ServiceSpecModeReplicated $replicated - * - * @return self - */ public function setReplicated(?ServiceSpecModeReplicated $replicated): self { + $this->initialized['replicated'] = true; $this->replicated = $replicated; return $this; } + public function getGlobal(): ?ServiceSpecModeGlobal + { + return $this->global; + } + + public function setGlobal(?ServiceSpecModeGlobal $global): self + { + $this->initialized['global'] = true; + $this->global = $global; + + return $this; + } + /** - * @return mixed + * The mode used for services with a finite number of tasks that run + * to a completed state. */ - public function getGlobal() + public function getReplicatedJob(): ?ServiceSpecModeReplicatedJob { - return $this->global; + return $this->replicatedJob; } /** - * @param mixed $global - * - * @return self + * The mode used for services with a finite number of tasks that run + * to a completed state. */ - public function setGlobal($global): self + public function setReplicatedJob(?ServiceSpecModeReplicatedJob $replicatedJob): self { - $this->global = $global; + $this->initialized['replicatedJob'] = true; + $this->replicatedJob = $replicatedJob; + + return $this; + } + + /** + * The mode used for services which run a task to the completed state + * on each valid node. + */ + public function getGlobalJob(): ?ServiceSpecModeGlobalJob + { + return $this->globalJob; + } + + /** + * The mode used for services which run a task to the completed state + * on each valid node. + */ + public function setGlobalJob(?ServiceSpecModeGlobalJob $globalJob): self + { + $this->initialized['globalJob'] = true; + $this->globalJob = $globalJob; return $this; } diff --git a/src/Model/ServiceSpecModeGlobal.php b/src/Model/ServiceSpecModeGlobal.php new file mode 100644 index 00000000..d1089e36 --- /dev/null +++ b/src/Model/ServiceSpecModeGlobal.php @@ -0,0 +1,18 @@ +initialized); + } +} diff --git a/src/Model/ServiceSpecModeGlobalJob.php b/src/Model/ServiceSpecModeGlobalJob.php new file mode 100644 index 00000000..33932bec --- /dev/null +++ b/src/Model/ServiceSpecModeGlobalJob.php @@ -0,0 +1,18 @@ +initialized); + } +} diff --git a/src/Model/ServiceSpecModeReplicated.php b/src/Model/ServiceSpecModeReplicated.php index 9c8bf3ef..7a25296d 100644 --- a/src/Model/ServiceSpecModeReplicated.php +++ b/src/Model/ServiceSpecModeReplicated.php @@ -2,36 +2,32 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ServiceSpecModeReplicated +class ServiceSpecModeReplicated extends \ArrayObject { /** - * @var int + * @var array */ - protected $replicas; + protected $initialized = []; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** - * @return int + * @var int|null */ + protected $replicas; + public function getReplicas(): ?int { return $this->replicas; } - /** - * @param int $replicas - * - * @return self - */ public function setReplicas(?int $replicas): self { + $this->initialized['replicas'] = true; $this->replicas = $replicas; return $this; diff --git a/src/Model/ServiceSpecModeReplicatedJob.php b/src/Model/ServiceSpecModeReplicatedJob.php new file mode 100644 index 00000000..f0642655 --- /dev/null +++ b/src/Model/ServiceSpecModeReplicatedJob.php @@ -0,0 +1,71 @@ +initialized); + } + /** + * The maximum number of replicas to run simultaneously. + * + * @var int|null + */ + protected $maxConcurrent = 1; + /** + * The total number of replicas desired to reach the Completed + * state. If unset, will default to the value of `MaxConcurrent`. + * + * @var int|null + */ + protected $totalCompletions; + + /** + * The maximum number of replicas to run simultaneously. + */ + public function getMaxConcurrent(): ?int + { + return $this->maxConcurrent; + } + + /** + * The maximum number of replicas to run simultaneously. + */ + public function setMaxConcurrent(?int $maxConcurrent): self + { + $this->initialized['maxConcurrent'] = true; + $this->maxConcurrent = $maxConcurrent; + + return $this; + } + + /** + * The total number of replicas desired to reach the Completed + * state. If unset, will default to the value of `MaxConcurrent`. + */ + public function getTotalCompletions(): ?int + { + return $this->totalCompletions; + } + + /** + * The total number of replicas desired to reach the Completed + * state. If unset, will default to the value of `MaxConcurrent`. + */ + public function setTotalCompletions(?int $totalCompletions): self + { + $this->initialized['totalCompletions'] = true; + $this->totalCompletions = $totalCompletions; + + return $this; + } +} diff --git a/src/Model/ServiceSpecNetworksItem.php b/src/Model/ServiceSpecNetworksItem.php deleted file mode 100644 index 32ebb9ac..00000000 --- a/src/Model/ServiceSpecNetworksItem.php +++ /dev/null @@ -1,63 +0,0 @@ -target; - } - - /** - * @param string $target - * - * @return self - */ - public function setTarget(?string $target): self - { - $this->target = $target; - - return $this; - } - - /** - * @return string[] - */ - public function getAliases(): ?array - { - return $this->aliases; - } - - /** - * @param string[] $aliases - * - * @return self - */ - public function setAliases(?array $aliases): self - { - $this->aliases = $aliases; - - return $this; - } -} diff --git a/src/Model/ServiceSpecRollbackConfig.php b/src/Model/ServiceSpecRollbackConfig.php index ec8a260a..c630b335 100644 --- a/src/Model/ServiceSpecRollbackConfig.php +++ b/src/Model/ServiceSpecRollbackConfig.php @@ -2,57 +2,66 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ServiceSpecRollbackConfig +class ServiceSpecRollbackConfig extends \ArrayObject { /** - * Maximum number of tasks to be rolled back in one iteration (0 means unlimited parallelism). + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * Maximum number of tasks to be rolled back in one iteration (0 means + * unlimited parallelism). * - * @var int + * @var int|null */ protected $parallelism; /** * Amount of time between rollback iterations, in nanoseconds. * - * @var int + * @var int|null */ protected $delay; /** - * Action to take if an rolled back task fails to run, or stops running during the rollback. + * Action to take if an rolled back task fails to run, or stops + * running during the rollback. * - * @var string + * @var string|null */ protected $failureAction; /** - * Amount of time to monitor each rolled back task for failures, in nanoseconds. + * Amount of time to monitor each rolled back task for failures, in + * nanoseconds. * - * @var int + * @var int|null */ protected $monitor; /** - * The fraction of tasks that may fail during a rollback before the failure action is invoked, specified as a floating point number between 0 and 1. + * The fraction of tasks that may fail during a rollback before the + * failure action is invoked, specified as a floating point number + * between 0 and 1. * - * @var float + * @var float|null */ protected $maxFailureRatio; /** - * The order of operations when rolling back a task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down. + * The order of operations when rolling back a task. Either the old + * task is shut down before the new task is started, or the new task + * is started before the old task is shut down. * - * @var string + * @var string|null */ protected $order; /** - * Maximum number of tasks to be rolled back in one iteration (0 means unlimited parallelism). - * - * @return int + * Maximum number of tasks to be rolled back in one iteration (0 means + * unlimited parallelism). */ public function getParallelism(): ?int { @@ -60,14 +69,12 @@ public function getParallelism(): ?int } /** - * Maximum number of tasks to be rolled back in one iteration (0 means unlimited parallelism). - * - * @param int $parallelism - * - * @return self + * Maximum number of tasks to be rolled back in one iteration (0 means + * unlimited parallelism). */ public function setParallelism(?int $parallelism): self { + $this->initialized['parallelism'] = true; $this->parallelism = $parallelism; return $this; @@ -75,8 +82,6 @@ public function setParallelism(?int $parallelism): self /** * Amount of time between rollback iterations, in nanoseconds. - * - * @return int */ public function getDelay(): ?int { @@ -85,22 +90,18 @@ public function getDelay(): ?int /** * Amount of time between rollback iterations, in nanoseconds. - * - * @param int $delay - * - * @return self */ public function setDelay(?int $delay): self { + $this->initialized['delay'] = true; $this->delay = $delay; return $this; } /** - * Action to take if an rolled back task fails to run, or stops running during the rollback. - * - * @return string + * Action to take if an rolled back task fails to run, or stops + * running during the rollback. */ public function getFailureAction(): ?string { @@ -108,23 +109,20 @@ public function getFailureAction(): ?string } /** - * Action to take if an rolled back task fails to run, or stops running during the rollback. - * - * @param string $failureAction - * - * @return self + * Action to take if an rolled back task fails to run, or stops + * running during the rollback. */ public function setFailureAction(?string $failureAction): self { + $this->initialized['failureAction'] = true; $this->failureAction = $failureAction; return $this; } /** - * Amount of time to monitor each rolled back task for failures, in nanoseconds. - * - * @return int + * Amount of time to monitor each rolled back task for failures, in + * nanoseconds. */ public function getMonitor(): ?int { @@ -132,23 +130,21 @@ public function getMonitor(): ?int } /** - * Amount of time to monitor each rolled back task for failures, in nanoseconds. - * - * @param int $monitor - * - * @return self + * Amount of time to monitor each rolled back task for failures, in + * nanoseconds. */ public function setMonitor(?int $monitor): self { + $this->initialized['monitor'] = true; $this->monitor = $monitor; return $this; } /** - * The fraction of tasks that may fail during a rollback before the failure action is invoked, specified as a floating point number between 0 and 1. - * - * @return float + * The fraction of tasks that may fail during a rollback before the + * failure action is invoked, specified as a floating point number + * between 0 and 1. */ public function getMaxFailureRatio(): ?float { @@ -156,23 +152,22 @@ public function getMaxFailureRatio(): ?float } /** - * The fraction of tasks that may fail during a rollback before the failure action is invoked, specified as a floating point number between 0 and 1. - * - * @param float $maxFailureRatio - * - * @return self + * The fraction of tasks that may fail during a rollback before the + * failure action is invoked, specified as a floating point number + * between 0 and 1. */ public function setMaxFailureRatio(?float $maxFailureRatio): self { + $this->initialized['maxFailureRatio'] = true; $this->maxFailureRatio = $maxFailureRatio; return $this; } /** - * The order of operations when rolling back a task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down. - * - * @return string + * The order of operations when rolling back a task. Either the old + * task is shut down before the new task is started, or the new task + * is started before the old task is shut down. */ public function getOrder(): ?string { @@ -180,14 +175,13 @@ public function getOrder(): ?string } /** - * The order of operations when rolling back a task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down. - * - * @param string $order - * - * @return self + * The order of operations when rolling back a task. Either the old + * task is shut down before the new task is started, or the new task + * is started before the old task is shut down. */ public function setOrder(?string $order): self { + $this->initialized['order'] = true; $this->order = $order; return $this; diff --git a/src/Model/ServiceSpecUpdateConfig.php b/src/Model/ServiceSpecUpdateConfig.php index ccb913e7..453dc337 100644 --- a/src/Model/ServiceSpecUpdateConfig.php +++ b/src/Model/ServiceSpecUpdateConfig.php @@ -2,57 +2,66 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ServiceSpecUpdateConfig +class ServiceSpecUpdateConfig extends \ArrayObject { /** - * Maximum number of tasks to be updated in one iteration (0 means unlimited parallelism). + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * Maximum number of tasks to be updated in one iteration (0 means + * unlimited parallelism). * - * @var int + * @var int|null */ protected $parallelism; /** * Amount of time between updates, in nanoseconds. * - * @var int + * @var int|null */ protected $delay; /** - * Action to take if an updated task fails to run, or stops running during the update. + * Action to take if an updated task fails to run, or stops running + * during the update. * - * @var string + * @var string|null */ protected $failureAction; /** - * Amount of time to monitor each updated task for failures, in nanoseconds. + * Amount of time to monitor each updated task for failures, in + * nanoseconds. * - * @var int + * @var int|null */ protected $monitor; /** - * 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. + * 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. * - * @var float + * @var float|null */ protected $maxFailureRatio; /** - * The order of operations when rolling out an updated task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down. + * The order of operations when rolling out an updated task. Either + * the old task is shut down before the new task is started, or the + * new task is started before the old task is shut down. * - * @var string + * @var string|null */ protected $order; /** - * Maximum number of tasks to be updated in one iteration (0 means unlimited parallelism). - * - * @return int + * Maximum number of tasks to be updated in one iteration (0 means + * unlimited parallelism). */ public function getParallelism(): ?int { @@ -60,14 +69,12 @@ public function getParallelism(): ?int } /** - * Maximum number of tasks to be updated in one iteration (0 means unlimited parallelism). - * - * @param int $parallelism - * - * @return self + * Maximum number of tasks to be updated in one iteration (0 means + * unlimited parallelism). */ public function setParallelism(?int $parallelism): self { + $this->initialized['parallelism'] = true; $this->parallelism = $parallelism; return $this; @@ -75,8 +82,6 @@ public function setParallelism(?int $parallelism): self /** * Amount of time between updates, in nanoseconds. - * - * @return int */ public function getDelay(): ?int { @@ -85,22 +90,18 @@ public function getDelay(): ?int /** * Amount of time between updates, in nanoseconds. - * - * @param int $delay - * - * @return self */ public function setDelay(?int $delay): self { + $this->initialized['delay'] = true; $this->delay = $delay; return $this; } /** - * Action to take if an updated task fails to run, or stops running during the update. - * - * @return string + * Action to take if an updated task fails to run, or stops running + * during the update. */ public function getFailureAction(): ?string { @@ -108,23 +109,20 @@ public function getFailureAction(): ?string } /** - * Action to take if an updated task fails to run, or stops running during the update. - * - * @param string $failureAction - * - * @return self + * Action to take if an updated task fails to run, or stops running + * during the update. */ public function setFailureAction(?string $failureAction): self { + $this->initialized['failureAction'] = true; $this->failureAction = $failureAction; return $this; } /** - * Amount of time to monitor each updated task for failures, in nanoseconds. - * - * @return int + * Amount of time to monitor each updated task for failures, in + * nanoseconds. */ public function getMonitor(): ?int { @@ -132,23 +130,21 @@ public function getMonitor(): ?int } /** - * Amount of time to monitor each updated task for failures, in nanoseconds. - * - * @param int $monitor - * - * @return self + * Amount of time to monitor each updated task for failures, in + * nanoseconds. */ public function setMonitor(?int $monitor): self { + $this->initialized['monitor'] = true; $this->monitor = $monitor; return $this; } /** - * 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. - * - * @return float + * 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. */ public function getMaxFailureRatio(): ?float { @@ -156,23 +152,22 @@ public function getMaxFailureRatio(): ?float } /** - * 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. - * - * @param float $maxFailureRatio - * - * @return self + * 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. */ public function setMaxFailureRatio(?float $maxFailureRatio): self { + $this->initialized['maxFailureRatio'] = true; $this->maxFailureRatio = $maxFailureRatio; return $this; } /** - * The order of operations when rolling out an updated task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down. - * - * @return string + * The order of operations when rolling out an updated task. Either + * the old task is shut down before the new task is started, or the + * new task is started before the old task is shut down. */ public function getOrder(): ?string { @@ -180,14 +175,13 @@ public function getOrder(): ?string } /** - * The order of operations when rolling out an updated task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down. - * - * @param string $order - * - * @return self + * The order of operations when rolling out an updated task. Either + * the old task is shut down before the new task is started, or the + * new task is started before the old task is shut down. */ public function setOrder(?string $order): self { + $this->initialized['order'] = true; $this->order = $order; return $this; diff --git a/src/Model/ServiceUpdateResponse.php b/src/Model/ServiceUpdateResponse.php index cb77082d..5489200c 100644 --- a/src/Model/ServiceUpdateResponse.php +++ b/src/Model/ServiceUpdateResponse.php @@ -2,27 +2,30 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ServiceUpdateResponse +class ServiceUpdateResponse extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Optional warning messages. * - * @var string[] + * @var list|null */ protected $warnings; /** * Optional warning messages. * - * @return string[] + * @return list|null */ public function getWarnings(): ?array { @@ -32,12 +35,11 @@ public function getWarnings(): ?array /** * Optional warning messages. * - * @param string[] $warnings - * - * @return self + * @param list|null $warnings */ public function setWarnings(?array $warnings): self { + $this->initialized['warnings'] = true; $this->warnings = $warnings; return $this; diff --git a/src/Model/ServiceUpdateStatus.php b/src/Model/ServiceUpdateStatus.php index 3626d277..2581c09f 100644 --- a/src/Model/ServiceUpdateStatus.php +++ b/src/Model/ServiceUpdateStatus.php @@ -2,108 +2,83 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ServiceUpdateStatus +class ServiceUpdateStatus extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $state; /** - * @var string + * @var string|null */ protected $startedAt; /** - * @var string + * @var string|null */ protected $completedAt; /** - * @var string + * @var string|null */ protected $message; - /** - * @return string - */ public function getState(): ?string { return $this->state; } - /** - * @param string $state - * - * @return self - */ public function setState(?string $state): self { + $this->initialized['state'] = true; $this->state = $state; return $this; } - /** - * @return string - */ public function getStartedAt(): ?string { return $this->startedAt; } - /** - * @param string $startedAt - * - * @return self - */ public function setStartedAt(?string $startedAt): self { + $this->initialized['startedAt'] = true; $this->startedAt = $startedAt; return $this; } - /** - * @return string - */ public function getCompletedAt(): ?string { return $this->completedAt; } - /** - * @param string $completedAt - * - * @return self - */ public function setCompletedAt(?string $completedAt): self { + $this->initialized['completedAt'] = true; $this->completedAt = $completedAt; return $this; } - /** - * @return string - */ public function getMessage(): ?string { return $this->message; } - /** - * @param string $message - * - * @return self - */ public function setMessage(?string $message): self { + $this->initialized['message'] = true; $this->message = $message; return $this; diff --git a/src/Model/ServicesCreatePostBody.php b/src/Model/ServicesCreatePostBody.php index 4b65df1d..d9ec1c6b 100644 --- a/src/Model/ServicesCreatePostBody.php +++ b/src/Model/ServicesCreatePostBody.php @@ -2,69 +2,72 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ServicesCreatePostBody +class ServicesCreatePostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Name of the service. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * User modifiable task configuration. * - * @var TaskSpec + * @var TaskSpec|null */ protected $taskTemplate; /** * Scheduling mode for the service. * - * @var ServiceSpecMode + * @var ServiceSpecMode|null */ protected $mode; /** * Specification for the update strategy of the service. * - * @var ServiceSpecUpdateConfig + * @var ServiceSpecUpdateConfig|null */ protected $updateConfig; /** * Specification for the rollback strategy of the service. * - * @var ServiceSpecRollbackConfig + * @var ServiceSpecRollbackConfig|null */ protected $rollbackConfig; /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. + * + * Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. * - * @var ServiceSpecNetworksItem[] + * @var list|null */ protected $networks; /** * Properties that can be configured to access and load balance a service. * - * @var EndpointSpec + * @var EndpointSpec|null */ protected $endpointSpec; /** * Name of the service. - * - * @return string */ public function getName(): ?string { @@ -73,13 +76,10 @@ public function getName(): ?string /** * Name of the service. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -88,9 +88,9 @@ public function setName(?string $name): self /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -98,12 +98,11 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value metadata. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; @@ -111,8 +110,6 @@ public function setLabels(?\ArrayObject $labels): self /** * User modifiable task configuration. - * - * @return TaskSpec */ public function getTaskTemplate(): ?TaskSpec { @@ -121,13 +118,10 @@ public function getTaskTemplate(): ?TaskSpec /** * User modifiable task configuration. - * - * @param TaskSpec $taskTemplate - * - * @return self */ public function setTaskTemplate(?TaskSpec $taskTemplate): self { + $this->initialized['taskTemplate'] = true; $this->taskTemplate = $taskTemplate; return $this; @@ -135,8 +129,6 @@ public function setTaskTemplate(?TaskSpec $taskTemplate): self /** * Scheduling mode for the service. - * - * @return ServiceSpecMode */ public function getMode(): ?ServiceSpecMode { @@ -145,13 +137,10 @@ public function getMode(): ?ServiceSpecMode /** * Scheduling mode for the service. - * - * @param ServiceSpecMode $mode - * - * @return self */ public function setMode(?ServiceSpecMode $mode): self { + $this->initialized['mode'] = true; $this->mode = $mode; return $this; @@ -159,8 +148,6 @@ public function setMode(?ServiceSpecMode $mode): self /** * Specification for the update strategy of the service. - * - * @return ServiceSpecUpdateConfig */ public function getUpdateConfig(): ?ServiceSpecUpdateConfig { @@ -169,13 +156,10 @@ public function getUpdateConfig(): ?ServiceSpecUpdateConfig /** * Specification for the update strategy of the service. - * - * @param ServiceSpecUpdateConfig $updateConfig - * - * @return self */ public function setUpdateConfig(?ServiceSpecUpdateConfig $updateConfig): self { + $this->initialized['updateConfig'] = true; $this->updateConfig = $updateConfig; return $this; @@ -183,8 +167,6 @@ public function setUpdateConfig(?ServiceSpecUpdateConfig $updateConfig): self /** * Specification for the rollback strategy of the service. - * - * @return ServiceSpecRollbackConfig */ public function getRollbackConfig(): ?ServiceSpecRollbackConfig { @@ -193,22 +175,21 @@ public function getRollbackConfig(): ?ServiceSpecRollbackConfig /** * Specification for the rollback strategy of the service. - * - * @param ServiceSpecRollbackConfig $rollbackConfig - * - * @return self */ public function setRollbackConfig(?ServiceSpecRollbackConfig $rollbackConfig): self { + $this->initialized['rollbackConfig'] = true; $this->rollbackConfig = $rollbackConfig; return $this; } /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. + * + * Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. * - * @return ServiceSpecNetworksItem[] + * @return list|null */ public function getNetworks(): ?array { @@ -216,14 +197,15 @@ public function getNetworks(): ?array } /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. * - * @param ServiceSpecNetworksItem[] $networks + * Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. * - * @return self + * @param list|null $networks */ public function setNetworks(?array $networks): self { + $this->initialized['networks'] = true; $this->networks = $networks; return $this; @@ -231,8 +213,6 @@ public function setNetworks(?array $networks): self /** * Properties that can be configured to access and load balance a service. - * - * @return EndpointSpec */ public function getEndpointSpec(): ?EndpointSpec { @@ -241,13 +221,10 @@ public function getEndpointSpec(): ?EndpointSpec /** * Properties that can be configured to access and load balance a service. - * - * @param EndpointSpec $endpointSpec - * - * @return self */ public function setEndpointSpec(?EndpointSpec $endpointSpec): self { + $this->initialized['endpointSpec'] = true; $this->endpointSpec = $endpointSpec; return $this; diff --git a/src/Model/ServicesCreatePostResponse201.php b/src/Model/ServicesCreatePostResponse201.php deleted file mode 100644 index d1d83385..00000000 --- a/src/Model/ServicesCreatePostResponse201.php +++ /dev/null @@ -1,75 +0,0 @@ -iD; - } - - /** - * The ID of the created service. - * - * @param string $iD - * - * @return self - */ - public function setID(?string $iD): self - { - $this->iD = $iD; - - return $this; - } - - /** - * Optional warning message. - * - * @return string - */ - public function getWarning(): ?string - { - return $this->warning; - } - - /** - * Optional warning message. - * - * @param string $warning - * - * @return self - */ - public function setWarning(?string $warning): self - { - $this->warning = $warning; - - return $this; - } -} diff --git a/src/Model/ServicesIdUpdatePostBody.php b/src/Model/ServicesIdUpdatePostBody.php index 1fc66e96..c53eacf1 100644 --- a/src/Model/ServicesIdUpdatePostBody.php +++ b/src/Model/ServicesIdUpdatePostBody.php @@ -2,69 +2,72 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ServicesIdUpdatePostBody +class ServicesIdUpdatePostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Name of the service. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * User modifiable task configuration. * - * @var TaskSpec + * @var TaskSpec|null */ protected $taskTemplate; /** * Scheduling mode for the service. * - * @var ServiceSpecMode + * @var ServiceSpecMode|null */ protected $mode; /** * Specification for the update strategy of the service. * - * @var ServiceSpecUpdateConfig + * @var ServiceSpecUpdateConfig|null */ protected $updateConfig; /** * Specification for the rollback strategy of the service. * - * @var ServiceSpecRollbackConfig + * @var ServiceSpecRollbackConfig|null */ protected $rollbackConfig; /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. + * + * Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. * - * @var ServiceSpecNetworksItem[] + * @var list|null */ protected $networks; /** * Properties that can be configured to access and load balance a service. * - * @var EndpointSpec + * @var EndpointSpec|null */ protected $endpointSpec; /** * Name of the service. - * - * @return string */ public function getName(): ?string { @@ -73,13 +76,10 @@ public function getName(): ?string /** * Name of the service. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -88,9 +88,9 @@ public function setName(?string $name): self /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -98,12 +98,11 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value metadata. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; @@ -111,8 +110,6 @@ public function setLabels(?\ArrayObject $labels): self /** * User modifiable task configuration. - * - * @return TaskSpec */ public function getTaskTemplate(): ?TaskSpec { @@ -121,13 +118,10 @@ public function getTaskTemplate(): ?TaskSpec /** * User modifiable task configuration. - * - * @param TaskSpec $taskTemplate - * - * @return self */ public function setTaskTemplate(?TaskSpec $taskTemplate): self { + $this->initialized['taskTemplate'] = true; $this->taskTemplate = $taskTemplate; return $this; @@ -135,8 +129,6 @@ public function setTaskTemplate(?TaskSpec $taskTemplate): self /** * Scheduling mode for the service. - * - * @return ServiceSpecMode */ public function getMode(): ?ServiceSpecMode { @@ -145,13 +137,10 @@ public function getMode(): ?ServiceSpecMode /** * Scheduling mode for the service. - * - * @param ServiceSpecMode $mode - * - * @return self */ public function setMode(?ServiceSpecMode $mode): self { + $this->initialized['mode'] = true; $this->mode = $mode; return $this; @@ -159,8 +148,6 @@ public function setMode(?ServiceSpecMode $mode): self /** * Specification for the update strategy of the service. - * - * @return ServiceSpecUpdateConfig */ public function getUpdateConfig(): ?ServiceSpecUpdateConfig { @@ -169,13 +156,10 @@ public function getUpdateConfig(): ?ServiceSpecUpdateConfig /** * Specification for the update strategy of the service. - * - * @param ServiceSpecUpdateConfig $updateConfig - * - * @return self */ public function setUpdateConfig(?ServiceSpecUpdateConfig $updateConfig): self { + $this->initialized['updateConfig'] = true; $this->updateConfig = $updateConfig; return $this; @@ -183,8 +167,6 @@ public function setUpdateConfig(?ServiceSpecUpdateConfig $updateConfig): self /** * Specification for the rollback strategy of the service. - * - * @return ServiceSpecRollbackConfig */ public function getRollbackConfig(): ?ServiceSpecRollbackConfig { @@ -193,22 +175,21 @@ public function getRollbackConfig(): ?ServiceSpecRollbackConfig /** * Specification for the rollback strategy of the service. - * - * @param ServiceSpecRollbackConfig $rollbackConfig - * - * @return self */ public function setRollbackConfig(?ServiceSpecRollbackConfig $rollbackConfig): self { + $this->initialized['rollbackConfig'] = true; $this->rollbackConfig = $rollbackConfig; return $this; } /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. + * + * Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. * - * @return ServiceSpecNetworksItem[] + * @return list|null */ public function getNetworks(): ?array { @@ -216,14 +197,15 @@ public function getNetworks(): ?array } /** - * Array of network names or IDs to attach the service to. + * Specifies which networks the service should attach to. * - * @param ServiceSpecNetworksItem[] $networks + * Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. * - * @return self + * @param list|null $networks */ public function setNetworks(?array $networks): self { + $this->initialized['networks'] = true; $this->networks = $networks; return $this; @@ -231,8 +213,6 @@ public function setNetworks(?array $networks): self /** * Properties that can be configured to access and load balance a service. - * - * @return EndpointSpec */ public function getEndpointSpec(): ?EndpointSpec { @@ -241,13 +221,10 @@ public function getEndpointSpec(): ?EndpointSpec /** * Properties that can be configured to access and load balance a service. - * - * @param EndpointSpec $endpointSpec - * - * @return self */ public function setEndpointSpec(?EndpointSpec $endpointSpec): self { + $this->initialized['endpointSpec'] = true; $this->endpointSpec = $endpointSpec; return $this; diff --git a/src/Model/Swarm.php b/src/Model/Swarm.php index b2fa2dec..ad88dd4b 100644 --- a/src/Model/Swarm.php +++ b/src/Model/Swarm.php @@ -2,80 +2,104 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Swarm +class Swarm extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The ID of the swarm. * - * @var string + * @var string|null */ protected $iD; /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - - * - * @var ObjectVersion + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. + * + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. + * + * @var ObjectVersion|null */ protected $version; /** - * Date and time at which the swarm was initialised in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - + * Date and time at which the swarm was initialised in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. * - * @var string + * @var string|null */ protected $createdAt; /** - * Date and time at which the swarm was last updated in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - + * Date and time at which the swarm was last updated in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. * - * @var string + * @var string|null */ protected $updatedAt; /** * User modifiable swarm configuration. * - * @var SwarmSpec + * @var SwarmSpec|null */ protected $spec; /** - * Information about the issuer of leaf TLS certificates and the trusted root CA certificate. + * Information about the issuer of leaf TLS certificates and the trusted root + * CA certificate. * - * @var TLSInfo + * @var TLSInfo|null */ protected $tLSInfo; /** * Whether there is currently a root CA rotation in progress for the swarm. * - * @var bool + * @var bool|null */ protected $rootRotationInProgress; + /** + * DataPathPort specifies the data path port number for data traffic. + * Acceptable port range is 1024 to 49151. + * If no port is set or is set to 0, the default port (4789) is used. + * + * @var int|null + */ + protected $dataPathPort; + /** + * Default Address Pool specifies default subnet pools for global scope + * networks. + * + * @var list|null + */ + protected $defaultAddrPool; + /** + * SubnetSize specifies the subnet size of the networks created from the + * default subnet pool. + * + * @var int|null + */ + protected $subnetSize; /** * JoinTokens contains the tokens workers and managers need to join the swarm. * - * @var JoinTokens + * @var JoinTokens|null */ protected $joinTokens; /** * The ID of the swarm. - * - * @return string */ public function getID(): ?string { @@ -84,29 +108,26 @@ public function getID(): ?string /** * The ID of the swarm. - * - * @param string $iD - * - * @return self */ public function setID(?string $iD): self { + $this->initialized['iD'] = true; $this->iD = $iD; return $this; } /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - - * - * @return ObjectVersion + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. + * + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. */ public function getVersion(): ?ObjectVersion { @@ -114,32 +135,28 @@ public function getVersion(): ?ObjectVersion } /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - - * - * @param ObjectVersion $version - * - * @return self + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. + * + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. */ public function setVersion(?ObjectVersion $version): self { + $this->initialized['version'] = true; $this->version = $version; return $this; } /** - * Date and time at which the swarm was initialised in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - - * - * @return string + * Date and time at which the swarm was initialised in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. */ public function getCreatedAt(): ?string { @@ -147,27 +164,20 @@ public function getCreatedAt(): ?string } /** - * Date and time at which the swarm was initialised in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - - * - * @param string $createdAt - * - * @return self + * Date and time at which the swarm was initialised in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. */ public function setCreatedAt(?string $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; } /** - * Date and time at which the swarm was last updated in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - - * - * @return string + * Date and time at which the swarm was last updated in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. */ public function getUpdatedAt(): ?string { @@ -175,16 +185,12 @@ public function getUpdatedAt(): ?string } /** - * Date and time at which the swarm was last updated in. - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. - - * - * @param string $updatedAt - * - * @return self + * Date and time at which the swarm was last updated in + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. */ public function setUpdatedAt(?string $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; @@ -192,8 +198,6 @@ public function setUpdatedAt(?string $updatedAt): self /** * User modifiable swarm configuration. - * - * @return SwarmSpec */ public function getSpec(): ?SwarmSpec { @@ -202,22 +206,18 @@ public function getSpec(): ?SwarmSpec /** * User modifiable swarm configuration. - * - * @param SwarmSpec $spec - * - * @return self */ public function setSpec(?SwarmSpec $spec): self { + $this->initialized['spec'] = true; $this->spec = $spec; return $this; } /** - * Information about the issuer of leaf TLS certificates and the trusted root CA certificate. - * - * @return TLSInfo + * Information about the issuer of leaf TLS certificates and the trusted root + * CA certificate. */ public function getTLSInfo(): ?TLSInfo { @@ -225,14 +225,12 @@ public function getTLSInfo(): ?TLSInfo } /** - * Information about the issuer of leaf TLS certificates and the trusted root CA certificate. - * - * @param TLSInfo $tLSInfo - * - * @return self + * Information about the issuer of leaf TLS certificates and the trusted root + * CA certificate. */ public function setTLSInfo(?TLSInfo $tLSInfo): self { + $this->initialized['tLSInfo'] = true; $this->tLSInfo = $tLSInfo; return $this; @@ -240,8 +238,6 @@ public function setTLSInfo(?TLSInfo $tLSInfo): self /** * Whether there is currently a root CA rotation in progress for the swarm. - * - * @return bool */ public function getRootRotationInProgress(): ?bool { @@ -250,22 +246,86 @@ public function getRootRotationInProgress(): ?bool /** * Whether there is currently a root CA rotation in progress for the swarm. - * - * @param bool $rootRotationInProgress - * - * @return self */ public function setRootRotationInProgress(?bool $rootRotationInProgress): self { + $this->initialized['rootRotationInProgress'] = true; $this->rootRotationInProgress = $rootRotationInProgress; return $this; } /** - * JoinTokens contains the tokens workers and managers need to join the swarm. + * DataPathPort specifies the data path port number for data traffic. + * Acceptable port range is 1024 to 49151. + * If no port is set or is set to 0, the default port (4789) is used. + */ + public function getDataPathPort(): ?int + { + return $this->dataPathPort; + } + + /** + * DataPathPort specifies the data path port number for data traffic. + * Acceptable port range is 1024 to 49151. + * If no port is set or is set to 0, the default port (4789) is used. + */ + public function setDataPathPort(?int $dataPathPort): self + { + $this->initialized['dataPathPort'] = true; + $this->dataPathPort = $dataPathPort; + + return $this; + } + + /** + * Default Address Pool specifies default subnet pools for global scope + * networks. * - * @return JoinTokens + * @return list|null + */ + public function getDefaultAddrPool(): ?array + { + return $this->defaultAddrPool; + } + + /** + * Default Address Pool specifies default subnet pools for global scope + * networks. + * + * @param list|null $defaultAddrPool + */ + public function setDefaultAddrPool(?array $defaultAddrPool): self + { + $this->initialized['defaultAddrPool'] = true; + $this->defaultAddrPool = $defaultAddrPool; + + return $this; + } + + /** + * SubnetSize specifies the subnet size of the networks created from the + * default subnet pool. + */ + public function getSubnetSize(): ?int + { + return $this->subnetSize; + } + + /** + * SubnetSize specifies the subnet size of the networks created from the + * default subnet pool. + */ + public function setSubnetSize(?int $subnetSize): self + { + $this->initialized['subnetSize'] = true; + $this->subnetSize = $subnetSize; + + return $this; + } + + /** + * JoinTokens contains the tokens workers and managers need to join the swarm. */ public function getJoinTokens(): ?JoinTokens { @@ -274,13 +334,10 @@ public function getJoinTokens(): ?JoinTokens /** * JoinTokens contains the tokens workers and managers need to join the swarm. - * - * @param JoinTokens $joinTokens - * - * @return self */ public function setJoinTokens(?JoinTokens $joinTokens): self { + $this->initialized['joinTokens'] = true; $this->joinTokens = $joinTokens; return $this; diff --git a/src/Model/SwarmInfo.php b/src/Model/SwarmInfo.php index 42c6993c..d09fb826 100644 --- a/src/Model/SwarmInfo.php +++ b/src/Model/SwarmInfo.php @@ -2,75 +2,74 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SwarmInfo +class SwarmInfo extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Unique identifier of for this node in the swarm. * - * @var string + * @var string|null */ - protected $nodeID; + protected $nodeID = ''; /** - * IP address at which this node can be reached by other nodes in the. - swarm. - + * IP address at which this node can be reached by other nodes in the + * swarm. * - * @var string + * @var string|null */ - protected $nodeAddr; + protected $nodeAddr = ''; /** * Current local status of this node. * - * @var string + * @var string|null */ - protected $localNodeState; + protected $localNodeState = ''; /** - * @var bool + * @var bool|null */ - protected $controlAvailable; + protected $controlAvailable = false; /** - * @var string + * @var string|null */ - protected $error; + protected $error = ''; /** * List of ID's and addresses of other managers in the swarm. * - * @var PeerNode[] + * @var list|null */ protected $remoteManagers; /** * Total number of nodes in the swarm. * - * @var int + * @var int|null */ protected $nodes; /** * Total number of managers in the swarm. * - * @var int + * @var int|null */ protected $managers; /** - * ClusterInfo represents information about the swarm as is returned by the. - "/info" endpoint. Join-tokens are not included. - + * ClusterInfo represents information about the swarm as is returned by the + * "/info" endpoint. Join-tokens are not included. * - * @var ClusterInfo + * @var ClusterInfo|null */ protected $cluster; /** * Unique identifier of for this node in the swarm. - * - * @return string */ public function getNodeID(): ?string { @@ -79,24 +78,18 @@ public function getNodeID(): ?string /** * Unique identifier of for this node in the swarm. - * - * @param string $nodeID - * - * @return self */ public function setNodeID(?string $nodeID): self { + $this->initialized['nodeID'] = true; $this->nodeID = $nodeID; return $this; } /** - * IP address at which this node can be reached by other nodes in the. - swarm. - - * - * @return string + * IP address at which this node can be reached by other nodes in the + * swarm. */ public function getNodeAddr(): ?string { @@ -104,16 +97,12 @@ public function getNodeAddr(): ?string } /** - * IP address at which this node can be reached by other nodes in the. - swarm. - - * - * @param string $nodeAddr - * - * @return self + * IP address at which this node can be reached by other nodes in the + * swarm. */ public function setNodeAddr(?string $nodeAddr): self { + $this->initialized['nodeAddr'] = true; $this->nodeAddr = $nodeAddr; return $this; @@ -121,8 +110,6 @@ public function setNodeAddr(?string $nodeAddr): self /** * Current local status of this node. - * - * @return string */ public function getLocalNodeState(): ?string { @@ -131,53 +118,36 @@ public function getLocalNodeState(): ?string /** * Current local status of this node. - * - * @param string $localNodeState - * - * @return self */ public function setLocalNodeState(?string $localNodeState): self { + $this->initialized['localNodeState'] = true; $this->localNodeState = $localNodeState; return $this; } - /** - * @return bool - */ public function getControlAvailable(): ?bool { return $this->controlAvailable; } - /** - * @param bool $controlAvailable - * - * @return self - */ public function setControlAvailable(?bool $controlAvailable): self { + $this->initialized['controlAvailable'] = true; $this->controlAvailable = $controlAvailable; return $this; } - /** - * @return string - */ public function getError(): ?string { return $this->error; } - /** - * @param string $error - * - * @return self - */ public function setError(?string $error): self { + $this->initialized['error'] = true; $this->error = $error; return $this; @@ -186,7 +156,7 @@ public function setError(?string $error): self /** * List of ID's and addresses of other managers in the swarm. * - * @return PeerNode[] + * @return list|null */ public function getRemoteManagers(): ?array { @@ -196,12 +166,11 @@ public function getRemoteManagers(): ?array /** * List of ID's and addresses of other managers in the swarm. * - * @param PeerNode[] $remoteManagers - * - * @return self + * @param list|null $remoteManagers */ public function setRemoteManagers(?array $remoteManagers): self { + $this->initialized['remoteManagers'] = true; $this->remoteManagers = $remoteManagers; return $this; @@ -209,8 +178,6 @@ public function setRemoteManagers(?array $remoteManagers): self /** * Total number of nodes in the swarm. - * - * @return int */ public function getNodes(): ?int { @@ -219,13 +186,10 @@ public function getNodes(): ?int /** * Total number of nodes in the swarm. - * - * @param int $nodes - * - * @return self */ public function setNodes(?int $nodes): self { + $this->initialized['nodes'] = true; $this->nodes = $nodes; return $this; @@ -233,8 +197,6 @@ public function setNodes(?int $nodes): self /** * Total number of managers in the swarm. - * - * @return int */ public function getManagers(): ?int { @@ -243,24 +205,18 @@ public function getManagers(): ?int /** * Total number of managers in the swarm. - * - * @param int $managers - * - * @return self */ public function setManagers(?int $managers): self { + $this->initialized['managers'] = true; $this->managers = $managers; return $this; } /** - * ClusterInfo represents information about the swarm as is returned by the. - "/info" endpoint. Join-tokens are not included. - - * - * @return ClusterInfo + * ClusterInfo represents information about the swarm as is returned by the + * "/info" endpoint. Join-tokens are not included. */ public function getCluster(): ?ClusterInfo { @@ -268,16 +224,12 @@ public function getCluster(): ?ClusterInfo } /** - * ClusterInfo represents information about the swarm as is returned by the. - "/info" endpoint. Join-tokens are not included. - - * - * @param ClusterInfo $cluster - * - * @return self + * ClusterInfo represents information about the swarm as is returned by the + * "/info" endpoint. Join-tokens are not included. */ public function setCluster(?ClusterInfo $cluster): self { + $this->initialized['cluster'] = true; $this->cluster = $cluster; return $this; diff --git a/src/Model/SwarmInitPostBody.php b/src/Model/SwarmInitPostBody.php index c383e49b..d037378a 100644 --- a/src/Model/SwarmInitPostBody.php +++ b/src/Model/SwarmInitPostBody.php @@ -2,58 +2,98 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SwarmInitPostBody +class SwarmInitPostBody extends \ArrayObject { /** - * 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. + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * 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. * - * @var string + * @var string|null */ protected $listenAddr; /** - * 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. + * 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. * - * @var string + * @var string|null */ protected $advertiseAddr; /** - * Address or interface to use for data path traffic (format: ``), for example, `192.168.1.1`,. - or an interface, like `eth0`. If `DataPathAddr` is unspecified, the same address as `AdvertiseAddr` - is used. - - The `DataPathAddr` specifies the address that global scope network drivers will publish towards other - nodes in order to reach the containers running on this node. Using this parameter it is possible to - separate the container data traffic from the management traffic of the cluster. - + * Address or interface to use for data path traffic (format: + * ``), for example, `192.168.1.1`, or an interface, + * like `eth0`. If `DataPathAddr` is unspecified, the same address + * as `AdvertiseAddr` is used. + * + * The `DataPathAddr` specifies the address that global scope + * network drivers will publish towards other nodes in order to + * reach the containers running on this node. Using this parameter + * it is possible to separate the container data traffic from the + * management traffic of the cluster. * - * @var string + * @var string|null */ protected $dataPathAddr; + /** + * DataPathPort specifies the data path port number for data traffic. + * Acceptable port range is 1024 to 49151. + * if no port is set or is set to 0, default port 4789 will be used. + * + * @var int|null + */ + protected $dataPathPort; + /** + * Default Address Pool specifies default subnet pools for global + * scope networks. + * + * @var list|null + */ + protected $defaultAddrPool; /** * Force creation of a new swarm. * - * @var bool + * @var bool|null */ protected $forceNewCluster; + /** + * SubnetSize specifies the subnet size of the networks created + * from the default subnet pool. + * + * @var int|null + */ + protected $subnetSize; /** * User modifiable swarm configuration. * - * @var SwarmSpec + * @var SwarmSpec|null */ protected $spec; /** - * 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. - * - * @return string + * 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. */ public function getListenAddr(): ?string { @@ -61,23 +101,28 @@ public function getListenAddr(): ?string } /** - * 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. - * - * @param string $listenAddr - * - * @return self + * 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. */ public function setListenAddr(?string $listenAddr): self { + $this->initialized['listenAddr'] = true; $this->listenAddr = $listenAddr; return $this; } /** - * 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. - * - * @return string + * 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. */ public function getAdvertiseAddr(): ?string { @@ -85,30 +130,32 @@ public function getAdvertiseAddr(): ?string } /** - * 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. - * - * @param string $advertiseAddr - * - * @return self + * 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. */ public function setAdvertiseAddr(?string $advertiseAddr): self { + $this->initialized['advertiseAddr'] = true; $this->advertiseAddr = $advertiseAddr; return $this; } /** - * Address or interface to use for data path traffic (format: ``), for example, `192.168.1.1`,. - or an interface, like `eth0`. If `DataPathAddr` is unspecified, the same address as `AdvertiseAddr` - is used. - - The `DataPathAddr` specifies the address that global scope network drivers will publish towards other - nodes in order to reach the containers running on this node. Using this parameter it is possible to - separate the container data traffic from the management traffic of the cluster. - + * Address or interface to use for data path traffic (format: + * ``), for example, `192.168.1.1`, or an interface, + * like `eth0`. If `DataPathAddr` is unspecified, the same address + * as `AdvertiseAddr` is used. * - * @return string + * The `DataPathAddr` specifies the address that global scope + * network drivers will publish towards other nodes in order to + * reach the containers running on this node. Using this parameter + * it is possible to separate the container data traffic from the + * management traffic of the cluster. */ public function getDataPathAddr(): ?string { @@ -116,30 +163,75 @@ public function getDataPathAddr(): ?string } /** - * Address or interface to use for data path traffic (format: ``), for example, `192.168.1.1`,. - or an interface, like `eth0`. If `DataPathAddr` is unspecified, the same address as `AdvertiseAddr` - is used. + * Address or interface to use for data path traffic (format: + * ``), for example, `192.168.1.1`, or an interface, + * like `eth0`. If `DataPathAddr` is unspecified, the same address + * as `AdvertiseAddr` is used. + * + * The `DataPathAddr` specifies the address that global scope + * network drivers will publish towards other nodes in order to + * reach the containers running on this node. Using this parameter + * it is possible to separate the container data traffic from the + * management traffic of the cluster. + */ + public function setDataPathAddr(?string $dataPathAddr): self + { + $this->initialized['dataPathAddr'] = true; + $this->dataPathAddr = $dataPathAddr; - The `DataPathAddr` specifies the address that global scope network drivers will publish towards other - nodes in order to reach the containers running on this node. Using this parameter it is possible to - separate the container data traffic from the management traffic of the cluster. + return $this; + } + /** + * DataPathPort specifies the data path port number for data traffic. + * Acceptable port range is 1024 to 49151. + * if no port is set or is set to 0, default port 4789 will be used. + */ + public function getDataPathPort(): ?int + { + return $this->dataPathPort; + } + + /** + * DataPathPort specifies the data path port number for data traffic. + * Acceptable port range is 1024 to 49151. + * if no port is set or is set to 0, default port 4789 will be used. + */ + public function setDataPathPort(?int $dataPathPort): self + { + $this->initialized['dataPathPort'] = true; + $this->dataPathPort = $dataPathPort; + + return $this; + } + + /** + * Default Address Pool specifies default subnet pools for global + * scope networks. * - * @param string $dataPathAddr + * @return list|null + */ + public function getDefaultAddrPool(): ?array + { + return $this->defaultAddrPool; + } + + /** + * Default Address Pool specifies default subnet pools for global + * scope networks. * - * @return self + * @param list|null $defaultAddrPool */ - public function setDataPathAddr(?string $dataPathAddr): self + public function setDefaultAddrPool(?array $defaultAddrPool): self { - $this->dataPathAddr = $dataPathAddr; + $this->initialized['defaultAddrPool'] = true; + $this->defaultAddrPool = $defaultAddrPool; return $this; } /** * Force creation of a new swarm. - * - * @return bool */ public function getForceNewCluster(): ?bool { @@ -148,22 +240,38 @@ public function getForceNewCluster(): ?bool /** * Force creation of a new swarm. - * - * @param bool $forceNewCluster - * - * @return self */ public function setForceNewCluster(?bool $forceNewCluster): self { + $this->initialized['forceNewCluster'] = true; $this->forceNewCluster = $forceNewCluster; return $this; } + /** + * SubnetSize specifies the subnet size of the networks created + * from the default subnet pool. + */ + public function getSubnetSize(): ?int + { + return $this->subnetSize; + } + + /** + * SubnetSize specifies the subnet size of the networks created + * from the default subnet pool. + */ + public function setSubnetSize(?int $subnetSize): self + { + $this->initialized['subnetSize'] = true; + $this->subnetSize = $subnetSize; + + return $this; + } + /** * User modifiable swarm configuration. - * - * @return SwarmSpec */ public function getSpec(): ?SwarmSpec { @@ -172,13 +280,10 @@ public function getSpec(): ?SwarmSpec /** * User modifiable swarm configuration. - * - * @param SwarmSpec $spec - * - * @return self */ public function setSpec(?SwarmSpec $spec): self { + $this->initialized['spec'] = true; $this->spec = $spec; return $this; diff --git a/src/Model/SwarmJoinPostBody.php b/src/Model/SwarmJoinPostBody.php index fdf759f2..21a3aebc 100644 --- a/src/Model/SwarmJoinPostBody.php +++ b/src/Model/SwarmJoinPostBody.php @@ -2,58 +2,70 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SwarmJoinPostBody +class SwarmJoinPostBody extends \ArrayObject { /** - * 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). + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * 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). * - * @var string + * @var string|null */ protected $listenAddr; /** - * 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. - * - * @var string + * 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. + * + * @var string|null */ protected $advertiseAddr; /** - * Address or interface to use for data path traffic (format: ``), for example, `192.168.1.1`,. - or an interface, like `eth0`. If `DataPathAddr` is unspecified, the same address as `AdvertiseAddr` - is used. - - The `DataPathAddr` specifies the address that global scope network drivers will publish towards other - nodes in order to reach the containers running on this node. Using this parameter it is possible to - separate the container data traffic from the management traffic of the cluster. - - * - * @var string + * Address or interface to use for data path traffic (format: + * ``), for example, `192.168.1.1`, or an interface, + * like `eth0`. If `DataPathAddr` is unspecified, the same address + * as `AdvertiseAddr` is used. + * + * The `DataPathAddr` specifies the address that global scope + * network drivers will publish towards other nodes in order to + * reach the containers running on this node. Using this parameter + * it is possible to separate the container data traffic from the + * management traffic of the cluster. + * + * @var string|null */ protected $dataPathAddr; /** * Addresses of manager nodes already participating in the swarm. * - * @var string + * @var list|null */ protected $remoteAddrs; /** * Secret token for joining this swarm. * - * @var string + * @var string|null */ protected $joinToken; /** - * 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). - * - * @return string + * 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). */ public function getListenAddr(): ?string { @@ -61,23 +73,25 @@ public function getListenAddr(): ?string } /** - * 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). - * - * @param string $listenAddr - * - * @return self + * 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). */ public function setListenAddr(?string $listenAddr): self { + $this->initialized['listenAddr'] = true; $this->listenAddr = $listenAddr; return $this; } /** - * 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. - * - * @return string + * 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. */ public function getAdvertiseAddr(): ?string { @@ -85,30 +99,32 @@ public function getAdvertiseAddr(): ?string } /** - * 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. - * - * @param string $advertiseAddr - * - * @return self + * 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. */ public function setAdvertiseAddr(?string $advertiseAddr): self { + $this->initialized['advertiseAddr'] = true; $this->advertiseAddr = $advertiseAddr; return $this; } /** - * Address or interface to use for data path traffic (format: ``), for example, `192.168.1.1`,. - or an interface, like `eth0`. If `DataPathAddr` is unspecified, the same address as `AdvertiseAddr` - is used. - - The `DataPathAddr` specifies the address that global scope network drivers will publish towards other - nodes in order to reach the containers running on this node. Using this parameter it is possible to - separate the container data traffic from the management traffic of the cluster. - - * - * @return string + * Address or interface to use for data path traffic (format: + * ``), for example, `192.168.1.1`, or an interface, + * like `eth0`. If `DataPathAddr` is unspecified, the same address + * as `AdvertiseAddr` is used. + * + * The `DataPathAddr` specifies the address that global scope + * network drivers will publish towards other nodes in order to + * reach the containers running on this node. Using this parameter + * it is possible to separate the container data traffic from the + * management traffic of the cluster. */ public function getDataPathAddr(): ?string { @@ -116,21 +132,20 @@ public function getDataPathAddr(): ?string } /** - * Address or interface to use for data path traffic (format: ``), for example, `192.168.1.1`,. - or an interface, like `eth0`. If `DataPathAddr` is unspecified, the same address as `AdvertiseAddr` - is used. - - The `DataPathAddr` specifies the address that global scope network drivers will publish towards other - nodes in order to reach the containers running on this node. Using this parameter it is possible to - separate the container data traffic from the management traffic of the cluster. - - * - * @param string $dataPathAddr - * - * @return self + * Address or interface to use for data path traffic (format: + * ``), for example, `192.168.1.1`, or an interface, + * like `eth0`. If `DataPathAddr` is unspecified, the same address + * as `AdvertiseAddr` is used. + * + * The `DataPathAddr` specifies the address that global scope + * network drivers will publish towards other nodes in order to + * reach the containers running on this node. Using this parameter + * it is possible to separate the container data traffic from the + * management traffic of the cluster. */ public function setDataPathAddr(?string $dataPathAddr): self { + $this->initialized['dataPathAddr'] = true; $this->dataPathAddr = $dataPathAddr; return $this; @@ -139,9 +154,9 @@ public function setDataPathAddr(?string $dataPathAddr): self /** * Addresses of manager nodes already participating in the swarm. * - * @return string + * @return list|null */ - public function getRemoteAddrs(): ?string + public function getRemoteAddrs(): ?array { return $this->remoteAddrs; } @@ -149,12 +164,11 @@ public function getRemoteAddrs(): ?string /** * Addresses of manager nodes already participating in the swarm. * - * @param string $remoteAddrs - * - * @return self + * @param list|null $remoteAddrs */ - public function setRemoteAddrs(?string $remoteAddrs): self + public function setRemoteAddrs(?array $remoteAddrs): self { + $this->initialized['remoteAddrs'] = true; $this->remoteAddrs = $remoteAddrs; return $this; @@ -162,8 +176,6 @@ public function setRemoteAddrs(?string $remoteAddrs): self /** * Secret token for joining this swarm. - * - * @return string */ public function getJoinToken(): ?string { @@ -172,13 +184,10 @@ public function getJoinToken(): ?string /** * Secret token for joining this swarm. - * - * @param string $joinToken - * - * @return self */ public function setJoinToken(?string $joinToken): self { + $this->initialized['joinToken'] = true; $this->joinToken = $joinToken; return $this; diff --git a/src/Model/SwarmSpec.php b/src/Model/SwarmSpec.php index 5f5b6d07..6efb97a0 100644 --- a/src/Model/SwarmSpec.php +++ b/src/Model/SwarmSpec.php @@ -2,69 +2,70 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SwarmSpec +class SwarmSpec extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Name of the swarm. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * Orchestration configuration. * - * @var SwarmSpecOrchestration + * @var SwarmSpecOrchestration|null */ protected $orchestration; /** * Raft configuration. * - * @var SwarmSpecRaft + * @var SwarmSpecRaft|null */ protected $raft; /** * Dispatcher configuration. * - * @var SwarmSpecDispatcher + * @var SwarmSpecDispatcher|null */ protected $dispatcher; /** * CA configuration. * - * @var SwarmSpecCAConfig + * @var SwarmSpecCAConfig|null */ protected $cAConfig; /** * Parameters related to encryption-at-rest. * - * @var SwarmSpecEncryptionConfig + * @var SwarmSpecEncryptionConfig|null */ protected $encryptionConfig; /** * Defaults for creating tasks in this cluster. * - * @var SwarmSpecTaskDefaults + * @var SwarmSpecTaskDefaults|null */ protected $taskDefaults; /** * Name of the swarm. - * - * @return string */ public function getName(): ?string { @@ -73,13 +74,10 @@ public function getName(): ?string /** * Name of the swarm. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -88,9 +86,9 @@ public function setName(?string $name): self /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -98,12 +96,11 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value metadata. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; @@ -111,8 +108,6 @@ public function setLabels(?\ArrayObject $labels): self /** * Orchestration configuration. - * - * @return SwarmSpecOrchestration */ public function getOrchestration(): ?SwarmSpecOrchestration { @@ -121,13 +116,10 @@ public function getOrchestration(): ?SwarmSpecOrchestration /** * Orchestration configuration. - * - * @param SwarmSpecOrchestration $orchestration - * - * @return self */ public function setOrchestration(?SwarmSpecOrchestration $orchestration): self { + $this->initialized['orchestration'] = true; $this->orchestration = $orchestration; return $this; @@ -135,8 +127,6 @@ public function setOrchestration(?SwarmSpecOrchestration $orchestration): self /** * Raft configuration. - * - * @return SwarmSpecRaft */ public function getRaft(): ?SwarmSpecRaft { @@ -145,13 +135,10 @@ public function getRaft(): ?SwarmSpecRaft /** * Raft configuration. - * - * @param SwarmSpecRaft $raft - * - * @return self */ public function setRaft(?SwarmSpecRaft $raft): self { + $this->initialized['raft'] = true; $this->raft = $raft; return $this; @@ -159,8 +146,6 @@ public function setRaft(?SwarmSpecRaft $raft): self /** * Dispatcher configuration. - * - * @return SwarmSpecDispatcher */ public function getDispatcher(): ?SwarmSpecDispatcher { @@ -169,13 +154,10 @@ public function getDispatcher(): ?SwarmSpecDispatcher /** * Dispatcher configuration. - * - * @param SwarmSpecDispatcher $dispatcher - * - * @return self */ public function setDispatcher(?SwarmSpecDispatcher $dispatcher): self { + $this->initialized['dispatcher'] = true; $this->dispatcher = $dispatcher; return $this; @@ -183,8 +165,6 @@ public function setDispatcher(?SwarmSpecDispatcher $dispatcher): self /** * CA configuration. - * - * @return SwarmSpecCAConfig */ public function getCAConfig(): ?SwarmSpecCAConfig { @@ -193,13 +173,10 @@ public function getCAConfig(): ?SwarmSpecCAConfig /** * CA configuration. - * - * @param SwarmSpecCAConfig $cAConfig - * - * @return self */ public function setCAConfig(?SwarmSpecCAConfig $cAConfig): self { + $this->initialized['cAConfig'] = true; $this->cAConfig = $cAConfig; return $this; @@ -207,8 +184,6 @@ public function setCAConfig(?SwarmSpecCAConfig $cAConfig): self /** * Parameters related to encryption-at-rest. - * - * @return SwarmSpecEncryptionConfig */ public function getEncryptionConfig(): ?SwarmSpecEncryptionConfig { @@ -217,13 +192,10 @@ public function getEncryptionConfig(): ?SwarmSpecEncryptionConfig /** * Parameters related to encryption-at-rest. - * - * @param SwarmSpecEncryptionConfig $encryptionConfig - * - * @return self */ public function setEncryptionConfig(?SwarmSpecEncryptionConfig $encryptionConfig): self { + $this->initialized['encryptionConfig'] = true; $this->encryptionConfig = $encryptionConfig; return $this; @@ -231,8 +203,6 @@ public function setEncryptionConfig(?SwarmSpecEncryptionConfig $encryptionConfig /** * Defaults for creating tasks in this cluster. - * - * @return SwarmSpecTaskDefaults */ public function getTaskDefaults(): ?SwarmSpecTaskDefaults { @@ -241,13 +211,10 @@ public function getTaskDefaults(): ?SwarmSpecTaskDefaults /** * Defaults for creating tasks in this cluster. - * - * @param SwarmSpecTaskDefaults $taskDefaults - * - * @return self */ public function setTaskDefaults(?SwarmSpecTaskDefaults $taskDefaults): self { + $this->initialized['taskDefaults'] = true; $this->taskDefaults = $taskDefaults; return $this; diff --git a/src/Model/SwarmSpecCAConfig.php b/src/Model/SwarmSpecCAConfig.php index 3efe3070..873690ff 100644 --- a/src/Model/SwarmSpecCAConfig.php +++ b/src/Model/SwarmSpecCAConfig.php @@ -2,51 +2,57 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SwarmSpecCAConfig +class SwarmSpecCAConfig extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The duration node certificates are issued for. * - * @var int + * @var int|null */ protected $nodeCertExpiry; /** - * Configuration for forwarding signing requests to an external certificate authority. + * Configuration for forwarding signing requests to an external + * certificate authority. * - * @var SwarmSpecCAConfigExternalCAsItem[] + * @var list|null */ protected $externalCAs; /** - * The desired signing CA certificate for all swarm node TLS leaf certificates, in PEM format. + * The desired signing CA certificate for all swarm node TLS leaf + * certificates, in PEM format. * - * @var string + * @var string|null */ protected $signingCACert; /** - * The desired signing CA key for all swarm node TLS leaf certificates, in PEM format. + * The desired signing CA key for all swarm node TLS leaf certificates, + * in PEM format. * - * @var string + * @var string|null */ protected $signingCAKey; /** - * An integer whose purpose is to force swarm to generate a new signing CA certificate and key, if none have been specified in `SigningCACert` and `SigningCAKey`. + * An integer whose purpose is to force swarm to generate a new + * signing CA certificate and key, if none have been specified in + * `SigningCACert` and `SigningCAKey`. * - * @var int + * @var int|null */ protected $forceRotate; /** * The duration node certificates are issued for. - * - * @return int */ public function getNodeCertExpiry(): ?int { @@ -55,22 +61,20 @@ public function getNodeCertExpiry(): ?int /** * The duration node certificates are issued for. - * - * @param int $nodeCertExpiry - * - * @return self */ public function setNodeCertExpiry(?int $nodeCertExpiry): self { + $this->initialized['nodeCertExpiry'] = true; $this->nodeCertExpiry = $nodeCertExpiry; return $this; } /** - * Configuration for forwarding signing requests to an external certificate authority. + * Configuration for forwarding signing requests to an external + * certificate authority. * - * @return SwarmSpecCAConfigExternalCAsItem[] + * @return list|null */ public function getExternalCAs(): ?array { @@ -78,23 +82,22 @@ public function getExternalCAs(): ?array } /** - * Configuration for forwarding signing requests to an external certificate authority. - * - * @param SwarmSpecCAConfigExternalCAsItem[] $externalCAs + * Configuration for forwarding signing requests to an external + * certificate authority. * - * @return self + * @param list|null $externalCAs */ public function setExternalCAs(?array $externalCAs): self { + $this->initialized['externalCAs'] = true; $this->externalCAs = $externalCAs; return $this; } /** - * The desired signing CA certificate for all swarm node TLS leaf certificates, in PEM format. - * - * @return string + * The desired signing CA certificate for all swarm node TLS leaf + * certificates, in PEM format. */ public function getSigningCACert(): ?string { @@ -102,23 +105,20 @@ public function getSigningCACert(): ?string } /** - * The desired signing CA certificate for all swarm node TLS leaf certificates, in PEM format. - * - * @param string $signingCACert - * - * @return self + * The desired signing CA certificate for all swarm node TLS leaf + * certificates, in PEM format. */ public function setSigningCACert(?string $signingCACert): self { + $this->initialized['signingCACert'] = true; $this->signingCACert = $signingCACert; return $this; } /** - * The desired signing CA key for all swarm node TLS leaf certificates, in PEM format. - * - * @return string + * The desired signing CA key for all swarm node TLS leaf certificates, + * in PEM format. */ public function getSigningCAKey(): ?string { @@ -126,23 +126,21 @@ public function getSigningCAKey(): ?string } /** - * The desired signing CA key for all swarm node TLS leaf certificates, in PEM format. - * - * @param string $signingCAKey - * - * @return self + * The desired signing CA key for all swarm node TLS leaf certificates, + * in PEM format. */ public function setSigningCAKey(?string $signingCAKey): self { + $this->initialized['signingCAKey'] = true; $this->signingCAKey = $signingCAKey; return $this; } /** - * An integer whose purpose is to force swarm to generate a new signing CA certificate and key, if none have been specified in `SigningCACert` and `SigningCAKey`. - * - * @return int + * An integer whose purpose is to force swarm to generate a new + * signing CA certificate and key, if none have been specified in + * `SigningCACert` and `SigningCAKey`. */ public function getForceRotate(): ?int { @@ -150,14 +148,13 @@ public function getForceRotate(): ?int } /** - * An integer whose purpose is to force swarm to generate a new signing CA certificate and key, if none have been specified in `SigningCACert` and `SigningCAKey`. - * - * @param int $forceRotate - * - * @return self + * An integer whose purpose is to force swarm to generate a new + * signing CA certificate and key, if none have been specified in + * `SigningCACert` and `SigningCAKey`. */ public function setForceRotate(?int $forceRotate): self { + $this->initialized['forceRotate'] = true; $this->forceRotate = $forceRotate; return $this; diff --git a/src/Model/SwarmSpecCAConfigExternalCAsItem.php b/src/Model/SwarmSpecCAConfigExternalCAsItem.php index a3e087f1..4a957f4d 100644 --- a/src/Model/SwarmSpecCAConfigExternalCAsItem.php +++ b/src/Model/SwarmSpecCAConfigExternalCAsItem.php @@ -2,45 +2,51 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SwarmSpecCAConfigExternalCAsItem +class SwarmSpecCAConfigExternalCAsItem extends \ArrayObject { /** - * Protocol for communication with the external CA (currently only `cfssl` is supported). + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * Protocol for communication with the external CA (currently + * only `cfssl` is supported). * - * @var string + * @var string|null */ - protected $protocol; + protected $protocol = 'cfssl'; /** * URL where certificate signing requests should be sent. * - * @var string + * @var string|null */ protected $uRL; /** - * An object with key/value pairs that are interpreted as protocol-specific options for the external CA driver. + * An object with key/value pairs that are interpreted as + * protocol-specific options for the external CA driver. * - * @var string[] + * @var array|null */ protected $options; /** - * The root CA certificate (in PEM format) this external CA uses to issue TLS certificates (assumed to be to the current swarm root CA certificate if not provided). + * The root CA certificate (in PEM format) this external CA uses + * to issue TLS certificates (assumed to be to the current swarm + * root CA certificate if not provided). * - * @var string + * @var string|null */ protected $cACert; /** - * Protocol for communication with the external CA (currently only `cfssl` is supported). - * - * @return string + * Protocol for communication with the external CA (currently + * only `cfssl` is supported). */ public function getProtocol(): ?string { @@ -48,14 +54,12 @@ public function getProtocol(): ?string } /** - * Protocol for communication with the external CA (currently only `cfssl` is supported). - * - * @param string $protocol - * - * @return self + * Protocol for communication with the external CA (currently + * only `cfssl` is supported). */ public function setProtocol(?string $protocol): self { + $this->initialized['protocol'] = true; $this->protocol = $protocol; return $this; @@ -63,8 +67,6 @@ public function setProtocol(?string $protocol): self /** * URL where certificate signing requests should be sent. - * - * @return string */ public function getURL(): ?string { @@ -73,46 +75,44 @@ public function getURL(): ?string /** * URL where certificate signing requests should be sent. - * - * @param string $uRL - * - * @return self */ public function setURL(?string $uRL): self { + $this->initialized['uRL'] = true; $this->uRL = $uRL; return $this; } /** - * An object with key/value pairs that are interpreted as protocol-specific options for the external CA driver. + * An object with key/value pairs that are interpreted as + * protocol-specific options for the external CA driver. * - * @return string[] + * @return array|null */ - public function getOptions(): ?\ArrayObject + public function getOptions(): ?iterable { return $this->options; } /** - * An object with key/value pairs that are interpreted as protocol-specific options for the external CA driver. + * An object with key/value pairs that are interpreted as + * protocol-specific options for the external CA driver. * - * @param string[] $options - * - * @return self + * @param array|null $options */ - public function setOptions(?\ArrayObject $options): self + public function setOptions(?iterable $options): self { + $this->initialized['options'] = true; $this->options = $options; return $this; } /** - * The root CA certificate (in PEM format) this external CA uses to issue TLS certificates (assumed to be to the current swarm root CA certificate if not provided). - * - * @return string + * The root CA certificate (in PEM format) this external CA uses + * to issue TLS certificates (assumed to be to the current swarm + * root CA certificate if not provided). */ public function getCACert(): ?string { @@ -120,14 +120,13 @@ public function getCACert(): ?string } /** - * The root CA certificate (in PEM format) this external CA uses to issue TLS certificates (assumed to be to the current swarm root CA certificate if not provided). - * - * @param string $cACert - * - * @return self + * The root CA certificate (in PEM format) this external CA uses + * to issue TLS certificates (assumed to be to the current swarm + * root CA certificate if not provided). */ public function setCACert(?string $cACert): self { + $this->initialized['cACert'] = true; $this->cACert = $cACert; return $this; diff --git a/src/Model/SwarmSpecDispatcher.php b/src/Model/SwarmSpecDispatcher.php index 7d0dee96..2b39e3c5 100644 --- a/src/Model/SwarmSpecDispatcher.php +++ b/src/Model/SwarmSpecDispatcher.php @@ -2,27 +2,28 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SwarmSpecDispatcher +class SwarmSpecDispatcher extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The delay for an agent to send a heartbeat to the dispatcher. * - * @var int + * @var int|null */ protected $heartbeatPeriod; /** * The delay for an agent to send a heartbeat to the dispatcher. - * - * @return int */ public function getHeartbeatPeriod(): ?int { @@ -31,13 +32,10 @@ public function getHeartbeatPeriod(): ?int /** * The delay for an agent to send a heartbeat to the dispatcher. - * - * @param int $heartbeatPeriod - * - * @return self */ public function setHeartbeatPeriod(?int $heartbeatPeriod): self { + $this->initialized['heartbeatPeriod'] = true; $this->heartbeatPeriod = $heartbeatPeriod; return $this; diff --git a/src/Model/SwarmSpecEncryptionConfig.php b/src/Model/SwarmSpecEncryptionConfig.php index c848fc16..dbfcade8 100644 --- a/src/Model/SwarmSpecEncryptionConfig.php +++ b/src/Model/SwarmSpecEncryptionConfig.php @@ -2,27 +2,30 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SwarmSpecEncryptionConfig +class SwarmSpecEncryptionConfig extends \ArrayObject { /** - * If set, generate a key and use it to lock data stored on the managers. + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * If set, generate a key and use it to lock data stored on the + * managers. * - * @var bool + * @var bool|null */ protected $autoLockManagers; /** - * If set, generate a key and use it to lock data stored on the managers. - * - * @return bool + * If set, generate a key and use it to lock data stored on the + * managers. */ public function getAutoLockManagers(): ?bool { @@ -30,14 +33,12 @@ public function getAutoLockManagers(): ?bool } /** - * If set, generate a key and use it to lock data stored on the managers. - * - * @param bool $autoLockManagers - * - * @return self + * If set, generate a key and use it to lock data stored on the + * managers. */ public function setAutoLockManagers(?bool $autoLockManagers): self { + $this->initialized['autoLockManagers'] = true; $this->autoLockManagers = $autoLockManagers; return $this; diff --git a/src/Model/SwarmSpecOrchestration.php b/src/Model/SwarmSpecOrchestration.php index a953751b..047e8b0f 100644 --- a/src/Model/SwarmSpecOrchestration.php +++ b/src/Model/SwarmSpecOrchestration.php @@ -2,27 +2,30 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SwarmSpecOrchestration +class SwarmSpecOrchestration extends \ArrayObject { /** - * The number of historic tasks to keep per instance or node. If negative, never remove completed or failed tasks. + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * The number of historic tasks to keep per instance or node. If + * negative, never remove completed or failed tasks. * - * @var int + * @var int|null */ protected $taskHistoryRetentionLimit; /** - * The number of historic tasks to keep per instance or node. If negative, never remove completed or failed tasks. - * - * @return int + * The number of historic tasks to keep per instance or node. If + * negative, never remove completed or failed tasks. */ public function getTaskHistoryRetentionLimit(): ?int { @@ -30,14 +33,12 @@ public function getTaskHistoryRetentionLimit(): ?int } /** - * The number of historic tasks to keep per instance or node. If negative, never remove completed or failed tasks. - * - * @param int $taskHistoryRetentionLimit - * - * @return self + * The number of historic tasks to keep per instance or node. If + * negative, never remove completed or failed tasks. */ public function setTaskHistoryRetentionLimit(?int $taskHistoryRetentionLimit): self { + $this->initialized['taskHistoryRetentionLimit'] = true; $this->taskHistoryRetentionLimit = $taskHistoryRetentionLimit; return $this; diff --git a/src/Model/SwarmSpecRaft.php b/src/Model/SwarmSpecRaft.php index c413a55a..039f2d41 100644 --- a/src/Model/SwarmSpecRaft.php +++ b/src/Model/SwarmSpecRaft.php @@ -2,57 +2,62 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SwarmSpecRaft +class SwarmSpecRaft extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The number of log entries between snapshots. * - * @var int + * @var int|null */ protected $snapshotInterval; /** * The number of snapshots to keep beyond the current snapshot. * - * @var int + * @var int|null */ protected $keepOldSnapshots; /** - * The number of log entries to keep around to sync up slow followers after a snapshot is created. + * The number of log entries to keep around to sync up slow followers + * after a snapshot is created. * - * @var int + * @var int|null */ protected $logEntriesForSlowFollowers; /** - * The number of ticks that a follower will wait for a message from the leader before becoming a candidate and starting an election. `ElectionTick` must be greater than `HeartbeatTick`. - - A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed. - + * 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`. * - * @var int + * A tick currently defaults to one second, so these translate + * directly to seconds currently, but this is NOT guaranteed. + * + * @var int|null */ protected $electionTick; /** - * The number of ticks between heartbeats. Every HeartbeatTick ticks, the leader will send a heartbeat to the followers. - - A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed. - + * The number of ticks between heartbeats. Every HeartbeatTick ticks, + * the leader will send a heartbeat to the followers. + * + * A tick currently defaults to one second, so these translate + * directly to seconds currently, but this is NOT guaranteed. * - * @var int + * @var int|null */ protected $heartbeatTick; /** * The number of log entries between snapshots. - * - * @return int */ public function getSnapshotInterval(): ?int { @@ -61,13 +66,10 @@ public function getSnapshotInterval(): ?int /** * The number of log entries between snapshots. - * - * @param int $snapshotInterval - * - * @return self */ public function setSnapshotInterval(?int $snapshotInterval): self { + $this->initialized['snapshotInterval'] = true; $this->snapshotInterval = $snapshotInterval; return $this; @@ -75,8 +77,6 @@ public function setSnapshotInterval(?int $snapshotInterval): self /** * The number of snapshots to keep beyond the current snapshot. - * - * @return int */ public function getKeepOldSnapshots(): ?int { @@ -85,22 +85,18 @@ public function getKeepOldSnapshots(): ?int /** * The number of snapshots to keep beyond the current snapshot. - * - * @param int $keepOldSnapshots - * - * @return self */ public function setKeepOldSnapshots(?int $keepOldSnapshots): self { + $this->initialized['keepOldSnapshots'] = true; $this->keepOldSnapshots = $keepOldSnapshots; return $this; } /** - * The number of log entries to keep around to sync up slow followers after a snapshot is created. - * - * @return int + * The number of log entries to keep around to sync up slow followers + * after a snapshot is created. */ public function getLogEntriesForSlowFollowers(): ?int { @@ -108,26 +104,24 @@ public function getLogEntriesForSlowFollowers(): ?int } /** - * The number of log entries to keep around to sync up slow followers after a snapshot is created. - * - * @param int $logEntriesForSlowFollowers - * - * @return self + * The number of log entries to keep around to sync up slow followers + * after a snapshot is created. */ public function setLogEntriesForSlowFollowers(?int $logEntriesForSlowFollowers): self { + $this->initialized['logEntriesForSlowFollowers'] = true; $this->logEntriesForSlowFollowers = $logEntriesForSlowFollowers; return $this; } /** - * The number of ticks that a follower will wait for a message from the leader before becoming a candidate and starting an election. `ElectionTick` must be greater than `HeartbeatTick`. - - A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed. - + * 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`. * - * @return int + * A tick currently defaults to one second, so these translate + * directly to seconds currently, but this is NOT guaranteed. */ public function getElectionTick(): ?int { @@ -135,29 +129,27 @@ public function getElectionTick(): ?int } /** - * The number of ticks that a follower will wait for a message from the leader before becoming a candidate and starting an election. `ElectionTick` must be greater than `HeartbeatTick`. - - A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed. - - * - * @param int $electionTick + * 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`. * - * @return self + * A tick currently defaults to one second, so these translate + * directly to seconds currently, but this is NOT guaranteed. */ public function setElectionTick(?int $electionTick): self { + $this->initialized['electionTick'] = true; $this->electionTick = $electionTick; return $this; } /** - * The number of ticks between heartbeats. Every HeartbeatTick ticks, the leader will send a heartbeat to the followers. - - A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed. - + * The number of ticks between heartbeats. Every HeartbeatTick ticks, + * the leader will send a heartbeat to the followers. * - * @return int + * A tick currently defaults to one second, so these translate + * directly to seconds currently, but this is NOT guaranteed. */ public function getHeartbeatTick(): ?int { @@ -165,17 +157,15 @@ public function getHeartbeatTick(): ?int } /** - * The number of ticks between heartbeats. Every HeartbeatTick ticks, the leader will send a heartbeat to the followers. - - A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed. - - * - * @param int $heartbeatTick + * The number of ticks between heartbeats. Every HeartbeatTick ticks, + * the leader will send a heartbeat to the followers. * - * @return self + * A tick currently defaults to one second, so these translate + * directly to seconds currently, but this is NOT guaranteed. */ public function setHeartbeatTick(?int $heartbeatTick): self { + $this->initialized['heartbeatTick'] = true; $this->heartbeatTick = $heartbeatTick; return $this; diff --git a/src/Model/SwarmSpecTaskDefaults.php b/src/Model/SwarmSpecTaskDefaults.php index a5f85611..aadcd88e 100644 --- a/src/Model/SwarmSpecTaskDefaults.php +++ b/src/Model/SwarmSpecTaskDefaults.php @@ -2,37 +2,36 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SwarmSpecTaskDefaults +class SwarmSpecTaskDefaults extends \ArrayObject { /** - * The log driver to use for tasks created in the orchestrator if. - unspecified by a service. - - Updating this value only affects new tasks. Existing tasks continue - to use their previously configured log driver until recreated. + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * The log driver to use for tasks created in the orchestrator if + * unspecified by a service. * - * @var SwarmSpecTaskDefaultsLogDriver + * Updating this value only affects new tasks. Existing tasks continue + * to use their previously configured log driver until recreated. + * + * @var SwarmSpecTaskDefaultsLogDriver|null */ protected $logDriver; /** - * The log driver to use for tasks created in the orchestrator if. - unspecified by a service. - - Updating this value only affects new tasks. Existing tasks continue - to use their previously configured log driver until recreated. - + * The log driver to use for tasks created in the orchestrator if + * unspecified by a service. * - * @return SwarmSpecTaskDefaultsLogDriver + * Updating this value only affects new tasks. Existing tasks continue + * to use their previously configured log driver until recreated. */ public function getLogDriver(): ?SwarmSpecTaskDefaultsLogDriver { @@ -40,19 +39,15 @@ public function getLogDriver(): ?SwarmSpecTaskDefaultsLogDriver } /** - * The log driver to use for tasks created in the orchestrator if. - unspecified by a service. - - Updating this value only affects new tasks. Existing tasks continue - to use their previously configured log driver until recreated. - - * - * @param SwarmSpecTaskDefaultsLogDriver $logDriver + * The log driver to use for tasks created in the orchestrator if + * unspecified by a service. * - * @return self + * Updating this value only affects new tasks. Existing tasks continue + * to use their previously configured log driver until recreated. */ public function setLogDriver(?SwarmSpecTaskDefaultsLogDriver $logDriver): self { + $this->initialized['logDriver'] = true; $this->logDriver = $logDriver; return $this; diff --git a/src/Model/SwarmSpecTaskDefaultsLogDriver.php b/src/Model/SwarmSpecTaskDefaultsLogDriver.php index 4fd39d9e..4bd8521f 100644 --- a/src/Model/SwarmSpecTaskDefaultsLogDriver.php +++ b/src/Model/SwarmSpecTaskDefaultsLogDriver.php @@ -2,35 +2,35 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SwarmSpecTaskDefaultsLogDriver +class SwarmSpecTaskDefaultsLogDriver extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The log driver to use as a default for new tasks. * - * @var string + * @var string|null */ protected $name; /** - * Driver-specific options for the selectd log driver, specified. - as key/value pairs. - + * Driver-specific options for the selectd log driver, specified + * as key/value pairs. * - * @var string[] + * @var array|null */ protected $options; /** * The log driver to use as a default for new tasks. - * - * @return string */ public function getName(): ?string { @@ -39,41 +39,35 @@ public function getName(): ?string /** * The log driver to use as a default for new tasks. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } /** - * Driver-specific options for the selectd log driver, specified. - as key/value pairs. - + * Driver-specific options for the selectd log driver, specified + * as key/value pairs. * - * @return string[] + * @return array|null */ - public function getOptions(): ?\ArrayObject + public function getOptions(): ?iterable { return $this->options; } /** - * Driver-specific options for the selectd log driver, specified. - as key/value pairs. - - * - * @param string[] $options + * Driver-specific options for the selectd log driver, specified + * as key/value pairs. * - * @return self + * @param array|null $options */ - public function setOptions(?\ArrayObject $options): self + public function setOptions(?iterable $options): self { + $this->initialized['options'] = true; $this->options = $options; return $this; diff --git a/src/Model/SwarmUnlockPostBody.php b/src/Model/SwarmUnlockPostBody.php index 2d1c4e71..1f33fdd3 100644 --- a/src/Model/SwarmUnlockPostBody.php +++ b/src/Model/SwarmUnlockPostBody.php @@ -2,27 +2,28 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SwarmUnlockPostBody +class SwarmUnlockPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The swarm's unlock key. * - * @var string + * @var string|null */ protected $unlockKey; /** * The swarm's unlock key. - * - * @return string */ public function getUnlockKey(): ?string { @@ -31,13 +32,10 @@ public function getUnlockKey(): ?string /** * The swarm's unlock key. - * - * @param string $unlockKey - * - * @return self */ public function setUnlockKey(?string $unlockKey): self { + $this->initialized['unlockKey'] = true; $this->unlockKey = $unlockKey; return $this; diff --git a/src/Model/SwarmUnlockkeyGetResponse200.php b/src/Model/SwarmUnlockkeyGetJsonResponse200.php similarity index 58% rename from src/Model/SwarmUnlockkeyGetResponse200.php rename to src/Model/SwarmUnlockkeyGetJsonResponse200.php index cc28747a..803e8f35 100644 --- a/src/Model/SwarmUnlockkeyGetResponse200.php +++ b/src/Model/SwarmUnlockkeyGetJsonResponse200.php @@ -2,27 +2,28 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SwarmUnlockkeyGetResponse200 +class SwarmUnlockkeyGetJsonResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The swarm's unlock key. * - * @var string + * @var string|null */ protected $unlockKey; /** * The swarm's unlock key. - * - * @return string */ public function getUnlockKey(): ?string { @@ -31,13 +32,10 @@ public function getUnlockKey(): ?string /** * The swarm's unlock key. - * - * @param string $unlockKey - * - * @return self */ public function setUnlockKey(?string $unlockKey): self { + $this->initialized['unlockKey'] = true; $this->unlockKey = $unlockKey; return $this; diff --git a/src/Model/SwarmUnlockkeyGetTextplainResponse200.php b/src/Model/SwarmUnlockkeyGetTextplainResponse200.php new file mode 100644 index 00000000..659e2c8f --- /dev/null +++ b/src/Model/SwarmUnlockkeyGetTextplainResponse200.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * The swarm's unlock key. + * + * @var string|null + */ + protected $unlockKey; + + /** + * The swarm's unlock key. + */ + public function getUnlockKey(): ?string + { + return $this->unlockKey; + } + + /** + * The swarm's unlock key. + */ + public function setUnlockKey(?string $unlockKey): self + { + $this->initialized['unlockKey'] = true; + $this->unlockKey = $unlockKey; + + return $this; + } +} diff --git a/src/Model/SystemDfGetJsonResponse200.php b/src/Model/SystemDfGetJsonResponse200.php new file mode 100644 index 00000000..8ba17211 --- /dev/null +++ b/src/Model/SystemDfGetJsonResponse200.php @@ -0,0 +1,127 @@ +initialized); + } + /** + * @var int|null + */ + protected $layersSize; + /** + * @var list|null + */ + protected $images; + /** + * @var list|null + */ + protected $containers; + /** + * @var list|null + */ + protected $volumes; + /** + * @var list|null + */ + protected $buildCache; + + public function getLayersSize(): ?int + { + return $this->layersSize; + } + + public function setLayersSize(?int $layersSize): self + { + $this->initialized['layersSize'] = true; + $this->layersSize = $layersSize; + + return $this; + } + + /** + * @return list|null + */ + public function getImages(): ?array + { + return $this->images; + } + + /** + * @param list|null $images + */ + public function setImages(?array $images): self + { + $this->initialized['images'] = true; + $this->images = $images; + + return $this; + } + + /** + * @return list|null + */ + public function getContainers(): ?array + { + return $this->containers; + } + + /** + * @param list|null $containers + */ + public function setContainers(?array $containers): self + { + $this->initialized['containers'] = true; + $this->containers = $containers; + + return $this; + } + + /** + * @return list|null + */ + public function getVolumes(): ?array + { + return $this->volumes; + } + + /** + * @param list|null $volumes + */ + public function setVolumes(?array $volumes): self + { + $this->initialized['volumes'] = true; + $this->volumes = $volumes; + + return $this; + } + + /** + * @return list|null + */ + public function getBuildCache(): ?array + { + return $this->buildCache; + } + + /** + * @param list|null $buildCache + */ + public function setBuildCache(?array $buildCache): self + { + $this->initialized['buildCache'] = true; + $this->buildCache = $buildCache; + + return $this; + } +} diff --git a/src/Model/SystemDfGetResponse200.php b/src/Model/SystemDfGetResponse200.php deleted file mode 100644 index 4a0ef614..00000000 --- a/src/Model/SystemDfGetResponse200.php +++ /dev/null @@ -1,111 +0,0 @@ -layersSize; - } - - /** - * @param int $layersSize - * - * @return self - */ - public function setLayersSize(?int $layersSize): self - { - $this->layersSize = $layersSize; - - return $this; - } - - /** - * @return ImageSummary[] - */ - public function getImages(): ?array - { - return $this->images; - } - - /** - * @param ImageSummary[] $images - * - * @return self - */ - public function setImages(?array $images): self - { - $this->images = $images; - - return $this; - } - - /** - * @return ContainerSummaryItem[][] - */ - public function getContainers(): ?array - { - return $this->containers; - } - - /** - * @param ContainerSummaryItem[][] $containers - * - * @return self - */ - public function setContainers(?array $containers): self - { - $this->containers = $containers; - - return $this; - } - - /** - * @return Volume[] - */ - public function getVolumes(): ?array - { - return $this->volumes; - } - - /** - * @param Volume[] $volumes - * - * @return self - */ - public function setVolumes(?array $volumes): self - { - $this->volumes = $volumes; - - return $this; - } -} diff --git a/src/Model/SystemDfGetTextplainResponse200.php b/src/Model/SystemDfGetTextplainResponse200.php new file mode 100644 index 00000000..0ca7e343 --- /dev/null +++ b/src/Model/SystemDfGetTextplainResponse200.php @@ -0,0 +1,127 @@ +initialized); + } + /** + * @var int|null + */ + protected $layersSize; + /** + * @var list|null + */ + protected $images; + /** + * @var list|null + */ + protected $containers; + /** + * @var list|null + */ + protected $volumes; + /** + * @var list|null + */ + protected $buildCache; + + public function getLayersSize(): ?int + { + return $this->layersSize; + } + + public function setLayersSize(?int $layersSize): self + { + $this->initialized['layersSize'] = true; + $this->layersSize = $layersSize; + + return $this; + } + + /** + * @return list|null + */ + public function getImages(): ?array + { + return $this->images; + } + + /** + * @param list|null $images + */ + public function setImages(?array $images): self + { + $this->initialized['images'] = true; + $this->images = $images; + + return $this; + } + + /** + * @return list|null + */ + public function getContainers(): ?array + { + return $this->containers; + } + + /** + * @param list|null $containers + */ + public function setContainers(?array $containers): self + { + $this->initialized['containers'] = true; + $this->containers = $containers; + + return $this; + } + + /** + * @return list|null + */ + public function getVolumes(): ?array + { + return $this->volumes; + } + + /** + * @param list|null $volumes + */ + public function setVolumes(?array $volumes): self + { + $this->initialized['volumes'] = true; + $this->volumes = $volumes; + + return $this; + } + + /** + * @return list|null + */ + public function getBuildCache(): ?array + { + return $this->buildCache; + } + + /** + * @param list|null $buildCache + */ + public function setBuildCache(?array $buildCache): self + { + $this->initialized['buildCache'] = true; + $this->buildCache = $buildCache; + + return $this; + } +} diff --git a/src/Model/SystemInfo.php b/src/Model/SystemInfo.php index 0afee2e6..df7f2409 100644 --- a/src/Model/SystemInfo.php +++ b/src/Model/SystemInfo.php @@ -2,534 +2,535 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class SystemInfo +class SystemInfo extends \ArrayObject { /** - * Unique identifier of the daemon. - -


- - > **Note**: The format of the ID itself is not part of the API, and - > should not be considered stable. + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * Unique identifier of the daemon. + * + *


* - * @var string + * > **Note**: The format of the ID itself is not part of the API, and + * > should not be considered stable. + * + * @var string|null */ protected $iD; /** * Total number of containers on the host. * - * @var int + * @var int|null */ protected $containers; /** * Number of containers with status `"running"`. * - * @var int + * @var int|null */ protected $containersRunning; /** * Number of containers with status `"paused"`. * - * @var int + * @var int|null */ protected $containersPaused; /** * Number of containers with status `"stopped"`. * - * @var int + * @var int|null */ protected $containersStopped; /** * Total number of images on the host. - - Both _tagged_ and _untagged_ (dangling) images are counted. - * - * @var int + * Both _tagged_ and _untagged_ (dangling) images are counted. + * + * @var int|null */ protected $images; /** * Name of the storage driver in use. * - * @var string + * @var string|null */ protected $driver; /** - * Information specific to the storage driver, provided as. - "label" / "value" pairs. - - This information is provided by the storage driver, and formatted - in a way consistent with the output of `docker info` on the command - line. - -


- - > **Note**: The information returned in this field, including the - > formatting of values and labels, should not be considered stable, - > and may change without notice. - + * Information specific to the storage driver, provided as + * "label" / "value" pairs. + * + * This information is provided by the storage driver, and formatted + * in a way consistent with the output of `docker info` on the command + * line. + * + *


* - * @var string[][] + * > **Note**: The information returned in this field, including the + * > formatting of values and labels, should not be considered stable, + * > and may change without notice. + * + * @var list>|null */ protected $driverStatus; /** * Root directory of persistent Docker state. - - Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` - on Windows. - * - * @var string - */ - protected $dockerRootDir; - /** - * Status information about this node (standalone Swarm API). - -


- - > **Note**: The information returned in this field is only propagated - > by the Swarm standalone API, and is empty (`null`) when using - > built-in swarm mode. - + * Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` + * on Windows. * - * @var string[][] + * @var string|null */ - protected $systemStatus; + protected $dockerRootDir; /** * Available plugins per type. - -


- - > **Note**: Only unmanaged (V1) plugins are included in this list. - > V1 plugins are "lazily" loaded, and are not returned in this list - > if there is no resource using the plugin. - * - * @var PluginsInfo + *


+ * + * > **Note**: Only unmanaged (V1) plugins are included in this list. + * > V1 plugins are "lazily" loaded, and are not returned in this list + * > if there is no resource using the plugin. + * + * @var PluginsInfo|null */ protected $plugins; /** * Indicates if the host has memory limit support enabled. * - * @var bool + * @var bool|null */ protected $memoryLimit; /** * Indicates if the host has memory swap limit support enabled. * - * @var bool + * @var bool|null */ protected $swapLimit; /** - * Indicates if the host has kernel memory limit support enabled. + * Indicates if the host has kernel memory TCP limit support enabled. This + * field is omitted if not supported. + * + * Kernel memory TCP limits are not supported when using cgroups v2, which + * does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup. * - * @var bool + * @var bool|null */ - protected $kernelMemory; + protected $kernelMemoryTCP; /** - * Indicates if CPU CFS(Completely Fair Scheduler) period is supported by the host. + * Indicates if CPU CFS(Completely Fair Scheduler) period is supported by + * the host. * - * @var bool + * @var bool|null */ protected $cpuCfsPeriod; /** - * Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by the host. + * Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by + * the host. * - * @var bool + * @var bool|null */ protected $cpuCfsQuota; /** * Indicates if CPU Shares limiting is supported by the host. * - * @var bool + * @var bool|null */ protected $cPUShares; /** * Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. - - See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) - * - * @var bool + * See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) + * + * @var bool|null */ protected $cPUSet; + /** + * Indicates if the host kernel has PID limit support enabled. + * + * @var bool|null + */ + protected $pidsLimit; /** * Indicates if OOM killer disable is supported on the host. * - * @var bool + * @var bool|null */ protected $oomKillDisable; /** * Indicates IPv4 forwarding is enabled. * - * @var bool + * @var bool|null */ protected $iPv4Forwarding; /** * Indicates if `bridge-nf-call-iptables` is available on the host. * - * @var bool + * @var bool|null */ protected $bridgeNfIptables; /** * Indicates if `bridge-nf-call-ip6tables` is available on the host. * - * @var bool + * @var bool|null */ protected $bridgeNfIp6tables; /** - * Indicates if the daemon is running in debug-mode / with debug-level logging enabled. + * Indicates if the daemon is running in debug-mode / with debug-level + * logging enabled. * - * @var bool + * @var bool|null */ protected $debug; /** * The total number of file Descriptors in use by the daemon process. - - This information is only returned if debug-mode is enabled. - * - * @var int + * This information is only returned if debug-mode is enabled. + * + * @var int|null */ protected $nFd; /** * The number of goroutines that currently exist. - - This information is only returned if debug-mode is enabled. - * - * @var int + * This information is only returned if debug-mode is enabled. + * + * @var int|null */ protected $nGoroutines; /** - * Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt). - format with nano-seconds. - + * Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + * format with nano-seconds. * - * @var string + * @var string|null */ protected $systemTime; /** * The logging driver to use as a default for new containers. * - * @var string + * @var string|null */ protected $loggingDriver; /** * The driver to use for managing cgroups. * - * @var string + * @var string|null + */ + protected $cgroupDriver = 'cgroupfs'; + /** + * The version of the cgroup. + * + * @var string|null */ - protected $cgroupDriver; + protected $cgroupVersion = '1'; /** * Number of event listeners subscribed. * - * @var int + * @var int|null */ protected $nEventsListener; /** * Kernel version of the host. - - On Linux, this information obtained from `uname`. On Windows this - information is queried from the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ - registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. - * - * @var string + * On Linux, this information obtained from `uname`. On Windows this + * information is queried from the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ + * registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. + * + * @var string|null */ protected $kernelVersion; /** - * Name of the host's operating system, for example: "Ubuntu 16.04.2 LTS". - or "Windows Server 2016 Datacenter" - + * Name of the host's operating system, for example: "Ubuntu 16.04.2 LTS" + * or "Windows Server 2016 Datacenter". * - * @var string + * @var string|null */ protected $operatingSystem; /** - * Generic type of the operating system of the host, as returned by the. - Go runtime (`GOOS`). - - Currently returned values are "linux" and "windows". A full list of - possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment). - + * Version of the host's operating system. + * + *


+ * + * > **Note**: The information returned in this field, including its + * > very existence, and the formatting of values, should not be considered + * > stable, and may change without notice. + * + * @var string|null + */ + protected $oSVersion; + /** + * Generic type of the operating system of the host, as returned by the + * Go runtime (`GOOS`). + * + * Currently returned values are "linux" and "windows". A full list of + * possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). * - * @var string + * @var string|null */ protected $oSType; /** - * Hardware architecture of the host, as returned by the Go runtime. - (`GOARCH`). - - A full list of possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment). - + * Hardware architecture of the host, as returned by the Go runtime + * (`GOARCH`). * - * @var string + * A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + * + * @var string|null */ protected $architecture; /** * The number of logical CPUs usable by the daemon. - - The number of available CPUs is checked by querying the operating - system when the daemon starts. Changes to operating system CPU - allocation after the daemon is started are not reflected. - * - * @var int + * The number of available CPUs is checked by querying the operating + * system when the daemon starts. Changes to operating system CPU + * allocation after the daemon is started are not reflected. + * + * @var int|null */ protected $nCPU; /** - * Total amount of physical memory available on the host, in kilobytes (kB). + * Total amount of physical memory available on the host, in bytes. * - * @var int + * @var int|null */ protected $memTotal; /** - * Address / URL of the index server that is used for image search,. - and as a default for user authentication for Docker Hub and Docker Cloud. - + * Address / URL of the index server that is used for image search, + * and as a default for user authentication for Docker Hub and Docker Cloud. * - * @var string + * @var string|null */ - protected $indexServerAddress; + protected $indexServerAddress = 'https://index.docker.io/v1/'; /** * RegistryServiceConfig stores daemon registry services configuration. * - * @var RegistryServiceConfig + * @var RegistryServiceConfig|null */ protected $registryConfig; /** - * User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`). + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + * String resources (e.g, `GPU=UUID1`). * - * @var GenericResourcesItem[] + * @var list|null */ protected $genericResources; /** - * HTTP-proxy configured for the daemon. This value is obtained from the. - [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. - - Containers do not automatically inherit this configuration. - + * HTTP-proxy configured for the daemon. This value is obtained from the + * [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + * Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + * are masked in the API response. + * + * Containers do not automatically inherit this configuration. * - * @var string + * @var string|null */ protected $httpProxy; /** - * HTTPS-proxy configured for the daemon. This value is obtained from the. - [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. - - Containers do not automatically inherit this configuration. - + * HTTPS-proxy configured for the daemon. This value is obtained from the + * [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + * Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + * are masked in the API response. * - * @var string + * Containers do not automatically inherit this configuration. + * + * @var string|null */ protected $httpsProxy; /** - * Comma-separated list of domain extensions for which no proxy should be. - used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) - environment variable. - - Containers do not automatically inherit this configuration. - + * Comma-separated list of domain extensions for which no proxy should be + * used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) + * environment variable. + * + * Containers do not automatically inherit this configuration. * - * @var string + * @var string|null */ protected $noProxy; /** * Hostname of the host. * - * @var string + * @var string|null */ protected $name; /** * User-defined labels (key/value metadata) as set on the daemon. - -


- - > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, - > set through the daemon configuration, and _node_ labels, set from a - > manager node in the Swarm. Node labels are not included in this - > field. Node labels can be retrieved using the `/nodes/(id)` endpoint - > on a manager node in the Swarm. - * - * @var string[] + *


+ * + * > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, + * > set through the daemon configuration, and _node_ labels, set from a + * > manager node in the Swarm. Node labels are not included in this + * > field. Node labels can be retrieved using the `/nodes/(id)` endpoint + * > on a manager node in the Swarm. + * + * @var list|null */ protected $labels; /** * Indicates if experimental features are enabled on the daemon. * - * @var bool + * @var bool|null */ protected $experimentalBuild; /** * Version string of the daemon. - - > **Note**: the [standalone Swarm API](https://docs.docker.com/swarm/swarm-api/) - > returns the Swarm version instead of the daemon version, for example - > `swarm/1.2.8`. - * - * @var string + * @var string|null */ protected $serverVersion; /** - * URL of the distributed storage backend. - - - The storage backend is used for multihost networking (to store - network and endpoint information) and by the node discovery mechanism. - -


- - > **Note**: This field is only propagated when using standalone Swarm - > mode, and overlay networking using an external k/v store. Overlay - > networks with Swarm mode enabled use the built-in raft store, and - > this field will be empty. - + * List of [OCI compliant](https://github.com/opencontainers/runtime-spec) + * runtimes configured on the daemon. Keys hold the "name" used to + * reference the runtime. * - * @var string - */ - protected $clusterStore; - /** - * The network endpoint that the Engine advertises for the purpose of. - node discovery. ClusterAdvertise is a `host:port` combination on which - the daemon is reachable by other hosts. - -


- - > **Note**: This field is only propagated when using standalone Swarm - > mode, and overlay networking using an external k/v store. Overlay - > networks with Swarm mode enabled use the built-in raft store, and - > this field will be empty. - + * The Docker daemon relies on an OCI compliant runtime (invoked via the + * `containerd` daemon) as its interface to the Linux kernel namespaces, + * cgroups, and SELinux. * - * @var string - */ - protected $clusterAdvertise; - /** - * List of [OCI compliant](https://github.com/opencontainers/runtime-spec). - runtimes configured on the daemon. Keys hold the "name" used to - reference the runtime. - - The Docker daemon relies on an OCI compliant runtime (invoked via the - `containerd` daemon) as its interface to the Linux kernel namespaces, - cgroups, and SELinux. - - The default runtime is `runc`, and automatically configured. Additional - runtimes can be configured by the user and will be listed here. - + * The default runtime is `runc`, and automatically configured. Additional + * runtimes can be configured by the user and will be listed here. * - * @var Runtime[] + * @var array|null */ protected $runtimes; /** * Name of the default OCI runtime that is used when starting containers. - - The default can be overridden per-container at create time. - * - * @var string + * The default can be overridden per-container at create time. + * + * @var string|null */ - protected $defaultRuntime; + protected $defaultRuntime = 'runc'; /** * Represents generic information about swarm. * - * @var SwarmInfo + * @var SwarmInfo|null */ protected $swarm; /** * Indicates if live restore is enabled. - - If enabled, containers are kept running when the daemon is shutdown - or upon daemon start if running containers are detected. - * - * @var bool + * If enabled, containers are kept running when the daemon is shutdown + * or upon daemon start if running containers are detected. + * + * @var bool|null */ - protected $liveRestoreEnabled; + protected $liveRestoreEnabled = false; /** * Represents the isolation technology to use as a default for containers. - The supported values are platform-specific. - - If no isolation value is specified on daemon start, on Windows client, - the default is `hyperv`, and on Windows server, the default is `process`. - - This option is currently not used on other platforms. - + * The supported values are platform-specific. + * + * If no isolation value is specified on daemon start, on Windows client, + * the default is `hyperv`, and on Windows server, the default is `process`. * - * @var string + * This option is currently not used on other platforms. + * + * @var string|null */ - protected $isolation; + protected $isolation = 'default'; /** - * Name and, optional, path of the the `docker-init` binary. - - If the path is omitted, the daemon searches the host's `$PATH` for the - binary and uses the first result. - + * Name and, optional, path of the `docker-init` binary. + * + * If the path is omitted, the daemon searches the host's `$PATH` for the + * binary and uses the first result. * - * @var string + * @var string|null */ protected $initBinary; /** - * Commit holds the Git-commit (SHA1) that a binary was built from, as. - reported in the version-string of external tools, such as `containerd`, - or `runC`. - + * Commit holds the Git-commit (SHA1) that a binary was built from, as + * reported in the version-string of external tools, such as `containerd`, + * or `runC`. * - * @var Commit + * @var Commit|null */ protected $containerdCommit; /** - * Commit holds the Git-commit (SHA1) that a binary was built from, as. - reported in the version-string of external tools, such as `containerd`, - or `runC`. - + * Commit holds the Git-commit (SHA1) that a binary was built from, as + * reported in the version-string of external tools, such as `containerd`, + * or `runC`. * - * @var Commit + * @var Commit|null */ protected $runcCommit; /** - * Commit holds the Git-commit (SHA1) that a binary was built from, as. - reported in the version-string of external tools, such as `containerd`, - or `runC`. - + * Commit holds the Git-commit (SHA1) that a binary was built from, as + * reported in the version-string of external tools, such as `containerd`, + * or `runC`. * - * @var Commit + * @var Commit|null */ protected $initCommit; /** - * List of security features that are enabled on the daemon, such as. - apparmor, seccomp, SELinux, and user-namespaces (userns). - - Additional configuration options for each security feature may - be present, and are included as a comma-separated list of key/value - pairs. - + * List of security features that are enabled on the daemon, such as + * apparmor, seccomp, SELinux, user-namespaces (userns), rootless and + * no-new-privileges. + * + * Additional configuration options for each security feature may + * be present, and are included as a comma-separated list of key/value + * pairs. * - * @var string[] + * @var list|null */ protected $securityOptions; + /** + * Reports a summary of the product license on the daemon. + * + * If a commercial license has been applied to the daemon, information + * such as number of nodes, and expiration are included. + * + * @var string|null + */ + protected $productLicense; + /** + * List of custom default address pools for local networks, which can be + * specified in the daemon.json file or dockerd option. + * + * Example: a Base "10.10.0.0/16" with Size 24 will define the set of 256 + * 10.10.[0-255].0/24 address pools. + * + * @var list|null + */ + protected $defaultAddressPools; + /** + * List of warnings / informational messages about missing features, or + * issues related to the daemon configuration. + * + * These messages can be printed by the client as information to the user. + * + * @var list|null + */ + protected $warnings; + /** + * List of directories where (Container Device Interface) CDI + * specifications are located. + * + * These specifications define vendor-specific modifications to an OCI + * runtime specification for a container being created. + * + * An empty list indicates that CDI device injection is disabled. + * + * Note that since using CDI device injection requires the daemon to have + * experimental enabled. For non-experimental daemons an empty list will + * always be returned. + * + * @var list|null + */ + protected $cDISpecDirs; /** * Unique identifier of the daemon. - -


- - > **Note**: The format of the ID itself is not part of the API, and - > should not be considered stable. - * - * @return string + *


+ * + * > **Note**: The format of the ID itself is not part of the API, and + * > should not be considered stable. */ public function getID(): ?string { @@ -538,19 +539,15 @@ public function getID(): ?string /** * Unique identifier of the daemon. - -


- - > **Note**: The format of the ID itself is not part of the API, and - > should not be considered stable. - * - * @param string $iD + *


* - * @return self + * > **Note**: The format of the ID itself is not part of the API, and + * > should not be considered stable. */ public function setID(?string $iD): self { + $this->initialized['iD'] = true; $this->iD = $iD; return $this; @@ -558,8 +555,6 @@ public function setID(?string $iD): self /** * Total number of containers on the host. - * - * @return int */ public function getContainers(): ?int { @@ -568,13 +563,10 @@ public function getContainers(): ?int /** * Total number of containers on the host. - * - * @param int $containers - * - * @return self */ public function setContainers(?int $containers): self { + $this->initialized['containers'] = true; $this->containers = $containers; return $this; @@ -582,8 +574,6 @@ public function setContainers(?int $containers): self /** * Number of containers with status `"running"`. - * - * @return int */ public function getContainersRunning(): ?int { @@ -592,13 +582,10 @@ public function getContainersRunning(): ?int /** * Number of containers with status `"running"`. - * - * @param int $containersRunning - * - * @return self */ public function setContainersRunning(?int $containersRunning): self { + $this->initialized['containersRunning'] = true; $this->containersRunning = $containersRunning; return $this; @@ -606,8 +593,6 @@ public function setContainersRunning(?int $containersRunning): self /** * Number of containers with status `"paused"`. - * - * @return int */ public function getContainersPaused(): ?int { @@ -616,13 +601,10 @@ public function getContainersPaused(): ?int /** * Number of containers with status `"paused"`. - * - * @param int $containersPaused - * - * @return self */ public function setContainersPaused(?int $containersPaused): self { + $this->initialized['containersPaused'] = true; $this->containersPaused = $containersPaused; return $this; @@ -630,8 +612,6 @@ public function setContainersPaused(?int $containersPaused): self /** * Number of containers with status `"stopped"`. - * - * @return int */ public function getContainersStopped(): ?int { @@ -640,13 +620,10 @@ public function getContainersStopped(): ?int /** * Number of containers with status `"stopped"`. - * - * @param int $containersStopped - * - * @return self */ public function setContainersStopped(?int $containersStopped): self { + $this->initialized['containersStopped'] = true; $this->containersStopped = $containersStopped; return $this; @@ -654,11 +631,8 @@ public function setContainersStopped(?int $containersStopped): self /** * Total number of images on the host. - - Both _tagged_ and _untagged_ (dangling) images are counted. - * - * @return int + * Both _tagged_ and _untagged_ (dangling) images are counted. */ public function getImages(): ?int { @@ -667,16 +641,12 @@ public function getImages(): ?int /** * Total number of images on the host. - - Both _tagged_ and _untagged_ (dangling) images are counted. - - * - * @param int $images * - * @return self + * Both _tagged_ and _untagged_ (dangling) images are counted. */ public function setImages(?int $images): self { + $this->initialized['images'] = true; $this->images = $images; return $this; @@ -684,8 +654,6 @@ public function setImages(?int $images): self /** * Name of the storage driver in use. - * - * @return string */ public function getDriver(): ?string { @@ -694,34 +662,30 @@ public function getDriver(): ?string /** * Name of the storage driver in use. - * - * @param string $driver - * - * @return self */ public function setDriver(?string $driver): self { + $this->initialized['driver'] = true; $this->driver = $driver; return $this; } /** - * Information specific to the storage driver, provided as. - "label" / "value" pairs. - - This information is provided by the storage driver, and formatted - in a way consistent with the output of `docker info` on the command - line. - -


- - > **Note**: The information returned in this field, including the - > formatting of values and labels, should not be considered stable, - > and may change without notice. - + * Information specific to the storage driver, provided as + * "label" / "value" pairs. + * + * This information is provided by the storage driver, and formatted + * in a way consistent with the output of `docker info` on the command + * line. * - * @return string[][] + *


+ * + * > **Note**: The information returned in this field, including the + * > formatting of values and labels, should not be considered stable, + * > and may change without notice. + * + * @return list>|null */ public function getDriverStatus(): ?array { @@ -729,26 +693,24 @@ public function getDriverStatus(): ?array } /** - * Information specific to the storage driver, provided as. - "label" / "value" pairs. - - This information is provided by the storage driver, and formatted - in a way consistent with the output of `docker info` on the command - line. - -


- - > **Note**: The information returned in this field, including the - > formatting of values and labels, should not be considered stable, - > and may change without notice. - + * Information specific to the storage driver, provided as + * "label" / "value" pairs. + * + * This information is provided by the storage driver, and formatted + * in a way consistent with the output of `docker info` on the command + * line. + * + *


* - * @param string[][] $driverStatus + * > **Note**: The information returned in this field, including the + * > formatting of values and labels, should not be considered stable, + * > and may change without notice. * - * @return self + * @param list>|null $driverStatus */ public function setDriverStatus(?array $driverStatus): self { + $this->initialized['driverStatus'] = true; $this->driverStatus = $driverStatus; return $this; @@ -756,12 +718,9 @@ public function setDriverStatus(?array $driverStatus): self /** * Root directory of persistent Docker state. - - Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` - on Windows. - * - * @return string + * Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` + * on Windows. */ public function getDockerRootDir(): ?string { @@ -770,71 +729,26 @@ public function getDockerRootDir(): ?string /** * Root directory of persistent Docker state. - - Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` - on Windows. - * - * @param string $dockerRootDir - * - * @return self + * Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` + * on Windows. */ public function setDockerRootDir(?string $dockerRootDir): self { + $this->initialized['dockerRootDir'] = true; $this->dockerRootDir = $dockerRootDir; return $this; } - /** - * Status information about this node (standalone Swarm API). - -


- - > **Note**: The information returned in this field is only propagated - > by the Swarm standalone API, and is empty (`null`) when using - > built-in swarm mode. - - * - * @return string[][] - */ - public function getSystemStatus(): ?array - { - return $this->systemStatus; - } - - /** - * Status information about this node (standalone Swarm API). - -


- - > **Note**: The information returned in this field is only propagated - > by the Swarm standalone API, and is empty (`null`) when using - > built-in swarm mode. - - * - * @param string[][] $systemStatus - * - * @return self - */ - public function setSystemStatus(?array $systemStatus): self - { - $this->systemStatus = $systemStatus; - - return $this; - } - /** * Available plugins per type. - -


- - > **Note**: Only unmanaged (V1) plugins are included in this list. - > V1 plugins are "lazily" loaded, and are not returned in this list - > if there is no resource using the plugin. - * - * @return PluginsInfo + *


+ * + * > **Note**: Only unmanaged (V1) plugins are included in this list. + * > V1 plugins are "lazily" loaded, and are not returned in this list + * > if there is no resource using the plugin. */ public function getPlugins(): ?PluginsInfo { @@ -843,20 +757,16 @@ public function getPlugins(): ?PluginsInfo /** * Available plugins per type. - -


- - > **Note**: Only unmanaged (V1) plugins are included in this list. - > V1 plugins are "lazily" loaded, and are not returned in this list - > if there is no resource using the plugin. - * - * @param PluginsInfo $plugins + *


* - * @return self + * > **Note**: Only unmanaged (V1) plugins are included in this list. + * > V1 plugins are "lazily" loaded, and are not returned in this list + * > if there is no resource using the plugin. */ public function setPlugins(?PluginsInfo $plugins): self { + $this->initialized['plugins'] = true; $this->plugins = $plugins; return $this; @@ -864,8 +774,6 @@ public function setPlugins(?PluginsInfo $plugins): self /** * Indicates if the host has memory limit support enabled. - * - * @return bool */ public function getMemoryLimit(): ?bool { @@ -874,13 +782,10 @@ public function getMemoryLimit(): ?bool /** * Indicates if the host has memory limit support enabled. - * - * @param bool $memoryLimit - * - * @return self */ public function setMemoryLimit(?bool $memoryLimit): self { + $this->initialized['memoryLimit'] = true; $this->memoryLimit = $memoryLimit; return $this; @@ -888,8 +793,6 @@ public function setMemoryLimit(?bool $memoryLimit): self /** * Indicates if the host has memory swap limit support enabled. - * - * @return bool */ public function getSwapLimit(): ?bool { @@ -898,46 +801,45 @@ public function getSwapLimit(): ?bool /** * Indicates if the host has memory swap limit support enabled. - * - * @param bool $swapLimit - * - * @return self */ public function setSwapLimit(?bool $swapLimit): self { + $this->initialized['swapLimit'] = true; $this->swapLimit = $swapLimit; return $this; } /** - * Indicates if the host has kernel memory limit support enabled. + * Indicates if the host has kernel memory TCP limit support enabled. This + * field is omitted if not supported. * - * @return bool + * Kernel memory TCP limits are not supported when using cgroups v2, which + * does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup. */ - public function getKernelMemory(): ?bool + public function getKernelMemoryTCP(): ?bool { - return $this->kernelMemory; + return $this->kernelMemoryTCP; } /** - * Indicates if the host has kernel memory limit support enabled. - * - * @param bool $kernelMemory + * Indicates if the host has kernel memory TCP limit support enabled. This + * field is omitted if not supported. * - * @return self + * Kernel memory TCP limits are not supported when using cgroups v2, which + * does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup. */ - public function setKernelMemory(?bool $kernelMemory): self + public function setKernelMemoryTCP(?bool $kernelMemoryTCP): self { - $this->kernelMemory = $kernelMemory; + $this->initialized['kernelMemoryTCP'] = true; + $this->kernelMemoryTCP = $kernelMemoryTCP; return $this; } /** - * Indicates if CPU CFS(Completely Fair Scheduler) period is supported by the host. - * - * @return bool + * Indicates if CPU CFS(Completely Fair Scheduler) period is supported by + * the host. */ public function getCpuCfsPeriod(): ?bool { @@ -945,23 +847,20 @@ public function getCpuCfsPeriod(): ?bool } /** - * Indicates if CPU CFS(Completely Fair Scheduler) period is supported by the host. - * - * @param bool $cpuCfsPeriod - * - * @return self + * Indicates if CPU CFS(Completely Fair Scheduler) period is supported by + * the host. */ public function setCpuCfsPeriod(?bool $cpuCfsPeriod): self { + $this->initialized['cpuCfsPeriod'] = true; $this->cpuCfsPeriod = $cpuCfsPeriod; return $this; } /** - * Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by the host. - * - * @return bool + * Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by + * the host. */ public function getCpuCfsQuota(): ?bool { @@ -969,14 +868,12 @@ public function getCpuCfsQuota(): ?bool } /** - * Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by the host. - * - * @param bool $cpuCfsQuota - * - * @return self + * Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by + * the host. */ public function setCpuCfsQuota(?bool $cpuCfsQuota): self { + $this->initialized['cpuCfsQuota'] = true; $this->cpuCfsQuota = $cpuCfsQuota; return $this; @@ -984,8 +881,6 @@ public function setCpuCfsQuota(?bool $cpuCfsQuota): self /** * Indicates if CPU Shares limiting is supported by the host. - * - * @return bool */ public function getCPUShares(): ?bool { @@ -994,13 +889,10 @@ public function getCPUShares(): ?bool /** * Indicates if CPU Shares limiting is supported by the host. - * - * @param bool $cPUShares - * - * @return self */ public function setCPUShares(?bool $cPUShares): self { + $this->initialized['cPUShares'] = true; $this->cPUShares = $cPUShares; return $this; @@ -1008,11 +900,8 @@ public function setCPUShares(?bool $cPUShares): self /** * Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. - - See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) - * - * @return bool + * See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) */ public function getCPUSet(): ?bool { @@ -1021,25 +910,38 @@ public function getCPUSet(): ?bool /** * Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. - - See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) - - * - * @param bool $cPUSet * - * @return self + * See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) */ public function setCPUSet(?bool $cPUSet): self { + $this->initialized['cPUSet'] = true; $this->cPUSet = $cPUSet; return $this; } + /** + * Indicates if the host kernel has PID limit support enabled. + */ + public function getPidsLimit(): ?bool + { + return $this->pidsLimit; + } + + /** + * Indicates if the host kernel has PID limit support enabled. + */ + public function setPidsLimit(?bool $pidsLimit): self + { + $this->initialized['pidsLimit'] = true; + $this->pidsLimit = $pidsLimit; + + return $this; + } + /** * Indicates if OOM killer disable is supported on the host. - * - * @return bool */ public function getOomKillDisable(): ?bool { @@ -1048,13 +950,10 @@ public function getOomKillDisable(): ?bool /** * Indicates if OOM killer disable is supported on the host. - * - * @param bool $oomKillDisable - * - * @return self */ public function setOomKillDisable(?bool $oomKillDisable): self { + $this->initialized['oomKillDisable'] = true; $this->oomKillDisable = $oomKillDisable; return $this; @@ -1062,8 +961,6 @@ public function setOomKillDisable(?bool $oomKillDisable): self /** * Indicates IPv4 forwarding is enabled. - * - * @return bool */ public function getIPv4Forwarding(): ?bool { @@ -1072,13 +969,10 @@ public function getIPv4Forwarding(): ?bool /** * Indicates IPv4 forwarding is enabled. - * - * @param bool $iPv4Forwarding - * - * @return self */ public function setIPv4Forwarding(?bool $iPv4Forwarding): self { + $this->initialized['iPv4Forwarding'] = true; $this->iPv4Forwarding = $iPv4Forwarding; return $this; @@ -1086,8 +980,6 @@ public function setIPv4Forwarding(?bool $iPv4Forwarding): self /** * Indicates if `bridge-nf-call-iptables` is available on the host. - * - * @return bool */ public function getBridgeNfIptables(): ?bool { @@ -1096,13 +988,10 @@ public function getBridgeNfIptables(): ?bool /** * Indicates if `bridge-nf-call-iptables` is available on the host. - * - * @param bool $bridgeNfIptables - * - * @return self */ public function setBridgeNfIptables(?bool $bridgeNfIptables): self { + $this->initialized['bridgeNfIptables'] = true; $this->bridgeNfIptables = $bridgeNfIptables; return $this; @@ -1110,8 +999,6 @@ public function setBridgeNfIptables(?bool $bridgeNfIptables): self /** * Indicates if `bridge-nf-call-ip6tables` is available on the host. - * - * @return bool */ public function getBridgeNfIp6tables(): ?bool { @@ -1120,22 +1007,18 @@ public function getBridgeNfIp6tables(): ?bool /** * Indicates if `bridge-nf-call-ip6tables` is available on the host. - * - * @param bool $bridgeNfIp6tables - * - * @return self */ public function setBridgeNfIp6tables(?bool $bridgeNfIp6tables): self { + $this->initialized['bridgeNfIp6tables'] = true; $this->bridgeNfIp6tables = $bridgeNfIp6tables; return $this; } /** - * Indicates if the daemon is running in debug-mode / with debug-level logging enabled. - * - * @return bool + * Indicates if the daemon is running in debug-mode / with debug-level + * logging enabled. */ public function getDebug(): ?bool { @@ -1143,14 +1026,12 @@ public function getDebug(): ?bool } /** - * Indicates if the daemon is running in debug-mode / with debug-level logging enabled. - * - * @param bool $debug - * - * @return self + * Indicates if the daemon is running in debug-mode / with debug-level + * logging enabled. */ public function setDebug(?bool $debug): self { + $this->initialized['debug'] = true; $this->debug = $debug; return $this; @@ -1158,11 +1039,8 @@ public function setDebug(?bool $debug): self /** * The total number of file Descriptors in use by the daemon process. - - This information is only returned if debug-mode is enabled. - * - * @return int + * This information is only returned if debug-mode is enabled. */ public function getNFd(): ?int { @@ -1171,16 +1049,12 @@ public function getNFd(): ?int /** * The total number of file Descriptors in use by the daemon process. - - This information is only returned if debug-mode is enabled. - * - * @param int $nFd - * - * @return self + * This information is only returned if debug-mode is enabled. */ public function setNFd(?int $nFd): self { + $this->initialized['nFd'] = true; $this->nFd = $nFd; return $this; @@ -1188,11 +1062,8 @@ public function setNFd(?int $nFd): self /** * The number of goroutines that currently exist. - - This information is only returned if debug-mode is enabled. - * - * @return int + * This information is only returned if debug-mode is enabled. */ public function getNGoroutines(): ?int { @@ -1201,27 +1072,20 @@ public function getNGoroutines(): ?int /** * The number of goroutines that currently exist. - - This information is only returned if debug-mode is enabled. - * - * @param int $nGoroutines - * - * @return self + * This information is only returned if debug-mode is enabled. */ public function setNGoroutines(?int $nGoroutines): self { + $this->initialized['nGoroutines'] = true; $this->nGoroutines = $nGoroutines; return $this; } /** - * Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt). - format with nano-seconds. - - * - * @return string + * Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + * format with nano-seconds. */ public function getSystemTime(): ?string { @@ -1229,16 +1093,12 @@ public function getSystemTime(): ?string } /** - * Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt). - format with nano-seconds. - - * - * @param string $systemTime - * - * @return self + * Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + * format with nano-seconds. */ public function setSystemTime(?string $systemTime): self { + $this->initialized['systemTime'] = true; $this->systemTime = $systemTime; return $this; @@ -1246,8 +1106,6 @@ public function setSystemTime(?string $systemTime): self /** * The logging driver to use as a default for new containers. - * - * @return string */ public function getLoggingDriver(): ?string { @@ -1256,13 +1114,10 @@ public function getLoggingDriver(): ?string /** * The logging driver to use as a default for new containers. - * - * @param string $loggingDriver - * - * @return self */ public function setLoggingDriver(?string $loggingDriver): self { + $this->initialized['loggingDriver'] = true; $this->loggingDriver = $loggingDriver; return $this; @@ -1270,8 +1125,6 @@ public function setLoggingDriver(?string $loggingDriver): self /** * The driver to use for managing cgroups. - * - * @return string */ public function getCgroupDriver(): ?string { @@ -1280,22 +1133,36 @@ public function getCgroupDriver(): ?string /** * The driver to use for managing cgroups. - * - * @param string $cgroupDriver - * - * @return self */ public function setCgroupDriver(?string $cgroupDriver): self { + $this->initialized['cgroupDriver'] = true; $this->cgroupDriver = $cgroupDriver; return $this; } + /** + * The version of the cgroup. + */ + public function getCgroupVersion(): ?string + { + return $this->cgroupVersion; + } + + /** + * The version of the cgroup. + */ + public function setCgroupVersion(?string $cgroupVersion): self + { + $this->initialized['cgroupVersion'] = true; + $this->cgroupVersion = $cgroupVersion; + + return $this; + } + /** * Number of event listeners subscribed. - * - * @return int */ public function getNEventsListener(): ?int { @@ -1304,13 +1171,10 @@ public function getNEventsListener(): ?int /** * Number of event listeners subscribed. - * - * @param int $nEventsListener - * - * @return self */ public function setNEventsListener(?int $nEventsListener): self { + $this->initialized['nEventsListener'] = true; $this->nEventsListener = $nEventsListener; return $this; @@ -1318,13 +1182,10 @@ public function setNEventsListener(?int $nEventsListener): self /** * Kernel version of the host. - - On Linux, this information obtained from `uname`. On Windows this - information is queried from the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ - registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. - * - * @return string + * On Linux, this information obtained from `uname`. On Windows this + * information is queried from the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ + * registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. */ public function getKernelVersion(): ?string { @@ -1333,29 +1194,22 @@ public function getKernelVersion(): ?string /** * Kernel version of the host. - - On Linux, this information obtained from `uname`. On Windows this - information is queried from the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ - registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. - * - * @param string $kernelVersion - * - * @return self + * On Linux, this information obtained from `uname`. On Windows this + * information is queried from the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ + * registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. */ public function setKernelVersion(?string $kernelVersion): self { + $this->initialized['kernelVersion'] = true; $this->kernelVersion = $kernelVersion; return $this; } /** - * Name of the host's operating system, for example: "Ubuntu 16.04.2 LTS". - or "Windows Server 2016 Datacenter" - - * - * @return string + * Name of the host's operating system, for example: "Ubuntu 16.04.2 LTS" + * or "Windows Server 2016 Datacenter". */ public function getOperatingSystem(): ?string { @@ -1363,30 +1217,54 @@ public function getOperatingSystem(): ?string } /** - * Name of the host's operating system, for example: "Ubuntu 16.04.2 LTS". - or "Windows Server 2016 Datacenter" - - * - * @param string $operatingSystem - * - * @return self + * Name of the host's operating system, for example: "Ubuntu 16.04.2 LTS" + * or "Windows Server 2016 Datacenter". */ public function setOperatingSystem(?string $operatingSystem): self { + $this->initialized['operatingSystem'] = true; $this->operatingSystem = $operatingSystem; return $this; } /** - * Generic type of the operating system of the host, as returned by the. - Go runtime (`GOOS`). + * Version of the host's operating system. + * + *


+ * + * > **Note**: The information returned in this field, including its + * > very existence, and the formatting of values, should not be considered + * > stable, and may change without notice. + */ + public function getOSVersion(): ?string + { + return $this->oSVersion; + } + + /** + * Version of the host's operating system. + * + *


+ * + * > **Note**: The information returned in this field, including its + * > very existence, and the formatting of values, should not be considered + * > stable, and may change without notice. + */ + public function setOSVersion(?string $oSVersion): self + { + $this->initialized['oSVersion'] = true; + $this->oSVersion = $oSVersion; - Currently returned values are "linux" and "windows". A full list of - possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment). + return $this; + } + /** + * Generic type of the operating system of the host, as returned by the + * Go runtime (`GOOS`). * - * @return string + * Currently returned values are "linux" and "windows". A full list of + * possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). */ public function getOSType(): ?string { @@ -1394,32 +1272,25 @@ public function getOSType(): ?string } /** - * Generic type of the operating system of the host, as returned by the. - Go runtime (`GOOS`). - - Currently returned values are "linux" and "windows". A full list of - possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment). - - * - * @param string $oSType + * Generic type of the operating system of the host, as returned by the + * Go runtime (`GOOS`). * - * @return self + * Currently returned values are "linux" and "windows". A full list of + * possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). */ public function setOSType(?string $oSType): self { + $this->initialized['oSType'] = true; $this->oSType = $oSType; return $this; } /** - * Hardware architecture of the host, as returned by the Go runtime. - (`GOARCH`). - - A full list of possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment). - + * Hardware architecture of the host, as returned by the Go runtime + * (`GOARCH`). * - * @return string + * A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). */ public function getArchitecture(): ?string { @@ -1427,18 +1298,14 @@ public function getArchitecture(): ?string } /** - * Hardware architecture of the host, as returned by the Go runtime. - (`GOARCH`). - - A full list of possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment). - + * Hardware architecture of the host, as returned by the Go runtime + * (`GOARCH`). * - * @param string $architecture - * - * @return self + * A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). */ public function setArchitecture(?string $architecture): self { + $this->initialized['architecture'] = true; $this->architecture = $architecture; return $this; @@ -1446,13 +1313,10 @@ public function setArchitecture(?string $architecture): self /** * The number of logical CPUs usable by the daemon. - - The number of available CPUs is checked by querying the operating - system when the daemon starts. Changes to operating system CPU - allocation after the daemon is started are not reflected. - * - * @return int + * The number of available CPUs is checked by querying the operating + * system when the daemon starts. Changes to operating system CPU + * allocation after the daemon is started are not reflected. */ public function getNCPU(): ?int { @@ -1461,27 +1325,21 @@ public function getNCPU(): ?int /** * The number of logical CPUs usable by the daemon. - - The number of available CPUs is checked by querying the operating - system when the daemon starts. Changes to operating system CPU - allocation after the daemon is started are not reflected. - * - * @param int $nCPU - * - * @return self + * The number of available CPUs is checked by querying the operating + * system when the daemon starts. Changes to operating system CPU + * allocation after the daemon is started are not reflected. */ public function setNCPU(?int $nCPU): self { + $this->initialized['nCPU'] = true; $this->nCPU = $nCPU; return $this; } /** - * Total amount of physical memory available on the host, in kilobytes (kB). - * - * @return int + * Total amount of physical memory available on the host, in bytes. */ public function getMemTotal(): ?int { @@ -1489,25 +1347,19 @@ public function getMemTotal(): ?int } /** - * Total amount of physical memory available on the host, in kilobytes (kB). - * - * @param int $memTotal - * - * @return self + * Total amount of physical memory available on the host, in bytes. */ public function setMemTotal(?int $memTotal): self { + $this->initialized['memTotal'] = true; $this->memTotal = $memTotal; return $this; } /** - * Address / URL of the index server that is used for image search,. - and as a default for user authentication for Docker Hub and Docker Cloud. - - * - * @return string + * Address / URL of the index server that is used for image search, + * and as a default for user authentication for Docker Hub and Docker Cloud. */ public function getIndexServerAddress(): ?string { @@ -1515,16 +1367,12 @@ public function getIndexServerAddress(): ?string } /** - * Address / URL of the index server that is used for image search,. - and as a default for user authentication for Docker Hub and Docker Cloud. - - * - * @param string $indexServerAddress - * - * @return self + * Address / URL of the index server that is used for image search, + * and as a default for user authentication for Docker Hub and Docker Cloud. */ public function setIndexServerAddress(?string $indexServerAddress): self { + $this->initialized['indexServerAddress'] = true; $this->indexServerAddress = $indexServerAddress; return $this; @@ -1532,8 +1380,6 @@ public function setIndexServerAddress(?string $indexServerAddress): self /** * RegistryServiceConfig stores daemon registry services configuration. - * - * @return RegistryServiceConfig */ public function getRegistryConfig(): ?RegistryServiceConfig { @@ -1542,22 +1388,20 @@ public function getRegistryConfig(): ?RegistryServiceConfig /** * RegistryServiceConfig stores daemon registry services configuration. - * - * @param RegistryServiceConfig $registryConfig - * - * @return self */ public function setRegistryConfig(?RegistryServiceConfig $registryConfig): self { + $this->initialized['registryConfig'] = true; $this->registryConfig = $registryConfig; return $this; } /** - * User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`). + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + * String resources (e.g, `GPU=UUID1`). * - * @return GenericResourcesItem[] + * @return list|null */ public function getGenericResources(): ?array { @@ -1565,27 +1409,26 @@ public function getGenericResources(): ?array } /** - * User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`). - * - * @param GenericResourcesItem[] $genericResources + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + * String resources (e.g, `GPU=UUID1`). * - * @return self + * @param list|null $genericResources */ public function setGenericResources(?array $genericResources): self { + $this->initialized['genericResources'] = true; $this->genericResources = $genericResources; return $this; } /** - * HTTP-proxy configured for the daemon. This value is obtained from the. - [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. - - Containers do not automatically inherit this configuration. - + * HTTP-proxy configured for the daemon. This value is obtained from the + * [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + * Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + * are masked in the API response. * - * @return string + * Containers do not automatically inherit this configuration. */ public function getHttpProxy(): ?string { @@ -1593,31 +1436,28 @@ public function getHttpProxy(): ?string } /** - * HTTP-proxy configured for the daemon. This value is obtained from the. - [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. - - Containers do not automatically inherit this configuration. - - * - * @param string $httpProxy + * HTTP-proxy configured for the daemon. This value is obtained from the + * [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + * Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + * are masked in the API response. * - * @return self + * Containers do not automatically inherit this configuration. */ public function setHttpProxy(?string $httpProxy): self { + $this->initialized['httpProxy'] = true; $this->httpProxy = $httpProxy; return $this; } /** - * HTTPS-proxy configured for the daemon. This value is obtained from the. - [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. - - Containers do not automatically inherit this configuration. - + * HTTPS-proxy configured for the daemon. This value is obtained from the + * [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + * Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + * are masked in the API response. * - * @return string + * Containers do not automatically inherit this configuration. */ public function getHttpsProxy(): ?string { @@ -1625,32 +1465,27 @@ public function getHttpsProxy(): ?string } /** - * HTTPS-proxy configured for the daemon. This value is obtained from the. - [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. - - Containers do not automatically inherit this configuration. - + * HTTPS-proxy configured for the daemon. This value is obtained from the + * [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + * Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + * are masked in the API response. * - * @param string $httpsProxy - * - * @return self + * Containers do not automatically inherit this configuration. */ public function setHttpsProxy(?string $httpsProxy): self { + $this->initialized['httpsProxy'] = true; $this->httpsProxy = $httpsProxy; return $this; } /** - * Comma-separated list of domain extensions for which no proxy should be. - used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) - environment variable. - - Containers do not automatically inherit this configuration. - + * Comma-separated list of domain extensions for which no proxy should be + * used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) + * environment variable. * - * @return string + * Containers do not automatically inherit this configuration. */ public function getNoProxy(): ?string { @@ -1658,19 +1493,15 @@ public function getNoProxy(): ?string } /** - * Comma-separated list of domain extensions for which no proxy should be. - used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) - environment variable. - - Containers do not automatically inherit this configuration. - + * Comma-separated list of domain extensions for which no proxy should be + * used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) + * environment variable. * - * @param string $noProxy - * - * @return self + * Containers do not automatically inherit this configuration. */ public function setNoProxy(?string $noProxy): self { + $this->initialized['noProxy'] = true; $this->noProxy = $noProxy; return $this; @@ -1678,8 +1509,6 @@ public function setNoProxy(?string $noProxy): self /** * Hostname of the host. - * - * @return string */ public function getName(): ?string { @@ -1688,13 +1517,10 @@ public function getName(): ?string /** * Hostname of the host. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -1702,17 +1528,16 @@ public function setName(?string $name): self /** * User-defined labels (key/value metadata) as set on the daemon. - -


- - > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, - > set through the daemon configuration, and _node_ labels, set from a - > manager node in the Swarm. Node labels are not included in this - > field. Node labels can be retrieved using the `/nodes/(id)` endpoint - > on a manager node in the Swarm. - * - * @return string[] + *


+ * + * > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, + * > set through the daemon configuration, and _node_ labels, set from a + * > manager node in the Swarm. Node labels are not included in this + * > field. Node labels can be retrieved using the `/nodes/(id)` endpoint + * > on a manager node in the Swarm. + * + * @return list|null */ public function getLabels(): ?array { @@ -1721,22 +1546,20 @@ public function getLabels(): ?array /** * User-defined labels (key/value metadata) as set on the daemon. - -


- - > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, - > set through the daemon configuration, and _node_ labels, set from a - > manager node in the Swarm. Node labels are not included in this - > field. Node labels can be retrieved using the `/nodes/(id)` endpoint - > on a manager node in the Swarm. - * - * @param string[] $labels + *


+ * + * > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, + * > set through the daemon configuration, and _node_ labels, set from a + * > manager node in the Swarm. Node labels are not included in this + * > field. Node labels can be retrieved using the `/nodes/(id)` endpoint + * > on a manager node in the Swarm. * - * @return self + * @param list|null $labels */ public function setLabels(?array $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; @@ -1744,8 +1567,6 @@ public function setLabels(?array $labels): self /** * Indicates if experimental features are enabled on the daemon. - * - * @return bool */ public function getExperimentalBuild(): ?bool { @@ -1754,13 +1575,10 @@ public function getExperimentalBuild(): ?bool /** * Indicates if experimental features are enabled on the daemon. - * - * @param bool $experimentalBuild - * - * @return self */ public function setExperimentalBuild(?bool $experimentalBuild): self { + $this->initialized['experimentalBuild'] = true; $this->experimentalBuild = $experimentalBuild; return $this; @@ -1768,13 +1586,6 @@ public function setExperimentalBuild(?bool $experimentalBuild): self /** * Version string of the daemon. - - > **Note**: the [standalone Swarm API](https://docs.docker.com/swarm/swarm-api/) - > returns the Swarm version instead of the daemon version, for example - > `swarm/1.2.8`. - - * - * @return string */ public function getServerVersion(): ?string { @@ -1783,154 +1594,51 @@ public function getServerVersion(): ?string /** * Version string of the daemon. - - > **Note**: the [standalone Swarm API](https://docs.docker.com/swarm/swarm-api/) - > returns the Swarm version instead of the daemon version, for example - > `swarm/1.2.8`. - - * - * @param string $serverVersion - * - * @return self */ public function setServerVersion(?string $serverVersion): self { + $this->initialized['serverVersion'] = true; $this->serverVersion = $serverVersion; return $this; } /** - * URL of the distributed storage backend. - - - The storage backend is used for multihost networking (to store - network and endpoint information) and by the node discovery mechanism. - -


- - > **Note**: This field is only propagated when using standalone Swarm - > mode, and overlay networking using an external k/v store. Overlay - > networks with Swarm mode enabled use the built-in raft store, and - > this field will be empty. - + * List of [OCI compliant](https://github.com/opencontainers/runtime-spec) + * runtimes configured on the daemon. Keys hold the "name" used to + * reference the runtime. * - * @return string - */ - public function getClusterStore(): ?string - { - return $this->clusterStore; - } - - /** - * URL of the distributed storage backend. - - - The storage backend is used for multihost networking (to store - network and endpoint information) and by the node discovery mechanism. - -


- - > **Note**: This field is only propagated when using standalone Swarm - > mode, and overlay networking using an external k/v store. Overlay - > networks with Swarm mode enabled use the built-in raft store, and - > this field will be empty. - + * The Docker daemon relies on an OCI compliant runtime (invoked via the + * `containerd` daemon) as its interface to the Linux kernel namespaces, + * cgroups, and SELinux. * - * @param string $clusterStore + * The default runtime is `runc`, and automatically configured. Additional + * runtimes can be configured by the user and will be listed here. * - * @return self + * @return array|null */ - public function setClusterStore(?string $clusterStore): self - { - $this->clusterStore = $clusterStore; - - return $this; - } - - /** - * The network endpoint that the Engine advertises for the purpose of. - node discovery. ClusterAdvertise is a `host:port` combination on which - the daemon is reachable by other hosts. - -


- - > **Note**: This field is only propagated when using standalone Swarm - > mode, and overlay networking using an external k/v store. Overlay - > networks with Swarm mode enabled use the built-in raft store, and - > this field will be empty. - - * - * @return string - */ - public function getClusterAdvertise(): ?string - { - return $this->clusterAdvertise; - } - - /** - * The network endpoint that the Engine advertises for the purpose of. - node discovery. ClusterAdvertise is a `host:port` combination on which - the daemon is reachable by other hosts. - -


- - > **Note**: This field is only propagated when using standalone Swarm - > mode, and overlay networking using an external k/v store. Overlay - > networks with Swarm mode enabled use the built-in raft store, and - > this field will be empty. - - * - * @param string $clusterAdvertise - * - * @return self - */ - public function setClusterAdvertise(?string $clusterAdvertise): self - { - $this->clusterAdvertise = $clusterAdvertise; - - return $this; - } - - /** - * List of [OCI compliant](https://github.com/opencontainers/runtime-spec). - runtimes configured on the daemon. Keys hold the "name" used to - reference the runtime. - - The Docker daemon relies on an OCI compliant runtime (invoked via the - `containerd` daemon) as its interface to the Linux kernel namespaces, - cgroups, and SELinux. - - The default runtime is `runc`, and automatically configured. Additional - runtimes can be configured by the user and will be listed here. - - * - * @return Runtime[] - */ - public function getRuntimes(): ?\ArrayObject + public function getRuntimes(): ?iterable { return $this->runtimes; } /** - * List of [OCI compliant](https://github.com/opencontainers/runtime-spec). - runtimes configured on the daemon. Keys hold the "name" used to - reference the runtime. - - The Docker daemon relies on an OCI compliant runtime (invoked via the - `containerd` daemon) as its interface to the Linux kernel namespaces, - cgroups, and SELinux. - - The default runtime is `runc`, and automatically configured. Additional - runtimes can be configured by the user and will be listed here. - + * List of [OCI compliant](https://github.com/opencontainers/runtime-spec) + * runtimes configured on the daemon. Keys hold the "name" used to + * reference the runtime. + * + * The Docker daemon relies on an OCI compliant runtime (invoked via the + * `containerd` daemon) as its interface to the Linux kernel namespaces, + * cgroups, and SELinux. * - * @param Runtime[] $runtimes + * The default runtime is `runc`, and automatically configured. Additional + * runtimes can be configured by the user and will be listed here. * - * @return self + * @param array|null $runtimes */ - public function setRuntimes(?\ArrayObject $runtimes): self + public function setRuntimes(?iterable $runtimes): self { + $this->initialized['runtimes'] = true; $this->runtimes = $runtimes; return $this; @@ -1938,11 +1646,8 @@ public function setRuntimes(?\ArrayObject $runtimes): self /** * Name of the default OCI runtime that is used when starting containers. - - The default can be overridden per-container at create time. - * - * @return string + * The default can be overridden per-container at create time. */ public function getDefaultRuntime(): ?string { @@ -1951,16 +1656,12 @@ public function getDefaultRuntime(): ?string /** * Name of the default OCI runtime that is used when starting containers. - - The default can be overridden per-container at create time. - - * - * @param string $defaultRuntime * - * @return self + * The default can be overridden per-container at create time. */ public function setDefaultRuntime(?string $defaultRuntime): self { + $this->initialized['defaultRuntime'] = true; $this->defaultRuntime = $defaultRuntime; return $this; @@ -1968,8 +1669,6 @@ public function setDefaultRuntime(?string $defaultRuntime): self /** * Represents generic information about swarm. - * - * @return SwarmInfo */ public function getSwarm(): ?SwarmInfo { @@ -1978,13 +1677,10 @@ public function getSwarm(): ?SwarmInfo /** * Represents generic information about swarm. - * - * @param SwarmInfo $swarm - * - * @return self */ public function setSwarm(?SwarmInfo $swarm): self { + $this->initialized['swarm'] = true; $this->swarm = $swarm; return $this; @@ -1992,12 +1688,9 @@ public function setSwarm(?SwarmInfo $swarm): self /** * Indicates if live restore is enabled. - - If enabled, containers are kept running when the daemon is shutdown - or upon daemon start if running containers are detected. - * - * @return bool + * If enabled, containers are kept running when the daemon is shutdown + * or upon daemon start if running containers are detected. */ public function getLiveRestoreEnabled(): ?bool { @@ -2006,17 +1699,13 @@ public function getLiveRestoreEnabled(): ?bool /** * Indicates if live restore is enabled. - - If enabled, containers are kept running when the daemon is shutdown - or upon daemon start if running containers are detected. - - * - * @param bool $liveRestoreEnabled * - * @return self + * If enabled, containers are kept running when the daemon is shutdown + * or upon daemon start if running containers are detected. */ public function setLiveRestoreEnabled(?bool $liveRestoreEnabled): self { + $this->initialized['liveRestoreEnabled'] = true; $this->liveRestoreEnabled = $liveRestoreEnabled; return $this; @@ -2024,15 +1713,12 @@ public function setLiveRestoreEnabled(?bool $liveRestoreEnabled): self /** * Represents the isolation technology to use as a default for containers. - The supported values are platform-specific. - - If no isolation value is specified on daemon start, on Windows client, - the default is `hyperv`, and on Windows server, the default is `process`. - - This option is currently not used on other platforms. - + * The supported values are platform-specific. * - * @return string + * If no isolation value is specified on daemon start, on Windows client, + * the default is `hyperv`, and on Windows server, the default is `process`. + * + * This option is currently not used on other platforms. */ public function getIsolation(): ?string { @@ -2041,33 +1727,26 @@ public function getIsolation(): ?string /** * Represents the isolation technology to use as a default for containers. - The supported values are platform-specific. - - If no isolation value is specified on daemon start, on Windows client, - the default is `hyperv`, and on Windows server, the default is `process`. - - This option is currently not used on other platforms. - + * The supported values are platform-specific. * - * @param string $isolation + * If no isolation value is specified on daemon start, on Windows client, + * the default is `hyperv`, and on Windows server, the default is `process`. * - * @return self + * This option is currently not used on other platforms. */ public function setIsolation(?string $isolation): self { + $this->initialized['isolation'] = true; $this->isolation = $isolation; return $this; } /** - * Name and, optional, path of the the `docker-init` binary. - - If the path is omitted, the daemon searches the host's `$PATH` for the - binary and uses the first result. - + * Name and, optional, path of the `docker-init` binary. * - * @return string + * If the path is omitted, the daemon searches the host's `$PATH` for the + * binary and uses the first result. */ public function getInitBinary(): ?string { @@ -2075,30 +1754,23 @@ public function getInitBinary(): ?string } /** - * Name and, optional, path of the the `docker-init` binary. - - If the path is omitted, the daemon searches the host's `$PATH` for the - binary and uses the first result. - - * - * @param string $initBinary + * Name and, optional, path of the `docker-init` binary. * - * @return self + * If the path is omitted, the daemon searches the host's `$PATH` for the + * binary and uses the first result. */ public function setInitBinary(?string $initBinary): self { + $this->initialized['initBinary'] = true; $this->initBinary = $initBinary; return $this; } /** - * Commit holds the Git-commit (SHA1) that a binary was built from, as. - reported in the version-string of external tools, such as `containerd`, - or `runC`. - - * - * @return Commit + * Commit holds the Git-commit (SHA1) that a binary was built from, as + * reported in the version-string of external tools, such as `containerd`, + * or `runC`. */ public function getContainerdCommit(): ?Commit { @@ -2106,29 +1778,22 @@ public function getContainerdCommit(): ?Commit } /** - * Commit holds the Git-commit (SHA1) that a binary was built from, as. - reported in the version-string of external tools, such as `containerd`, - or `runC`. - - * - * @param Commit $containerdCommit - * - * @return self + * Commit holds the Git-commit (SHA1) that a binary was built from, as + * reported in the version-string of external tools, such as `containerd`, + * or `runC`. */ public function setContainerdCommit(?Commit $containerdCommit): self { + $this->initialized['containerdCommit'] = true; $this->containerdCommit = $containerdCommit; return $this; } /** - * Commit holds the Git-commit (SHA1) that a binary was built from, as. - reported in the version-string of external tools, such as `containerd`, - or `runC`. - - * - * @return Commit + * Commit holds the Git-commit (SHA1) that a binary was built from, as + * reported in the version-string of external tools, such as `containerd`, + * or `runC`. */ public function getRuncCommit(): ?Commit { @@ -2136,29 +1801,22 @@ public function getRuncCommit(): ?Commit } /** - * Commit holds the Git-commit (SHA1) that a binary was built from, as. - reported in the version-string of external tools, such as `containerd`, - or `runC`. - - * - * @param Commit $runcCommit - * - * @return self + * Commit holds the Git-commit (SHA1) that a binary was built from, as + * reported in the version-string of external tools, such as `containerd`, + * or `runC`. */ public function setRuncCommit(?Commit $runcCommit): self { + $this->initialized['runcCommit'] = true; $this->runcCommit = $runcCommit; return $this; } /** - * Commit holds the Git-commit (SHA1) that a binary was built from, as. - reported in the version-string of external tools, such as `containerd`, - or `runC`. - - * - * @return Commit + * Commit holds the Git-commit (SHA1) that a binary was built from, as + * reported in the version-string of external tools, such as `containerd`, + * or `runC`. */ public function getInitCommit(): ?Commit { @@ -2166,54 +1824,177 @@ public function getInitCommit(): ?Commit } /** - * Commit holds the Git-commit (SHA1) that a binary was built from, as. - reported in the version-string of external tools, such as `containerd`, - or `runC`. + * Commit holds the Git-commit (SHA1) that a binary was built from, as + * reported in the version-string of external tools, such as `containerd`, + * or `runC`. + */ + public function setInitCommit(?Commit $initCommit): self + { + $this->initialized['initCommit'] = true; + $this->initCommit = $initCommit; + return $this; + } + + /** + * List of security features that are enabled on the daemon, such as + * apparmor, seccomp, SELinux, user-namespaces (userns), rootless and + * no-new-privileges. * - * @param Commit $initCommit + * Additional configuration options for each security feature may + * be present, and are included as a comma-separated list of key/value + * pairs. * - * @return self + * @return list|null */ - public function setInitCommit(?Commit $initCommit): self + public function getSecurityOptions(): ?array { - $this->initCommit = $initCommit; + return $this->securityOptions; + } + + /** + * List of security features that are enabled on the daemon, such as + * apparmor, seccomp, SELinux, user-namespaces (userns), rootless and + * no-new-privileges. + * + * Additional configuration options for each security feature may + * be present, and are included as a comma-separated list of key/value + * pairs. + * + * @param list|null $securityOptions + */ + public function setSecurityOptions(?array $securityOptions): self + { + $this->initialized['securityOptions'] = true; + $this->securityOptions = $securityOptions; return $this; } /** - * List of security features that are enabled on the daemon, such as. - apparmor, seccomp, SELinux, and user-namespaces (userns). + * Reports a summary of the product license on the daemon. + * + * If a commercial license has been applied to the daemon, information + * such as number of nodes, and expiration are included. + */ + public function getProductLicense(): ?string + { + return $this->productLicense; + } + + /** + * Reports a summary of the product license on the daemon. + * + * If a commercial license has been applied to the daemon, information + * such as number of nodes, and expiration are included. + */ + public function setProductLicense(?string $productLicense): self + { + $this->initialized['productLicense'] = true; + $this->productLicense = $productLicense; - Additional configuration options for each security feature may - be present, and are included as a comma-separated list of key/value - pairs. + return $this; + } + /** + * List of custom default address pools for local networks, which can be + * specified in the daemon.json file or dockerd option. * - * @return string[] + * Example: a Base "10.10.0.0/16" with Size 24 will define the set of 256 + * 10.10.[0-255].0/24 address pools. + * + * @return list|null */ - public function getSecurityOptions(): ?array + public function getDefaultAddressPools(): ?array { - return $this->securityOptions; + return $this->defaultAddressPools; } /** - * List of security features that are enabled on the daemon, such as. - apparmor, seccomp, SELinux, and user-namespaces (userns). + * List of custom default address pools for local networks, which can be + * specified in the daemon.json file or dockerd option. + * + * Example: a Base "10.10.0.0/16" with Size 24 will define the set of 256 + * 10.10.[0-255].0/24 address pools. + * + * @param list|null $defaultAddressPools + */ + public function setDefaultAddressPools(?array $defaultAddressPools): self + { + $this->initialized['defaultAddressPools'] = true; + $this->defaultAddressPools = $defaultAddressPools; - Additional configuration options for each security feature may - be present, and are included as a comma-separated list of key/value - pairs. + return $this; + } + /** + * List of warnings / informational messages about missing features, or + * issues related to the daemon configuration. * - * @param string[] $securityOptions + * These messages can be printed by the client as information to the user. * - * @return self + * @return list|null */ - public function setSecurityOptions(?array $securityOptions): self + public function getWarnings(): ?array { - $this->securityOptions = $securityOptions; + return $this->warnings; + } + + /** + * List of warnings / informational messages about missing features, or + * issues related to the daemon configuration. + * + * These messages can be printed by the client as information to the user. + * + * @param list|null $warnings + */ + public function setWarnings(?array $warnings): self + { + $this->initialized['warnings'] = true; + $this->warnings = $warnings; + + return $this; + } + + /** + * List of directories where (Container Device Interface) CDI + * specifications are located. + * + * These specifications define vendor-specific modifications to an OCI + * runtime specification for a container being created. + * + * An empty list indicates that CDI device injection is disabled. + * + * Note that since using CDI device injection requires the daemon to have + * experimental enabled. For non-experimental daemons an empty list will + * always be returned. + * + * @return list|null + */ + public function getCDISpecDirs(): ?array + { + return $this->cDISpecDirs; + } + + /** + * List of directories where (Container Device Interface) CDI + * specifications are located. + * + * These specifications define vendor-specific modifications to an OCI + * runtime specification for a container being created. + * + * An empty list indicates that CDI device injection is disabled. + * + * Note that since using CDI device injection requires the daemon to have + * experimental enabled. For non-experimental daemons an empty list will + * always be returned. + * + * @param list|null $cDISpecDirs + */ + public function setCDISpecDirs(?array $cDISpecDirs): self + { + $this->initialized['cDISpecDirs'] = true; + $this->cDISpecDirs = $cDISpecDirs; return $this; } diff --git a/src/Model/SystemInfoDefaultAddressPoolsItem.php b/src/Model/SystemInfoDefaultAddressPoolsItem.php new file mode 100644 index 00000000..7847664f --- /dev/null +++ b/src/Model/SystemInfoDefaultAddressPoolsItem.php @@ -0,0 +1,68 @@ +initialized); + } + /** + * The network address in CIDR format. + * + * @var string|null + */ + protected $base; + /** + * The network pool size. + * + * @var int|null + */ + protected $size; + + /** + * The network address in CIDR format. + */ + public function getBase(): ?string + { + return $this->base; + } + + /** + * The network address in CIDR format. + */ + public function setBase(?string $base): self + { + $this->initialized['base'] = true; + $this->base = $base; + + return $this; + } + + /** + * The network pool size. + */ + public function getSize(): ?int + { + return $this->size; + } + + /** + * The network pool size. + */ + public function setSize(?int $size): self + { + $this->initialized['size'] = true; + $this->size = $size; + + return $this; + } +} diff --git a/src/Model/SystemVersion.php b/src/Model/SystemVersion.php new file mode 100644 index 00000000..1281aabe --- /dev/null +++ b/src/Model/SystemVersion.php @@ -0,0 +1,329 @@ +initialized); + } + /** + * @var SystemVersionPlatform|null + */ + protected $platform; + /** + * Information about system components. + * + * @var list|null + */ + protected $components; + /** + * The version of the daemon. + * + * @var string|null + */ + protected $version; + /** + * The default (and highest) API version that is supported by the daemon. + * + * @var string|null + */ + protected $apiVersion; + /** + * The minimum API version that is supported by the daemon. + * + * @var string|null + */ + protected $minAPIVersion; + /** + * The Git commit of the source code that was used to build the daemon. + * + * @var string|null + */ + protected $gitCommit; + /** + * The version Go used to compile the daemon, and the version of the Go + * runtime in use. + * + * @var string|null + */ + protected $goVersion; + /** + * The operating system that the daemon is running on ("linux" or "windows"). + * + * @var string|null + */ + protected $os; + /** + * The architecture that the daemon is running on. + * + * @var string|null + */ + protected $arch; + /** + * The kernel version (`uname -r`) that the daemon is running on. + * + * This field is omitted when empty. + * + * @var string|null + */ + protected $kernelVersion; + /** + * Indicates if the daemon is started with experimental features enabled. + * + * This field is omitted when empty / false. + * + * @var bool|null + */ + protected $experimental; + /** + * The date and time that the daemon was compiled. + * + * @var string|null + */ + protected $buildTime; + + public function getPlatform(): ?SystemVersionPlatform + { + return $this->platform; + } + + public function setPlatform(?SystemVersionPlatform $platform): self + { + $this->initialized['platform'] = true; + $this->platform = $platform; + + return $this; + } + + /** + * Information about system components. + * + * @return list|null + */ + public function getComponents(): ?array + { + return $this->components; + } + + /** + * Information about system components. + * + * @param list|null $components + */ + public function setComponents(?array $components): self + { + $this->initialized['components'] = true; + $this->components = $components; + + return $this; + } + + /** + * The version of the daemon. + */ + public function getVersion(): ?string + { + return $this->version; + } + + /** + * The version of the daemon. + */ + public function setVersion(?string $version): self + { + $this->initialized['version'] = true; + $this->version = $version; + + return $this; + } + + /** + * The default (and highest) API version that is supported by the daemon. + */ + public function getApiVersion(): ?string + { + return $this->apiVersion; + } + + /** + * The default (and highest) API version that is supported by the daemon. + */ + public function setApiVersion(?string $apiVersion): self + { + $this->initialized['apiVersion'] = true; + $this->apiVersion = $apiVersion; + + return $this; + } + + /** + * The minimum API version that is supported by the daemon. + */ + public function getMinAPIVersion(): ?string + { + return $this->minAPIVersion; + } + + /** + * The minimum API version that is supported by the daemon. + */ + public function setMinAPIVersion(?string $minAPIVersion): self + { + $this->initialized['minAPIVersion'] = true; + $this->minAPIVersion = $minAPIVersion; + + return $this; + } + + /** + * The Git commit of the source code that was used to build the daemon. + */ + public function getGitCommit(): ?string + { + return $this->gitCommit; + } + + /** + * The Git commit of the source code that was used to build the daemon. + */ + public function setGitCommit(?string $gitCommit): self + { + $this->initialized['gitCommit'] = true; + $this->gitCommit = $gitCommit; + + return $this; + } + + /** + * The version Go used to compile the daemon, and the version of the Go + * runtime in use. + */ + public function getGoVersion(): ?string + { + return $this->goVersion; + } + + /** + * The version Go used to compile the daemon, and the version of the Go + * runtime in use. + */ + public function setGoVersion(?string $goVersion): self + { + $this->initialized['goVersion'] = true; + $this->goVersion = $goVersion; + + return $this; + } + + /** + * The operating system that the daemon is running on ("linux" or "windows"). + */ + public function getOs(): ?string + { + return $this->os; + } + + /** + * The operating system that the daemon is running on ("linux" or "windows"). + */ + public function setOs(?string $os): self + { + $this->initialized['os'] = true; + $this->os = $os; + + return $this; + } + + /** + * The architecture that the daemon is running on. + */ + public function getArch(): ?string + { + return $this->arch; + } + + /** + * The architecture that the daemon is running on. + */ + public function setArch(?string $arch): self + { + $this->initialized['arch'] = true; + $this->arch = $arch; + + return $this; + } + + /** + * The kernel version (`uname -r`) that the daemon is running on. + * + * This field is omitted when empty. + */ + public function getKernelVersion(): ?string + { + return $this->kernelVersion; + } + + /** + * The kernel version (`uname -r`) that the daemon is running on. + * + * This field is omitted when empty. + */ + public function setKernelVersion(?string $kernelVersion): self + { + $this->initialized['kernelVersion'] = true; + $this->kernelVersion = $kernelVersion; + + return $this; + } + + /** + * Indicates if the daemon is started with experimental features enabled. + * + * This field is omitted when empty / false. + */ + public function getExperimental(): ?bool + { + return $this->experimental; + } + + /** + * Indicates if the daemon is started with experimental features enabled. + * + * This field is omitted when empty / false. + */ + public function setExperimental(?bool $experimental): self + { + $this->initialized['experimental'] = true; + $this->experimental = $experimental; + + return $this; + } + + /** + * The date and time that the daemon was compiled. + */ + public function getBuildTime(): ?string + { + return $this->buildTime; + } + + /** + * The date and time that the daemon was compiled. + */ + public function setBuildTime(?string $buildTime): self + { + $this->initialized['buildTime'] = true; + $this->buildTime = $buildTime; + + return $this; + } +} diff --git a/src/Model/SystemVersionComponentsItem.php b/src/Model/SystemVersionComponentsItem.php new file mode 100644 index 00000000..3236b6a9 --- /dev/null +++ b/src/Model/SystemVersionComponentsItem.php @@ -0,0 +1,108 @@ +initialized); + } + /** + * Name of the component. + * + * @var string|null + */ + protected $name; + /** + * Version of the component. + * + * @var string|null + */ + protected $version; + /** + * Key/value pairs of strings with additional information about the + * component. These values are intended for informational purposes + * only, and their content is not defined, and not part of the API + * specification. + * + * These messages can be printed by the client as information to the user. + * + * @var SystemVersionComponentsItemDetails|null + */ + protected $details; + + /** + * Name of the component. + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * Name of the component. + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + + return $this; + } + + /** + * Version of the component. + */ + public function getVersion(): ?string + { + return $this->version; + } + + /** + * Version of the component. + */ + public function setVersion(?string $version): self + { + $this->initialized['version'] = true; + $this->version = $version; + + return $this; + } + + /** + * Key/value pairs of strings with additional information about the + * component. These values are intended for informational purposes + * only, and their content is not defined, and not part of the API + * specification. + * + * These messages can be printed by the client as information to the user. + */ + public function getDetails(): ?SystemVersionComponentsItemDetails + { + return $this->details; + } + + /** + * Key/value pairs of strings with additional information about the + * component. These values are intended for informational purposes + * only, and their content is not defined, and not part of the API + * specification. + * + * These messages can be printed by the client as information to the user. + */ + public function setDetails(?SystemVersionComponentsItemDetails $details): self + { + $this->initialized['details'] = true; + $this->details = $details; + + return $this; + } +} diff --git a/src/Model/SystemVersionComponentsItemDetails.php b/src/Model/SystemVersionComponentsItemDetails.php new file mode 100644 index 00000000..ee3fb711 --- /dev/null +++ b/src/Model/SystemVersionComponentsItemDetails.php @@ -0,0 +1,18 @@ +initialized); + } +} diff --git a/src/Model/VersionGetResponse200Platform.php b/src/Model/SystemVersionPlatform.php similarity index 51% rename from src/Model/VersionGetResponse200Platform.php rename to src/Model/SystemVersionPlatform.php index e342d9e5..0dbeaa69 100644 --- a/src/Model/VersionGetResponse200Platform.php +++ b/src/Model/SystemVersionPlatform.php @@ -2,36 +2,32 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class VersionGetResponse200Platform +class SystemVersionPlatform extends \ArrayObject { /** - * @var string + * @var array */ - protected $name; + protected $initialized = []; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** - * @return string + * @var string|null */ + protected $name; + public function getName(): ?string { return $this->name; } - /** - * @param string $name - * - * @return self - */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/src/Model/TLSInfo.php b/src/Model/TLSInfo.php index 759e140b..9dfef4a0 100644 --- a/src/Model/TLSInfo.php +++ b/src/Model/TLSInfo.php @@ -2,39 +2,42 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TLSInfo +class TLSInfo extends \ArrayObject { /** - * The root CA certificate(s) that are used to validate leaf TLS certificates. + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * The root CA certificate(s) that are used to validate leaf TLS + * certificates. * - * @var string + * @var string|null */ protected $trustRoot; /** * The base64-url-safe-encoded raw subject bytes of the issuer. * - * @var string + * @var string|null */ protected $certIssuerSubject; /** * The base64-url-safe-encoded raw public key bytes of the issuer. * - * @var string + * @var string|null */ protected $certIssuerPublicKey; /** - * The root CA certificate(s) that are used to validate leaf TLS certificates. - * - * @return string + * The root CA certificate(s) that are used to validate leaf TLS + * certificates. */ public function getTrustRoot(): ?string { @@ -42,14 +45,12 @@ public function getTrustRoot(): ?string } /** - * The root CA certificate(s) that are used to validate leaf TLS certificates. - * - * @param string $trustRoot - * - * @return self + * The root CA certificate(s) that are used to validate leaf TLS + * certificates. */ public function setTrustRoot(?string $trustRoot): self { + $this->initialized['trustRoot'] = true; $this->trustRoot = $trustRoot; return $this; @@ -57,8 +58,6 @@ public function setTrustRoot(?string $trustRoot): self /** * The base64-url-safe-encoded raw subject bytes of the issuer. - * - * @return string */ public function getCertIssuerSubject(): ?string { @@ -67,13 +66,10 @@ public function getCertIssuerSubject(): ?string /** * The base64-url-safe-encoded raw subject bytes of the issuer. - * - * @param string $certIssuerSubject - * - * @return self */ public function setCertIssuerSubject(?string $certIssuerSubject): self { + $this->initialized['certIssuerSubject'] = true; $this->certIssuerSubject = $certIssuerSubject; return $this; @@ -81,8 +77,6 @@ public function setCertIssuerSubject(?string $certIssuerSubject): self /** * The base64-url-safe-encoded raw public key bytes of the issuer. - * - * @return string */ public function getCertIssuerPublicKey(): ?string { @@ -91,13 +85,10 @@ public function getCertIssuerPublicKey(): ?string /** * The base64-url-safe-encoded raw public key bytes of the issuer. - * - * @param string $certIssuerPublicKey - * - * @return self */ public function setCertIssuerPublicKey(?string $certIssuerPublicKey): self { + $this->initialized['certIssuerPublicKey'] = true; $this->certIssuerPublicKey = $certIssuerPublicKey; return $this; diff --git a/src/Model/Task.php b/src/Model/Task.php index 2cc62683..812f1275 100644 --- a/src/Model/Task.php +++ b/src/Model/Task.php @@ -2,96 +2,117 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Task +class Task extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The ID of the task. * - * @var string + * @var string|null */ protected $iD; /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. * - * @var ObjectVersion + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. + * + * @var ObjectVersion|null */ protected $version; /** - * @var string + * @var string|null */ protected $createdAt; /** - * @var string + * @var string|null */ protected $updatedAt; /** * Name of the task. * - * @var string + * @var string|null */ protected $name; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** * User modifiable task configuration. * - * @var TaskSpec + * @var TaskSpec|null */ protected $spec; /** * The ID of the service this task is part of. * - * @var string + * @var string|null */ protected $serviceID; /** - * @var int + * @var int|null */ protected $slot; /** * The ID of the node that this task is on. * - * @var string + * @var string|null */ protected $nodeID; /** - * User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`). + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + * String resources (e.g, `GPU=UUID1`). * - * @var GenericResourcesItem[] + * @var list|null */ protected $assignedGenericResources; /** - * @var TaskStatus + * represents the status of a task. + * + * @var TaskStatus|null */ protected $status; /** - * @var string + * @var string|null */ protected $desiredState; + /** + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. + * + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. + * + * @var ObjectVersion|null + */ + protected $jobIteration; /** * The ID of the task. - * - * @return string */ public function getID(): ?string { @@ -100,29 +121,26 @@ public function getID(): ?string /** * The ID of the task. - * - * @param string $iD - * - * @return self */ public function setID(?string $iD): self { + $this->initialized['iD'] = true; $this->iD = $iD; return $this; } /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. * - * @return ObjectVersion + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. */ public function getVersion(): ?ObjectVersion { @@ -130,61 +148,46 @@ public function getVersion(): ?ObjectVersion } /** - * The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. - The client must send the version number along with the modified specification when updating these objects. - This approach ensures safe concurrency and determinism in that the change on the object - may not be applied if the version number has changed from the last read. In other words, - if two update requests specify the same base version, only one of the requests can succeed. - As a result, two separate update requests that happen at the same time will not - unintentionally overwrite each other. - - * - * @param ObjectVersion $version + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. * - * @return self + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. */ public function setVersion(?ObjectVersion $version): self { + $this->initialized['version'] = true; $this->version = $version; return $this; } - /** - * @return string - */ public function getCreatedAt(): ?string { return $this->createdAt; } - /** - * @param string $createdAt - * - * @return self - */ public function setCreatedAt(?string $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; } - /** - * @return string - */ public function getUpdatedAt(): ?string { return $this->updatedAt; } - /** - * @param string $updatedAt - * - * @return self - */ public function setUpdatedAt(?string $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; @@ -192,8 +195,6 @@ public function setUpdatedAt(?string $updatedAt): self /** * Name of the task. - * - * @return string */ public function getName(): ?string { @@ -202,13 +203,10 @@ public function getName(): ?string /** * Name of the task. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -217,9 +215,9 @@ public function setName(?string $name): self /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -227,12 +225,11 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value metadata. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; @@ -240,8 +237,6 @@ public function setLabels(?\ArrayObject $labels): self /** * User modifiable task configuration. - * - * @return TaskSpec */ public function getSpec(): ?TaskSpec { @@ -250,13 +245,10 @@ public function getSpec(): ?TaskSpec /** * User modifiable task configuration. - * - * @param TaskSpec $spec - * - * @return self */ public function setSpec(?TaskSpec $spec): self { + $this->initialized['spec'] = true; $this->spec = $spec; return $this; @@ -264,8 +256,6 @@ public function setSpec(?TaskSpec $spec): self /** * The ID of the service this task is part of. - * - * @return string */ public function getServiceID(): ?string { @@ -274,33 +264,23 @@ public function getServiceID(): ?string /** * The ID of the service this task is part of. - * - * @param string $serviceID - * - * @return self */ public function setServiceID(?string $serviceID): self { + $this->initialized['serviceID'] = true; $this->serviceID = $serviceID; return $this; } - /** - * @return int - */ public function getSlot(): ?int { return $this->slot; } - /** - * @param int $slot - * - * @return self - */ public function setSlot(?int $slot): self { + $this->initialized['slot'] = true; $this->slot = $slot; return $this; @@ -308,8 +288,6 @@ public function setSlot(?int $slot): self /** * The ID of the node that this task is on. - * - * @return string */ public function getNodeID(): ?string { @@ -318,22 +296,20 @@ public function getNodeID(): ?string /** * The ID of the node that this task is on. - * - * @param string $nodeID - * - * @return self */ public function setNodeID(?string $nodeID): self { + $this->initialized['nodeID'] = true; $this->nodeID = $nodeID; return $this; } /** - * User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`). + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + * String resources (e.g, `GPU=UUID1`). * - * @return GenericResourcesItem[] + * @return list|null */ public function getAssignedGenericResources(): ?array { @@ -341,21 +317,21 @@ public function getAssignedGenericResources(): ?array } /** - * User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`). - * - * @param GenericResourcesItem[] $assignedGenericResources + * User-defined resources can be either Integer resources (e.g, `SSD=3`) or + * String resources (e.g, `GPU=UUID1`). * - * @return self + * @param list|null $assignedGenericResources */ public function setAssignedGenericResources(?array $assignedGenericResources): self { + $this->initialized['assignedGenericResources'] = true; $this->assignedGenericResources = $assignedGenericResources; return $this; } /** - * @return TaskStatus + * represents the status of a task. */ public function getStatus(): ?TaskStatus { @@ -363,33 +339,62 @@ public function getStatus(): ?TaskStatus } /** - * @param TaskStatus $status - * - * @return self + * represents the status of a task. */ public function setStatus(?TaskStatus $status): self { + $this->initialized['status'] = true; $this->status = $status; return $this; } - /** - * @return string - */ public function getDesiredState(): ?string { return $this->desiredState; } + public function setDesiredState(?string $desiredState): self + { + $this->initialized['desiredState'] = true; + $this->desiredState = $desiredState; + + return $this; + } + /** - * @param string $desiredState + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. * - * @return self + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. */ - public function setDesiredState(?string $desiredState): self + public function getJobIteration(): ?ObjectVersion { - $this->desiredState = $desiredState; + return $this->jobIteration; + } + + /** + * The version number of the object such as node, service, etc. This is needed + * to avoid conflicting writes. The client must send the version number along + * with the modified specification when updating these objects. + * + * This approach ensures safe concurrency and determinism in that the change + * on the object may not be applied if the version number has changed from the + * last read. In other words, if two update requests specify the same base + * version, only one of the requests can succeed. As a result, two separate + * update requests that happen at the same time will not unintentionally + * overwrite each other. + */ + public function setJobIteration(?ObjectVersion $jobIteration): self + { + $this->initialized['jobIteration'] = true; + $this->jobIteration = $jobIteration; return $this; } diff --git a/src/Model/TaskSpec.php b/src/Model/TaskSpec.php index c04beb6a..e030d1cf 100644 --- a/src/Model/TaskSpec.php +++ b/src/Model/TaskSpec.php @@ -2,71 +2,114 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpec +class TaskSpec extends \ArrayObject { /** - * Invalid when specified with `ContainerSpec`. *(Experimental release only.)*. + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * Plugin spec for the service. *(Experimental release only.)*. + * + *


* - * @var TaskSpecPluginSpec + * > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + * > mutually exclusive. PluginSpec is only used when the Runtime field + * > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + * > field is set to `attachment`. + * + * @var TaskSpecPluginSpec|null */ protected $pluginSpec; /** - * Invalid when specified with `PluginSpec`. + * Container spec for the service. + * + *


* - * @var TaskSpecContainerSpec + * > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + * > mutually exclusive. PluginSpec is only used when the Runtime field + * > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + * > field is set to `attachment`. + * + * @var TaskSpecContainerSpec|null */ protected $containerSpec; /** - * Resource requirements which apply to each individual container created as part of the service. + * Read-only spec type for non-swarm containers attached to swarm overlay + * networks. + * + *


* - * @var TaskSpecResources + * > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + * > mutually exclusive. PluginSpec is only used when the Runtime field + * > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + * > field is set to `attachment`. + * + * @var TaskSpecNetworkAttachmentSpec|null + */ + protected $networkAttachmentSpec; + /** + * Resource requirements which apply to each individual container created + * as part of the service. + * + * @var TaskSpecResources|null */ protected $resources; /** - * Specification for the restart policy which applies to containers created as part of this service. + * Specification for the restart policy which applies to containers + * created as part of this service. * - * @var TaskSpecRestartPolicy + * @var TaskSpecRestartPolicy|null */ protected $restartPolicy; /** - * @var TaskSpecPlacement + * @var TaskSpecPlacement|null */ protected $placement; /** - * A counter that triggers an update even if no relevant parameters have been changed. + * A counter that triggers an update even if no relevant parameters have + * been changed. * - * @var int + * @var int|null */ protected $forceUpdate; /** * Runtime is the type of runtime specified for the task executor. * - * @var string + * @var string|null */ protected $runtime; /** - * @var TaskSpecNetworksItem[] + * Specifies which networks the service should attach to. + * + * @var list|null */ protected $networks; /** - * 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. + * 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. * - * @var TaskSpecLogDriver + * @var TaskSpecLogDriver|null */ protected $logDriver; /** - * Invalid when specified with `ContainerSpec`. *(Experimental release only.)*. + * Plugin spec for the service. *(Experimental release only.)*. * - * @return TaskSpecPluginSpec + *


+ * + * > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + * > mutually exclusive. PluginSpec is only used when the Runtime field + * > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + * > field is set to `attachment`. */ public function getPluginSpec(): ?TaskSpecPluginSpec { @@ -74,23 +117,32 @@ public function getPluginSpec(): ?TaskSpecPluginSpec } /** - * Invalid when specified with `ContainerSpec`. *(Experimental release only.)*. + * Plugin spec for the service. *(Experimental release only.)*. * - * @param TaskSpecPluginSpec $pluginSpec + *


* - * @return self + * > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + * > mutually exclusive. PluginSpec is only used when the Runtime field + * > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + * > field is set to `attachment`. */ public function setPluginSpec(?TaskSpecPluginSpec $pluginSpec): self { + $this->initialized['pluginSpec'] = true; $this->pluginSpec = $pluginSpec; return $this; } /** - * Invalid when specified with `PluginSpec`. + * Container spec for the service. + * + *


* - * @return TaskSpecContainerSpec + * > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + * > mutually exclusive. PluginSpec is only used when the Runtime field + * > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + * > field is set to `attachment`. */ public function getContainerSpec(): ?TaskSpecContainerSpec { @@ -98,47 +150,82 @@ public function getContainerSpec(): ?TaskSpecContainerSpec } /** - * Invalid when specified with `PluginSpec`. + * Container spec for the service. * - * @param TaskSpecContainerSpec $containerSpec + *


* - * @return self + * > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + * > mutually exclusive. PluginSpec is only used when the Runtime field + * > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + * > field is set to `attachment`. */ public function setContainerSpec(?TaskSpecContainerSpec $containerSpec): self { + $this->initialized['containerSpec'] = true; $this->containerSpec = $containerSpec; return $this; } /** - * Resource requirements which apply to each individual container created as part of the service. + * Read-only spec type for non-swarm containers attached to swarm overlay + * networks. * - * @return TaskSpecResources + *


+ * + * > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + * > mutually exclusive. PluginSpec is only used when the Runtime field + * > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + * > field is set to `attachment`. */ - public function getResources(): ?TaskSpecResources + public function getNetworkAttachmentSpec(): ?TaskSpecNetworkAttachmentSpec { - return $this->resources; + return $this->networkAttachmentSpec; } /** - * Resource requirements which apply to each individual container created as part of the service. + * Read-only spec type for non-swarm containers attached to swarm overlay + * networks. * - * @param TaskSpecResources $resources + *


* - * @return self + * > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + * > mutually exclusive. PluginSpec is only used when the Runtime field + * > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + * > field is set to `attachment`. + */ + public function setNetworkAttachmentSpec(?TaskSpecNetworkAttachmentSpec $networkAttachmentSpec): self + { + $this->initialized['networkAttachmentSpec'] = true; + $this->networkAttachmentSpec = $networkAttachmentSpec; + + return $this; + } + + /** + * Resource requirements which apply to each individual container created + * as part of the service. + */ + public function getResources(): ?TaskSpecResources + { + return $this->resources; + } + + /** + * Resource requirements which apply to each individual container created + * as part of the service. */ public function setResources(?TaskSpecResources $resources): self { + $this->initialized['resources'] = true; $this->resources = $resources; return $this; } /** - * Specification for the restart policy which applies to containers created as part of this service. - * - * @return TaskSpecRestartPolicy + * Specification for the restart policy which applies to containers + * created as part of this service. */ public function getRestartPolicy(): ?TaskSpecRestartPolicy { @@ -146,43 +233,33 @@ public function getRestartPolicy(): ?TaskSpecRestartPolicy } /** - * Specification for the restart policy which applies to containers created as part of this service. - * - * @param TaskSpecRestartPolicy $restartPolicy - * - * @return self + * Specification for the restart policy which applies to containers + * created as part of this service. */ public function setRestartPolicy(?TaskSpecRestartPolicy $restartPolicy): self { + $this->initialized['restartPolicy'] = true; $this->restartPolicy = $restartPolicy; return $this; } - /** - * @return TaskSpecPlacement - */ public function getPlacement(): ?TaskSpecPlacement { return $this->placement; } - /** - * @param TaskSpecPlacement $placement - * - * @return self - */ public function setPlacement(?TaskSpecPlacement $placement): self { + $this->initialized['placement'] = true; $this->placement = $placement; return $this; } /** - * A counter that triggers an update even if no relevant parameters have been changed. - * - * @return int + * A counter that triggers an update even if no relevant parameters have + * been changed. */ public function getForceUpdate(): ?int { @@ -190,14 +267,12 @@ public function getForceUpdate(): ?int } /** - * A counter that triggers an update even if no relevant parameters have been changed. - * - * @param int $forceUpdate - * - * @return self + * A counter that triggers an update even if no relevant parameters have + * been changed. */ public function setForceUpdate(?int $forceUpdate): self { + $this->initialized['forceUpdate'] = true; $this->forceUpdate = $forceUpdate; return $this; @@ -205,8 +280,6 @@ public function setForceUpdate(?int $forceUpdate): self /** * Runtime is the type of runtime specified for the task executor. - * - * @return string */ public function getRuntime(): ?string { @@ -215,20 +288,19 @@ public function getRuntime(): ?string /** * Runtime is the type of runtime specified for the task executor. - * - * @param string $runtime - * - * @return self */ public function setRuntime(?string $runtime): self { + $this->initialized['runtime'] = true; $this->runtime = $runtime; return $this; } /** - * @return TaskSpecNetworksItem[] + * Specifies which networks the service should attach to. + * + * @return list|null */ public function getNetworks(): ?array { @@ -236,21 +308,22 @@ public function getNetworks(): ?array } /** - * @param TaskSpecNetworksItem[] $networks + * Specifies which networks the service should attach to. * - * @return self + * @param list|null $networks */ public function setNetworks(?array $networks): self { + $this->initialized['networks'] = true; $this->networks = $networks; return $this; } /** - * 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. - * - * @return TaskSpecLogDriver + * 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. */ public function getLogDriver(): ?TaskSpecLogDriver { @@ -258,14 +331,13 @@ public function getLogDriver(): ?TaskSpecLogDriver } /** - * 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. - * - * @param TaskSpecLogDriver $logDriver - * - * @return self + * 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. */ public function setLogDriver(?TaskSpecLogDriver $logDriver): self { + $this->initialized['logDriver'] = true; $this->logDriver = $logDriver; return $this; diff --git a/src/Model/TaskSpecContainerSpec.php b/src/Model/TaskSpecContainerSpec.php index a0c29fed..bcb9cac8 100644 --- a/src/Model/TaskSpecContainerSpec.php +++ b/src/Model/TaskSpecContainerSpec.php @@ -2,159 +2,206 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecContainerSpec +class TaskSpecContainerSpec extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The image name to use for the container. * - * @var string + * @var string|null */ protected $image; /** * User-defined key/value data. * - * @var string[] + * @var array|null */ protected $labels; /** * The command to be run in the image. * - * @var string[] + * @var list|null */ protected $command; /** * Arguments to the command. * - * @var string[] + * @var list|null */ protected $args; /** - * The hostname to use for the container, as a valid RFC 1123 hostname. + * The hostname to use for the container, as a valid + * [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname. * - * @var string + * @var string|null */ protected $hostname; /** * A list of environment variables in the form `VAR=value`. * - * @var string[] + * @var list|null */ protected $env; /** * The working directory for commands to run in. * - * @var string + * @var string|null */ protected $dir; /** * The user inside the container. * - * @var string + * @var string|null */ protected $user; /** * A list of additional groups that the container process will run as. * - * @var string[] + * @var list|null */ protected $groups; /** * Security options for the container. * - * @var TaskSpecContainerSpecPrivileges + * @var TaskSpecContainerSpecPrivileges|null */ protected $privileges; /** * Whether a pseudo-TTY should be allocated. * - * @var bool + * @var bool|null */ protected $tTY; /** * Open `stdin`. * - * @var bool + * @var bool|null */ protected $openStdin; /** * Mount the container's root filesystem as read only. * - * @var bool + * @var bool|null */ protected $readOnly; /** - * Specification for mounts to be added to containers created as part of the service. + * Specification for mounts to be added to containers created as part + * of the service. * - * @var Mount[] + * @var list|null */ protected $mounts; /** * Signal to stop the container. * - * @var string + * @var string|null */ protected $stopSignal; /** - * Amount of time to wait for the container to terminate before forcefully killing it. + * Amount of time to wait for the container to terminate before + * forcefully killing it. * - * @var int + * @var int|null */ protected $stopGracePeriod; /** * A test to perform to check that the container is healthy. * - * @var HealthConfig + * @var HealthConfig|null */ protected $healthCheck; /** - * A list of hostname/IP mappings to add to the container's `hosts`. - file. The format of extra hosts is specified in the - [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) - man page: - - IP_address canonical_hostname [aliases...] - + * A list of hostname/IP mappings to add to the container's `hosts` + * file. The format of extra hosts is specified in the + * [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) + * man page: + * + * IP_address canonical_hostname [aliases...] * - * @var string[] + * @var list|null */ protected $hosts; /** - * Specification for DNS related configurations in resolver configuration file (`resolv.conf`). + * Specification for DNS related configurations in resolver configuration + * file (`resolv.conf`). * - * @var TaskSpecContainerSpecDNSConfig + * @var TaskSpecContainerSpecDNSConfig|null */ protected $dNSConfig; /** - * Secrets contains references to zero or more secrets that will be exposed to the service. + * Secrets contains references to zero or more secrets that will be + * exposed to the service. * - * @var TaskSpecContainerSpecSecretsItem[] + * @var list|null */ protected $secrets; /** - * Configs contains references to zero or more configs that will be exposed to the service. + * Configs contains references to zero or more configs that will be + * exposed to the service. * - * @var TaskSpecContainerSpecConfigsItem[] + * @var list|null */ protected $configs; /** - * Isolation technology of the containers running the service. (Windows only). + * Isolation technology of the containers running the service. + * (Windows only). * - * @var string + * @var string|null */ protected $isolation; + /** + * Run an init inside the container that forwards signals and reaps + * processes. This field is omitted if empty, and the default (as + * configured on the daemon) is used. + * + * @var bool|null + */ + protected $init; + /** + * Set kernel namedspaced parameters (sysctls) in the container. + * The Sysctls option on services accepts the same sysctls as the + * are supported on containers. Note that while the same sysctls are + * supported, no guarantees or checks are made about their + * suitability for a clustered environment, and it's up to the user + * to determine whether a given sysctl will work properly in a + * Service. + * + * @var array|null + */ + protected $sysctls; + /** + * A list of kernel capabilities to add to the default set + * for the container. + * + * @var list|null + */ + protected $capabilityAdd; + /** + * A list of kernel capabilities to drop from the default set + * for the container. + * + * @var list|null + */ + protected $capabilityDrop; + /** + * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`". + * + * @var list|null + */ + protected $ulimits; /** * The image name to use for the container. - * - * @return string */ public function getImage(): ?string { @@ -163,13 +210,10 @@ public function getImage(): ?string /** * The image name to use for the container. - * - * @param string $image - * - * @return self */ public function setImage(?string $image): self { + $this->initialized['image'] = true; $this->image = $image; return $this; @@ -178,9 +222,9 @@ public function setImage(?string $image): self /** * User-defined key/value data. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -188,12 +232,11 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value data. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; @@ -202,7 +245,7 @@ public function setLabels(?\ArrayObject $labels): self /** * The command to be run in the image. * - * @return string[] + * @return list|null */ public function getCommand(): ?array { @@ -212,12 +255,11 @@ public function getCommand(): ?array /** * The command to be run in the image. * - * @param string[] $command - * - * @return self + * @param list|null $command */ public function setCommand(?array $command): self { + $this->initialized['command'] = true; $this->command = $command; return $this; @@ -226,7 +268,7 @@ public function setCommand(?array $command): self /** * Arguments to the command. * - * @return string[] + * @return list|null */ public function getArgs(): ?array { @@ -236,21 +278,19 @@ public function getArgs(): ?array /** * Arguments to the command. * - * @param string[] $args - * - * @return self + * @param list|null $args */ public function setArgs(?array $args): self { + $this->initialized['args'] = true; $this->args = $args; return $this; } /** - * The hostname to use for the container, as a valid RFC 1123 hostname. - * - * @return string + * The hostname to use for the container, as a valid + * [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname. */ public function getHostname(): ?string { @@ -258,14 +298,12 @@ public function getHostname(): ?string } /** - * The hostname to use for the container, as a valid RFC 1123 hostname. - * - * @param string $hostname - * - * @return self + * The hostname to use for the container, as a valid + * [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname. */ public function setHostname(?string $hostname): self { + $this->initialized['hostname'] = true; $this->hostname = $hostname; return $this; @@ -274,7 +312,7 @@ public function setHostname(?string $hostname): self /** * A list of environment variables in the form `VAR=value`. * - * @return string[] + * @return list|null */ public function getEnv(): ?array { @@ -284,12 +322,11 @@ public function getEnv(): ?array /** * A list of environment variables in the form `VAR=value`. * - * @param string[] $env - * - * @return self + * @param list|null $env */ public function setEnv(?array $env): self { + $this->initialized['env'] = true; $this->env = $env; return $this; @@ -297,8 +334,6 @@ public function setEnv(?array $env): self /** * The working directory for commands to run in. - * - * @return string */ public function getDir(): ?string { @@ -307,13 +342,10 @@ public function getDir(): ?string /** * The working directory for commands to run in. - * - * @param string $dir - * - * @return self */ public function setDir(?string $dir): self { + $this->initialized['dir'] = true; $this->dir = $dir; return $this; @@ -321,8 +353,6 @@ public function setDir(?string $dir): self /** * The user inside the container. - * - * @return string */ public function getUser(): ?string { @@ -331,13 +361,10 @@ public function getUser(): ?string /** * The user inside the container. - * - * @param string $user - * - * @return self */ public function setUser(?string $user): self { + $this->initialized['user'] = true; $this->user = $user; return $this; @@ -346,7 +373,7 @@ public function setUser(?string $user): self /** * A list of additional groups that the container process will run as. * - * @return string[] + * @return list|null */ public function getGroups(): ?array { @@ -356,12 +383,11 @@ public function getGroups(): ?array /** * A list of additional groups that the container process will run as. * - * @param string[] $groups - * - * @return self + * @param list|null $groups */ public function setGroups(?array $groups): self { + $this->initialized['groups'] = true; $this->groups = $groups; return $this; @@ -369,8 +395,6 @@ public function setGroups(?array $groups): self /** * Security options for the container. - * - * @return TaskSpecContainerSpecPrivileges */ public function getPrivileges(): ?TaskSpecContainerSpecPrivileges { @@ -379,13 +403,10 @@ public function getPrivileges(): ?TaskSpecContainerSpecPrivileges /** * Security options for the container. - * - * @param TaskSpecContainerSpecPrivileges $privileges - * - * @return self */ public function setPrivileges(?TaskSpecContainerSpecPrivileges $privileges): self { + $this->initialized['privileges'] = true; $this->privileges = $privileges; return $this; @@ -393,8 +414,6 @@ public function setPrivileges(?TaskSpecContainerSpecPrivileges $privileges): sel /** * Whether a pseudo-TTY should be allocated. - * - * @return bool */ public function getTTY(): ?bool { @@ -403,13 +422,10 @@ public function getTTY(): ?bool /** * Whether a pseudo-TTY should be allocated. - * - * @param bool $tTY - * - * @return self */ public function setTTY(?bool $tTY): self { + $this->initialized['tTY'] = true; $this->tTY = $tTY; return $this; @@ -417,8 +433,6 @@ public function setTTY(?bool $tTY): self /** * Open `stdin`. - * - * @return bool */ public function getOpenStdin(): ?bool { @@ -427,13 +441,10 @@ public function getOpenStdin(): ?bool /** * Open `stdin`. - * - * @param bool $openStdin - * - * @return self */ public function setOpenStdin(?bool $openStdin): self { + $this->initialized['openStdin'] = true; $this->openStdin = $openStdin; return $this; @@ -441,8 +452,6 @@ public function setOpenStdin(?bool $openStdin): self /** * Mount the container's root filesystem as read only. - * - * @return bool */ public function getReadOnly(): ?bool { @@ -451,22 +460,20 @@ public function getReadOnly(): ?bool /** * Mount the container's root filesystem as read only. - * - * @param bool $readOnly - * - * @return self */ public function setReadOnly(?bool $readOnly): self { + $this->initialized['readOnly'] = true; $this->readOnly = $readOnly; return $this; } /** - * Specification for mounts to be added to containers created as part of the service. + * Specification for mounts to be added to containers created as part + * of the service. * - * @return Mount[] + * @return list|null */ public function getMounts(): ?array { @@ -474,14 +481,14 @@ public function getMounts(): ?array } /** - * Specification for mounts to be added to containers created as part of the service. - * - * @param Mount[] $mounts + * Specification for mounts to be added to containers created as part + * of the service. * - * @return self + * @param list|null $mounts */ public function setMounts(?array $mounts): self { + $this->initialized['mounts'] = true; $this->mounts = $mounts; return $this; @@ -489,8 +496,6 @@ public function setMounts(?array $mounts): self /** * Signal to stop the container. - * - * @return string */ public function getStopSignal(): ?string { @@ -499,22 +504,18 @@ public function getStopSignal(): ?string /** * Signal to stop the container. - * - * @param string $stopSignal - * - * @return self */ public function setStopSignal(?string $stopSignal): self { + $this->initialized['stopSignal'] = true; $this->stopSignal = $stopSignal; return $this; } /** - * Amount of time to wait for the container to terminate before forcefully killing it. - * - * @return int + * Amount of time to wait for the container to terminate before + * forcefully killing it. */ public function getStopGracePeriod(): ?int { @@ -522,14 +523,12 @@ public function getStopGracePeriod(): ?int } /** - * Amount of time to wait for the container to terminate before forcefully killing it. - * - * @param int $stopGracePeriod - * - * @return self + * Amount of time to wait for the container to terminate before + * forcefully killing it. */ public function setStopGracePeriod(?int $stopGracePeriod): self { + $this->initialized['stopGracePeriod'] = true; $this->stopGracePeriod = $stopGracePeriod; return $this; @@ -537,8 +536,6 @@ public function setStopGracePeriod(?int $stopGracePeriod): self /** * A test to perform to check that the container is healthy. - * - * @return HealthConfig */ public function getHealthCheck(): ?HealthConfig { @@ -547,28 +544,24 @@ public function getHealthCheck(): ?HealthConfig /** * A test to perform to check that the container is healthy. - * - * @param HealthConfig $healthCheck - * - * @return self */ public function setHealthCheck(?HealthConfig $healthCheck): self { + $this->initialized['healthCheck'] = true; $this->healthCheck = $healthCheck; return $this; } /** - * A list of hostname/IP mappings to add to the container's `hosts`. - file. The format of extra hosts is specified in the - [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) - man page: - - IP_address canonical_hostname [aliases...] - + * A list of hostname/IP mappings to add to the container's `hosts` + * file. The format of extra hosts is specified in the + * [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) + * man page: + * + * IP_address canonical_hostname [aliases...] * - * @return string[] + * @return list|null */ public function getHosts(): ?array { @@ -576,29 +569,26 @@ public function getHosts(): ?array } /** - * A list of hostname/IP mappings to add to the container's `hosts`. - file. The format of extra hosts is specified in the - [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) - man page: - - IP_address canonical_hostname [aliases...] - + * A list of hostname/IP mappings to add to the container's `hosts` + * file. The format of extra hosts is specified in the + * [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) + * man page: * - * @param string[] $hosts + * IP_address canonical_hostname [aliases...] * - * @return self + * @param list|null $hosts */ public function setHosts(?array $hosts): self { + $this->initialized['hosts'] = true; $this->hosts = $hosts; return $this; } /** - * Specification for DNS related configurations in resolver configuration file (`resolv.conf`). - * - * @return TaskSpecContainerSpecDNSConfig + * Specification for DNS related configurations in resolver configuration + * file (`resolv.conf`). */ public function getDNSConfig(): ?TaskSpecContainerSpecDNSConfig { @@ -606,23 +596,22 @@ public function getDNSConfig(): ?TaskSpecContainerSpecDNSConfig } /** - * Specification for DNS related configurations in resolver configuration file (`resolv.conf`). - * - * @param TaskSpecContainerSpecDNSConfig $dNSConfig - * - * @return self + * Specification for DNS related configurations in resolver configuration + * file (`resolv.conf`). */ public function setDNSConfig(?TaskSpecContainerSpecDNSConfig $dNSConfig): self { + $this->initialized['dNSConfig'] = true; $this->dNSConfig = $dNSConfig; return $this; } /** - * Secrets contains references to zero or more secrets that will be exposed to the service. + * Secrets contains references to zero or more secrets that will be + * exposed to the service. * - * @return TaskSpecContainerSpecSecretsItem[] + * @return list|null */ public function getSecrets(): ?array { @@ -630,23 +619,24 @@ public function getSecrets(): ?array } /** - * Secrets contains references to zero or more secrets that will be exposed to the service. - * - * @param TaskSpecContainerSpecSecretsItem[] $secrets + * Secrets contains references to zero or more secrets that will be + * exposed to the service. * - * @return self + * @param list|null $secrets */ public function setSecrets(?array $secrets): self { + $this->initialized['secrets'] = true; $this->secrets = $secrets; return $this; } /** - * Configs contains references to zero or more configs that will be exposed to the service. + * Configs contains references to zero or more configs that will be + * exposed to the service. * - * @return TaskSpecContainerSpecConfigsItem[] + * @return list|null */ public function getConfigs(): ?array { @@ -654,23 +644,22 @@ public function getConfigs(): ?array } /** - * Configs contains references to zero or more configs that will be exposed to the service. + * Configs contains references to zero or more configs that will be + * exposed to the service. * - * @param TaskSpecContainerSpecConfigsItem[] $configs - * - * @return self + * @param list|null $configs */ public function setConfigs(?array $configs): self { + $this->initialized['configs'] = true; $this->configs = $configs; return $this; } /** - * Isolation technology of the containers running the service. (Windows only). - * - * @return string + * Isolation technology of the containers running the service. + * (Windows only). */ public function getIsolation(): ?string { @@ -678,16 +667,145 @@ public function getIsolation(): ?string } /** - * Isolation technology of the containers running the service. (Windows only). - * - * @param string $isolation - * - * @return self + * Isolation technology of the containers running the service. + * (Windows only). */ public function setIsolation(?string $isolation): self { + $this->initialized['isolation'] = true; $this->isolation = $isolation; return $this; } + + /** + * Run an init inside the container that forwards signals and reaps + * processes. This field is omitted if empty, and the default (as + * configured on the daemon) is used. + */ + public function getInit(): ?bool + { + return $this->init; + } + + /** + * Run an init inside the container that forwards signals and reaps + * processes. This field is omitted if empty, and the default (as + * configured on the daemon) is used. + */ + public function setInit(?bool $init): self + { + $this->initialized['init'] = true; + $this->init = $init; + + return $this; + } + + /** + * Set kernel namedspaced parameters (sysctls) in the container. + * The Sysctls option on services accepts the same sysctls as the + * are supported on containers. Note that while the same sysctls are + * supported, no guarantees or checks are made about their + * suitability for a clustered environment, and it's up to the user + * to determine whether a given sysctl will work properly in a + * Service. + * + * @return array|null + */ + public function getSysctls(): ?iterable + { + return $this->sysctls; + } + + /** + * Set kernel namedspaced parameters (sysctls) in the container. + * The Sysctls option on services accepts the same sysctls as the + * are supported on containers. Note that while the same sysctls are + * supported, no guarantees or checks are made about their + * suitability for a clustered environment, and it's up to the user + * to determine whether a given sysctl will work properly in a + * Service. + * + * @param array|null $sysctls + */ + public function setSysctls(?iterable $sysctls): self + { + $this->initialized['sysctls'] = true; + $this->sysctls = $sysctls; + + return $this; + } + + /** + * A list of kernel capabilities to add to the default set + * for the container. + * + * @return list|null + */ + public function getCapabilityAdd(): ?array + { + return $this->capabilityAdd; + } + + /** + * A list of kernel capabilities to add to the default set + * for the container. + * + * @param list|null $capabilityAdd + */ + public function setCapabilityAdd(?array $capabilityAdd): self + { + $this->initialized['capabilityAdd'] = true; + $this->capabilityAdd = $capabilityAdd; + + return $this; + } + + /** + * A list of kernel capabilities to drop from the default set + * for the container. + * + * @return list|null + */ + public function getCapabilityDrop(): ?array + { + return $this->capabilityDrop; + } + + /** + * A list of kernel capabilities to drop from the default set + * for the container. + * + * @param list|null $capabilityDrop + */ + public function setCapabilityDrop(?array $capabilityDrop): self + { + $this->initialized['capabilityDrop'] = true; + $this->capabilityDrop = $capabilityDrop; + + return $this; + } + + /** + * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`". + * + * @return list|null + */ + public function getUlimits(): ?array + { + return $this->ulimits; + } + + /** + * A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`". + * + * @param list|null $ulimits + */ + public function setUlimits(?array $ulimits): self + { + $this->initialized['ulimits'] = true; + $this->ulimits = $ulimits; + + return $this; + } } diff --git a/src/Model/TaskSpecContainerSpecConfigsItem.php b/src/Model/TaskSpecContainerSpecConfigsItem.php index fec154e7..96d87e38 100644 --- a/src/Model/TaskSpecContainerSpecConfigsItem.php +++ b/src/Model/TaskSpecContainerSpecConfigsItem.php @@ -2,41 +2,63 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecContainerSpecConfigsItem +class TaskSpecContainerSpecConfigsItem extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * File represents a specific target that is backed by a file. * - * @var TaskSpecContainerSpecConfigsItemFile + *


+ * + * > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive + * + * @var TaskSpecContainerSpecConfigsItemFile|null */ protected $file; /** - * ConfigID represents the ID of the specific config that we're referencing. + * Runtime represents a target that is not mounted into the + * container but is used by the task. + * + *


+ * + * > **Note**: `Configs.File` and `Configs.Runtime` are mutually + * > exclusive * - * @var string + * @var TaskSpecContainerSpecConfigsItemRuntime|null + */ + protected $runtime; + /** + * ConfigID represents the ID of the specific config that we're + * referencing. + * + * @var string|null */ protected $configID; /** - * ConfigName is the name of the config that this references, but this is just provided for. - lookup/display purposes. The config in the reference will be identified by its ID. - + * ConfigName is the name of the config that this references, + * but this is just provided for lookup/display purposes. The + * config in the reference will be identified by its ID. * - * @var string + * @var string|null */ protected $configName; /** * File represents a specific target that is backed by a file. * - * @return TaskSpecContainerSpecConfigsItemFile + *


+ * + * > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive */ public function getFile(): ?TaskSpecContainerSpecConfigsItemFile { @@ -46,47 +68,74 @@ public function getFile(): ?TaskSpecContainerSpecConfigsItemFile /** * File represents a specific target that is backed by a file. * - * @param TaskSpecContainerSpecConfigsItemFile $file + *


* - * @return self + * > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive */ public function setFile(?TaskSpecContainerSpecConfigsItemFile $file): self { + $this->initialized['file'] = true; $this->file = $file; return $this; } /** - * ConfigID represents the ID of the specific config that we're referencing. + * Runtime represents a target that is not mounted into the + * container but is used by the task. * - * @return string + *


+ * + * > **Note**: `Configs.File` and `Configs.Runtime` are mutually + * > exclusive */ - public function getConfigID(): ?string + public function getRuntime(): ?TaskSpecContainerSpecConfigsItemRuntime { - return $this->configID; + return $this->runtime; } /** - * ConfigID represents the ID of the specific config that we're referencing. + * Runtime represents a target that is not mounted into the + * container but is used by the task. * - * @param string $configID + *


* - * @return self + * > **Note**: `Configs.File` and `Configs.Runtime` are mutually + * > exclusive + */ + public function setRuntime(?TaskSpecContainerSpecConfigsItemRuntime $runtime): self + { + $this->initialized['runtime'] = true; + $this->runtime = $runtime; + + return $this; + } + + /** + * ConfigID represents the ID of the specific config that we're + * referencing. + */ + public function getConfigID(): ?string + { + return $this->configID; + } + + /** + * ConfigID represents the ID of the specific config that we're + * referencing. */ public function setConfigID(?string $configID): self { + $this->initialized['configID'] = true; $this->configID = $configID; return $this; } /** - * ConfigName is the name of the config that this references, but this is just provided for. - lookup/display purposes. The config in the reference will be identified by its ID. - - * - * @return string + * ConfigName is the name of the config that this references, + * but this is just provided for lookup/display purposes. The + * config in the reference will be identified by its ID. */ public function getConfigName(): ?string { @@ -94,16 +143,13 @@ public function getConfigName(): ?string } /** - * ConfigName is the name of the config that this references, but this is just provided for. - lookup/display purposes. The config in the reference will be identified by its ID. - - * - * @param string $configName - * - * @return self + * ConfigName is the name of the config that this references, + * but this is just provided for lookup/display purposes. The + * config in the reference will be identified by its ID. */ public function setConfigName(?string $configName): self { + $this->initialized['configName'] = true; $this->configName = $configName; return $this; diff --git a/src/Model/TaskSpecContainerSpecConfigsItemFile.php b/src/Model/TaskSpecContainerSpecConfigsItemFile.php index 4bb8ef9f..d77ee9fc 100644 --- a/src/Model/TaskSpecContainerSpecConfigsItemFile.php +++ b/src/Model/TaskSpecContainerSpecConfigsItemFile.php @@ -2,45 +2,46 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecContainerSpecConfigsItemFile +class TaskSpecContainerSpecConfigsItemFile extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Name represents the final filename in the filesystem. * - * @var string + * @var string|null */ protected $name; /** * UID represents the file UID. * - * @var string + * @var string|null */ protected $uID; /** * GID represents the file GID. * - * @var string + * @var string|null */ protected $gID; /** * Mode represents the FileMode of the file. * - * @var int + * @var int|null */ protected $mode; /** * Name represents the final filename in the filesystem. - * - * @return string */ public function getName(): ?string { @@ -49,13 +50,10 @@ public function getName(): ?string /** * Name represents the final filename in the filesystem. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -63,8 +61,6 @@ public function setName(?string $name): self /** * UID represents the file UID. - * - * @return string */ public function getUID(): ?string { @@ -73,13 +69,10 @@ public function getUID(): ?string /** * UID represents the file UID. - * - * @param string $uID - * - * @return self */ public function setUID(?string $uID): self { + $this->initialized['uID'] = true; $this->uID = $uID; return $this; @@ -87,8 +80,6 @@ public function setUID(?string $uID): self /** * GID represents the file GID. - * - * @return string */ public function getGID(): ?string { @@ -97,13 +88,10 @@ public function getGID(): ?string /** * GID represents the file GID. - * - * @param string $gID - * - * @return self */ public function setGID(?string $gID): self { + $this->initialized['gID'] = true; $this->gID = $gID; return $this; @@ -111,8 +99,6 @@ public function setGID(?string $gID): self /** * Mode represents the FileMode of the file. - * - * @return int */ public function getMode(): ?int { @@ -121,13 +107,10 @@ public function getMode(): ?int /** * Mode represents the FileMode of the file. - * - * @param int $mode - * - * @return self */ public function setMode(?int $mode): self { + $this->initialized['mode'] = true; $this->mode = $mode; return $this; diff --git a/src/Model/TaskSpecContainerSpecConfigsItemRuntime.php b/src/Model/TaskSpecContainerSpecConfigsItemRuntime.php new file mode 100644 index 00000000..15c69e66 --- /dev/null +++ b/src/Model/TaskSpecContainerSpecConfigsItemRuntime.php @@ -0,0 +1,18 @@ +initialized); + } +} diff --git a/src/Model/TaskSpecContainerSpecDNSConfig.php b/src/Model/TaskSpecContainerSpecDNSConfig.php index fa2ac5fe..be0f8e9e 100644 --- a/src/Model/TaskSpecContainerSpecDNSConfig.php +++ b/src/Model/TaskSpecContainerSpecDNSConfig.php @@ -2,39 +2,43 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecContainerSpecDNSConfig +class TaskSpecContainerSpecDNSConfig extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The IP addresses of the name servers. * - * @var string[] + * @var list|null */ protected $nameservers; /** * A search list for host-name lookup. * - * @var string[] + * @var list|null */ protected $search; /** - * A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.). + * A list of internal resolver variables to be modified (e.g., + * `debug`, `ndots:3`, etc.). * - * @var string[] + * @var list|null */ protected $options; /** * The IP addresses of the name servers. * - * @return string[] + * @return list|null */ public function getNameservers(): ?array { @@ -44,12 +48,11 @@ public function getNameservers(): ?array /** * The IP addresses of the name servers. * - * @param string[] $nameservers - * - * @return self + * @param list|null $nameservers */ public function setNameservers(?array $nameservers): self { + $this->initialized['nameservers'] = true; $this->nameservers = $nameservers; return $this; @@ -58,7 +61,7 @@ public function setNameservers(?array $nameservers): self /** * A search list for host-name lookup. * - * @return string[] + * @return list|null */ public function getSearch(): ?array { @@ -68,21 +71,21 @@ public function getSearch(): ?array /** * A search list for host-name lookup. * - * @param string[] $search - * - * @return self + * @param list|null $search */ public function setSearch(?array $search): self { + $this->initialized['search'] = true; $this->search = $search; return $this; } /** - * A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.). + * A list of internal resolver variables to be modified (e.g., + * `debug`, `ndots:3`, etc.). * - * @return string[] + * @return list|null */ public function getOptions(): ?array { @@ -90,14 +93,14 @@ public function getOptions(): ?array } /** - * A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.). - * - * @param string[] $options + * A list of internal resolver variables to be modified (e.g., + * `debug`, `ndots:3`, etc.). * - * @return self + * @param list|null $options */ public function setOptions(?array $options): self { + $this->initialized['options'] = true; $this->options = $options; return $this; diff --git a/src/Model/TaskSpecContainerSpecPrivileges.php b/src/Model/TaskSpecContainerSpecPrivileges.php index 4ea08229..43643178 100644 --- a/src/Model/TaskSpecContainerSpecPrivileges.php +++ b/src/Model/TaskSpecContainerSpecPrivileges.php @@ -2,33 +2,52 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecContainerSpecPrivileges +class TaskSpecContainerSpecPrivileges extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * CredentialSpec for managed service account (Windows only). * - * @var TaskSpecContainerSpecPrivilegesCredentialSpec + * @var TaskSpecContainerSpecPrivilegesCredentialSpec|null */ protected $credentialSpec; /** * SELinux labels of the container. * - * @var TaskSpecContainerSpecPrivilegesSELinuxContext + * @var TaskSpecContainerSpecPrivilegesSELinuxContext|null */ protected $sELinuxContext; + /** + * Options for configuring seccomp on the container. + * + * @var TaskSpecContainerSpecPrivilegesSeccomp|null + */ + protected $seccomp; + /** + * Options for configuring AppArmor on the container. + * + * @var TaskSpecContainerSpecPrivilegesAppArmor|null + */ + protected $appArmor; + /** + * Configuration of the no_new_privs bit in the container. + * + * @var bool|null + */ + protected $noNewPrivileges; /** * CredentialSpec for managed service account (Windows only). - * - * @return TaskSpecContainerSpecPrivilegesCredentialSpec */ public function getCredentialSpec(): ?TaskSpecContainerSpecPrivilegesCredentialSpec { @@ -37,13 +56,10 @@ public function getCredentialSpec(): ?TaskSpecContainerSpecPrivilegesCredentialS /** * CredentialSpec for managed service account (Windows only). - * - * @param TaskSpecContainerSpecPrivilegesCredentialSpec $credentialSpec - * - * @return self */ public function setCredentialSpec(?TaskSpecContainerSpecPrivilegesCredentialSpec $credentialSpec): self { + $this->initialized['credentialSpec'] = true; $this->credentialSpec = $credentialSpec; return $this; @@ -51,8 +67,6 @@ public function setCredentialSpec(?TaskSpecContainerSpecPrivilegesCredentialSpec /** * SELinux labels of the container. - * - * @return TaskSpecContainerSpecPrivilegesSELinuxContext */ public function getSELinuxContext(): ?TaskSpecContainerSpecPrivilegesSELinuxContext { @@ -61,15 +75,69 @@ public function getSELinuxContext(): ?TaskSpecContainerSpecPrivilegesSELinuxCont /** * SELinux labels of the container. - * - * @param TaskSpecContainerSpecPrivilegesSELinuxContext $sELinuxContext - * - * @return self */ public function setSELinuxContext(?TaskSpecContainerSpecPrivilegesSELinuxContext $sELinuxContext): self { + $this->initialized['sELinuxContext'] = true; $this->sELinuxContext = $sELinuxContext; return $this; } + + /** + * Options for configuring seccomp on the container. + */ + public function getSeccomp(): ?TaskSpecContainerSpecPrivilegesSeccomp + { + return $this->seccomp; + } + + /** + * Options for configuring seccomp on the container. + */ + public function setSeccomp(?TaskSpecContainerSpecPrivilegesSeccomp $seccomp): self + { + $this->initialized['seccomp'] = true; + $this->seccomp = $seccomp; + + return $this; + } + + /** + * Options for configuring AppArmor on the container. + */ + public function getAppArmor(): ?TaskSpecContainerSpecPrivilegesAppArmor + { + return $this->appArmor; + } + + /** + * Options for configuring AppArmor on the container. + */ + public function setAppArmor(?TaskSpecContainerSpecPrivilegesAppArmor $appArmor): self + { + $this->initialized['appArmor'] = true; + $this->appArmor = $appArmor; + + return $this; + } + + /** + * Configuration of the no_new_privs bit in the container. + */ + public function getNoNewPrivileges(): ?bool + { + return $this->noNewPrivileges; + } + + /** + * Configuration of the no_new_privs bit in the container. + */ + public function setNoNewPrivileges(?bool $noNewPrivileges): self + { + $this->initialized['noNewPrivileges'] = true; + $this->noNewPrivileges = $noNewPrivileges; + + return $this; + } } diff --git a/src/Model/TaskSpecContainerSpecPrivilegesAppArmor.php b/src/Model/TaskSpecContainerSpecPrivilegesAppArmor.php new file mode 100644 index 00000000..8314775b --- /dev/null +++ b/src/Model/TaskSpecContainerSpecPrivilegesAppArmor.php @@ -0,0 +1,35 @@ +initialized); + } + /** + * @var string|null + */ + protected $mode; + + public function getMode(): ?string + { + return $this->mode; + } + + public function setMode(?string $mode): self + { + $this->initialized['mode'] = true; + $this->mode = $mode; + + return $this; + } +} diff --git a/src/Model/TaskSpecContainerSpecPrivilegesCredentialSpec.php b/src/Model/TaskSpecContainerSpecPrivilegesCredentialSpec.php index c807ff7a..5238b40b 100644 --- a/src/Model/TaskSpecContainerSpecPrivilegesCredentialSpec.php +++ b/src/Model/TaskSpecContainerSpecPrivilegesCredentialSpec.php @@ -2,60 +2,114 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecContainerSpecPrivilegesCredentialSpec +class TaskSpecContainerSpecPrivilegesCredentialSpec extends \ArrayObject { /** - * Load credential spec from this file. The file is read by the daemon, and must be present in the. - `CredentialSpecs` subdirectory in the docker data directory, which defaults to - `C:\ProgramData\Docker\` on Windows. - - For example, specifying `spec.json` loads `C:\ProgramData\Docker\CredentialSpecs\spec.json`. - -


- - > **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive. + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * Load credential spec from a Swarm Config with the given ID. + * The specified config must also be present in the Configs + * field with the Runtime property set. + * + *


+ * + * + * > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + * > and `CredentialSpec.Config` are mutually exclusive. + * + * @var string|null + */ + protected $config; + /** + * Load credential spec from this file. The file is read by + * the daemon, and must be present in the `CredentialSpecs` + * subdirectory in the docker data directory, which defaults + * to `C:\ProgramData\Docker\` on Windows. + * + * For example, specifying `spec.json` loads + * `C:\ProgramData\Docker\CredentialSpecs\spec.json`. + * + *


* - * @var string + * > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + * > and `CredentialSpec.Config` are mutually exclusive. + * + * @var string|null */ protected $file; /** - * Load credential spec from this value in the Windows registry. The specified registry value must be. - located in: - - `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` - -


- - - > **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive. - + * Load credential spec from this value in the Windows + * registry. The specified registry value must be located in: + * + * `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` + * + *


* - * @var string + * + * > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + * > and `CredentialSpec.Config` are mutually exclusive. + * + * @var string|null */ protected $registry; /** - * Load credential spec from this file. The file is read by the daemon, and must be present in the. - `CredentialSpecs` subdirectory in the docker data directory, which defaults to - `C:\ProgramData\Docker\` on Windows. - - For example, specifying `spec.json` loads `C:\ProgramData\Docker\CredentialSpecs\spec.json`. + * Load credential spec from a Swarm Config with the given ID. + * The specified config must also be present in the Configs + * field with the Runtime property set. + * + *


+ * + * + * > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + * > and `CredentialSpec.Config` are mutually exclusive. + */ + public function getConfig(): ?string + { + return $this->config; + } -


+ /** + * Load credential spec from a Swarm Config with the given ID. + * The specified config must also be present in the Configs + * field with the Runtime property set. + * + *


+ * + * + * > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + * > and `CredentialSpec.Config` are mutually exclusive. + */ + public function setConfig(?string $config): self + { + $this->initialized['config'] = true; + $this->config = $config; - > **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive. + return $this; + } + /** + * Load credential spec from this file. The file is read by + * the daemon, and must be present in the `CredentialSpecs` + * subdirectory in the docker data directory, which defaults + * to `C:\ProgramData\Docker\` on Windows. + * + * For example, specifying `spec.json` loads + * `C:\ProgramData\Docker\CredentialSpecs\spec.json`. + * + *


* - * @return string + * > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + * > and `CredentialSpec.Config` are mutually exclusive. */ public function getFile(): ?string { @@ -63,41 +117,38 @@ public function getFile(): ?string } /** - * Load credential spec from this file. The file is read by the daemon, and must be present in the. - `CredentialSpecs` subdirectory in the docker data directory, which defaults to - `C:\ProgramData\Docker\` on Windows. - - For example, specifying `spec.json` loads `C:\ProgramData\Docker\CredentialSpecs\spec.json`. - -


- - > **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive. - + * Load credential spec from this file. The file is read by + * the daemon, and must be present in the `CredentialSpecs` + * subdirectory in the docker data directory, which defaults + * to `C:\ProgramData\Docker\` on Windows. * - * @param string $file + * For example, specifying `spec.json` loads + * `C:\ProgramData\Docker\CredentialSpecs\spec.json`. * - * @return self + *


+ * + * > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + * > and `CredentialSpec.Config` are mutually exclusive. */ public function setFile(?string $file): self { + $this->initialized['file'] = true; $this->file = $file; return $this; } /** - * Load credential spec from this value in the Windows registry. The specified registry value must be. - located in: - - `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` - -


- - - > **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive. - + * Load credential spec from this value in the Windows + * registry. The specified registry value must be located in: + * + * `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` + * + *


* - * @return string + * + * > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + * > and `CredentialSpec.Config` are mutually exclusive. */ public function getRegistry(): ?string { @@ -105,23 +156,20 @@ public function getRegistry(): ?string } /** - * Load credential spec from this value in the Windows registry. The specified registry value must be. - located in: - - `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` - -


- - - > **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive. - + * Load credential spec from this value in the Windows + * registry. The specified registry value must be located in: + * + * `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` + * + *


* - * @param string $registry * - * @return self + * > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + * > and `CredentialSpec.Config` are mutually exclusive. */ public function setRegistry(?string $registry): self { + $this->initialized['registry'] = true; $this->registry = $registry; return $this; diff --git a/src/Model/TaskSpecContainerSpecPrivilegesSELinuxContext.php b/src/Model/TaskSpecContainerSpecPrivilegesSELinuxContext.php index 883de75e..f5cf5a82 100644 --- a/src/Model/TaskSpecContainerSpecPrivilegesSELinuxContext.php +++ b/src/Model/TaskSpecContainerSpecPrivilegesSELinuxContext.php @@ -2,51 +2,52 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecContainerSpecPrivilegesSELinuxContext +class TaskSpecContainerSpecPrivilegesSELinuxContext extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Disable SELinux. * - * @var bool + * @var bool|null */ protected $disable; /** * SELinux user label. * - * @var string + * @var string|null */ protected $user; /** * SELinux role label. * - * @var string + * @var string|null */ protected $role; /** * SELinux type label. * - * @var string + * @var string|null */ protected $type; /** * SELinux level label. * - * @var string + * @var string|null */ protected $level; /** * Disable SELinux. - * - * @return bool */ public function getDisable(): ?bool { @@ -55,13 +56,10 @@ public function getDisable(): ?bool /** * Disable SELinux. - * - * @param bool $disable - * - * @return self */ public function setDisable(?bool $disable): self { + $this->initialized['disable'] = true; $this->disable = $disable; return $this; @@ -69,8 +67,6 @@ public function setDisable(?bool $disable): self /** * SELinux user label. - * - * @return string */ public function getUser(): ?string { @@ -79,13 +75,10 @@ public function getUser(): ?string /** * SELinux user label. - * - * @param string $user - * - * @return self */ public function setUser(?string $user): self { + $this->initialized['user'] = true; $this->user = $user; return $this; @@ -93,8 +86,6 @@ public function setUser(?string $user): self /** * SELinux role label. - * - * @return string */ public function getRole(): ?string { @@ -103,13 +94,10 @@ public function getRole(): ?string /** * SELinux role label. - * - * @param string $role - * - * @return self */ public function setRole(?string $role): self { + $this->initialized['role'] = true; $this->role = $role; return $this; @@ -117,8 +105,6 @@ public function setRole(?string $role): self /** * SELinux type label. - * - * @return string */ public function getType(): ?string { @@ -127,13 +113,10 @@ public function getType(): ?string /** * SELinux type label. - * - * @param string $type - * - * @return self */ public function setType(?string $type): self { + $this->initialized['type'] = true; $this->type = $type; return $this; @@ -141,8 +124,6 @@ public function setType(?string $type): self /** * SELinux level label. - * - * @return string */ public function getLevel(): ?string { @@ -151,13 +132,10 @@ public function getLevel(): ?string /** * SELinux level label. - * - * @param string $level - * - * @return self */ public function setLevel(?string $level): self { + $this->initialized['level'] = true; $this->level = $level; return $this; diff --git a/src/Model/TaskSpecContainerSpecPrivilegesSeccomp.php b/src/Model/TaskSpecContainerSpecPrivilegesSeccomp.php new file mode 100644 index 00000000..01116284 --- /dev/null +++ b/src/Model/TaskSpecContainerSpecPrivilegesSeccomp.php @@ -0,0 +1,60 @@ +initialized); + } + /** + * @var string|null + */ + protected $mode; + /** + * The custom seccomp profile as a json object. + * + * @var string|null + */ + protected $profile; + + public function getMode(): ?string + { + return $this->mode; + } + + public function setMode(?string $mode): self + { + $this->initialized['mode'] = true; + $this->mode = $mode; + + return $this; + } + + /** + * The custom seccomp profile as a json object. + */ + public function getProfile(): ?string + { + return $this->profile; + } + + /** + * The custom seccomp profile as a json object. + */ + public function setProfile(?string $profile): self + { + $this->initialized['profile'] = true; + $this->profile = $profile; + + return $this; + } +} diff --git a/src/Model/TaskSpecContainerSpecSecretsItem.php b/src/Model/TaskSpecContainerSpecSecretsItem.php index 71e1205a..ea540fa3 100644 --- a/src/Model/TaskSpecContainerSpecSecretsItem.php +++ b/src/Model/TaskSpecContainerSpecSecretsItem.php @@ -2,41 +2,43 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecContainerSpecSecretsItem +class TaskSpecContainerSpecSecretsItem extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * File represents a specific target that is backed by a file. * - * @var TaskSpecContainerSpecSecretsItemFile + * @var TaskSpecContainerSpecSecretsItemFile|null */ protected $file; /** - * SecretID represents the ID of the specific secret that we're referencing. + * SecretID represents the ID of the specific secret that we're + * referencing. * - * @var string + * @var string|null */ protected $secretID; /** - * SecretName is the name of the secret that this references, but this is just provided for. - lookup/display purposes. The secret in the reference will be identified by its ID. - + * SecretName is the name of the secret that this references, + * but this is just provided for lookup/display purposes. The + * secret in the reference will be identified by its ID. * - * @var string + * @var string|null */ protected $secretName; /** * File represents a specific target that is backed by a file. - * - * @return TaskSpecContainerSpecSecretsItemFile */ public function getFile(): ?TaskSpecContainerSpecSecretsItemFile { @@ -45,22 +47,18 @@ public function getFile(): ?TaskSpecContainerSpecSecretsItemFile /** * File represents a specific target that is backed by a file. - * - * @param TaskSpecContainerSpecSecretsItemFile $file - * - * @return self */ public function setFile(?TaskSpecContainerSpecSecretsItemFile $file): self { + $this->initialized['file'] = true; $this->file = $file; return $this; } /** - * SecretID represents the ID of the specific secret that we're referencing. - * - * @return string + * SecretID represents the ID of the specific secret that we're + * referencing. */ public function getSecretID(): ?string { @@ -68,25 +66,21 @@ public function getSecretID(): ?string } /** - * SecretID represents the ID of the specific secret that we're referencing. - * - * @param string $secretID - * - * @return self + * SecretID represents the ID of the specific secret that we're + * referencing. */ public function setSecretID(?string $secretID): self { + $this->initialized['secretID'] = true; $this->secretID = $secretID; return $this; } /** - * SecretName is the name of the secret that this references, but this is just provided for. - lookup/display purposes. The secret in the reference will be identified by its ID. - - * - * @return string + * SecretName is the name of the secret that this references, + * but this is just provided for lookup/display purposes. The + * secret in the reference will be identified by its ID. */ public function getSecretName(): ?string { @@ -94,16 +88,13 @@ public function getSecretName(): ?string } /** - * SecretName is the name of the secret that this references, but this is just provided for. - lookup/display purposes. The secret in the reference will be identified by its ID. - - * - * @param string $secretName - * - * @return self + * SecretName is the name of the secret that this references, + * but this is just provided for lookup/display purposes. The + * secret in the reference will be identified by its ID. */ public function setSecretName(?string $secretName): self { + $this->initialized['secretName'] = true; $this->secretName = $secretName; return $this; diff --git a/src/Model/TaskSpecContainerSpecSecretsItemFile.php b/src/Model/TaskSpecContainerSpecSecretsItemFile.php index 960c2a2e..d9daf7eb 100644 --- a/src/Model/TaskSpecContainerSpecSecretsItemFile.php +++ b/src/Model/TaskSpecContainerSpecSecretsItemFile.php @@ -2,45 +2,46 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecContainerSpecSecretsItemFile +class TaskSpecContainerSpecSecretsItemFile extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Name represents the final filename in the filesystem. * - * @var string + * @var string|null */ protected $name; /** * UID represents the file UID. * - * @var string + * @var string|null */ protected $uID; /** * GID represents the file GID. * - * @var string + * @var string|null */ protected $gID; /** * Mode represents the FileMode of the file. * - * @var int + * @var int|null */ protected $mode; /** * Name represents the final filename in the filesystem. - * - * @return string */ public function getName(): ?string { @@ -49,13 +50,10 @@ public function getName(): ?string /** * Name represents the final filename in the filesystem. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -63,8 +61,6 @@ public function setName(?string $name): self /** * UID represents the file UID. - * - * @return string */ public function getUID(): ?string { @@ -73,13 +69,10 @@ public function getUID(): ?string /** * UID represents the file UID. - * - * @param string $uID - * - * @return self */ public function setUID(?string $uID): self { + $this->initialized['uID'] = true; $this->uID = $uID; return $this; @@ -87,8 +80,6 @@ public function setUID(?string $uID): self /** * GID represents the file GID. - * - * @return string */ public function getGID(): ?string { @@ -97,13 +88,10 @@ public function getGID(): ?string /** * GID represents the file GID. - * - * @param string $gID - * - * @return self */ public function setGID(?string $gID): self { + $this->initialized['gID'] = true; $this->gID = $gID; return $this; @@ -111,8 +99,6 @@ public function setGID(?string $gID): self /** * Mode represents the FileMode of the file. - * - * @return int */ public function getMode(): ?int { @@ -121,13 +107,10 @@ public function getMode(): ?int /** * Mode represents the FileMode of the file. - * - * @param int $mode - * - * @return self */ public function setMode(?int $mode): self { + $this->initialized['mode'] = true; $this->mode = $mode; return $this; diff --git a/src/Model/TaskSpecContainerSpecUlimitsItem.php b/src/Model/TaskSpecContainerSpecUlimitsItem.php new file mode 100644 index 00000000..f4583199 --- /dev/null +++ b/src/Model/TaskSpecContainerSpecUlimitsItem.php @@ -0,0 +1,93 @@ +initialized); + } + /** + * Name of ulimit. + * + * @var string|null + */ + protected $name; + /** + * Soft limit. + * + * @var int|null + */ + protected $soft; + /** + * Hard limit. + * + * @var int|null + */ + protected $hard; + + /** + * Name of ulimit. + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * Name of ulimit. + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + + return $this; + } + + /** + * Soft limit. + */ + public function getSoft(): ?int + { + return $this->soft; + } + + /** + * Soft limit. + */ + public function setSoft(?int $soft): self + { + $this->initialized['soft'] = true; + $this->soft = $soft; + + return $this; + } + + /** + * Hard limit. + */ + public function getHard(): ?int + { + return $this->hard; + } + + /** + * Hard limit. + */ + public function setHard(?int $hard): self + { + $this->initialized['hard'] = true; + $this->hard = $hard; + + return $this; + } +} diff --git a/src/Model/TaskSpecLogDriver.php b/src/Model/TaskSpecLogDriver.php index b4a0df28..ad67be23 100644 --- a/src/Model/TaskSpecLogDriver.php +++ b/src/Model/TaskSpecLogDriver.php @@ -2,60 +2,55 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecLogDriver +class TaskSpecLogDriver extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $name; /** - * @var string[] + * @var array|null */ protected $options; - /** - * @return string - */ public function getName(): ?string { return $this->name; } - /** - * @param string $name - * - * @return self - */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; } /** - * @return string[] + * @return array|null */ - public function getOptions(): ?\ArrayObject + public function getOptions(): ?iterable { return $this->options; } /** - * @param string[] $options - * - * @return self + * @param array|null $options */ - public function setOptions(?\ArrayObject $options): self + public function setOptions(?iterable $options): self { + $this->initialized['options'] = true; $this->options = $options; return $this; diff --git a/src/Model/TaskSpecNetworkAttachmentSpec.php b/src/Model/TaskSpecNetworkAttachmentSpec.php new file mode 100644 index 00000000..b34b1240 --- /dev/null +++ b/src/Model/TaskSpecNetworkAttachmentSpec.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * ID of the container represented by this task. + * + * @var string|null + */ + protected $containerID; + + /** + * ID of the container represented by this task. + */ + public function getContainerID(): ?string + { + return $this->containerID; + } + + /** + * ID of the container represented by this task. + */ + public function setContainerID(?string $containerID): self + { + $this->initialized['containerID'] = true; + $this->containerID = $containerID; + + return $this; + } +} diff --git a/src/Model/TaskSpecNetworksItem.php b/src/Model/TaskSpecNetworksItem.php deleted file mode 100644 index d94a64b7..00000000 --- a/src/Model/TaskSpecNetworksItem.php +++ /dev/null @@ -1,63 +0,0 @@ -target; - } - - /** - * @param string $target - * - * @return self - */ - public function setTarget(?string $target): self - { - $this->target = $target; - - return $this; - } - - /** - * @return string[] - */ - public function getAliases(): ?array - { - return $this->aliases; - } - - /** - * @param string[] $aliases - * - * @return self - */ - public function setAliases(?array $aliases): self - { - $this->aliases = $aliases; - - return $this; - } -} diff --git a/src/Model/TaskSpecPlacement.php b/src/Model/TaskSpecPlacement.php index 08784dfe..676ef539 100644 --- a/src/Model/TaskSpecPlacement.php +++ b/src/Model/TaskSpecPlacement.php @@ -2,43 +2,90 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecPlacement +class TaskSpecPlacement extends \ArrayObject { /** - * An array of constraints. + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * An array of constraint expressions to limit the set of nodes where + * a task can be scheduled. Constraint expressions can either use a + * _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find + * nodes that satisfy every expression (AND match). Constraints can + * match node or Docker Engine labels as follows: + * + * node attribute | matches | example + * ---------------------|--------------------------------|----------------------------------------------- + * `node.id` | Node ID | `node.id==2ivku8v2gvtg4` + * `node.hostname` | Node hostname | `node.hostname!=node-2` + * `node.role` | Node role (`manager`/`worker`) | `node.role==manager` + * `node.platform.os` | Node operating system | `node.platform.os==windows` + * `node.platform.arch` | Node architecture | `node.platform.arch==x86_64` + * `node.labels` | User-defined node labels | `node.labels.security==high` + * `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-14.04` + * + * `engine.labels` apply to Docker Engine labels like operating system, + * drivers, etc. Swarm administrators add `node.labels` for operational + * purposes by using the [`node update endpoint`](#operation/NodeUpdate). * - * @var string[] + * @var list|null */ protected $constraints; /** - * Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence. + * Preferences provide a way to make the scheduler aware of factors + * such as topology. They are provided in order from highest to + * lowest precedence. * - * @var TaskSpecPlacementPreferencesItem[] + * @var list|null */ protected $preferences; /** - * Platforms stores all the platforms that the service's image can. - run on. This field is used in the platform filter for scheduling. - If empty, then the platform filter is off, meaning there are no - scheduling restrictions. - + * Maximum number of replicas for per node (default value is 0, which + * is unlimited). + * + * @var int|null + */ + protected $maxReplicas = 0; + /** + * Platforms stores all the platforms that the service's image can + * run on. This field is used in the platform filter for scheduling. + * If empty, then the platform filter is off, meaning there are no + * scheduling restrictions. * - * @var Platform[] + * @var list|null */ protected $platforms; /** - * An array of constraints. + * An array of constraint expressions to limit the set of nodes where + * a task can be scheduled. Constraint expressions can either use a + * _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find + * nodes that satisfy every expression (AND match). Constraints can + * match node or Docker Engine labels as follows: * - * @return string[] + * node attribute | matches | example + * ---------------------|--------------------------------|----------------------------------------------- + * `node.id` | Node ID | `node.id==2ivku8v2gvtg4` + * `node.hostname` | Node hostname | `node.hostname!=node-2` + * `node.role` | Node role (`manager`/`worker`) | `node.role==manager` + * `node.platform.os` | Node operating system | `node.platform.os==windows` + * `node.platform.arch` | Node architecture | `node.platform.arch==x86_64` + * `node.labels` | User-defined node labels | `node.labels.security==high` + * `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-14.04` + * + * `engine.labels` apply to Docker Engine labels like operating system, + * drivers, etc. Swarm administrators add `node.labels` for operational + * purposes by using the [`node update endpoint`](#operation/NodeUpdate). + * + * @return list|null */ public function getConstraints(): ?array { @@ -46,23 +93,42 @@ public function getConstraints(): ?array } /** - * An array of constraints. + * An array of constraint expressions to limit the set of nodes where + * a task can be scheduled. Constraint expressions can either use a + * _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find + * nodes that satisfy every expression (AND match). Constraints can + * match node or Docker Engine labels as follows: + * + * node attribute | matches | example + * ---------------------|--------------------------------|----------------------------------------------- + * `node.id` | Node ID | `node.id==2ivku8v2gvtg4` + * `node.hostname` | Node hostname | `node.hostname!=node-2` + * `node.role` | Node role (`manager`/`worker`) | `node.role==manager` + * `node.platform.os` | Node operating system | `node.platform.os==windows` + * `node.platform.arch` | Node architecture | `node.platform.arch==x86_64` + * `node.labels` | User-defined node labels | `node.labels.security==high` + * `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-14.04` * - * @param string[] $constraints + * `engine.labels` apply to Docker Engine labels like operating system, + * drivers, etc. Swarm administrators add `node.labels` for operational + * purposes by using the [`node update endpoint`](#operation/NodeUpdate). * - * @return self + * @param list|null $constraints */ public function setConstraints(?array $constraints): self { + $this->initialized['constraints'] = true; $this->constraints = $constraints; return $this; } /** - * Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence. + * Preferences provide a way to make the scheduler aware of factors + * such as topology. They are provided in order from highest to + * lowest precedence. * - * @return TaskSpecPlacementPreferencesItem[] + * @return list|null */ public function getPreferences(): ?array { @@ -70,27 +136,48 @@ public function getPreferences(): ?array } /** - * Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence. + * Preferences provide a way to make the scheduler aware of factors + * such as topology. They are provided in order from highest to + * lowest precedence. * - * @param TaskSpecPlacementPreferencesItem[] $preferences - * - * @return self + * @param list|null $preferences */ public function setPreferences(?array $preferences): self { + $this->initialized['preferences'] = true; $this->preferences = $preferences; return $this; } /** - * Platforms stores all the platforms that the service's image can. - run on. This field is used in the platform filter for scheduling. - If empty, then the platform filter is off, meaning there are no - scheduling restrictions. + * Maximum number of replicas for per node (default value is 0, which + * is unlimited). + */ + public function getMaxReplicas(): ?int + { + return $this->maxReplicas; + } + + /** + * Maximum number of replicas for per node (default value is 0, which + * is unlimited). + */ + public function setMaxReplicas(?int $maxReplicas): self + { + $this->initialized['maxReplicas'] = true; + $this->maxReplicas = $maxReplicas; + + return $this; + } + /** + * Platforms stores all the platforms that the service's image can + * run on. This field is used in the platform filter for scheduling. + * If empty, then the platform filter is off, meaning there are no + * scheduling restrictions. * - * @return Platform[] + * @return list|null */ public function getPlatforms(): ?array { @@ -98,18 +185,16 @@ public function getPlatforms(): ?array } /** - * Platforms stores all the platforms that the service's image can. - run on. This field is used in the platform filter for scheduling. - If empty, then the platform filter is off, meaning there are no - scheduling restrictions. - - * - * @param Platform[] $platforms + * Platforms stores all the platforms that the service's image can + * run on. This field is used in the platform filter for scheduling. + * If empty, then the platform filter is off, meaning there are no + * scheduling restrictions. * - * @return self + * @param list|null $platforms */ public function setPlatforms(?array $platforms): self { + $this->initialized['platforms'] = true; $this->platforms = $platforms; return $this; diff --git a/src/Model/TaskSpecPlacementPreferencesItem.php b/src/Model/TaskSpecPlacementPreferencesItem.php index 7b1fda7c..558b254b 100644 --- a/src/Model/TaskSpecPlacementPreferencesItem.php +++ b/src/Model/TaskSpecPlacementPreferencesItem.php @@ -2,36 +2,32 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecPlacementPreferencesItem +class TaskSpecPlacementPreferencesItem extends \ArrayObject { /** - * @var TaskSpecPlacementPreferencesItemSpread + * @var array */ - protected $spread; + protected $initialized = []; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** - * @return TaskSpecPlacementPreferencesItemSpread + * @var TaskSpecPlacementPreferencesItemSpread|null */ + protected $spread; + public function getSpread(): ?TaskSpecPlacementPreferencesItemSpread { return $this->spread; } - /** - * @param TaskSpecPlacementPreferencesItemSpread $spread - * - * @return self - */ public function setSpread(?TaskSpecPlacementPreferencesItemSpread $spread): self { + $this->initialized['spread'] = true; $this->spread = $spread; return $this; diff --git a/src/Model/TaskSpecPlacementPreferencesItemSpread.php b/src/Model/TaskSpecPlacementPreferencesItemSpread.php index 585f6278..bca2bc3c 100644 --- a/src/Model/TaskSpecPlacementPreferencesItemSpread.php +++ b/src/Model/TaskSpecPlacementPreferencesItemSpread.php @@ -2,27 +2,28 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecPlacementPreferencesItemSpread +class TaskSpecPlacementPreferencesItemSpread extends \ArrayObject { /** - * label descriptor, such as engine.labels.az. + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * label descriptor, such as `engine.labels.az`. * - * @var string + * @var string|null */ protected $spreadDescriptor; /** - * label descriptor, such as engine.labels.az. - * - * @return string + * label descriptor, such as `engine.labels.az`. */ public function getSpreadDescriptor(): ?string { @@ -30,14 +31,11 @@ public function getSpreadDescriptor(): ?string } /** - * label descriptor, such as engine.labels.az. - * - * @param string $spreadDescriptor - * - * @return self + * label descriptor, such as `engine.labels.az`. */ public function setSpreadDescriptor(?string $spreadDescriptor): self { + $this->initialized['spreadDescriptor'] = true; $this->spreadDescriptor = $spreadDescriptor; return $this; diff --git a/src/Model/TaskSpecPluginSpec.php b/src/Model/TaskSpecPluginSpec.php index 816a9f12..de74015f 100644 --- a/src/Model/TaskSpecPluginSpec.php +++ b/src/Model/TaskSpecPluginSpec.php @@ -2,43 +2,44 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecPluginSpec +class TaskSpecPluginSpec extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * The name or 'alias' to use for the plugin. * - * @var string + * @var string|null */ protected $name; /** * The plugin image reference to use. * - * @var string + * @var string|null */ protected $remote; /** * Disable the plugin once scheduled. * - * @var bool + * @var bool|null */ protected $disabled; /** - * @var TaskSpecPluginSpecPluginPrivilegeItem[] + * @var list|null */ protected $pluginPrivilege; /** * The name or 'alias' to use for the plugin. - * - * @return string */ public function getName(): ?string { @@ -47,13 +48,10 @@ public function getName(): ?string /** * The name or 'alias' to use for the plugin. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -61,8 +59,6 @@ public function setName(?string $name): self /** * The plugin image reference to use. - * - * @return string */ public function getRemote(): ?string { @@ -71,13 +67,10 @@ public function getRemote(): ?string /** * The plugin image reference to use. - * - * @param string $remote - * - * @return self */ public function setRemote(?string $remote): self { + $this->initialized['remote'] = true; $this->remote = $remote; return $this; @@ -85,8 +78,6 @@ public function setRemote(?string $remote): self /** * Disable the plugin once scheduled. - * - * @return bool */ public function getDisabled(): ?bool { @@ -95,20 +86,17 @@ public function getDisabled(): ?bool /** * Disable the plugin once scheduled. - * - * @param bool $disabled - * - * @return self */ public function setDisabled(?bool $disabled): self { + $this->initialized['disabled'] = true; $this->disabled = $disabled; return $this; } /** - * @return TaskSpecPluginSpecPluginPrivilegeItem[] + * @return list|null */ public function getPluginPrivilege(): ?array { @@ -116,12 +104,11 @@ public function getPluginPrivilege(): ?array } /** - * @param TaskSpecPluginSpecPluginPrivilegeItem[] $pluginPrivilege - * - * @return self + * @param list|null $pluginPrivilege */ public function setPluginPrivilege(?array $pluginPrivilege): self { + $this->initialized['pluginPrivilege'] = true; $this->pluginPrivilege = $pluginPrivilege; return $this; diff --git a/src/Model/TaskSpecResources.php b/src/Model/TaskSpecResources.php index a3f83e74..2936c851 100644 --- a/src/Model/TaskSpecResources.php +++ b/src/Model/TaskSpecResources.php @@ -2,73 +2,69 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecResources +class TaskSpecResources extends \ArrayObject { /** - * An object describing the resources which can be advertised by a node and requested by a task. + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * An object describing a limit on resources which can be requested by a task. * - * @var ResourceObject + * @var Limit|null */ protected $limits; /** - * An object describing the resources which can be advertised by a node and requested by a task. + * An object describing the resources which can be advertised by a node and + * requested by a task. * - * @var ResourceObject + * @var ResourceObject|null */ - protected $reservation; + protected $reservations; /** - * An object describing the resources which can be advertised by a node and requested by a task. - * - * @return ResourceObject + * An object describing a limit on resources which can be requested by a task. */ - public function getLimits(): ?ResourceObject + public function getLimits(): ?Limit { return $this->limits; } /** - * An object describing the resources which can be advertised by a node and requested by a task. - * - * @param ResourceObject $limits - * - * @return self + * An object describing a limit on resources which can be requested by a task. */ - public function setLimits(?ResourceObject $limits): self + public function setLimits(?Limit $limits): self { + $this->initialized['limits'] = true; $this->limits = $limits; return $this; } /** - * An object describing the resources which can be advertised by a node and requested by a task. - * - * @return ResourceObject + * An object describing the resources which can be advertised by a node and + * requested by a task. */ - public function getReservation(): ?ResourceObject + public function getReservations(): ?ResourceObject { - return $this->reservation; + return $this->reservations; } /** - * An object describing the resources which can be advertised by a node and requested by a task. - * - * @param ResourceObject $reservation - * - * @return self + * An object describing the resources which can be advertised by a node and + * requested by a task. */ - public function setReservation(?ResourceObject $reservation): self + public function setReservations(?ResourceObject $reservations): self { - $this->reservation = $reservation; + $this->initialized['reservations'] = true; + $this->reservations = $reservations; return $this; } diff --git a/src/Model/TaskSpecRestartPolicy.php b/src/Model/TaskSpecRestartPolicy.php index f32bb5d1..068b26f2 100644 --- a/src/Model/TaskSpecRestartPolicy.php +++ b/src/Model/TaskSpecRestartPolicy.php @@ -2,45 +2,48 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskSpecRestartPolicy +class TaskSpecRestartPolicy extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Condition for restart. * - * @var string + * @var string|null */ protected $condition; /** * Delay between restart attempts. * - * @var int + * @var int|null */ protected $delay; /** - * Maximum attempts to restart a given container before giving up (default value is 0, which is ignored). + * Maximum attempts to restart a given container before giving up + * (default value is 0, which is ignored). * - * @var int + * @var int|null */ - protected $maxAttempts; + protected $maxAttempts = 0; /** - * Windows is the time window used to evaluate the restart policy (default value is 0, which is unbounded). + * Windows is the time window used to evaluate the restart policy + * (default value is 0, which is unbounded). * - * @var int + * @var int|null */ - protected $window; + protected $window = 0; /** * Condition for restart. - * - * @return string */ public function getCondition(): ?string { @@ -49,13 +52,10 @@ public function getCondition(): ?string /** * Condition for restart. - * - * @param string $condition - * - * @return self */ public function setCondition(?string $condition): self { + $this->initialized['condition'] = true; $this->condition = $condition; return $this; @@ -63,8 +63,6 @@ public function setCondition(?string $condition): self /** * Delay between restart attempts. - * - * @return int */ public function getDelay(): ?int { @@ -73,22 +71,18 @@ public function getDelay(): ?int /** * Delay between restart attempts. - * - * @param int $delay - * - * @return self */ public function setDelay(?int $delay): self { + $this->initialized['delay'] = true; $this->delay = $delay; return $this; } /** - * Maximum attempts to restart a given container before giving up (default value is 0, which is ignored). - * - * @return int + * Maximum attempts to restart a given container before giving up + * (default value is 0, which is ignored). */ public function getMaxAttempts(): ?int { @@ -96,23 +90,20 @@ public function getMaxAttempts(): ?int } /** - * Maximum attempts to restart a given container before giving up (default value is 0, which is ignored). - * - * @param int $maxAttempts - * - * @return self + * Maximum attempts to restart a given container before giving up + * (default value is 0, which is ignored). */ public function setMaxAttempts(?int $maxAttempts): self { + $this->initialized['maxAttempts'] = true; $this->maxAttempts = $maxAttempts; return $this; } /** - * Windows is the time window used to evaluate the restart policy (default value is 0, which is unbounded). - * - * @return int + * Windows is the time window used to evaluate the restart policy + * (default value is 0, which is unbounded). */ public function getWindow(): ?int { @@ -120,14 +111,12 @@ public function getWindow(): ?int } /** - * Windows is the time window used to evaluate the restart policy (default value is 0, which is unbounded). - * - * @param int $window - * - * @return self + * Windows is the time window used to evaluate the restart policy + * (default value is 0, which is unbounded). */ public function setWindow(?int $window): self { + $this->initialized['window'] = true; $this->window = $window; return $this; diff --git a/src/Model/TaskStatus.php b/src/Model/TaskStatus.php index 56ebc4a7..179633bf 100644 --- a/src/Model/TaskStatus.php +++ b/src/Model/TaskStatus.php @@ -2,134 +2,135 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class TaskStatus +class TaskStatus extends \ArrayObject { /** - * @var string + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * @var string|null */ protected $timestamp; /** - * @var string + * @var string|null */ protected $state; /** - * @var string + * @var string|null */ protected $message; /** - * @var string + * @var string|null */ protected $err; /** - * @var TaskStatusContainerStatus + * represents the status of a container. + * + * @var ContainerStatus|null */ protected $containerStatus; - /** - * @return string + * represents the port status of a task's host ports whose service has published host ports. + * + * @var PortStatus|null */ + protected $portStatus; + public function getTimestamp(): ?string { return $this->timestamp; } - /** - * @param string $timestamp - * - * @return self - */ public function setTimestamp(?string $timestamp): self { + $this->initialized['timestamp'] = true; $this->timestamp = $timestamp; return $this; } - /** - * @return string - */ public function getState(): ?string { return $this->state; } - /** - * @param string $state - * - * @return self - */ public function setState(?string $state): self { + $this->initialized['state'] = true; $this->state = $state; return $this; } - /** - * @return string - */ public function getMessage(): ?string { return $this->message; } - /** - * @param string $message - * - * @return self - */ public function setMessage(?string $message): self { + $this->initialized['message'] = true; $this->message = $message; return $this; } - /** - * @return string - */ public function getErr(): ?string { return $this->err; } - /** - * @param string $err - * - * @return self - */ public function setErr(?string $err): self { + $this->initialized['err'] = true; $this->err = $err; return $this; } /** - * @return TaskStatusContainerStatus + * represents the status of a container. */ - public function getContainerStatus(): ?TaskStatusContainerStatus + public function getContainerStatus(): ?ContainerStatus { return $this->containerStatus; } /** - * @param TaskStatusContainerStatus $containerStatus - * - * @return self + * represents the status of a container. */ - public function setContainerStatus(?TaskStatusContainerStatus $containerStatus): self + public function setContainerStatus(?ContainerStatus $containerStatus): self { + $this->initialized['containerStatus'] = true; $this->containerStatus = $containerStatus; return $this; } + + /** + * represents the port status of a task's host ports whose service has published host ports. + */ + public function getPortStatus(): ?PortStatus + { + return $this->portStatus; + } + + /** + * represents the port status of a task's host ports whose service has published host ports. + */ + public function setPortStatus(?PortStatus $portStatus): self + { + $this->initialized['portStatus'] = true; + $this->portStatus = $portStatus; + + return $this; + } } diff --git a/src/Model/ThrottleDevice.php b/src/Model/ThrottleDevice.php index 60565d27..693a2251 100644 --- a/src/Model/ThrottleDevice.php +++ b/src/Model/ThrottleDevice.php @@ -2,33 +2,34 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class ThrottleDevice +class ThrottleDevice extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Device path. * - * @var string + * @var string|null */ protected $path; /** * Rate. * - * @var int + * @var int|null */ protected $rate; /** * Device path. - * - * @return string */ public function getPath(): ?string { @@ -37,13 +38,10 @@ public function getPath(): ?string /** * Device path. - * - * @param string $path - * - * @return self */ public function setPath(?string $path): self { + $this->initialized['path'] = true; $this->path = $path; return $this; @@ -51,8 +49,6 @@ public function setPath(?string $path): self /** * Rate. - * - * @return int */ public function getRate(): ?int { @@ -61,13 +57,10 @@ public function getRate(): ?int /** * Rate. - * - * @param int $rate - * - * @return self */ public function setRate(?int $rate): self { + $this->initialized['rate'] = true; $this->rate = $rate; return $this; diff --git a/src/Model/VersionGetResponse200.php b/src/Model/VersionGetResponse200.php deleted file mode 100644 index 4bb04d5c..00000000 --- a/src/Model/VersionGetResponse200.php +++ /dev/null @@ -1,303 +0,0 @@ -platform; - } - - /** - * @param VersionGetResponse200Platform $platform - * - * @return self - */ - public function setPlatform(?VersionGetResponse200Platform $platform): self - { - $this->platform = $platform; - - return $this; - } - - /** - * @return VersionGetResponse200ComponentsItem[] - */ - public function getComponents(): ?array - { - return $this->components; - } - - /** - * @param VersionGetResponse200ComponentsItem[] $components - * - * @return self - */ - public function setComponents(?array $components): self - { - $this->components = $components; - - return $this; - } - - /** - * @return string - */ - public function getVersion(): ?string - { - return $this->version; - } - - /** - * @param string $version - * - * @return self - */ - public function setVersion(?string $version): self - { - $this->version = $version; - - return $this; - } - - /** - * @return string - */ - public function getApiVersion(): ?string - { - return $this->apiVersion; - } - - /** - * @param string $apiVersion - * - * @return self - */ - public function setApiVersion(?string $apiVersion): self - { - $this->apiVersion = $apiVersion; - - return $this; - } - - /** - * @return string - */ - public function getMinAPIVersion(): ?string - { - return $this->minAPIVersion; - } - - /** - * @param string $minAPIVersion - * - * @return self - */ - public function setMinAPIVersion(?string $minAPIVersion): self - { - $this->minAPIVersion = $minAPIVersion; - - return $this; - } - - /** - * @return string - */ - public function getGitCommit(): ?string - { - return $this->gitCommit; - } - - /** - * @param string $gitCommit - * - * @return self - */ - public function setGitCommit(?string $gitCommit): self - { - $this->gitCommit = $gitCommit; - - return $this; - } - - /** - * @return string - */ - public function getGoVersion(): ?string - { - return $this->goVersion; - } - - /** - * @param string $goVersion - * - * @return self - */ - public function setGoVersion(?string $goVersion): self - { - $this->goVersion = $goVersion; - - return $this; - } - - /** - * @return string - */ - public function getOs(): ?string - { - return $this->os; - } - - /** - * @param string $os - * - * @return self - */ - public function setOs(?string $os): self - { - $this->os = $os; - - return $this; - } - - /** - * @return string - */ - public function getArch(): ?string - { - return $this->arch; - } - - /** - * @param string $arch - * - * @return self - */ - public function setArch(?string $arch): self - { - $this->arch = $arch; - - return $this; - } - - /** - * @return string - */ - public function getKernelVersion(): ?string - { - return $this->kernelVersion; - } - - /** - * @param string $kernelVersion - * - * @return self - */ - public function setKernelVersion(?string $kernelVersion): self - { - $this->kernelVersion = $kernelVersion; - - return $this; - } - - /** - * @return bool - */ - public function getExperimental(): ?bool - { - return $this->experimental; - } - - /** - * @param bool $experimental - * - * @return self - */ - public function setExperimental(?bool $experimental): self - { - $this->experimental = $experimental; - - return $this; - } - - /** - * @return string - */ - public function getBuildTime(): ?string - { - return $this->buildTime; - } - - /** - * @param string $buildTime - * - * @return self - */ - public function setBuildTime(?string $buildTime): self - { - $this->buildTime = $buildTime; - - return $this; - } -} diff --git a/src/Model/VersionGetResponse200ComponentsItem.php b/src/Model/VersionGetResponse200ComponentsItem.php deleted file mode 100644 index ab3e944a..00000000 --- a/src/Model/VersionGetResponse200ComponentsItem.php +++ /dev/null @@ -1,87 +0,0 @@ -name; - } - - /** - * @param string $name - * - * @return self - */ - public function setName(?string $name): self - { - $this->name = $name; - - return $this; - } - - /** - * @return string - */ - public function getVersion(): ?string - { - return $this->version; - } - - /** - * @param string $version - * - * @return self - */ - public function setVersion(?string $version): self - { - $this->version = $version; - - return $this; - } - - /** - * @return mixed - */ - public function getDetails() - { - return $this->details; - } - - /** - * @param mixed $details - * - * @return self - */ - public function setDetails($details): self - { - $this->details = $details; - - return $this; - } -} diff --git a/src/Model/Volume.php b/src/Model/Volume.php index a293b807..b622c7b0 100644 --- a/src/Model/Volume.php +++ b/src/Model/Volume.php @@ -2,83 +2,90 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class Volume +class Volume extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Name of the volume. * - * @var string + * @var string|null */ protected $name; /** * Name of the volume driver used by the volume. * - * @var string + * @var string|null */ protected $driver; /** * Mount path of the volume on the host. * - * @var string + * @var string|null */ protected $mountpoint; /** * Date/Time the volume was created. * - * @var string + * @var string|null */ protected $createdAt; /** * Low-level details about the volume, provided by the volume driver. - Details are returned as a map with key/value pairs: - `{"key":"value","key2":"value2"}`. - - The `Status` field is optional, and is omitted if the volume driver - does not support this feature. - + * Details are returned as a map with key/value pairs: + * `{"key":"value","key2":"value2"}`. + * + * The `Status` field is optional, and is omitted if the volume driver + * does not support this feature. * - * @var mixed[] + * @var array|null */ protected $status; /** * User-defined key/value metadata. * - * @var string[] + * @var array|null */ protected $labels; /** - * The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level. + * The level at which the volume exists. Either `global` for cluster-wide, + * or `local` for machine level. + * + * @var string|null + */ + protected $scope = 'local'; + /** + * Options and information specific to, and only present on, Swarm CSI + * cluster volumes. * - * @var string + * @var ClusterVolume|null */ - protected $scope; + protected $clusterVolume; /** * The driver specific options used when creating the volume. * - * @var string[] + * @var array|null */ protected $options; /** - * Usage details about the volume. This information is used by the. - `GET /system/df` endpoint, and omitted in other endpoints. - + * Usage details about the volume. This information is used by the + * `GET /system/df` endpoint, and omitted in other endpoints. * - * @var VolumeUsageData + * @var VolumeUsageData|null */ protected $usageData; /** * Name of the volume. - * - * @return string */ public function getName(): ?string { @@ -87,13 +94,10 @@ public function getName(): ?string /** * Name of the volume. - * - * @param string $name - * - * @return self */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -101,8 +105,6 @@ public function setName(?string $name): self /** * Name of the volume driver used by the volume. - * - * @return string */ public function getDriver(): ?string { @@ -111,13 +113,10 @@ public function getDriver(): ?string /** * Name of the volume driver used by the volume. - * - * @param string $driver - * - * @return self */ public function setDriver(?string $driver): self { + $this->initialized['driver'] = true; $this->driver = $driver; return $this; @@ -125,8 +124,6 @@ public function setDriver(?string $driver): self /** * Mount path of the volume on the host. - * - * @return string */ public function getMountpoint(): ?string { @@ -135,13 +132,10 @@ public function getMountpoint(): ?string /** * Mount path of the volume on the host. - * - * @param string $mountpoint - * - * @return self */ public function setMountpoint(?string $mountpoint): self { + $this->initialized['mountpoint'] = true; $this->mountpoint = $mountpoint; return $this; @@ -149,8 +143,6 @@ public function setMountpoint(?string $mountpoint): self /** * Date/Time the volume was created. - * - * @return string */ public function getCreatedAt(): ?string { @@ -159,13 +151,10 @@ public function getCreatedAt(): ?string /** * Date/Time the volume was created. - * - * @param string $createdAt - * - * @return self */ public function setCreatedAt(?string $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -173,35 +162,32 @@ public function setCreatedAt(?string $createdAt): self /** * Low-level details about the volume, provided by the volume driver. - Details are returned as a map with key/value pairs: - `{"key":"value","key2":"value2"}`. - - The `Status` field is optional, and is omitted if the volume driver - does not support this feature. - + * Details are returned as a map with key/value pairs: + * `{"key":"value","key2":"value2"}`. + * + * The `Status` field is optional, and is omitted if the volume driver + * does not support this feature. * - * @return mixed[] + * @return array|null */ - public function getStatus(): ?\ArrayObject + public function getStatus(): ?iterable { return $this->status; } /** * Low-level details about the volume, provided by the volume driver. - Details are returned as a map with key/value pairs: - `{"key":"value","key2":"value2"}`. - - The `Status` field is optional, and is omitted if the volume driver - does not support this feature. - + * Details are returned as a map with key/value pairs: + * `{"key":"value","key2":"value2"}`. * - * @param mixed[] $status + * The `Status` field is optional, and is omitted if the volume driver + * does not support this feature. * - * @return self + * @param array|null $status */ - public function setStatus(?\ArrayObject $status): self + public function setStatus(?iterable $status): self { + $this->initialized['status'] = true; $this->status = $status; return $this; @@ -210,9 +196,9 @@ public function setStatus(?\ArrayObject $status): self /** * User-defined key/value metadata. * - * @return string[] + * @return array|null */ - public function getLabels(): ?\ArrayObject + public function getLabels(): ?iterable { return $this->labels; } @@ -220,21 +206,19 @@ public function getLabels(): ?\ArrayObject /** * User-defined key/value metadata. * - * @param string[] $labels - * - * @return self + * @param array|null $labels */ - public function setLabels(?\ArrayObject $labels): self + public function setLabels(?iterable $labels): self { + $this->initialized['labels'] = true; $this->labels = $labels; return $this; } /** - * The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level. - * - * @return string + * The level at which the volume exists. Either `global` for cluster-wide, + * or `local` for machine level. */ public function getScope(): ?string { @@ -242,25 +226,44 @@ public function getScope(): ?string } /** - * The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level. - * - * @param string $scope - * - * @return self + * The level at which the volume exists. Either `global` for cluster-wide, + * or `local` for machine level. */ public function setScope(?string $scope): self { + $this->initialized['scope'] = true; $this->scope = $scope; return $this; } + /** + * Options and information specific to, and only present on, Swarm CSI + * cluster volumes. + */ + public function getClusterVolume(): ?ClusterVolume + { + return $this->clusterVolume; + } + + /** + * Options and information specific to, and only present on, Swarm CSI + * cluster volumes. + */ + public function setClusterVolume(?ClusterVolume $clusterVolume): self + { + $this->initialized['clusterVolume'] = true; + $this->clusterVolume = $clusterVolume; + + return $this; + } + /** * The driver specific options used when creating the volume. * - * @return string[] + * @return array|null */ - public function getOptions(): ?\ArrayObject + public function getOptions(): ?iterable { return $this->options; } @@ -268,23 +271,19 @@ public function getOptions(): ?\ArrayObject /** * The driver specific options used when creating the volume. * - * @param string[] $options - * - * @return self + * @param array|null $options */ - public function setOptions(?\ArrayObject $options): self + public function setOptions(?iterable $options): self { + $this->initialized['options'] = true; $this->options = $options; return $this; } /** - * Usage details about the volume. This information is used by the. - `GET /system/df` endpoint, and omitted in other endpoints. - - * - * @return VolumeUsageData + * Usage details about the volume. This information is used by the + * `GET /system/df` endpoint, and omitted in other endpoints. */ public function getUsageData(): ?VolumeUsageData { @@ -292,16 +291,12 @@ public function getUsageData(): ?VolumeUsageData } /** - * Usage details about the volume. This information is used by the. - `GET /system/df` endpoint, and omitted in other endpoints. - - * - * @param VolumeUsageData $usageData - * - * @return self + * Usage details about the volume. This information is used by the + * `GET /system/df` endpoint, and omitted in other endpoints. */ public function setUsageData(?VolumeUsageData $usageData): self { + $this->initialized['usageData'] = true; $this->usageData = $usageData; return $this; diff --git a/src/Model/VolumeCreateOptions.php b/src/Model/VolumeCreateOptions.php new file mode 100644 index 00000000..0cc7ba34 --- /dev/null +++ b/src/Model/VolumeCreateOptions.php @@ -0,0 +1,154 @@ +initialized); + } + /** + * The new volume's name. If not specified, Docker generates a name. + * + * @var string|null + */ + protected $name; + /** + * Name of the volume driver to use. + * + * @var string|null + */ + protected $driver = 'local'; + /** + * A mapping of driver options and values. These options are + * passed directly to the driver and are driver specific. + * + * @var array|null + */ + protected $driverOpts; + /** + * User-defined key/value metadata. + * + * @var array|null + */ + protected $labels; + /** + * Cluster-specific options used to create the volume. + * + * @var ClusterVolumeSpec|null + */ + protected $clusterVolumeSpec; + + /** + * The new volume's name. If not specified, Docker generates a name. + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * The new volume's name. If not specified, Docker generates a name. + */ + public function setName(?string $name): self + { + $this->initialized['name'] = true; + $this->name = $name; + + return $this; + } + + /** + * Name of the volume driver to use. + */ + public function getDriver(): ?string + { + return $this->driver; + } + + /** + * Name of the volume driver to use. + */ + public function setDriver(?string $driver): self + { + $this->initialized['driver'] = true; + $this->driver = $driver; + + return $this; + } + + /** + * A mapping of driver options and values. These options are + * passed directly to the driver and are driver specific. + * + * @return array|null + */ + public function getDriverOpts(): ?iterable + { + return $this->driverOpts; + } + + /** + * A mapping of driver options and values. These options are + * passed directly to the driver and are driver specific. + * + * @param array|null $driverOpts + */ + public function setDriverOpts(?iterable $driverOpts): self + { + $this->initialized['driverOpts'] = true; + $this->driverOpts = $driverOpts; + + return $this; + } + + /** + * User-defined key/value metadata. + * + * @return array|null + */ + public function getLabels(): ?iterable + { + return $this->labels; + } + + /** + * User-defined key/value metadata. + * + * @param array|null $labels + */ + public function setLabels(?iterable $labels): self + { + $this->initialized['labels'] = true; + $this->labels = $labels; + + return $this; + } + + /** + * Cluster-specific options used to create the volume. + */ + public function getClusterVolumeSpec(): ?ClusterVolumeSpec + { + return $this->clusterVolumeSpec; + } + + /** + * Cluster-specific options used to create the volume. + */ + public function setClusterVolumeSpec(?ClusterVolumeSpec $clusterVolumeSpec): self + { + $this->initialized['clusterVolumeSpec'] = true; + $this->clusterVolumeSpec = $clusterVolumeSpec; + + return $this; + } +} diff --git a/src/Model/VolumesGetResponse200.php b/src/Model/VolumeListResponse.php similarity index 63% rename from src/Model/VolumesGetResponse200.php rename to src/Model/VolumeListResponse.php index 25f09825..52f83952 100644 --- a/src/Model/VolumesGetResponse200.php +++ b/src/Model/VolumeListResponse.php @@ -2,33 +2,36 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class VolumesGetResponse200 +class VolumeListResponse extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * List of volumes. * - * @var Volume[] + * @var list|null */ protected $volumes; /** * Warnings that occurred when fetching the list of volumes. * - * @var string[] + * @var list|null */ protected $warnings; /** * List of volumes. * - * @return Volume[] + * @return list|null */ public function getVolumes(): ?array { @@ -38,12 +41,11 @@ public function getVolumes(): ?array /** * List of volumes. * - * @param Volume[] $volumes - * - * @return self + * @param list|null $volumes */ public function setVolumes(?array $volumes): self { + $this->initialized['volumes'] = true; $this->volumes = $volumes; return $this; @@ -52,7 +54,7 @@ public function setVolumes(?array $volumes): self /** * Warnings that occurred when fetching the list of volumes. * - * @return string[] + * @return list|null */ public function getWarnings(): ?array { @@ -62,12 +64,11 @@ public function getWarnings(): ?array /** * Warnings that occurred when fetching the list of volumes. * - * @param string[] $warnings - * - * @return self + * @param list|null $warnings */ public function setWarnings(?array $warnings): self { + $this->initialized['warnings'] = true; $this->warnings = $warnings; return $this; diff --git a/src/Model/VolumeStatusItem.php b/src/Model/VolumeStatusItem.php new file mode 100644 index 00000000..fbfd2212 --- /dev/null +++ b/src/Model/VolumeStatusItem.php @@ -0,0 +1,18 @@ +initialized); + } +} diff --git a/src/Model/VolumeUsageData.php b/src/Model/VolumeUsageData.php index d33f8190..09fb2d8d 100644 --- a/src/Model/VolumeUsageData.php +++ b/src/Model/VolumeUsageData.php @@ -2,43 +2,41 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class VolumeUsageData +class VolumeUsageData extends \ArrayObject { /** - * Amount of disk space used by the volume (in bytes). This information. - is only available for volumes created with the `"local"` volume - driver. For volumes created with other volume drivers, this field - is set to `-1` ("not available") + * @var array + */ + protected $initialized = []; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** + * Amount of disk space used by the volume (in bytes). This information + * is only available for volumes created with the `"local"` volume + * driver. For volumes created with other volume drivers, this field + * is set to `-1` ("not available"). * - * @var int + * @var int|null */ - protected $size; + protected $size = -1; /** - * The number of containers referencing this volume. This field. - is set to `-1` if the reference-count is not available. - + * The number of containers referencing this volume. This field + * is set to `-1` if the reference-count is not available. * - * @var int + * @var int|null */ - protected $refCount; + protected $refCount = -1; /** - * Amount of disk space used by the volume (in bytes). This information. - is only available for volumes created with the `"local"` volume - driver. For volumes created with other volume drivers, this field - is set to `-1` ("not available") - - * - * @return int + * Amount of disk space used by the volume (in bytes). This information + * is only available for volumes created with the `"local"` volume + * driver. For volumes created with other volume drivers, this field + * is set to `-1` ("not available"). */ public function getSize(): ?int { @@ -46,29 +44,22 @@ public function getSize(): ?int } /** - * Amount of disk space used by the volume (in bytes). This information. - is only available for volumes created with the `"local"` volume - driver. For volumes created with other volume drivers, this field - is set to `-1` ("not available") - - * - * @param int $size - * - * @return self + * Amount of disk space used by the volume (in bytes). This information + * is only available for volumes created with the `"local"` volume + * driver. For volumes created with other volume drivers, this field + * is set to `-1` ("not available"). */ public function setSize(?int $size): self { + $this->initialized['size'] = true; $this->size = $size; return $this; } /** - * The number of containers referencing this volume. This field. - is set to `-1` if the reference-count is not available. - - * - * @return int + * The number of containers referencing this volume. This field + * is set to `-1` if the reference-count is not available. */ public function getRefCount(): ?int { @@ -76,16 +67,12 @@ public function getRefCount(): ?int } /** - * The number of containers referencing this volume. This field. - is set to `-1` if the reference-count is not available. - - * - * @param int $refCount - * - * @return self + * The number of containers referencing this volume. This field + * is set to `-1` if the reference-count is not available. */ public function setRefCount(?int $refCount): self { + $this->initialized['refCount'] = true; $this->refCount = $refCount; return $this; diff --git a/src/Model/VolumesCreatePostBody.php b/src/Model/VolumesCreatePostBody.php deleted file mode 100644 index 3b7ad484..00000000 --- a/src/Model/VolumesCreatePostBody.php +++ /dev/null @@ -1,135 +0,0 @@ -name; - } - - /** - * The new volume's name. If not specified, Docker generates a name. - * - * @param string $name - * - * @return self - */ - public function setName(?string $name): self - { - $this->name = $name; - - return $this; - } - - /** - * Name of the volume driver to use. - * - * @return string - */ - public function getDriver(): ?string - { - return $this->driver; - } - - /** - * Name of the volume driver to use. - * - * @param string $driver - * - * @return self - */ - public function setDriver(?string $driver): self - { - $this->driver = $driver; - - return $this; - } - - /** - * A mapping of driver options and values. These options are passed directly to the driver and are driver specific. - * - * @return string[] - */ - public function getDriverOpts(): ?\ArrayObject - { - return $this->driverOpts; - } - - /** - * A mapping of driver options and values. These options are passed directly to the driver and are driver specific. - * - * @param string[] $driverOpts - * - * @return self - */ - public function setDriverOpts(?\ArrayObject $driverOpts): self - { - $this->driverOpts = $driverOpts; - - return $this; - } - - /** - * User-defined key/value metadata. - * - * @return string[] - */ - public function getLabels(): ?\ArrayObject - { - return $this->labels; - } - - /** - * User-defined key/value metadata. - * - * @param string[] $labels - * - * @return self - */ - public function setLabels(?\ArrayObject $labels): self - { - $this->labels = $labels; - - return $this; - } -} diff --git a/src/Model/VolumesNamePutBody.php b/src/Model/VolumesNamePutBody.php new file mode 100644 index 00000000..b4820e68 --- /dev/null +++ b/src/Model/VolumesNamePutBody.php @@ -0,0 +1,43 @@ +initialized); + } + /** + * Cluster-specific options used to create the volume. + * + * @var ClusterVolumeSpec|null + */ + protected $spec; + + /** + * Cluster-specific options used to create the volume. + */ + public function getSpec(): ?ClusterVolumeSpec + { + return $this->spec; + } + + /** + * Cluster-specific options used to create the volume. + */ + public function setSpec(?ClusterVolumeSpec $spec): self + { + $this->initialized['spec'] = true; + $this->spec = $spec; + + return $this; + } +} diff --git a/src/Model/VolumesPrunePostResponse200.php b/src/Model/VolumesPrunePostResponse200.php index f0456883..46a8dc2a 100644 --- a/src/Model/VolumesPrunePostResponse200.php +++ b/src/Model/VolumesPrunePostResponse200.php @@ -2,33 +2,36 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Model; -class VolumesPrunePostResponse200 +class VolumesPrunePostResponse200 extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } /** * Volumes that were deleted. * - * @var string[] + * @var list|null */ protected $volumesDeleted; /** * Disk space reclaimed in bytes. * - * @var int + * @var int|null */ protected $spaceReclaimed; /** * Volumes that were deleted. * - * @return string[] + * @return list|null */ public function getVolumesDeleted(): ?array { @@ -38,12 +41,11 @@ public function getVolumesDeleted(): ?array /** * Volumes that were deleted. * - * @param string[] $volumesDeleted - * - * @return self + * @param list|null $volumesDeleted */ public function setVolumesDeleted(?array $volumesDeleted): self { + $this->initialized['volumesDeleted'] = true; $this->volumesDeleted = $volumesDeleted; return $this; @@ -51,8 +53,6 @@ public function setVolumesDeleted(?array $volumesDeleted): self /** * Disk space reclaimed in bytes. - * - * @return int */ public function getSpaceReclaimed(): ?int { @@ -61,13 +61,10 @@ public function getSpaceReclaimed(): ?int /** * Disk space reclaimed in bytes. - * - * @param int $spaceReclaimed - * - * @return self */ public function setSpaceReclaimed(?int $spaceReclaimed): self { + $this->initialized['spaceReclaimed'] = true; $this->spaceReclaimed = $spaceReclaimed; return $this; diff --git a/src/Normalizer/AddressNormalizer.php b/src/Normalizer/AddressNormalizer.php index 4d3c81ef..6499fba8 100644 --- a/src/Normalizer/AddressNormalizer.php +++ b/src/Normalizer/AddressNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class AddressNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Address'; + return \Docker\API\Model\Address::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Address; + return \is_object($data) && \Docker\API\Model\Address::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\Address(); - if (property_exists($data, 'Addr') && $data->{'Addr'} !== null) { - $object->setAddr($data->{'Addr'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Addr', $data) && null !== $data['Addr']) { + $object->setAddr($data['Addr']); + unset($data['Addr']); + } elseif (\array_key_exists('Addr', $data) && null === $data['Addr']) { + $object->setAddr(null); + } + if (\array_key_exists('PrefixLen', $data) && null !== $data['PrefixLen']) { + $object->setPrefixLen($data['PrefixLen']); + unset($data['PrefixLen']); + } elseif (\array_key_exists('PrefixLen', $data) && null === $data['PrefixLen']) { + $object->setPrefixLen(null); } - if (property_exists($data, 'PrefixLen') && $data->{'PrefixLen'} !== null) { - $object->setPrefixLen($data->{'PrefixLen'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getAddr()) { - $data->{'Addr'} = $object->getAddr(); + $dataArray = []; + if ($data->isInitialized('addr') && null !== $data->getAddr()) { + $dataArray['Addr'] = $data->getAddr(); } - if (null !== $object->getPrefixLen()) { - $data->{'PrefixLen'} = $object->getPrefixLen(); + if ($data->isInitialized('prefixLen') && null !== $data->getPrefixLen()) { + $dataArray['PrefixLen'] = $data->getPrefixLen(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Address::class => false]; } } diff --git a/src/Normalizer/AuthConfigNormalizer.php b/src/Normalizer/AuthConfigNormalizer.php index 5ed0f80f..882c6660 100644 --- a/src/Normalizer/AuthConfigNormalizer.php +++ b/src/Normalizer/AuthConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,57 +16,92 @@ class AuthConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\AuthConfig'; + return \Docker\API\Model\AuthConfig::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\AuthConfig; + return \is_object($data) && \Docker\API\Model\AuthConfig::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\AuthConfig(); - if (property_exists($data, 'username') && $data->{'username'} !== null) { - $object->setUsername($data->{'username'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('username', $data) && null !== $data['username']) { + $object->setUsername($data['username']); + unset($data['username']); + } elseif (\array_key_exists('username', $data) && null === $data['username']) { + $object->setUsername(null); + } + if (\array_key_exists('password', $data) && null !== $data['password']) { + $object->setPassword($data['password']); + unset($data['password']); + } elseif (\array_key_exists('password', $data) && null === $data['password']) { + $object->setPassword(null); } - if (property_exists($data, 'password') && $data->{'password'} !== null) { - $object->setPassword($data->{'password'}); + if (\array_key_exists('email', $data) && null !== $data['email']) { + $object->setEmail($data['email']); + unset($data['email']); + } elseif (\array_key_exists('email', $data) && null === $data['email']) { + $object->setEmail(null); } - if (property_exists($data, 'email') && $data->{'email'} !== null) { - $object->setEmail($data->{'email'}); + if (\array_key_exists('serveraddress', $data) && null !== $data['serveraddress']) { + $object->setServeraddress($data['serveraddress']); + unset($data['serveraddress']); + } elseif (\array_key_exists('serveraddress', $data) && null === $data['serveraddress']) { + $object->setServeraddress(null); } - if (property_exists($data, 'serveraddress') && $data->{'serveraddress'} !== null) { - $object->setServeraddress($data->{'serveraddress'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getUsername()) { - $data->{'username'} = $object->getUsername(); + $dataArray = []; + if ($data->isInitialized('username') && null !== $data->getUsername()) { + $dataArray['username'] = $data->getUsername(); } - if (null !== $object->getPassword()) { - $data->{'password'} = $object->getPassword(); + if ($data->isInitialized('password') && null !== $data->getPassword()) { + $dataArray['password'] = $data->getPassword(); } - if (null !== $object->getEmail()) { - $data->{'email'} = $object->getEmail(); + if ($data->isInitialized('email') && null !== $data->getEmail()) { + $dataArray['email'] = $data->getEmail(); } - if (null !== $object->getServeraddress()) { - $data->{'serveraddress'} = $object->getServeraddress(); + if ($data->isInitialized('serveraddress') && null !== $data->getServeraddress()) { + $dataArray['serveraddress'] = $data->getServeraddress(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\AuthConfig::class => false]; } } diff --git a/src/Normalizer/AuthPostResponse200Normalizer.php b/src/Normalizer/AuthPostResponse200Normalizer.php index e5031ff4..69b2e4d2 100644 --- a/src/Normalizer/AuthPostResponse200Normalizer.php +++ b/src/Normalizer/AuthPostResponse200Normalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,72 @@ class AuthPostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\AuthPostResponse200'; + return \Docker\API\Model\AuthPostResponse200::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\AuthPostResponse200; + return \is_object($data) && \Docker\API\Model\AuthPostResponse200::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\AuthPostResponse200(); - if (property_exists($data, 'Status') && $data->{'Status'} !== null) { - $object->setStatus($data->{'Status'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Status', $data) && null !== $data['Status']) { + $object->setStatus($data['Status']); + unset($data['Status']); + } elseif (\array_key_exists('Status', $data) && null === $data['Status']) { + $object->setStatus(null); + } + if (\array_key_exists('IdentityToken', $data) && null !== $data['IdentityToken']) { + $object->setIdentityToken($data['IdentityToken']); + unset($data['IdentityToken']); + } elseif (\array_key_exists('IdentityToken', $data) && null === $data['IdentityToken']) { + $object->setIdentityToken(null); } - if (property_exists($data, 'IdentityToken') && $data->{'IdentityToken'} !== null) { - $object->setIdentityToken($data->{'IdentityToken'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getStatus()) { - $data->{'Status'} = $object->getStatus(); + $dataArray = []; + $dataArray['Status'] = $data->getStatus(); + if ($data->isInitialized('identityToken') && null !== $data->getIdentityToken()) { + $dataArray['IdentityToken'] = $data->getIdentityToken(); } - if (null !== $object->getIdentityToken()) { - $data->{'IdentityToken'} = $object->getIdentityToken(); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\AuthPostResponse200::class => false]; } } diff --git a/src/Normalizer/BuildCacheNormalizer.php b/src/Normalizer/BuildCacheNormalizer.php new file mode 100644 index 00000000..cf83c441 --- /dev/null +++ b/src/Normalizer/BuildCacheNormalizer.php @@ -0,0 +1,184 @@ +setID($data['ID']); + unset($data['ID']); + } elseif (\array_key_exists('ID', $data) && null === $data['ID']) { + $object->setID(null); + } + if (\array_key_exists('Parent', $data) && null !== $data['Parent']) { + $object->setParent($data['Parent']); + unset($data['Parent']); + } elseif (\array_key_exists('Parent', $data) && null === $data['Parent']) { + $object->setParent(null); + } + if (\array_key_exists('Parents', $data) && null !== $data['Parents']) { + $values = []; + foreach ($data['Parents'] as $value) { + $values[] = $value; + } + $object->setParents($values); + unset($data['Parents']); + } elseif (\array_key_exists('Parents', $data) && null === $data['Parents']) { + $object->setParents(null); + } + if (\array_key_exists('Type', $data) && null !== $data['Type']) { + $object->setType($data['Type']); + unset($data['Type']); + } elseif (\array_key_exists('Type', $data) && null === $data['Type']) { + $object->setType(null); + } + if (\array_key_exists('Description', $data) && null !== $data['Description']) { + $object->setDescription($data['Description']); + unset($data['Description']); + } elseif (\array_key_exists('Description', $data) && null === $data['Description']) { + $object->setDescription(null); + } + if (\array_key_exists('InUse', $data) && null !== $data['InUse']) { + $object->setInUse($data['InUse']); + unset($data['InUse']); + } elseif (\array_key_exists('InUse', $data) && null === $data['InUse']) { + $object->setInUse(null); + } + if (\array_key_exists('Shared', $data) && null !== $data['Shared']) { + $object->setShared($data['Shared']); + unset($data['Shared']); + } elseif (\array_key_exists('Shared', $data) && null === $data['Shared']) { + $object->setShared(null); + } + if (\array_key_exists('Size', $data) && null !== $data['Size']) { + $object->setSize($data['Size']); + unset($data['Size']); + } elseif (\array_key_exists('Size', $data) && null === $data['Size']) { + $object->setSize(null); + } + if (\array_key_exists('CreatedAt', $data) && null !== $data['CreatedAt']) { + $object->setCreatedAt($data['CreatedAt']); + unset($data['CreatedAt']); + } elseif (\array_key_exists('CreatedAt', $data) && null === $data['CreatedAt']) { + $object->setCreatedAt(null); + } + if (\array_key_exists('LastUsedAt', $data) && null !== $data['LastUsedAt']) { + $object->setLastUsedAt($data['LastUsedAt']); + unset($data['LastUsedAt']); + } elseif (\array_key_exists('LastUsedAt', $data) && null === $data['LastUsedAt']) { + $object->setLastUsedAt(null); + } + if (\array_key_exists('UsageCount', $data) && null !== $data['UsageCount']) { + $object->setUsageCount($data['UsageCount']); + unset($data['UsageCount']); + } elseif (\array_key_exists('UsageCount', $data) && null === $data['UsageCount']) { + $object->setUsageCount(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('iD') && null !== $data->getID()) { + $dataArray['ID'] = $data->getID(); + } + if ($data->isInitialized('parent') && null !== $data->getParent()) { + $dataArray['Parent'] = $data->getParent(); + } + if ($data->isInitialized('parents') && null !== $data->getParents()) { + $values = []; + foreach ($data->getParents() as $value) { + $values[] = $value; + } + $dataArray['Parents'] = $values; + } + if ($data->isInitialized('type') && null !== $data->getType()) { + $dataArray['Type'] = $data->getType(); + } + if ($data->isInitialized('description') && null !== $data->getDescription()) { + $dataArray['Description'] = $data->getDescription(); + } + if ($data->isInitialized('inUse') && null !== $data->getInUse()) { + $dataArray['InUse'] = $data->getInUse(); + } + if ($data->isInitialized('shared') && null !== $data->getShared()) { + $dataArray['Shared'] = $data->getShared(); + } + if ($data->isInitialized('size') && null !== $data->getSize()) { + $dataArray['Size'] = $data->getSize(); + } + if ($data->isInitialized('createdAt') && null !== $data->getCreatedAt()) { + $dataArray['CreatedAt'] = $data->getCreatedAt(); + } + if ($data->isInitialized('lastUsedAt') && null !== $data->getLastUsedAt()) { + $dataArray['LastUsedAt'] = $data->getLastUsedAt(); + } + if ($data->isInitialized('usageCount') && null !== $data->getUsageCount()) { + $dataArray['UsageCount'] = $data->getUsageCount(); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\BuildCache::class => false]; + } +} diff --git a/src/Normalizer/BuildInfoNormalizer.php b/src/Normalizer/BuildInfoNormalizer.php index f6901a7b..c902ed64 100644 --- a/src/Normalizer/BuildInfoNormalizer.php +++ b/src/Normalizer/BuildInfoNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,81 +16,128 @@ class BuildInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\BuildInfo'; + return \Docker\API\Model\BuildInfo::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\BuildInfo; + return \is_object($data) && \Docker\API\Model\BuildInfo::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\BuildInfo(); - if (property_exists($data, 'id') && $data->{'id'} !== null) { - $object->setId($data->{'id'}); - } - if (property_exists($data, 'stream') && $data->{'stream'} !== null) { - $object->setStream($data->{'stream'}); - } - if (property_exists($data, 'error') && $data->{'error'} !== null) { - $object->setError($data->{'error'}); - } - if (property_exists($data, 'errorDetail') && $data->{'errorDetail'} !== null) { - $object->setErrorDetail($this->denormalizer->denormalize($data->{'errorDetail'}, 'Docker\\API\\Model\\ErrorDetail', 'json', $context)); - } - if (property_exists($data, 'status') && $data->{'status'} !== null) { - $object->setStatus($data->{'status'}); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'progress') && $data->{'progress'} !== null) { - $object->setProgress($data->{'progress'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'progressDetail') && $data->{'progressDetail'} !== null) { - $object->setProgressDetail($this->denormalizer->denormalize($data->{'progressDetail'}, 'Docker\\API\\Model\\ProgressDetail', 'json', $context)); - } - if (property_exists($data, 'aux') && $data->{'aux'} !== null) { - $object->setAux($this->denormalizer->denormalize($data->{'aux'}, 'Docker\\API\\Model\\ImageID', 'json', $context)); + $object = new \Docker\API\Model\BuildInfo(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('stream', $data) && null !== $data['stream']) { + $object->setStream($data['stream']); + unset($data['stream']); + } elseif (\array_key_exists('stream', $data) && null === $data['stream']) { + $object->setStream(null); + } + if (\array_key_exists('error', $data) && null !== $data['error']) { + $object->setError($data['error']); + unset($data['error']); + } elseif (\array_key_exists('error', $data) && null === $data['error']) { + $object->setError(null); + } + if (\array_key_exists('errorDetail', $data) && null !== $data['errorDetail']) { + $object->setErrorDetail($this->denormalizer->denormalize($data['errorDetail'], \Docker\API\Model\ErrorDetail::class, 'json', $context)); + unset($data['errorDetail']); + } elseif (\array_key_exists('errorDetail', $data) && null === $data['errorDetail']) { + $object->setErrorDetail(null); + } + if (\array_key_exists('status', $data) && null !== $data['status']) { + $object->setStatus($data['status']); + unset($data['status']); + } elseif (\array_key_exists('status', $data) && null === $data['status']) { + $object->setStatus(null); + } + if (\array_key_exists('progress', $data) && null !== $data['progress']) { + $object->setProgress($data['progress']); + unset($data['progress']); + } elseif (\array_key_exists('progress', $data) && null === $data['progress']) { + $object->setProgress(null); + } + if (\array_key_exists('progressDetail', $data) && null !== $data['progressDetail']) { + $object->setProgressDetail($this->denormalizer->denormalize($data['progressDetail'], \Docker\API\Model\ProgressDetail::class, 'json', $context)); + unset($data['progressDetail']); + } elseif (\array_key_exists('progressDetail', $data) && null === $data['progressDetail']) { + $object->setProgressDetail(null); + } + if (\array_key_exists('aux', $data) && null !== $data['aux']) { + $object->setAux($this->denormalizer->denormalize($data['aux'], \Docker\API\Model\ImageID::class, 'json', $context)); + unset($data['aux']); + } elseif (\array_key_exists('aux', $data) && null === $data['aux']) { + $object->setAux(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'id'} = $object->getId(); + $dataArray = []; + if ($data->isInitialized('id') && null !== $data->getId()) { + $dataArray['id'] = $data->getId(); + } + if ($data->isInitialized('stream') && null !== $data->getStream()) { + $dataArray['stream'] = $data->getStream(); } - if (null !== $object->getStream()) { - $data->{'stream'} = $object->getStream(); + if ($data->isInitialized('error') && null !== $data->getError()) { + $dataArray['error'] = $data->getError(); } - if (null !== $object->getError()) { - $data->{'error'} = $object->getError(); + if ($data->isInitialized('errorDetail') && null !== $data->getErrorDetail()) { + $dataArray['errorDetail'] = $this->normalizer->normalize($data->getErrorDetail(), 'json', $context); } - if (null !== $object->getErrorDetail()) { - $data->{'errorDetail'} = $this->normalizer->normalize($object->getErrorDetail(), 'json', $context); + if ($data->isInitialized('status') && null !== $data->getStatus()) { + $dataArray['status'] = $data->getStatus(); } - if (null !== $object->getStatus()) { - $data->{'status'} = $object->getStatus(); + if ($data->isInitialized('progress') && null !== $data->getProgress()) { + $dataArray['progress'] = $data->getProgress(); } - if (null !== $object->getProgress()) { - $data->{'progress'} = $object->getProgress(); + if ($data->isInitialized('progressDetail') && null !== $data->getProgressDetail()) { + $dataArray['progressDetail'] = $this->normalizer->normalize($data->getProgressDetail(), 'json', $context); } - if (null !== $object->getProgressDetail()) { - $data->{'progressDetail'} = $this->normalizer->normalize($object->getProgressDetail(), 'json', $context); + if ($data->isInitialized('aux') && null !== $data->getAux()) { + $dataArray['aux'] = $this->normalizer->normalize($data->getAux(), 'json', $context); } - if (null !== $object->getAux()) { - $data->{'aux'} = $this->normalizer->normalize($object->getAux(), 'json', $context); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\BuildInfo::class => false]; } } diff --git a/src/Normalizer/BuildPrunePostResponse200Normalizer.php b/src/Normalizer/BuildPrunePostResponse200Normalizer.php index 66f8a476..c3deb102 100644 --- a/src/Normalizer/BuildPrunePostResponse200Normalizer.php +++ b/src/Normalizer/BuildPrunePostResponse200Normalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,39 +16,82 @@ class BuildPrunePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\BuildPrunePostResponse200'; + return \Docker\API\Model\BuildPrunePostResponse200::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\BuildPrunePostResponse200; + return \is_object($data) && \Docker\API\Model\BuildPrunePostResponse200::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\BuildPrunePostResponse200(); - if (property_exists($data, 'SpaceReclaimed') && $data->{'SpaceReclaimed'} !== null) { - $object->setSpaceReclaimed($data->{'SpaceReclaimed'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CachesDeleted', $data) && null !== $data['CachesDeleted']) { + $values = []; + foreach ($data['CachesDeleted'] as $value) { + $values[] = $value; + } + $object->setCachesDeleted($values); + unset($data['CachesDeleted']); + } elseif (\array_key_exists('CachesDeleted', $data) && null === $data['CachesDeleted']) { + $object->setCachesDeleted(null); + } + if (\array_key_exists('SpaceReclaimed', $data) && null !== $data['SpaceReclaimed']) { + $object->setSpaceReclaimed($data['SpaceReclaimed']); + unset($data['SpaceReclaimed']); + } elseif (\array_key_exists('SpaceReclaimed', $data) && null === $data['SpaceReclaimed']) { + $object->setSpaceReclaimed(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getSpaceReclaimed()) { - $data->{'SpaceReclaimed'} = $object->getSpaceReclaimed(); + $dataArray = []; + if ($data->isInitialized('cachesDeleted') && null !== $data->getCachesDeleted()) { + $values = []; + foreach ($data->getCachesDeleted() as $value) { + $values[] = $value; + } + $dataArray['CachesDeleted'] = $values; + } + if ($data->isInitialized('spaceReclaimed') && null !== $data->getSpaceReclaimed()) { + $dataArray['SpaceReclaimed'] = $data->getSpaceReclaimed(); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\BuildPrunePostResponse200::class => false]; } } diff --git a/src/Normalizer/ClusterInfoNormalizer.php b/src/Normalizer/ClusterInfoNormalizer.php index efd2f622..17567346 100644 --- a/src/Normalizer/ClusterInfoNormalizer.php +++ b/src/Normalizer/ClusterInfoNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,75 +16,157 @@ class ClusterInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ClusterInfo'; + return \Docker\API\Model\ClusterInfo::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ClusterInfo; + return \is_object($data) && \Docker\API\Model\ClusterInfo::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ClusterInfo(); - if (property_exists($data, 'ID') && $data->{'ID'} !== null) { - $object->setID($data->{'ID'}); + if (\array_key_exists('RootRotationInProgress', $data) && \is_int($data['RootRotationInProgress'])) { + $data['RootRotationInProgress'] = (bool) $data['RootRotationInProgress']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && null !== $data['ID']) { + $object->setID($data['ID']); + unset($data['ID']); + } elseif (\array_key_exists('ID', $data) && null === $data['ID']) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && null !== $data['Version']) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + unset($data['Version']); + } elseif (\array_key_exists('Version', $data) && null === $data['Version']) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && null !== $data['CreatedAt']) { + $object->setCreatedAt($data['CreatedAt']); + unset($data['CreatedAt']); + } elseif (\array_key_exists('CreatedAt', $data) && null === $data['CreatedAt']) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && null !== $data['UpdatedAt']) { + $object->setUpdatedAt($data['UpdatedAt']); + unset($data['UpdatedAt']); + } elseif (\array_key_exists('UpdatedAt', $data) && null === $data['UpdatedAt']) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && null !== $data['Spec']) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\SwarmSpec::class, 'json', $context)); + unset($data['Spec']); + } elseif (\array_key_exists('Spec', $data) && null === $data['Spec']) { + $object->setSpec(null); } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($this->denormalizer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); + if (\array_key_exists('TLSInfo', $data) && null !== $data['TLSInfo']) { + $object->setTLSInfo($this->denormalizer->denormalize($data['TLSInfo'], \Docker\API\Model\TLSInfo::class, 'json', $context)); + unset($data['TLSInfo']); + } elseif (\array_key_exists('TLSInfo', $data) && null === $data['TLSInfo']) { + $object->setTLSInfo(null); } - if (property_exists($data, 'CreatedAt') && $data->{'CreatedAt'} !== null) { - $object->setCreatedAt($data->{'CreatedAt'}); + if (\array_key_exists('RootRotationInProgress', $data) && null !== $data['RootRotationInProgress']) { + $object->setRootRotationInProgress($data['RootRotationInProgress']); + unset($data['RootRotationInProgress']); + } elseif (\array_key_exists('RootRotationInProgress', $data) && null === $data['RootRotationInProgress']) { + $object->setRootRotationInProgress(null); } - if (property_exists($data, 'UpdatedAt') && $data->{'UpdatedAt'} !== null) { - $object->setUpdatedAt($data->{'UpdatedAt'}); + if (\array_key_exists('DataPathPort', $data) && null !== $data['DataPathPort']) { + $object->setDataPathPort($data['DataPathPort']); + unset($data['DataPathPort']); + } elseif (\array_key_exists('DataPathPort', $data) && null === $data['DataPathPort']) { + $object->setDataPathPort(null); } - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\SwarmSpec', 'json', $context)); + if (\array_key_exists('DefaultAddrPool', $data) && null !== $data['DefaultAddrPool']) { + $values = []; + foreach ($data['DefaultAddrPool'] as $value) { + $values[] = $value; + } + $object->setDefaultAddrPool($values); + unset($data['DefaultAddrPool']); + } elseif (\array_key_exists('DefaultAddrPool', $data) && null === $data['DefaultAddrPool']) { + $object->setDefaultAddrPool(null); } - if (property_exists($data, 'TLSInfo') && $data->{'TLSInfo'} !== null) { - $object->setTLSInfo($this->denormalizer->denormalize($data->{'TLSInfo'}, 'Docker\\API\\Model\\TLSInfo', 'json', $context)); + if (\array_key_exists('SubnetSize', $data) && null !== $data['SubnetSize']) { + $object->setSubnetSize($data['SubnetSize']); + unset($data['SubnetSize']); + } elseif (\array_key_exists('SubnetSize', $data) && null === $data['SubnetSize']) { + $object->setSubnetSize(null); } - if (property_exists($data, 'RootRotationInProgress') && $data->{'RootRotationInProgress'} !== null) { - $object->setRootRotationInProgress($data->{'RootRotationInProgress'}); + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $dataArray = []; + if ($data->isInitialized('iD') && null !== $data->getID()) { + $dataArray['ID'] = $data->getID(); } - if (null !== $object->getVersion()) { - $data->{'Version'} = $this->normalizer->normalize($object->getVersion(), 'json', $context); + if ($data->isInitialized('version') && null !== $data->getVersion()) { + $dataArray['Version'] = $this->normalizer->normalize($data->getVersion(), 'json', $context); } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt(); + if ($data->isInitialized('createdAt') && null !== $data->getCreatedAt()) { + $dataArray['CreatedAt'] = $data->getCreatedAt(); } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt(); + if ($data->isInitialized('updatedAt') && null !== $data->getUpdatedAt()) { + $dataArray['UpdatedAt'] = $data->getUpdatedAt(); } - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + if ($data->isInitialized('spec') && null !== $data->getSpec()) { + $dataArray['Spec'] = $this->normalizer->normalize($data->getSpec(), 'json', $context); } - if (null !== $object->getTLSInfo()) { - $data->{'TLSInfo'} = $this->normalizer->normalize($object->getTLSInfo(), 'json', $context); + if ($data->isInitialized('tLSInfo') && null !== $data->getTLSInfo()) { + $dataArray['TLSInfo'] = $this->normalizer->normalize($data->getTLSInfo(), 'json', $context); } - if (null !== $object->getRootRotationInProgress()) { - $data->{'RootRotationInProgress'} = $object->getRootRotationInProgress(); + if ($data->isInitialized('rootRotationInProgress') && null !== $data->getRootRotationInProgress()) { + $dataArray['RootRotationInProgress'] = $data->getRootRotationInProgress(); + } + if ($data->isInitialized('dataPathPort') && null !== $data->getDataPathPort()) { + $dataArray['DataPathPort'] = $data->getDataPathPort(); + } + if ($data->isInitialized('defaultAddrPool') && null !== $data->getDefaultAddrPool()) { + $values = []; + foreach ($data->getDefaultAddrPool() as $value) { + $values[] = $value; + } + $dataArray['DefaultAddrPool'] = $values; + } + if ($data->isInitialized('subnetSize') && null !== $data->getSubnetSize()) { + $dataArray['SubnetSize'] = $data->getSubnetSize(); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterInfo::class => false]; } } diff --git a/src/Normalizer/ClusterVolumeInfoNormalizer.php b/src/Normalizer/ClusterVolumeInfoNormalizer.php new file mode 100644 index 00000000..53a4415f --- /dev/null +++ b/src/Normalizer/ClusterVolumeInfoNormalizer.php @@ -0,0 +1,131 @@ +setCapacityBytes($data['CapacityBytes']); + unset($data['CapacityBytes']); + } elseif (\array_key_exists('CapacityBytes', $data) && null === $data['CapacityBytes']) { + $object->setCapacityBytes(null); + } + if (\array_key_exists('VolumeContext', $data) && null !== $data['VolumeContext']) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['VolumeContext'] as $key => $value) { + $values[$key] = $value; + } + $object->setVolumeContext($values); + unset($data['VolumeContext']); + } elseif (\array_key_exists('VolumeContext', $data) && null === $data['VolumeContext']) { + $object->setVolumeContext(null); + } + if (\array_key_exists('VolumeID', $data) && null !== $data['VolumeID']) { + $object->setVolumeID($data['VolumeID']); + unset($data['VolumeID']); + } elseif (\array_key_exists('VolumeID', $data) && null === $data['VolumeID']) { + $object->setVolumeID(null); + } + if (\array_key_exists('AccessibleTopology', $data) && null !== $data['AccessibleTopology']) { + $values_1 = []; + foreach ($data['AccessibleTopology'] as $value_1) { + $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value_1 as $key_1 => $value_2) { + $values_2[$key_1] = $value_2; + } + $values_1[] = $values_2; + } + $object->setAccessibleTopology($values_1); + unset($data['AccessibleTopology']); + } elseif (\array_key_exists('AccessibleTopology', $data) && null === $data['AccessibleTopology']) { + $object->setAccessibleTopology(null); + } + foreach ($data as $key_2 => $value_3) { + if (preg_match('/.*/', (string) $key_2)) { + $object[$key_2] = $value_3; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('capacityBytes') && null !== $data->getCapacityBytes()) { + $dataArray['CapacityBytes'] = $data->getCapacityBytes(); + } + if ($data->isInitialized('volumeContext') && null !== $data->getVolumeContext()) { + $values = []; + foreach ($data->getVolumeContext() as $key => $value) { + $values[$key] = $value; + } + $dataArray['VolumeContext'] = $values; + } + if ($data->isInitialized('volumeID') && null !== $data->getVolumeID()) { + $dataArray['VolumeID'] = $data->getVolumeID(); + } + if ($data->isInitialized('accessibleTopology') && null !== $data->getAccessibleTopology()) { + $values_1 = []; + foreach ($data->getAccessibleTopology() as $value_1) { + $values_2 = []; + foreach ($value_1 as $key_1 => $value_2) { + $values_2[$key_1] = $value_2; + } + $values_1[] = $values_2; + } + $dataArray['AccessibleTopology'] = $values_1; + } + foreach ($data as $key_2 => $value_3) { + if (preg_match('/.*/', (string) $key_2)) { + $dataArray[$key_2] = $value_3; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeInfo::class => false]; + } +} diff --git a/src/Normalizer/ClusterVolumeNormalizer.php b/src/Normalizer/ClusterVolumeNormalizer.php new file mode 100644 index 00000000..68ef1c76 --- /dev/null +++ b/src/Normalizer/ClusterVolumeNormalizer.php @@ -0,0 +1,142 @@ +setID($data['ID']); + unset($data['ID']); + } elseif (\array_key_exists('ID', $data) && null === $data['ID']) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && null !== $data['Version']) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + unset($data['Version']); + } elseif (\array_key_exists('Version', $data) && null === $data['Version']) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && null !== $data['CreatedAt']) { + $object->setCreatedAt($data['CreatedAt']); + unset($data['CreatedAt']); + } elseif (\array_key_exists('CreatedAt', $data) && null === $data['CreatedAt']) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && null !== $data['UpdatedAt']) { + $object->setUpdatedAt($data['UpdatedAt']); + unset($data['UpdatedAt']); + } elseif (\array_key_exists('UpdatedAt', $data) && null === $data['UpdatedAt']) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && null !== $data['Spec']) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\ClusterVolumeSpec::class, 'json', $context)); + unset($data['Spec']); + } elseif (\array_key_exists('Spec', $data) && null === $data['Spec']) { + $object->setSpec(null); + } + if (\array_key_exists('Info', $data) && null !== $data['Info']) { + $object->setInfo($this->denormalizer->denormalize($data['Info'], \Docker\API\Model\ClusterVolumeInfo::class, 'json', $context)); + unset($data['Info']); + } elseif (\array_key_exists('Info', $data) && null === $data['Info']) { + $object->setInfo(null); + } + if (\array_key_exists('PublishStatus', $data) && null !== $data['PublishStatus']) { + $values = []; + foreach ($data['PublishStatus'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ClusterVolumePublishStatusItem::class, 'json', $context); + } + $object->setPublishStatus($values); + unset($data['PublishStatus']); + } elseif (\array_key_exists('PublishStatus', $data) && null === $data['PublishStatus']) { + $object->setPublishStatus(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('iD') && null !== $data->getID()) { + $dataArray['ID'] = $data->getID(); + } + if ($data->isInitialized('version') && null !== $data->getVersion()) { + $dataArray['Version'] = $this->normalizer->normalize($data->getVersion(), 'json', $context); + } + if ($data->isInitialized('createdAt') && null !== $data->getCreatedAt()) { + $dataArray['CreatedAt'] = $data->getCreatedAt(); + } + if ($data->isInitialized('updatedAt') && null !== $data->getUpdatedAt()) { + $dataArray['UpdatedAt'] = $data->getUpdatedAt(); + } + if ($data->isInitialized('spec') && null !== $data->getSpec()) { + $dataArray['Spec'] = $this->normalizer->normalize($data->getSpec(), 'json', $context); + } + if ($data->isInitialized('info') && null !== $data->getInfo()) { + $dataArray['Info'] = $this->normalizer->normalize($data->getInfo(), 'json', $context); + } + if ($data->isInitialized('publishStatus') && null !== $data->getPublishStatus()) { + $values = []; + foreach ($data->getPublishStatus() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $dataArray['PublishStatus'] = $values; + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolume::class => false]; + } +} diff --git a/src/Normalizer/ClusterVolumePublishStatusItemNormalizer.php b/src/Normalizer/ClusterVolumePublishStatusItemNormalizer.php new file mode 100644 index 00000000..1acd5f6c --- /dev/null +++ b/src/Normalizer/ClusterVolumePublishStatusItemNormalizer.php @@ -0,0 +1,106 @@ +setNodeID($data['NodeID']); + unset($data['NodeID']); + } elseif (\array_key_exists('NodeID', $data) && null === $data['NodeID']) { + $object->setNodeID(null); + } + if (\array_key_exists('State', $data) && null !== $data['State']) { + $object->setState($data['State']); + unset($data['State']); + } elseif (\array_key_exists('State', $data) && null === $data['State']) { + $object->setState(null); + } + if (\array_key_exists('PublishContext', $data) && null !== $data['PublishContext']) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['PublishContext'] as $key => $value) { + $values[$key] = $value; + } + $object->setPublishContext($values); + unset($data['PublishContext']); + } elseif (\array_key_exists('PublishContext', $data) && null === $data['PublishContext']) { + $object->setPublishContext(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('nodeID') && null !== $data->getNodeID()) { + $dataArray['NodeID'] = $data->getNodeID(); + } + if ($data->isInitialized('state') && null !== $data->getState()) { + $dataArray['State'] = $data->getState(); + } + if ($data->isInitialized('publishContext') && null !== $data->getPublishContext()) { + $values = []; + foreach ($data->getPublishContext() as $key => $value) { + $values[$key] = $value; + } + $dataArray['PublishContext'] = $values; + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumePublishStatusItem::class => false]; + } +} diff --git a/src/Normalizer/ClusterVolumeSpecAccessModeAccessibilityRequirementsNormalizer.php b/src/Normalizer/ClusterVolumeSpecAccessModeAccessibilityRequirementsNormalizer.php new file mode 100644 index 00000000..d0f0f9c4 --- /dev/null +++ b/src/Normalizer/ClusterVolumeSpecAccessModeAccessibilityRequirementsNormalizer.php @@ -0,0 +1,121 @@ + $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $object->setRequisite($values); + unset($data['Requisite']); + } elseif (\array_key_exists('Requisite', $data) && null === $data['Requisite']) { + $object->setRequisite(null); + } + if (\array_key_exists('Preferred', $data) && null !== $data['Preferred']) { + $values_2 = []; + foreach ($data['Preferred'] as $value_2) { + $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($value_2 as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $values_2[] = $values_3; + } + $object->setPreferred($values_2); + unset($data['Preferred']); + } elseif (\array_key_exists('Preferred', $data) && null === $data['Preferred']) { + $object->setPreferred(null); + } + foreach ($data as $key_2 => $value_4) { + if (preg_match('/.*/', (string) $key_2)) { + $object[$key_2] = $value_4; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('requisite') && null !== $data->getRequisite()) { + $values = []; + foreach ($data->getRequisite() as $value) { + $values_1 = []; + foreach ($value as $key => $value_1) { + $values_1[$key] = $value_1; + } + $values[] = $values_1; + } + $dataArray['Requisite'] = $values; + } + if ($data->isInitialized('preferred') && null !== $data->getPreferred()) { + $values_2 = []; + foreach ($data->getPreferred() as $value_2) { + $values_3 = []; + foreach ($value_2 as $key_1 => $value_3) { + $values_3[$key_1] = $value_3; + } + $values_2[] = $values_3; + } + $dataArray['Preferred'] = $values_2; + } + foreach ($data as $key_2 => $value_4) { + if (preg_match('/.*/', (string) $key_2)) { + $dataArray[$key_2] = $value_4; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements::class => false]; + } +} diff --git a/src/Normalizer/ClusterVolumeSpecAccessModeCapacityRangeNormalizer.php b/src/Normalizer/ClusterVolumeSpecAccessModeCapacityRangeNormalizer.php new file mode 100644 index 00000000..420d14b6 --- /dev/null +++ b/src/Normalizer/ClusterVolumeSpecAccessModeCapacityRangeNormalizer.php @@ -0,0 +1,89 @@ +setRequiredBytes($data['RequiredBytes']); + unset($data['RequiredBytes']); + } elseif (\array_key_exists('RequiredBytes', $data) && null === $data['RequiredBytes']) { + $object->setRequiredBytes(null); + } + if (\array_key_exists('LimitBytes', $data) && null !== $data['LimitBytes']) { + $object->setLimitBytes($data['LimitBytes']); + unset($data['LimitBytes']); + } elseif (\array_key_exists('LimitBytes', $data) && null === $data['LimitBytes']) { + $object->setLimitBytes(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('requiredBytes') && null !== $data->getRequiredBytes()) { + $dataArray['RequiredBytes'] = $data->getRequiredBytes(); + } + if ($data->isInitialized('limitBytes') && null !== $data->getLimitBytes()) { + $dataArray['LimitBytes'] = $data->getLimitBytes(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange::class => false]; + } +} diff --git a/src/Normalizer/ClusterVolumeSpecAccessModeMountVolumeNormalizer.php b/src/Normalizer/ClusterVolumeSpecAccessModeMountVolumeNormalizer.php new file mode 100644 index 00000000..a008372b --- /dev/null +++ b/src/Normalizer/ClusterVolumeSpecAccessModeMountVolumeNormalizer.php @@ -0,0 +1,71 @@ + $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeSpecAccessModeMountVolume::class => false]; + } +} diff --git a/src/Normalizer/ClusterVolumeSpecAccessModeNormalizer.php b/src/Normalizer/ClusterVolumeSpecAccessModeNormalizer.php new file mode 100644 index 00000000..8416948b --- /dev/null +++ b/src/Normalizer/ClusterVolumeSpecAccessModeNormalizer.php @@ -0,0 +1,142 @@ +setScope($data['Scope']); + unset($data['Scope']); + } elseif (\array_key_exists('Scope', $data) && null === $data['Scope']) { + $object->setScope(null); + } + if (\array_key_exists('Sharing', $data) && null !== $data['Sharing']) { + $object->setSharing($data['Sharing']); + unset($data['Sharing']); + } elseif (\array_key_exists('Sharing', $data) && null === $data['Sharing']) { + $object->setSharing(null); + } + if (\array_key_exists('MountVolume', $data) && null !== $data['MountVolume']) { + $object->setMountVolume($this->denormalizer->denormalize($data['MountVolume'], \Docker\API\Model\ClusterVolumeSpecAccessModeMountVolume::class, 'json', $context)); + unset($data['MountVolume']); + } elseif (\array_key_exists('MountVolume', $data) && null === $data['MountVolume']) { + $object->setMountVolume(null); + } + if (\array_key_exists('Secrets', $data) && null !== $data['Secrets']) { + $values = []; + foreach ($data['Secrets'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem::class, 'json', $context); + } + $object->setSecrets($values); + unset($data['Secrets']); + } elseif (\array_key_exists('Secrets', $data) && null === $data['Secrets']) { + $object->setSecrets(null); + } + if (\array_key_exists('AccessibilityRequirements', $data) && null !== $data['AccessibilityRequirements']) { + $object->setAccessibilityRequirements($this->denormalizer->denormalize($data['AccessibilityRequirements'], \Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements::class, 'json', $context)); + unset($data['AccessibilityRequirements']); + } elseif (\array_key_exists('AccessibilityRequirements', $data) && null === $data['AccessibilityRequirements']) { + $object->setAccessibilityRequirements(null); + } + if (\array_key_exists('CapacityRange', $data) && null !== $data['CapacityRange']) { + $object->setCapacityRange($this->denormalizer->denormalize($data['CapacityRange'], \Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange::class, 'json', $context)); + unset($data['CapacityRange']); + } elseif (\array_key_exists('CapacityRange', $data) && null === $data['CapacityRange']) { + $object->setCapacityRange(null); + } + if (\array_key_exists('Availability', $data) && null !== $data['Availability']) { + $object->setAvailability($data['Availability']); + unset($data['Availability']); + } elseif (\array_key_exists('Availability', $data) && null === $data['Availability']) { + $object->setAvailability(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('scope') && null !== $data->getScope()) { + $dataArray['Scope'] = $data->getScope(); + } + if ($data->isInitialized('sharing') && null !== $data->getSharing()) { + $dataArray['Sharing'] = $data->getSharing(); + } + if ($data->isInitialized('mountVolume') && null !== $data->getMountVolume()) { + $dataArray['MountVolume'] = $this->normalizer->normalize($data->getMountVolume(), 'json', $context); + } + if ($data->isInitialized('secrets') && null !== $data->getSecrets()) { + $values = []; + foreach ($data->getSecrets() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $dataArray['Secrets'] = $values; + } + if ($data->isInitialized('accessibilityRequirements') && null !== $data->getAccessibilityRequirements()) { + $dataArray['AccessibilityRequirements'] = $this->normalizer->normalize($data->getAccessibilityRequirements(), 'json', $context); + } + if ($data->isInitialized('capacityRange') && null !== $data->getCapacityRange()) { + $dataArray['CapacityRange'] = $this->normalizer->normalize($data->getCapacityRange(), 'json', $context); + } + if ($data->isInitialized('availability') && null !== $data->getAvailability()) { + $dataArray['Availability'] = $data->getAvailability(); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeSpecAccessMode::class => false]; + } +} diff --git a/src/Normalizer/ClusterVolumeSpecAccessModeSecretsItemNormalizer.php b/src/Normalizer/ClusterVolumeSpecAccessModeSecretsItemNormalizer.php new file mode 100644 index 00000000..99e6a5e2 --- /dev/null +++ b/src/Normalizer/ClusterVolumeSpecAccessModeSecretsItemNormalizer.php @@ -0,0 +1,89 @@ +setKey($data['Key']); + unset($data['Key']); + } elseif (\array_key_exists('Key', $data) && null === $data['Key']) { + $object->setKey(null); + } + if (\array_key_exists('Secret', $data) && null !== $data['Secret']) { + $object->setSecret($data['Secret']); + unset($data['Secret']); + } elseif (\array_key_exists('Secret', $data) && null === $data['Secret']) { + $object->setSecret(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('key') && null !== $data->getKey()) { + $dataArray['Key'] = $data->getKey(); + } + if ($data->isInitialized('secret') && null !== $data->getSecret()) { + $dataArray['Secret'] = $data->getSecret(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem::class => false]; + } +} diff --git a/src/Normalizer/ClusterVolumeSpecNormalizer.php b/src/Normalizer/ClusterVolumeSpecNormalizer.php new file mode 100644 index 00000000..ea1ddea4 --- /dev/null +++ b/src/Normalizer/ClusterVolumeSpecNormalizer.php @@ -0,0 +1,89 @@ +setGroup($data['Group']); + unset($data['Group']); + } elseif (\array_key_exists('Group', $data) && null === $data['Group']) { + $object->setGroup(null); + } + if (\array_key_exists('AccessMode', $data) && null !== $data['AccessMode']) { + $object->setAccessMode($this->denormalizer->denormalize($data['AccessMode'], \Docker\API\Model\ClusterVolumeSpecAccessMode::class, 'json', $context)); + unset($data['AccessMode']); + } elseif (\array_key_exists('AccessMode', $data) && null === $data['AccessMode']) { + $object->setAccessMode(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('group') && null !== $data->getGroup()) { + $dataArray['Group'] = $data->getGroup(); + } + if ($data->isInitialized('accessMode') && null !== $data->getAccessMode()) { + $dataArray['AccessMode'] = $this->normalizer->normalize($data->getAccessMode(), 'json', $context); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ClusterVolumeSpec::class => false]; + } +} diff --git a/src/Normalizer/CommitNormalizer.php b/src/Normalizer/CommitNormalizer.php index 7e7f59ee..2d51a9bb 100644 --- a/src/Normalizer/CommitNormalizer.php +++ b/src/Normalizer/CommitNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class CommitNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Commit'; + return \Docker\API\Model\Commit::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Commit; + return \is_object($data) && \Docker\API\Model\Commit::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\Commit(); - if (property_exists($data, 'ID') && $data->{'ID'} !== null) { - $object->setID($data->{'ID'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && null !== $data['ID']) { + $object->setID($data['ID']); + unset($data['ID']); + } elseif (\array_key_exists('ID', $data) && null === $data['ID']) { + $object->setID(null); + } + if (\array_key_exists('Expected', $data) && null !== $data['Expected']) { + $object->setExpected($data['Expected']); + unset($data['Expected']); + } elseif (\array_key_exists('Expected', $data) && null === $data['Expected']) { + $object->setExpected(null); } - if (property_exists($data, 'Expected') && $data->{'Expected'} !== null) { - $object->setExpected($data->{'Expected'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $dataArray = []; + if ($data->isInitialized('iD') && null !== $data->getID()) { + $dataArray['ID'] = $data->getID(); } - if (null !== $object->getExpected()) { - $data->{'Expected'} = $object->getExpected(); + if ($data->isInitialized('expected') && null !== $data->getExpected()) { + $dataArray['Expected'] = $data->getExpected(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Commit::class => false]; } } diff --git a/src/Normalizer/ConfigNormalizer.php b/src/Normalizer/ConfigNormalizer.php index 8c6c5e69..7f5620f2 100644 --- a/src/Normalizer/ConfigNormalizer.php +++ b/src/Normalizer/ConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,63 +16,101 @@ class ConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Config'; + return \Docker\API\Model\Config::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Config; + return \is_object($data) && \Docker\API\Model\Config::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\Config(); - if (property_exists($data, 'ID') && $data->{'ID'} !== null) { - $object->setID($data->{'ID'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && null !== $data['ID']) { + $object->setID($data['ID']); + unset($data['ID']); + } elseif (\array_key_exists('ID', $data) && null === $data['ID']) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && null !== $data['Version']) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + unset($data['Version']); + } elseif (\array_key_exists('Version', $data) && null === $data['Version']) { + $object->setVersion(null); } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($this->denormalizer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); + if (\array_key_exists('CreatedAt', $data) && null !== $data['CreatedAt']) { + $object->setCreatedAt($data['CreatedAt']); + unset($data['CreatedAt']); + } elseif (\array_key_exists('CreatedAt', $data) && null === $data['CreatedAt']) { + $object->setCreatedAt(null); } - if (property_exists($data, 'CreatedAt') && $data->{'CreatedAt'} !== null) { - $object->setCreatedAt($data->{'CreatedAt'}); + if (\array_key_exists('UpdatedAt', $data) && null !== $data['UpdatedAt']) { + $object->setUpdatedAt($data['UpdatedAt']); + unset($data['UpdatedAt']); + } elseif (\array_key_exists('UpdatedAt', $data) && null === $data['UpdatedAt']) { + $object->setUpdatedAt(null); } - if (property_exists($data, 'UpdatedAt') && $data->{'UpdatedAt'} !== null) { - $object->setUpdatedAt($data->{'UpdatedAt'}); + if (\array_key_exists('Spec', $data) && null !== $data['Spec']) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\ConfigSpec::class, 'json', $context)); + unset($data['Spec']); + } elseif (\array_key_exists('Spec', $data) && null === $data['Spec']) { + $object->setSpec(null); } - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\ConfigSpec', 'json', $context)); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $dataArray = []; + if ($data->isInitialized('iD') && null !== $data->getID()) { + $dataArray['ID'] = $data->getID(); } - if (null !== $object->getVersion()) { - $data->{'Version'} = $this->normalizer->normalize($object->getVersion(), 'json', $context); + if ($data->isInitialized('version') && null !== $data->getVersion()) { + $dataArray['Version'] = $this->normalizer->normalize($data->getVersion(), 'json', $context); } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt(); + if ($data->isInitialized('createdAt') && null !== $data->getCreatedAt()) { + $dataArray['CreatedAt'] = $data->getCreatedAt(); } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt(); + if ($data->isInitialized('updatedAt') && null !== $data->getUpdatedAt()) { + $dataArray['UpdatedAt'] = $data->getUpdatedAt(); } - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + if ($data->isInitialized('spec') && null !== $data->getSpec()) { + $dataArray['Spec'] = $this->normalizer->normalize($data->getSpec(), 'json', $context); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Config::class => false]; } } diff --git a/src/Normalizer/ConfigSpecNormalizer.php b/src/Normalizer/ConfigSpecNormalizer.php index f14a7010..e41c10a6 100644 --- a/src/Normalizer/ConfigSpecNormalizer.php +++ b/src/Normalizer/ConfigSpecNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,59 +16,100 @@ class ConfigSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ConfigSpec'; + return \Docker\API\Model\ConfigSpec::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ConfigSpec; + return \is_object($data) && \Docker\API\Model\ConfigSpec::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ConfigSpec(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + if (\array_key_exists('Data', $data) && null !== $data['Data']) { + $object->setData($data['Data']); + unset($data['Data']); + } elseif (\array_key_exists('Data', $data) && null === $data['Data']) { + $object->setData(null); } - if (property_exists($data, 'Data') && $data->{'Data'} !== null) { - $object->setData($data->{'Data'}); + if (\array_key_exists('Templating', $data) && null !== $data['Templating']) { + $object->setTemplating($this->denormalizer->denormalize($data['Templating'], \Docker\API\Model\Driver::class, 'json', $context)); + unset($data['Templating']); + } elseif (\array_key_exists('Templating', $data) && null === $data['Templating']) { + $object->setTemplating(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values = []; + foreach ($data->getLabels() as $key => $value) { + $values[$key] = $value; } - $data->{'Labels'} = $values; + $dataArray['Labels'] = $values; } - if (null !== $object->getData()) { - $data->{'Data'} = $object->getData(); + if ($data->isInitialized('data') && null !== $data->getData()) { + $dataArray['Data'] = $data->getData(); + } + if ($data->isInitialized('templating') && null !== $data->getTemplating()) { + $dataArray['Templating'] = $this->normalizer->normalize($data->getTemplating(), 'json', $context); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ConfigSpec::class => false]; } } diff --git a/src/Normalizer/ConfigsCreatePostBodyNormalizer.php b/src/Normalizer/ConfigsCreatePostBodyNormalizer.php index 942db8a4..575ebc61 100644 --- a/src/Normalizer/ConfigsCreatePostBodyNormalizer.php +++ b/src/Normalizer/ConfigsCreatePostBodyNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,59 +16,100 @@ class ConfigsCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ConfigsCreatePostBody'; + return \Docker\API\Model\ConfigsCreatePostBody::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ConfigsCreatePostBody; + return \is_object($data) && \Docker\API\Model\ConfigsCreatePostBody::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ConfigsCreatePostBody(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + if (\array_key_exists('Data', $data) && null !== $data['Data']) { + $object->setData($data['Data']); + unset($data['Data']); + } elseif (\array_key_exists('Data', $data) && null === $data['Data']) { + $object->setData(null); } - if (property_exists($data, 'Data') && $data->{'Data'} !== null) { - $object->setData($data->{'Data'}); + if (\array_key_exists('Templating', $data) && null !== $data['Templating']) { + $object->setTemplating($this->denormalizer->denormalize($data['Templating'], \Docker\API\Model\Driver::class, 'json', $context)); + unset($data['Templating']); + } elseif (\array_key_exists('Templating', $data) && null === $data['Templating']) { + $object->setTemplating(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values = []; + foreach ($data->getLabels() as $key => $value) { + $values[$key] = $value; } - $data->{'Labels'} = $values; + $dataArray['Labels'] = $values; } - if (null !== $object->getData()) { - $data->{'Data'} = $object->getData(); + if ($data->isInitialized('data') && null !== $data->getData()) { + $dataArray['Data'] = $data->getData(); + } + if ($data->isInitialized('templating') && null !== $data->getTemplating()) { + $dataArray['Templating'] = $this->normalizer->normalize($data->getTemplating(), 'json', $context); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ConfigsCreatePostBody::class => false]; } } diff --git a/src/Normalizer/ContainerConfigExposedPortsItemNormalizer.php b/src/Normalizer/ContainerConfigExposedPortsItemNormalizer.php new file mode 100644 index 00000000..e67f7f08 --- /dev/null +++ b/src/Normalizer/ContainerConfigExposedPortsItemNormalizer.php @@ -0,0 +1,71 @@ + $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerConfigExposedPortsItem::class => false]; + } +} diff --git a/src/Normalizer/ContainerConfigNormalizer.php b/src/Normalizer/ContainerConfigNormalizer.php index f43fd69a..ab299e95 100644 --- a/src/Normalizer/ContainerConfigNormalizer.php +++ b/src/Normalizer/ContainerConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,247 +16,369 @@ class ContainerConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ContainerConfig'; + return \Docker\API\Model\ContainerConfig::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ContainerConfig; + return \is_object($data) && \Docker\API\Model\ContainerConfig::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\ContainerConfig(); - if (property_exists($data, 'Hostname') && $data->{'Hostname'} !== null) { - $object->setHostname($data->{'Hostname'}); - } - if (property_exists($data, 'Domainname') && $data->{'Domainname'} !== null) { - $object->setDomainname($data->{'Domainname'}); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'User') && $data->{'User'} !== null) { - $object->setUser($data->{'User'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'AttachStdin') && $data->{'AttachStdin'} !== null) { - $object->setAttachStdin($data->{'AttachStdin'}); - } - if (property_exists($data, 'AttachStdout') && $data->{'AttachStdout'} !== null) { - $object->setAttachStdout($data->{'AttachStdout'}); - } - if (property_exists($data, 'AttachStderr') && $data->{'AttachStderr'} !== null) { - $object->setAttachStderr($data->{'AttachStderr'}); - } - if (property_exists($data, 'ExposedPorts') && $data->{'ExposedPorts'} !== null) { + $object = new \Docker\API\Model\ContainerConfig(); + if (\array_key_exists('AttachStdin', $data) && \is_int($data['AttachStdin'])) { + $data['AttachStdin'] = (bool) $data['AttachStdin']; + } + if (\array_key_exists('AttachStdout', $data) && \is_int($data['AttachStdout'])) { + $data['AttachStdout'] = (bool) $data['AttachStdout']; + } + if (\array_key_exists('AttachStderr', $data) && \is_int($data['AttachStderr'])) { + $data['AttachStderr'] = (bool) $data['AttachStderr']; + } + if (\array_key_exists('Tty', $data) && \is_int($data['Tty'])) { + $data['Tty'] = (bool) $data['Tty']; + } + if (\array_key_exists('OpenStdin', $data) && \is_int($data['OpenStdin'])) { + $data['OpenStdin'] = (bool) $data['OpenStdin']; + } + if (\array_key_exists('StdinOnce', $data) && \is_int($data['StdinOnce'])) { + $data['StdinOnce'] = (bool) $data['StdinOnce']; + } + if (\array_key_exists('ArgsEscaped', $data) && \is_int($data['ArgsEscaped'])) { + $data['ArgsEscaped'] = (bool) $data['ArgsEscaped']; + } + if (\array_key_exists('NetworkDisabled', $data) && \is_int($data['NetworkDisabled'])) { + $data['NetworkDisabled'] = (bool) $data['NetworkDisabled']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Hostname', $data) && null !== $data['Hostname']) { + $object->setHostname($data['Hostname']); + unset($data['Hostname']); + } elseif (\array_key_exists('Hostname', $data) && null === $data['Hostname']) { + $object->setHostname(null); + } + if (\array_key_exists('Domainname', $data) && null !== $data['Domainname']) { + $object->setDomainname($data['Domainname']); + unset($data['Domainname']); + } elseif (\array_key_exists('Domainname', $data) && null === $data['Domainname']) { + $object->setDomainname(null); + } + if (\array_key_exists('User', $data) && null !== $data['User']) { + $object->setUser($data['User']); + unset($data['User']); + } elseif (\array_key_exists('User', $data) && null === $data['User']) { + $object->setUser(null); + } + if (\array_key_exists('AttachStdin', $data) && null !== $data['AttachStdin']) { + $object->setAttachStdin($data['AttachStdin']); + unset($data['AttachStdin']); + } elseif (\array_key_exists('AttachStdin', $data) && null === $data['AttachStdin']) { + $object->setAttachStdin(null); + } + if (\array_key_exists('AttachStdout', $data) && null !== $data['AttachStdout']) { + $object->setAttachStdout($data['AttachStdout']); + unset($data['AttachStdout']); + } elseif (\array_key_exists('AttachStdout', $data) && null === $data['AttachStdout']) { + $object->setAttachStdout(null); + } + if (\array_key_exists('AttachStderr', $data) && null !== $data['AttachStderr']) { + $object->setAttachStderr($data['AttachStderr']); + unset($data['AttachStderr']); + } elseif (\array_key_exists('AttachStderr', $data) && null === $data['AttachStderr']) { + $object->setAttachStderr(null); + } + if (\array_key_exists('ExposedPorts', $data) && null !== $data['ExposedPorts']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'ExposedPorts'} as $key => $value) { - $values[$key] = $value; + foreach ($data['ExposedPorts'] as $key => $value) { + $values[$key] = $this->denormalizer->denormalize($value, \Docker\API\Model\ContainerConfigExposedPortsItem::class, 'json', $context); } $object->setExposedPorts($values); - } - if (property_exists($data, 'Tty') && $data->{'Tty'} !== null) { - $object->setTty($data->{'Tty'}); - } - if (property_exists($data, 'OpenStdin') && $data->{'OpenStdin'} !== null) { - $object->setOpenStdin($data->{'OpenStdin'}); - } - if (property_exists($data, 'StdinOnce') && $data->{'StdinOnce'} !== null) { - $object->setStdinOnce($data->{'StdinOnce'}); - } - if (property_exists($data, 'Env') && $data->{'Env'} !== null) { + unset($data['ExposedPorts']); + } elseif (\array_key_exists('ExposedPorts', $data) && null === $data['ExposedPorts']) { + $object->setExposedPorts(null); + } + if (\array_key_exists('Tty', $data) && null !== $data['Tty']) { + $object->setTty($data['Tty']); + unset($data['Tty']); + } elseif (\array_key_exists('Tty', $data) && null === $data['Tty']) { + $object->setTty(null); + } + if (\array_key_exists('OpenStdin', $data) && null !== $data['OpenStdin']) { + $object->setOpenStdin($data['OpenStdin']); + unset($data['OpenStdin']); + } elseif (\array_key_exists('OpenStdin', $data) && null === $data['OpenStdin']) { + $object->setOpenStdin(null); + } + if (\array_key_exists('StdinOnce', $data) && null !== $data['StdinOnce']) { + $object->setStdinOnce($data['StdinOnce']); + unset($data['StdinOnce']); + } elseif (\array_key_exists('StdinOnce', $data) && null === $data['StdinOnce']) { + $object->setStdinOnce(null); + } + if (\array_key_exists('Env', $data) && null !== $data['Env']) { $values_1 = []; - foreach ($data->{'Env'} as $value_1) { + foreach ($data['Env'] as $value_1) { $values_1[] = $value_1; } $object->setEnv($values_1); + unset($data['Env']); + } elseif (\array_key_exists('Env', $data) && null === $data['Env']) { + $object->setEnv(null); } - if (property_exists($data, 'Cmd') && $data->{'Cmd'} !== null) { + if (\array_key_exists('Cmd', $data) && null !== $data['Cmd']) { $values_2 = []; - foreach ($data->{'Cmd'} as $value_2) { + foreach ($data['Cmd'] as $value_2) { $values_2[] = $value_2; } $object->setCmd($values_2); - } - if (property_exists($data, 'Healthcheck') && $data->{'Healthcheck'} !== null) { - $object->setHealthcheck($this->denormalizer->denormalize($data->{'Healthcheck'}, 'Docker\\API\\Model\\HealthConfig', 'json', $context)); - } - if (property_exists($data, 'ArgsEscaped') && $data->{'ArgsEscaped'} !== null) { - $object->setArgsEscaped($data->{'ArgsEscaped'}); - } - if (property_exists($data, 'Image') && $data->{'Image'} !== null) { - $object->setImage($data->{'Image'}); - } - if (property_exists($data, 'Volumes') && $data->{'Volumes'} !== null) { + unset($data['Cmd']); + } elseif (\array_key_exists('Cmd', $data) && null === $data['Cmd']) { + $object->setCmd(null); + } + if (\array_key_exists('Healthcheck', $data) && null !== $data['Healthcheck']) { + $object->setHealthcheck($this->denormalizer->denormalize($data['Healthcheck'], \Docker\API\Model\HealthConfig::class, 'json', $context)); + unset($data['Healthcheck']); + } elseif (\array_key_exists('Healthcheck', $data) && null === $data['Healthcheck']) { + $object->setHealthcheck(null); + } + if (\array_key_exists('ArgsEscaped', $data) && null !== $data['ArgsEscaped']) { + $object->setArgsEscaped($data['ArgsEscaped']); + unset($data['ArgsEscaped']); + } elseif (\array_key_exists('ArgsEscaped', $data) && null === $data['ArgsEscaped']) { + $object->setArgsEscaped(null); + } + if (\array_key_exists('Image', $data) && null !== $data['Image']) { + $object->setImage($data['Image']); + unset($data['Image']); + } elseif (\array_key_exists('Image', $data) && null === $data['Image']) { + $object->setImage(null); + } + if (\array_key_exists('Volumes', $data) && null !== $data['Volumes']) { $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Volumes'} as $key_1 => $value_3) { - $values_3[$key_1] = $value_3; + foreach ($data['Volumes'] as $key_1 => $value_3) { + $values_3[$key_1] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\ContainerConfigVolumesItem::class, 'json', $context); } $object->setVolumes($values_3); + unset($data['Volumes']); + } elseif (\array_key_exists('Volumes', $data) && null === $data['Volumes']) { + $object->setVolumes(null); } - if (property_exists($data, 'WorkingDir') && $data->{'WorkingDir'} !== null) { - $object->setWorkingDir($data->{'WorkingDir'}); + if (\array_key_exists('WorkingDir', $data) && null !== $data['WorkingDir']) { + $object->setWorkingDir($data['WorkingDir']); + unset($data['WorkingDir']); + } elseif (\array_key_exists('WorkingDir', $data) && null === $data['WorkingDir']) { + $object->setWorkingDir(null); } - if (property_exists($data, 'Entrypoint') && $data->{'Entrypoint'} !== null) { + if (\array_key_exists('Entrypoint', $data) && null !== $data['Entrypoint']) { $values_4 = []; - foreach ($data->{'Entrypoint'} as $value_4) { + foreach ($data['Entrypoint'] as $value_4) { $values_4[] = $value_4; } $object->setEntrypoint($values_4); - } - if (property_exists($data, 'NetworkDisabled') && $data->{'NetworkDisabled'} !== null) { - $object->setNetworkDisabled($data->{'NetworkDisabled'}); - } - if (property_exists($data, 'MacAddress') && $data->{'MacAddress'} !== null) { - $object->setMacAddress($data->{'MacAddress'}); - } - if (property_exists($data, 'OnBuild') && $data->{'OnBuild'} !== null) { + unset($data['Entrypoint']); + } elseif (\array_key_exists('Entrypoint', $data) && null === $data['Entrypoint']) { + $object->setEntrypoint(null); + } + if (\array_key_exists('NetworkDisabled', $data) && null !== $data['NetworkDisabled']) { + $object->setNetworkDisabled($data['NetworkDisabled']); + unset($data['NetworkDisabled']); + } elseif (\array_key_exists('NetworkDisabled', $data) && null === $data['NetworkDisabled']) { + $object->setNetworkDisabled(null); + } + if (\array_key_exists('MacAddress', $data) && null !== $data['MacAddress']) { + $object->setMacAddress($data['MacAddress']); + unset($data['MacAddress']); + } elseif (\array_key_exists('MacAddress', $data) && null === $data['MacAddress']) { + $object->setMacAddress(null); + } + if (\array_key_exists('OnBuild', $data) && null !== $data['OnBuild']) { $values_5 = []; - foreach ($data->{'OnBuild'} as $value_5) { + foreach ($data['OnBuild'] as $value_5) { $values_5[] = $value_5; } $object->setOnBuild($values_5); + unset($data['OnBuild']); + } elseif (\array_key_exists('OnBuild', $data) && null === $data['OnBuild']) { + $object->setOnBuild(null); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key_2 => $value_6) { + foreach ($data['Labels'] as $key_2 => $value_6) { $values_6[$key_2] = $value_6; } $object->setLabels($values_6); - } - if (property_exists($data, 'StopSignal') && $data->{'StopSignal'} !== null) { - $object->setStopSignal($data->{'StopSignal'}); - } - if (property_exists($data, 'StopTimeout') && $data->{'StopTimeout'} !== null) { - $object->setStopTimeout($data->{'StopTimeout'}); - } - if (property_exists($data, 'Shell') && $data->{'Shell'} !== null) { + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + if (\array_key_exists('StopSignal', $data) && null !== $data['StopSignal']) { + $object->setStopSignal($data['StopSignal']); + unset($data['StopSignal']); + } elseif (\array_key_exists('StopSignal', $data) && null === $data['StopSignal']) { + $object->setStopSignal(null); + } + if (\array_key_exists('StopTimeout', $data) && null !== $data['StopTimeout']) { + $object->setStopTimeout($data['StopTimeout']); + unset($data['StopTimeout']); + } elseif (\array_key_exists('StopTimeout', $data) && null === $data['StopTimeout']) { + $object->setStopTimeout(null); + } + if (\array_key_exists('Shell', $data) && null !== $data['Shell']) { $values_7 = []; - foreach ($data->{'Shell'} as $value_7) { + foreach ($data['Shell'] as $value_7) { $values_7[] = $value_7; } $object->setShell($values_7); + unset($data['Shell']); + } elseif (\array_key_exists('Shell', $data) && null === $data['Shell']) { + $object->setShell(null); + } + foreach ($data as $key_3 => $value_8) { + if (preg_match('/.*/', (string) $key_3)) { + $object[$key_3] = $value_8; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getHostname()) { - $data->{'Hostname'} = $object->getHostname(); + $dataArray = []; + if ($data->isInitialized('hostname') && null !== $data->getHostname()) { + $dataArray['Hostname'] = $data->getHostname(); } - if (null !== $object->getDomainname()) { - $data->{'Domainname'} = $object->getDomainname(); + if ($data->isInitialized('domainname') && null !== $data->getDomainname()) { + $dataArray['Domainname'] = $data->getDomainname(); } - if (null !== $object->getUser()) { - $data->{'User'} = $object->getUser(); + if ($data->isInitialized('user') && null !== $data->getUser()) { + $dataArray['User'] = $data->getUser(); } - if (null !== $object->getAttachStdin()) { - $data->{'AttachStdin'} = $object->getAttachStdin(); + if ($data->isInitialized('attachStdin') && null !== $data->getAttachStdin()) { + $dataArray['AttachStdin'] = $data->getAttachStdin(); } - if (null !== $object->getAttachStdout()) { - $data->{'AttachStdout'} = $object->getAttachStdout(); + if ($data->isInitialized('attachStdout') && null !== $data->getAttachStdout()) { + $dataArray['AttachStdout'] = $data->getAttachStdout(); } - if (null !== $object->getAttachStderr()) { - $data->{'AttachStderr'} = $object->getAttachStderr(); + if ($data->isInitialized('attachStderr') && null !== $data->getAttachStderr()) { + $dataArray['AttachStderr'] = $data->getAttachStderr(); } - if (null !== $object->getExposedPorts()) { - $values = new \stdClass(); - foreach ($object->getExposedPorts() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('exposedPorts') && null !== $data->getExposedPorts()) { + $values = []; + foreach ($data->getExposedPorts() as $key => $value) { + $values[$key] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'ExposedPorts'} = $values; + $dataArray['ExposedPorts'] = $values; } - if (null !== $object->getTty()) { - $data->{'Tty'} = $object->getTty(); + if ($data->isInitialized('tty') && null !== $data->getTty()) { + $dataArray['Tty'] = $data->getTty(); } - if (null !== $object->getOpenStdin()) { - $data->{'OpenStdin'} = $object->getOpenStdin(); + if ($data->isInitialized('openStdin') && null !== $data->getOpenStdin()) { + $dataArray['OpenStdin'] = $data->getOpenStdin(); } - if (null !== $object->getStdinOnce()) { - $data->{'StdinOnce'} = $object->getStdinOnce(); + if ($data->isInitialized('stdinOnce') && null !== $data->getStdinOnce()) { + $dataArray['StdinOnce'] = $data->getStdinOnce(); } - if (null !== $object->getEnv()) { + if ($data->isInitialized('env') && null !== $data->getEnv()) { $values_1 = []; - foreach ($object->getEnv() as $value_1) { + foreach ($data->getEnv() as $value_1) { $values_1[] = $value_1; } - $data->{'Env'} = $values_1; + $dataArray['Env'] = $values_1; } - if (null !== $object->getCmd()) { + if ($data->isInitialized('cmd') && null !== $data->getCmd()) { $values_2 = []; - foreach ($object->getCmd() as $value_2) { + foreach ($data->getCmd() as $value_2) { $values_2[] = $value_2; } - $data->{'Cmd'} = $values_2; + $dataArray['Cmd'] = $values_2; } - if (null !== $object->getHealthcheck()) { - $data->{'Healthcheck'} = $this->normalizer->normalize($object->getHealthcheck(), 'json', $context); + if ($data->isInitialized('healthcheck') && null !== $data->getHealthcheck()) { + $dataArray['Healthcheck'] = $this->normalizer->normalize($data->getHealthcheck(), 'json', $context); } - if (null !== $object->getArgsEscaped()) { - $data->{'ArgsEscaped'} = $object->getArgsEscaped(); + if ($data->isInitialized('argsEscaped') && null !== $data->getArgsEscaped()) { + $dataArray['ArgsEscaped'] = $data->getArgsEscaped(); } - if (null !== $object->getImage()) { - $data->{'Image'} = $object->getImage(); + if ($data->isInitialized('image') && null !== $data->getImage()) { + $dataArray['Image'] = $data->getImage(); } - if (null !== $object->getVolumes()) { - $values_3 = new \stdClass(); - foreach ($object->getVolumes() as $key_1 => $value_3) { - $values_3->{$key_1} = $value_3; + if ($data->isInitialized('volumes') && null !== $data->getVolumes()) { + $values_3 = []; + foreach ($data->getVolumes() as $key_1 => $value_3) { + $values_3[$key_1] = $this->normalizer->normalize($value_3, 'json', $context); } - $data->{'Volumes'} = $values_3; + $dataArray['Volumes'] = $values_3; } - if (null !== $object->getWorkingDir()) { - $data->{'WorkingDir'} = $object->getWorkingDir(); + if ($data->isInitialized('workingDir') && null !== $data->getWorkingDir()) { + $dataArray['WorkingDir'] = $data->getWorkingDir(); } - if (null !== $object->getEntrypoint()) { + if ($data->isInitialized('entrypoint') && null !== $data->getEntrypoint()) { $values_4 = []; - foreach ($object->getEntrypoint() as $value_4) { + foreach ($data->getEntrypoint() as $value_4) { $values_4[] = $value_4; } - $data->{'Entrypoint'} = $values_4; + $dataArray['Entrypoint'] = $values_4; } - if (null !== $object->getNetworkDisabled()) { - $data->{'NetworkDisabled'} = $object->getNetworkDisabled(); + if ($data->isInitialized('networkDisabled') && null !== $data->getNetworkDisabled()) { + $dataArray['NetworkDisabled'] = $data->getNetworkDisabled(); } - if (null !== $object->getMacAddress()) { - $data->{'MacAddress'} = $object->getMacAddress(); + if ($data->isInitialized('macAddress') && null !== $data->getMacAddress()) { + $dataArray['MacAddress'] = $data->getMacAddress(); } - if (null !== $object->getOnBuild()) { + if ($data->isInitialized('onBuild') && null !== $data->getOnBuild()) { $values_5 = []; - foreach ($object->getOnBuild() as $value_5) { + foreach ($data->getOnBuild() as $value_5) { $values_5[] = $value_5; } - $data->{'OnBuild'} = $values_5; + $dataArray['OnBuild'] = $values_5; } - if (null !== $object->getLabels()) { - $values_6 = new \stdClass(); - foreach ($object->getLabels() as $key_2 => $value_6) { - $values_6->{$key_2} = $value_6; + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values_6 = []; + foreach ($data->getLabels() as $key_2 => $value_6) { + $values_6[$key_2] = $value_6; } - $data->{'Labels'} = $values_6; + $dataArray['Labels'] = $values_6; } - if (null !== $object->getStopSignal()) { - $data->{'StopSignal'} = $object->getStopSignal(); + if ($data->isInitialized('stopSignal') && null !== $data->getStopSignal()) { + $dataArray['StopSignal'] = $data->getStopSignal(); } - if (null !== $object->getStopTimeout()) { - $data->{'StopTimeout'} = $object->getStopTimeout(); + if ($data->isInitialized('stopTimeout') && null !== $data->getStopTimeout()) { + $dataArray['StopTimeout'] = $data->getStopTimeout(); } - if (null !== $object->getShell()) { + if ($data->isInitialized('shell') && null !== $data->getShell()) { $values_7 = []; - foreach ($object->getShell() as $value_7) { + foreach ($data->getShell() as $value_7) { $values_7[] = $value_7; } - $data->{'Shell'} = $values_7; + $dataArray['Shell'] = $values_7; + } + foreach ($data as $key_3 => $value_8) { + if (preg_match('/.*/', (string) $key_3)) { + $dataArray[$key_3] = $value_8; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerConfig::class => false]; } } diff --git a/src/Normalizer/ContainerConfigVolumesItemNormalizer.php b/src/Normalizer/ContainerConfigVolumesItemNormalizer.php new file mode 100644 index 00000000..260757b6 --- /dev/null +++ b/src/Normalizer/ContainerConfigVolumesItemNormalizer.php @@ -0,0 +1,71 @@ + $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerConfigVolumesItem::class => false]; + } +} diff --git a/src/Normalizer/ContainerCreateResponseNormalizer.php b/src/Normalizer/ContainerCreateResponseNormalizer.php new file mode 100644 index 00000000..d459ed31 --- /dev/null +++ b/src/Normalizer/ContainerCreateResponseNormalizer.php @@ -0,0 +1,93 @@ +setId($data['Id']); + unset($data['Id']); + } elseif (\array_key_exists('Id', $data) && null === $data['Id']) { + $object->setId(null); + } + if (\array_key_exists('Warnings', $data) && null !== $data['Warnings']) { + $values = []; + foreach ($data['Warnings'] as $value) { + $values[] = $value; + } + $object->setWarnings($values); + unset($data['Warnings']); + } elseif (\array_key_exists('Warnings', $data) && null === $data['Warnings']) { + $object->setWarnings(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + $dataArray['Id'] = $data->getId(); + $values = []; + foreach ($data->getWarnings() as $value) { + $values[] = $value; + } + $dataArray['Warnings'] = $values; + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerCreateResponse::class => false]; + } +} diff --git a/src/Normalizer/ContainerStateNormalizer.php b/src/Normalizer/ContainerStateNormalizer.php new file mode 100644 index 00000000..f2e60922 --- /dev/null +++ b/src/Normalizer/ContainerStateNormalizer.php @@ -0,0 +1,194 @@ +setStatus($data['Status']); + unset($data['Status']); + } elseif (\array_key_exists('Status', $data) && null === $data['Status']) { + $object->setStatus(null); + } + if (\array_key_exists('Running', $data) && null !== $data['Running']) { + $object->setRunning($data['Running']); + unset($data['Running']); + } elseif (\array_key_exists('Running', $data) && null === $data['Running']) { + $object->setRunning(null); + } + if (\array_key_exists('Paused', $data) && null !== $data['Paused']) { + $object->setPaused($data['Paused']); + unset($data['Paused']); + } elseif (\array_key_exists('Paused', $data) && null === $data['Paused']) { + $object->setPaused(null); + } + if (\array_key_exists('Restarting', $data) && null !== $data['Restarting']) { + $object->setRestarting($data['Restarting']); + unset($data['Restarting']); + } elseif (\array_key_exists('Restarting', $data) && null === $data['Restarting']) { + $object->setRestarting(null); + } + if (\array_key_exists('OOMKilled', $data) && null !== $data['OOMKilled']) { + $object->setOOMKilled($data['OOMKilled']); + unset($data['OOMKilled']); + } elseif (\array_key_exists('OOMKilled', $data) && null === $data['OOMKilled']) { + $object->setOOMKilled(null); + } + if (\array_key_exists('Dead', $data) && null !== $data['Dead']) { + $object->setDead($data['Dead']); + unset($data['Dead']); + } elseif (\array_key_exists('Dead', $data) && null === $data['Dead']) { + $object->setDead(null); + } + if (\array_key_exists('Pid', $data) && null !== $data['Pid']) { + $object->setPid($data['Pid']); + unset($data['Pid']); + } elseif (\array_key_exists('Pid', $data) && null === $data['Pid']) { + $object->setPid(null); + } + if (\array_key_exists('ExitCode', $data) && null !== $data['ExitCode']) { + $object->setExitCode($data['ExitCode']); + unset($data['ExitCode']); + } elseif (\array_key_exists('ExitCode', $data) && null === $data['ExitCode']) { + $object->setExitCode(null); + } + if (\array_key_exists('Error', $data) && null !== $data['Error']) { + $object->setError($data['Error']); + unset($data['Error']); + } elseif (\array_key_exists('Error', $data) && null === $data['Error']) { + $object->setError(null); + } + if (\array_key_exists('StartedAt', $data) && null !== $data['StartedAt']) { + $object->setStartedAt($data['StartedAt']); + unset($data['StartedAt']); + } elseif (\array_key_exists('StartedAt', $data) && null === $data['StartedAt']) { + $object->setStartedAt(null); + } + if (\array_key_exists('FinishedAt', $data) && null !== $data['FinishedAt']) { + $object->setFinishedAt($data['FinishedAt']); + unset($data['FinishedAt']); + } elseif (\array_key_exists('FinishedAt', $data) && null === $data['FinishedAt']) { + $object->setFinishedAt(null); + } + if (\array_key_exists('Health', $data) && null !== $data['Health']) { + $object->setHealth($this->denormalizer->denormalize($data['Health'], \Docker\API\Model\Health::class, 'json', $context)); + unset($data['Health']); + } elseif (\array_key_exists('Health', $data) && null === $data['Health']) { + $object->setHealth(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('status') && null !== $data->getStatus()) { + $dataArray['Status'] = $data->getStatus(); + } + if ($data->isInitialized('running') && null !== $data->getRunning()) { + $dataArray['Running'] = $data->getRunning(); + } + if ($data->isInitialized('paused') && null !== $data->getPaused()) { + $dataArray['Paused'] = $data->getPaused(); + } + if ($data->isInitialized('restarting') && null !== $data->getRestarting()) { + $dataArray['Restarting'] = $data->getRestarting(); + } + if ($data->isInitialized('oOMKilled') && null !== $data->getOOMKilled()) { + $dataArray['OOMKilled'] = $data->getOOMKilled(); + } + if ($data->isInitialized('dead') && null !== $data->getDead()) { + $dataArray['Dead'] = $data->getDead(); + } + if ($data->isInitialized('pid') && null !== $data->getPid()) { + $dataArray['Pid'] = $data->getPid(); + } + if ($data->isInitialized('exitCode') && null !== $data->getExitCode()) { + $dataArray['ExitCode'] = $data->getExitCode(); + } + if ($data->isInitialized('error') && null !== $data->getError()) { + $dataArray['Error'] = $data->getError(); + } + if ($data->isInitialized('startedAt') && null !== $data->getStartedAt()) { + $dataArray['StartedAt'] = $data->getStartedAt(); + } + if ($data->isInitialized('finishedAt') && null !== $data->getFinishedAt()) { + $dataArray['FinishedAt'] = $data->getFinishedAt(); + } + if ($data->isInitialized('health') && null !== $data->getHealth()) { + $dataArray['Health'] = $this->normalizer->normalize($data->getHealth(), 'json', $context); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerState::class => false]; + } +} diff --git a/src/Normalizer/ContainerStatusNormalizer.php b/src/Normalizer/ContainerStatusNormalizer.php new file mode 100644 index 00000000..c7b81c3a --- /dev/null +++ b/src/Normalizer/ContainerStatusNormalizer.php @@ -0,0 +1,98 @@ +setContainerID($data['ContainerID']); + unset($data['ContainerID']); + } elseif (\array_key_exists('ContainerID', $data) && null === $data['ContainerID']) { + $object->setContainerID(null); + } + if (\array_key_exists('PID', $data) && null !== $data['PID']) { + $object->setPID($data['PID']); + unset($data['PID']); + } elseif (\array_key_exists('PID', $data) && null === $data['PID']) { + $object->setPID(null); + } + if (\array_key_exists('ExitCode', $data) && null !== $data['ExitCode']) { + $object->setExitCode($data['ExitCode']); + unset($data['ExitCode']); + } elseif (\array_key_exists('ExitCode', $data) && null === $data['ExitCode']) { + $object->setExitCode(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('containerID') && null !== $data->getContainerID()) { + $dataArray['ContainerID'] = $data->getContainerID(); + } + if ($data->isInitialized('pID') && null !== $data->getPID()) { + $dataArray['PID'] = $data->getPID(); + } + if ($data->isInitialized('exitCode') && null !== $data->getExitCode()) { + $dataArray['ExitCode'] = $data->getExitCode(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerStatus::class => false]; + } +} diff --git a/src/Normalizer/ContainerSummaryHostConfigNormalizer.php b/src/Normalizer/ContainerSummaryHostConfigNormalizer.php new file mode 100644 index 00000000..a98a873e --- /dev/null +++ b/src/Normalizer/ContainerSummaryHostConfigNormalizer.php @@ -0,0 +1,80 @@ +setNetworkMode($data['NetworkMode']); + unset($data['NetworkMode']); + } elseif (\array_key_exists('NetworkMode', $data) && null === $data['NetworkMode']) { + $object->setNetworkMode(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('networkMode') && null !== $data->getNetworkMode()) { + $dataArray['NetworkMode'] = $data->getNetworkMode(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerSummaryHostConfig::class => false]; + } +} diff --git a/src/Normalizer/ContainerSummaryItemHostConfigNormalizer.php b/src/Normalizer/ContainerSummaryItemHostConfigNormalizer.php deleted file mode 100644 index 35399650..00000000 --- a/src/Normalizer/ContainerSummaryItemHostConfigNormalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -{'NetworkMode'} !== null) { - $object->setNetworkMode($data->{'NetworkMode'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getNetworkMode()) { - $data->{'NetworkMode'} = $object->getNetworkMode(); - } - - return $data; - } -} diff --git a/src/Normalizer/ContainerSummaryItemNetworkSettingsNormalizer.php b/src/Normalizer/ContainerSummaryItemNetworkSettingsNormalizer.php deleted file mode 100644 index 32bb2022..00000000 --- a/src/Normalizer/ContainerSummaryItemNetworkSettingsNormalizer.php +++ /dev/null @@ -1,65 +0,0 @@ -{'Networks'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Networks'} as $key => $value) { - $values[$key] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\EndpointSettings', 'json', $context); - } - $object->setNetworks($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getNetworks()) { - $values = new \stdClass(); - foreach ($object->getNetworks() as $key => $value) { - $values->{$key} = $this->normalizer->normalize($value, 'json', $context); - } - $data->{'Networks'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/ContainerSummaryItemNormalizer.php b/src/Normalizer/ContainerSummaryItemNormalizer.php deleted file mode 100644 index 804c536e..00000000 --- a/src/Normalizer/ContainerSummaryItemNormalizer.php +++ /dev/null @@ -1,173 +0,0 @@ -{'Id'} !== null) { - $object->setId($data->{'Id'}); - } - if (property_exists($data, 'Names') && $data->{'Names'} !== null) { - $values = []; - foreach ($data->{'Names'} as $value) { - $values[] = $value; - } - $object->setNames($values); - } - if (property_exists($data, 'Image') && $data->{'Image'} !== null) { - $object->setImage($data->{'Image'}); - } - if (property_exists($data, 'ImageID') && $data->{'ImageID'} !== null) { - $object->setImageID($data->{'ImageID'}); - } - if (property_exists($data, 'Command') && $data->{'Command'} !== null) { - $object->setCommand($data->{'Command'}); - } - if (property_exists($data, 'Created') && $data->{'Created'} !== null) { - $object->setCreated($data->{'Created'}); - } - if (property_exists($data, 'Ports') && $data->{'Ports'} !== null) { - $values_1 = []; - foreach ($data->{'Ports'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\Port', 'json', $context); - } - $object->setPorts($values_1); - } - if (property_exists($data, 'SizeRw') && $data->{'SizeRw'} !== null) { - $object->setSizeRw($data->{'SizeRw'}); - } - if (property_exists($data, 'SizeRootFs') && $data->{'SizeRootFs'} !== null) { - $object->setSizeRootFs($data->{'SizeRootFs'}); - } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value_2) { - $values_2[$key] = $value_2; - } - $object->setLabels($values_2); - } - if (property_exists($data, 'State') && $data->{'State'} !== null) { - $object->setState($data->{'State'}); - } - if (property_exists($data, 'Status') && $data->{'Status'} !== null) { - $object->setStatus($data->{'Status'}); - } - if (property_exists($data, 'HostConfig') && $data->{'HostConfig'} !== null) { - $object->setHostConfig($this->denormalizer->denormalize($data->{'HostConfig'}, 'Docker\\API\\Model\\ContainerSummaryItemHostConfig', 'json', $context)); - } - if (property_exists($data, 'NetworkSettings') && $data->{'NetworkSettings'} !== null) { - $object->setNetworkSettings($this->denormalizer->denormalize($data->{'NetworkSettings'}, 'Docker\\API\\Model\\ContainerSummaryItemNetworkSettings', 'json', $context)); - } - if (property_exists($data, 'Mounts') && $data->{'Mounts'} !== null) { - $values_3 = []; - foreach ($data->{'Mounts'} as $value_3) { - $values_3[] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\Mount', 'json', $context); - } - $object->setMounts($values_3); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - if (null !== $object->getNames()) { - $values = []; - foreach ($object->getNames() as $value) { - $values[] = $value; - } - $data->{'Names'} = $values; - } - if (null !== $object->getImage()) { - $data->{'Image'} = $object->getImage(); - } - if (null !== $object->getImageID()) { - $data->{'ImageID'} = $object->getImageID(); - } - if (null !== $object->getCommand()) { - $data->{'Command'} = $object->getCommand(); - } - if (null !== $object->getCreated()) { - $data->{'Created'} = $object->getCreated(); - } - if (null !== $object->getPorts()) { - $values_1 = []; - foreach ($object->getPorts() as $value_1) { - $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); - } - $data->{'Ports'} = $values_1; - } - if (null !== $object->getSizeRw()) { - $data->{'SizeRw'} = $object->getSizeRw(); - } - if (null !== $object->getSizeRootFs()) { - $data->{'SizeRootFs'} = $object->getSizeRootFs(); - } - if (null !== $object->getLabels()) { - $values_2 = new \stdClass(); - foreach ($object->getLabels() as $key => $value_2) { - $values_2->{$key} = $value_2; - } - $data->{'Labels'} = $values_2; - } - if (null !== $object->getState()) { - $data->{'State'} = $object->getState(); - } - if (null !== $object->getStatus()) { - $data->{'Status'} = $object->getStatus(); - } - if (null !== $object->getHostConfig()) { - $data->{'HostConfig'} = $this->normalizer->normalize($object->getHostConfig(), 'json', $context); - } - if (null !== $object->getNetworkSettings()) { - $data->{'NetworkSettings'} = $this->normalizer->normalize($object->getNetworkSettings(), 'json', $context); - } - if (null !== $object->getMounts()) { - $values_3 = []; - foreach ($object->getMounts() as $value_3) { - $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); - } - $data->{'Mounts'} = $values_3; - } - - return $data; - } -} diff --git a/src/Normalizer/ContainerSummaryNetworkSettingsNormalizer.php b/src/Normalizer/ContainerSummaryNetworkSettingsNormalizer.php new file mode 100644 index 00000000..f10dc4db --- /dev/null +++ b/src/Normalizer/ContainerSummaryNetworkSettingsNormalizer.php @@ -0,0 +1,88 @@ + $value) { + $values[$key] = $this->denormalizer->denormalize($value, \Docker\API\Model\EndpointSettings::class, 'json', $context); + } + $object->setNetworks($values); + unset($data['Networks']); + } elseif (\array_key_exists('Networks', $data) && null === $data['Networks']) { + $object->setNetworks(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('networks') && null !== $data->getNetworks()) { + $values = []; + foreach ($data->getNetworks() as $key => $value) { + $values[$key] = $this->normalizer->normalize($value, 'json', $context); + } + $dataArray['Networks'] = $values; + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerSummaryNetworkSettings::class => false]; + } +} diff --git a/src/Normalizer/ContainerSummaryNormalizer.php b/src/Normalizer/ContainerSummaryNormalizer.php new file mode 100644 index 00000000..1eb0fdb6 --- /dev/null +++ b/src/Normalizer/ContainerSummaryNormalizer.php @@ -0,0 +1,238 @@ +setId($data['Id']); + unset($data['Id']); + } elseif (\array_key_exists('Id', $data) && null === $data['Id']) { + $object->setId(null); + } + if (\array_key_exists('Names', $data) && null !== $data['Names']) { + $values = []; + foreach ($data['Names'] as $value) { + $values[] = $value; + } + $object->setNames($values); + unset($data['Names']); + } elseif (\array_key_exists('Names', $data) && null === $data['Names']) { + $object->setNames(null); + } + if (\array_key_exists('Image', $data) && null !== $data['Image']) { + $object->setImage($data['Image']); + unset($data['Image']); + } elseif (\array_key_exists('Image', $data) && null === $data['Image']) { + $object->setImage(null); + } + if (\array_key_exists('ImageID', $data) && null !== $data['ImageID']) { + $object->setImageID($data['ImageID']); + unset($data['ImageID']); + } elseif (\array_key_exists('ImageID', $data) && null === $data['ImageID']) { + $object->setImageID(null); + } + if (\array_key_exists('Command', $data) && null !== $data['Command']) { + $object->setCommand($data['Command']); + unset($data['Command']); + } elseif (\array_key_exists('Command', $data) && null === $data['Command']) { + $object->setCommand(null); + } + if (\array_key_exists('Created', $data) && null !== $data['Created']) { + $object->setCreated($data['Created']); + unset($data['Created']); + } elseif (\array_key_exists('Created', $data) && null === $data['Created']) { + $object->setCreated(null); + } + if (\array_key_exists('Ports', $data) && null !== $data['Ports']) { + $values_1 = []; + foreach ($data['Ports'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\Port::class, 'json', $context); + } + $object->setPorts($values_1); + unset($data['Ports']); + } elseif (\array_key_exists('Ports', $data) && null === $data['Ports']) { + $object->setPorts(null); + } + if (\array_key_exists('SizeRw', $data) && null !== $data['SizeRw']) { + $object->setSizeRw($data['SizeRw']); + unset($data['SizeRw']); + } elseif (\array_key_exists('SizeRw', $data) && null === $data['SizeRw']) { + $object->setSizeRw(null); + } + if (\array_key_exists('SizeRootFs', $data) && null !== $data['SizeRootFs']) { + $object->setSizeRootFs($data['SizeRootFs']); + unset($data['SizeRootFs']); + } elseif (\array_key_exists('SizeRootFs', $data) && null === $data['SizeRootFs']) { + $object->setSizeRootFs(null); + } + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { + $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key => $value_2) { + $values_2[$key] = $value_2; + } + $object->setLabels($values_2); + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + if (\array_key_exists('State', $data) && null !== $data['State']) { + $object->setState($data['State']); + unset($data['State']); + } elseif (\array_key_exists('State', $data) && null === $data['State']) { + $object->setState(null); + } + if (\array_key_exists('Status', $data) && null !== $data['Status']) { + $object->setStatus($data['Status']); + unset($data['Status']); + } elseif (\array_key_exists('Status', $data) && null === $data['Status']) { + $object->setStatus(null); + } + if (\array_key_exists('HostConfig', $data) && null !== $data['HostConfig']) { + $object->setHostConfig($this->denormalizer->denormalize($data['HostConfig'], \Docker\API\Model\ContainerSummaryHostConfig::class, 'json', $context)); + unset($data['HostConfig']); + } elseif (\array_key_exists('HostConfig', $data) && null === $data['HostConfig']) { + $object->setHostConfig(null); + } + if (\array_key_exists('NetworkSettings', $data) && null !== $data['NetworkSettings']) { + $object->setNetworkSettings($this->denormalizer->denormalize($data['NetworkSettings'], \Docker\API\Model\ContainerSummaryNetworkSettings::class, 'json', $context)); + unset($data['NetworkSettings']); + } elseif (\array_key_exists('NetworkSettings', $data) && null === $data['NetworkSettings']) { + $object->setNetworkSettings(null); + } + if (\array_key_exists('Mounts', $data) && null !== $data['Mounts']) { + $values_3 = []; + foreach ($data['Mounts'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\MountPoint::class, 'json', $context); + } + $object->setMounts($values_3); + unset($data['Mounts']); + } elseif (\array_key_exists('Mounts', $data) && null === $data['Mounts']) { + $object->setMounts(null); + } + foreach ($data as $key_1 => $value_4) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_4; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('id') && null !== $data->getId()) { + $dataArray['Id'] = $data->getId(); + } + if ($data->isInitialized('names') && null !== $data->getNames()) { + $values = []; + foreach ($data->getNames() as $value) { + $values[] = $value; + } + $dataArray['Names'] = $values; + } + if ($data->isInitialized('image') && null !== $data->getImage()) { + $dataArray['Image'] = $data->getImage(); + } + if ($data->isInitialized('imageID') && null !== $data->getImageID()) { + $dataArray['ImageID'] = $data->getImageID(); + } + if ($data->isInitialized('command') && null !== $data->getCommand()) { + $dataArray['Command'] = $data->getCommand(); + } + if ($data->isInitialized('created') && null !== $data->getCreated()) { + $dataArray['Created'] = $data->getCreated(); + } + if ($data->isInitialized('ports') && null !== $data->getPorts()) { + $values_1 = []; + foreach ($data->getPorts() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $dataArray['Ports'] = $values_1; + } + if ($data->isInitialized('sizeRw') && null !== $data->getSizeRw()) { + $dataArray['SizeRw'] = $data->getSizeRw(); + } + if ($data->isInitialized('sizeRootFs') && null !== $data->getSizeRootFs()) { + $dataArray['SizeRootFs'] = $data->getSizeRootFs(); + } + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values_2 = []; + foreach ($data->getLabels() as $key => $value_2) { + $values_2[$key] = $value_2; + } + $dataArray['Labels'] = $values_2; + } + if ($data->isInitialized('state') && null !== $data->getState()) { + $dataArray['State'] = $data->getState(); + } + if ($data->isInitialized('status') && null !== $data->getStatus()) { + $dataArray['Status'] = $data->getStatus(); + } + if ($data->isInitialized('hostConfig') && null !== $data->getHostConfig()) { + $dataArray['HostConfig'] = $this->normalizer->normalize($data->getHostConfig(), 'json', $context); + } + if ($data->isInitialized('networkSettings') && null !== $data->getNetworkSettings()) { + $dataArray['NetworkSettings'] = $this->normalizer->normalize($data->getNetworkSettings(), 'json', $context); + } + if ($data->isInitialized('mounts') && null !== $data->getMounts()) { + $values_3 = []; + foreach ($data->getMounts() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $dataArray['Mounts'] = $values_3; + } + foreach ($data as $key_1 => $value_4) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_4; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerSummary::class => false]; + } +} diff --git a/src/Normalizer/ContainerWaitExitErrorNormalizer.php b/src/Normalizer/ContainerWaitExitErrorNormalizer.php new file mode 100644 index 00000000..bc33a5bf --- /dev/null +++ b/src/Normalizer/ContainerWaitExitErrorNormalizer.php @@ -0,0 +1,80 @@ +setMessage($data['Message']); + unset($data['Message']); + } elseif (\array_key_exists('Message', $data) && null === $data['Message']) { + $object->setMessage(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('message') && null !== $data->getMessage()) { + $dataArray['Message'] = $data->getMessage(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerWaitExitError::class => false]; + } +} diff --git a/src/Normalizer/ContainerWaitResponseNormalizer.php b/src/Normalizer/ContainerWaitResponseNormalizer.php new file mode 100644 index 00000000..5fda7d67 --- /dev/null +++ b/src/Normalizer/ContainerWaitResponseNormalizer.php @@ -0,0 +1,87 @@ +setStatusCode($data['StatusCode']); + unset($data['StatusCode']); + } elseif (\array_key_exists('StatusCode', $data) && null === $data['StatusCode']) { + $object->setStatusCode(null); + } + if (\array_key_exists('Error', $data) && null !== $data['Error']) { + $object->setError($this->denormalizer->denormalize($data['Error'], \Docker\API\Model\ContainerWaitExitError::class, 'json', $context)); + unset($data['Error']); + } elseif (\array_key_exists('Error', $data) && null === $data['Error']) { + $object->setError(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + $dataArray['StatusCode'] = $data->getStatusCode(); + if ($data->isInitialized('error') && null !== $data->getError()) { + $dataArray['Error'] = $this->normalizer->normalize($data->getError(), 'json', $context); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainerWaitResponse::class => false]; + } +} diff --git a/src/Normalizer/ContainersCreatePostBodyNetworkingConfigNormalizer.php b/src/Normalizer/ContainersCreatePostBodyNetworkingConfigNormalizer.php deleted file mode 100644 index 94f43826..00000000 --- a/src/Normalizer/ContainersCreatePostBodyNetworkingConfigNormalizer.php +++ /dev/null @@ -1,65 +0,0 @@ -{'EndpointsConfig'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'EndpointsConfig'} as $key => $value) { - $values[$key] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\EndpointSettings', 'json', $context); - } - $object->setEndpointsConfig($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getEndpointsConfig()) { - $values = new \stdClass(); - foreach ($object->getEndpointsConfig() as $key => $value) { - $values->{$key} = $this->normalizer->normalize($value, 'json', $context); - } - $data->{'EndpointsConfig'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/ContainersCreatePostBodyNormalizer.php b/src/Normalizer/ContainersCreatePostBodyNormalizer.php index 3024507c..279678d3 100644 --- a/src/Normalizer/ContainersCreatePostBodyNormalizer.php +++ b/src/Normalizer/ContainersCreatePostBodyNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,259 +16,387 @@ class ContainersCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ContainersCreatePostBody'; + return \Docker\API\Model\ContainersCreatePostBody::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ContainersCreatePostBody; + return \is_object($data) && \Docker\API\Model\ContainersCreatePostBody::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\ContainersCreatePostBody(); - if (property_exists($data, 'Hostname') && $data->{'Hostname'} !== null) { - $object->setHostname($data->{'Hostname'}); - } - if (property_exists($data, 'Domainname') && $data->{'Domainname'} !== null) { - $object->setDomainname($data->{'Domainname'}); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'User') && $data->{'User'} !== null) { - $object->setUser($data->{'User'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'AttachStdin') && $data->{'AttachStdin'} !== null) { - $object->setAttachStdin($data->{'AttachStdin'}); - } - if (property_exists($data, 'AttachStdout') && $data->{'AttachStdout'} !== null) { - $object->setAttachStdout($data->{'AttachStdout'}); - } - if (property_exists($data, 'AttachStderr') && $data->{'AttachStderr'} !== null) { - $object->setAttachStderr($data->{'AttachStderr'}); - } - if (property_exists($data, 'ExposedPorts') && $data->{'ExposedPorts'} !== null) { + $object = new \Docker\API\Model\ContainersCreatePostBody(); + if (\array_key_exists('AttachStdin', $data) && \is_int($data['AttachStdin'])) { + $data['AttachStdin'] = (bool) $data['AttachStdin']; + } + if (\array_key_exists('AttachStdout', $data) && \is_int($data['AttachStdout'])) { + $data['AttachStdout'] = (bool) $data['AttachStdout']; + } + if (\array_key_exists('AttachStderr', $data) && \is_int($data['AttachStderr'])) { + $data['AttachStderr'] = (bool) $data['AttachStderr']; + } + if (\array_key_exists('Tty', $data) && \is_int($data['Tty'])) { + $data['Tty'] = (bool) $data['Tty']; + } + if (\array_key_exists('OpenStdin', $data) && \is_int($data['OpenStdin'])) { + $data['OpenStdin'] = (bool) $data['OpenStdin']; + } + if (\array_key_exists('StdinOnce', $data) && \is_int($data['StdinOnce'])) { + $data['StdinOnce'] = (bool) $data['StdinOnce']; + } + if (\array_key_exists('ArgsEscaped', $data) && \is_int($data['ArgsEscaped'])) { + $data['ArgsEscaped'] = (bool) $data['ArgsEscaped']; + } + if (\array_key_exists('NetworkDisabled', $data) && \is_int($data['NetworkDisabled'])) { + $data['NetworkDisabled'] = (bool) $data['NetworkDisabled']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Hostname', $data) && null !== $data['Hostname']) { + $object->setHostname($data['Hostname']); + unset($data['Hostname']); + } elseif (\array_key_exists('Hostname', $data) && null === $data['Hostname']) { + $object->setHostname(null); + } + if (\array_key_exists('Domainname', $data) && null !== $data['Domainname']) { + $object->setDomainname($data['Domainname']); + unset($data['Domainname']); + } elseif (\array_key_exists('Domainname', $data) && null === $data['Domainname']) { + $object->setDomainname(null); + } + if (\array_key_exists('User', $data) && null !== $data['User']) { + $object->setUser($data['User']); + unset($data['User']); + } elseif (\array_key_exists('User', $data) && null === $data['User']) { + $object->setUser(null); + } + if (\array_key_exists('AttachStdin', $data) && null !== $data['AttachStdin']) { + $object->setAttachStdin($data['AttachStdin']); + unset($data['AttachStdin']); + } elseif (\array_key_exists('AttachStdin', $data) && null === $data['AttachStdin']) { + $object->setAttachStdin(null); + } + if (\array_key_exists('AttachStdout', $data) && null !== $data['AttachStdout']) { + $object->setAttachStdout($data['AttachStdout']); + unset($data['AttachStdout']); + } elseif (\array_key_exists('AttachStdout', $data) && null === $data['AttachStdout']) { + $object->setAttachStdout(null); + } + if (\array_key_exists('AttachStderr', $data) && null !== $data['AttachStderr']) { + $object->setAttachStderr($data['AttachStderr']); + unset($data['AttachStderr']); + } elseif (\array_key_exists('AttachStderr', $data) && null === $data['AttachStderr']) { + $object->setAttachStderr(null); + } + if (\array_key_exists('ExposedPorts', $data) && null !== $data['ExposedPorts']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'ExposedPorts'} as $key => $value) { - $values[$key] = $value; + foreach ($data['ExposedPorts'] as $key => $value) { + $values[$key] = $this->denormalizer->denormalize($value, \Docker\API\Model\ContainerConfigExposedPortsItem::class, 'json', $context); } $object->setExposedPorts($values); - } - if (property_exists($data, 'Tty') && $data->{'Tty'} !== null) { - $object->setTty($data->{'Tty'}); - } - if (property_exists($data, 'OpenStdin') && $data->{'OpenStdin'} !== null) { - $object->setOpenStdin($data->{'OpenStdin'}); - } - if (property_exists($data, 'StdinOnce') && $data->{'StdinOnce'} !== null) { - $object->setStdinOnce($data->{'StdinOnce'}); - } - if (property_exists($data, 'Env') && $data->{'Env'} !== null) { + unset($data['ExposedPorts']); + } elseif (\array_key_exists('ExposedPorts', $data) && null === $data['ExposedPorts']) { + $object->setExposedPorts(null); + } + if (\array_key_exists('Tty', $data) && null !== $data['Tty']) { + $object->setTty($data['Tty']); + unset($data['Tty']); + } elseif (\array_key_exists('Tty', $data) && null === $data['Tty']) { + $object->setTty(null); + } + if (\array_key_exists('OpenStdin', $data) && null !== $data['OpenStdin']) { + $object->setOpenStdin($data['OpenStdin']); + unset($data['OpenStdin']); + } elseif (\array_key_exists('OpenStdin', $data) && null === $data['OpenStdin']) { + $object->setOpenStdin(null); + } + if (\array_key_exists('StdinOnce', $data) && null !== $data['StdinOnce']) { + $object->setStdinOnce($data['StdinOnce']); + unset($data['StdinOnce']); + } elseif (\array_key_exists('StdinOnce', $data) && null === $data['StdinOnce']) { + $object->setStdinOnce(null); + } + if (\array_key_exists('Env', $data) && null !== $data['Env']) { $values_1 = []; - foreach ($data->{'Env'} as $value_1) { + foreach ($data['Env'] as $value_1) { $values_1[] = $value_1; } $object->setEnv($values_1); + unset($data['Env']); + } elseif (\array_key_exists('Env', $data) && null === $data['Env']) { + $object->setEnv(null); } - if (property_exists($data, 'Cmd') && $data->{'Cmd'} !== null) { + if (\array_key_exists('Cmd', $data) && null !== $data['Cmd']) { $values_2 = []; - foreach ($data->{'Cmd'} as $value_2) { + foreach ($data['Cmd'] as $value_2) { $values_2[] = $value_2; } $object->setCmd($values_2); - } - if (property_exists($data, 'Healthcheck') && $data->{'Healthcheck'} !== null) { - $object->setHealthcheck($this->denormalizer->denormalize($data->{'Healthcheck'}, 'Docker\\API\\Model\\HealthConfig', 'json', $context)); - } - if (property_exists($data, 'ArgsEscaped') && $data->{'ArgsEscaped'} !== null) { - $object->setArgsEscaped($data->{'ArgsEscaped'}); - } - if (property_exists($data, 'Image') && $data->{'Image'} !== null) { - $object->setImage($data->{'Image'}); - } - if (property_exists($data, 'Volumes') && $data->{'Volumes'} !== null) { + unset($data['Cmd']); + } elseif (\array_key_exists('Cmd', $data) && null === $data['Cmd']) { + $object->setCmd(null); + } + if (\array_key_exists('Healthcheck', $data) && null !== $data['Healthcheck']) { + $object->setHealthcheck($this->denormalizer->denormalize($data['Healthcheck'], \Docker\API\Model\HealthConfig::class, 'json', $context)); + unset($data['Healthcheck']); + } elseif (\array_key_exists('Healthcheck', $data) && null === $data['Healthcheck']) { + $object->setHealthcheck(null); + } + if (\array_key_exists('ArgsEscaped', $data) && null !== $data['ArgsEscaped']) { + $object->setArgsEscaped($data['ArgsEscaped']); + unset($data['ArgsEscaped']); + } elseif (\array_key_exists('ArgsEscaped', $data) && null === $data['ArgsEscaped']) { + $object->setArgsEscaped(null); + } + if (\array_key_exists('Image', $data) && null !== $data['Image']) { + $object->setImage($data['Image']); + unset($data['Image']); + } elseif (\array_key_exists('Image', $data) && null === $data['Image']) { + $object->setImage(null); + } + if (\array_key_exists('Volumes', $data) && null !== $data['Volumes']) { $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Volumes'} as $key_1 => $value_3) { - $values_3[$key_1] = $value_3; + foreach ($data['Volumes'] as $key_1 => $value_3) { + $values_3[$key_1] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\ContainerConfigVolumesItem::class, 'json', $context); } $object->setVolumes($values_3); + unset($data['Volumes']); + } elseif (\array_key_exists('Volumes', $data) && null === $data['Volumes']) { + $object->setVolumes(null); } - if (property_exists($data, 'WorkingDir') && $data->{'WorkingDir'} !== null) { - $object->setWorkingDir($data->{'WorkingDir'}); + if (\array_key_exists('WorkingDir', $data) && null !== $data['WorkingDir']) { + $object->setWorkingDir($data['WorkingDir']); + unset($data['WorkingDir']); + } elseif (\array_key_exists('WorkingDir', $data) && null === $data['WorkingDir']) { + $object->setWorkingDir(null); } - if (property_exists($data, 'Entrypoint') && $data->{'Entrypoint'} !== null) { + if (\array_key_exists('Entrypoint', $data) && null !== $data['Entrypoint']) { $values_4 = []; - foreach ($data->{'Entrypoint'} as $value_4) { + foreach ($data['Entrypoint'] as $value_4) { $values_4[] = $value_4; } $object->setEntrypoint($values_4); - } - if (property_exists($data, 'NetworkDisabled') && $data->{'NetworkDisabled'} !== null) { - $object->setNetworkDisabled($data->{'NetworkDisabled'}); - } - if (property_exists($data, 'MacAddress') && $data->{'MacAddress'} !== null) { - $object->setMacAddress($data->{'MacAddress'}); - } - if (property_exists($data, 'OnBuild') && $data->{'OnBuild'} !== null) { + unset($data['Entrypoint']); + } elseif (\array_key_exists('Entrypoint', $data) && null === $data['Entrypoint']) { + $object->setEntrypoint(null); + } + if (\array_key_exists('NetworkDisabled', $data) && null !== $data['NetworkDisabled']) { + $object->setNetworkDisabled($data['NetworkDisabled']); + unset($data['NetworkDisabled']); + } elseif (\array_key_exists('NetworkDisabled', $data) && null === $data['NetworkDisabled']) { + $object->setNetworkDisabled(null); + } + if (\array_key_exists('MacAddress', $data) && null !== $data['MacAddress']) { + $object->setMacAddress($data['MacAddress']); + unset($data['MacAddress']); + } elseif (\array_key_exists('MacAddress', $data) && null === $data['MacAddress']) { + $object->setMacAddress(null); + } + if (\array_key_exists('OnBuild', $data) && null !== $data['OnBuild']) { $values_5 = []; - foreach ($data->{'OnBuild'} as $value_5) { + foreach ($data['OnBuild'] as $value_5) { $values_5[] = $value_5; } $object->setOnBuild($values_5); + unset($data['OnBuild']); + } elseif (\array_key_exists('OnBuild', $data) && null === $data['OnBuild']) { + $object->setOnBuild(null); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key_2 => $value_6) { + foreach ($data['Labels'] as $key_2 => $value_6) { $values_6[$key_2] = $value_6; } $object->setLabels($values_6); - } - if (property_exists($data, 'StopSignal') && $data->{'StopSignal'} !== null) { - $object->setStopSignal($data->{'StopSignal'}); - } - if (property_exists($data, 'StopTimeout') && $data->{'StopTimeout'} !== null) { - $object->setStopTimeout($data->{'StopTimeout'}); - } - if (property_exists($data, 'Shell') && $data->{'Shell'} !== null) { + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + if (\array_key_exists('StopSignal', $data) && null !== $data['StopSignal']) { + $object->setStopSignal($data['StopSignal']); + unset($data['StopSignal']); + } elseif (\array_key_exists('StopSignal', $data) && null === $data['StopSignal']) { + $object->setStopSignal(null); + } + if (\array_key_exists('StopTimeout', $data) && null !== $data['StopTimeout']) { + $object->setStopTimeout($data['StopTimeout']); + unset($data['StopTimeout']); + } elseif (\array_key_exists('StopTimeout', $data) && null === $data['StopTimeout']) { + $object->setStopTimeout(null); + } + if (\array_key_exists('Shell', $data) && null !== $data['Shell']) { $values_7 = []; - foreach ($data->{'Shell'} as $value_7) { + foreach ($data['Shell'] as $value_7) { $values_7[] = $value_7; } $object->setShell($values_7); - } - if (property_exists($data, 'HostConfig') && $data->{'HostConfig'} !== null) { - $object->setHostConfig($this->denormalizer->denormalize($data->{'HostConfig'}, 'Docker\\API\\Model\\HostConfig', 'json', $context)); - } - if (property_exists($data, 'NetworkingConfig') && $data->{'NetworkingConfig'} !== null) { - $object->setNetworkingConfig($this->denormalizer->denormalize($data->{'NetworkingConfig'}, 'Docker\\API\\Model\\ContainersCreatePostBodyNetworkingConfig', 'json', $context)); + unset($data['Shell']); + } elseif (\array_key_exists('Shell', $data) && null === $data['Shell']) { + $object->setShell(null); + } + if (\array_key_exists('HostConfig', $data) && null !== $data['HostConfig']) { + $object->setHostConfig($this->denormalizer->denormalize($data['HostConfig'], \Docker\API\Model\HostConfig::class, 'json', $context)); + unset($data['HostConfig']); + } elseif (\array_key_exists('HostConfig', $data) && null === $data['HostConfig']) { + $object->setHostConfig(null); + } + if (\array_key_exists('NetworkingConfig', $data) && null !== $data['NetworkingConfig']) { + $object->setNetworkingConfig($this->denormalizer->denormalize($data['NetworkingConfig'], \Docker\API\Model\NetworkingConfig::class, 'json', $context)); + unset($data['NetworkingConfig']); + } elseif (\array_key_exists('NetworkingConfig', $data) && null === $data['NetworkingConfig']) { + $object->setNetworkingConfig(null); + } + foreach ($data as $key_3 => $value_8) { + if (preg_match('/.*/', (string) $key_3)) { + $object[$key_3] = $value_8; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getHostname()) { - $data->{'Hostname'} = $object->getHostname(); + $dataArray = []; + if ($data->isInitialized('hostname') && null !== $data->getHostname()) { + $dataArray['Hostname'] = $data->getHostname(); } - if (null !== $object->getDomainname()) { - $data->{'Domainname'} = $object->getDomainname(); + if ($data->isInitialized('domainname') && null !== $data->getDomainname()) { + $dataArray['Domainname'] = $data->getDomainname(); } - if (null !== $object->getUser()) { - $data->{'User'} = $object->getUser(); + if ($data->isInitialized('user') && null !== $data->getUser()) { + $dataArray['User'] = $data->getUser(); } - if (null !== $object->getAttachStdin()) { - $data->{'AttachStdin'} = $object->getAttachStdin(); + if ($data->isInitialized('attachStdin') && null !== $data->getAttachStdin()) { + $dataArray['AttachStdin'] = $data->getAttachStdin(); } - if (null !== $object->getAttachStdout()) { - $data->{'AttachStdout'} = $object->getAttachStdout(); + if ($data->isInitialized('attachStdout') && null !== $data->getAttachStdout()) { + $dataArray['AttachStdout'] = $data->getAttachStdout(); } - if (null !== $object->getAttachStderr()) { - $data->{'AttachStderr'} = $object->getAttachStderr(); + if ($data->isInitialized('attachStderr') && null !== $data->getAttachStderr()) { + $dataArray['AttachStderr'] = $data->getAttachStderr(); } - if (null !== $object->getExposedPorts()) { - $values = new \stdClass(); - foreach ($object->getExposedPorts() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('exposedPorts') && null !== $data->getExposedPorts()) { + $values = []; + foreach ($data->getExposedPorts() as $key => $value) { + $values[$key] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'ExposedPorts'} = $values; + $dataArray['ExposedPorts'] = $values; } - if (null !== $object->getTty()) { - $data->{'Tty'} = $object->getTty(); + if ($data->isInitialized('tty') && null !== $data->getTty()) { + $dataArray['Tty'] = $data->getTty(); } - if (null !== $object->getOpenStdin()) { - $data->{'OpenStdin'} = $object->getOpenStdin(); + if ($data->isInitialized('openStdin') && null !== $data->getOpenStdin()) { + $dataArray['OpenStdin'] = $data->getOpenStdin(); } - if (null !== $object->getStdinOnce()) { - $data->{'StdinOnce'} = $object->getStdinOnce(); + if ($data->isInitialized('stdinOnce') && null !== $data->getStdinOnce()) { + $dataArray['StdinOnce'] = $data->getStdinOnce(); } - if (null !== $object->getEnv()) { + if ($data->isInitialized('env') && null !== $data->getEnv()) { $values_1 = []; - foreach ($object->getEnv() as $value_1) { + foreach ($data->getEnv() as $value_1) { $values_1[] = $value_1; } - $data->{'Env'} = $values_1; + $dataArray['Env'] = $values_1; } - if (null !== $object->getCmd()) { + if ($data->isInitialized('cmd') && null !== $data->getCmd()) { $values_2 = []; - foreach ($object->getCmd() as $value_2) { + foreach ($data->getCmd() as $value_2) { $values_2[] = $value_2; } - $data->{'Cmd'} = $values_2; + $dataArray['Cmd'] = $values_2; } - if (null !== $object->getHealthcheck()) { - $data->{'Healthcheck'} = $this->normalizer->normalize($object->getHealthcheck(), 'json', $context); + if ($data->isInitialized('healthcheck') && null !== $data->getHealthcheck()) { + $dataArray['Healthcheck'] = $this->normalizer->normalize($data->getHealthcheck(), 'json', $context); } - if (null !== $object->getArgsEscaped()) { - $data->{'ArgsEscaped'} = $object->getArgsEscaped(); + if ($data->isInitialized('argsEscaped') && null !== $data->getArgsEscaped()) { + $dataArray['ArgsEscaped'] = $data->getArgsEscaped(); } - if (null !== $object->getImage()) { - $data->{'Image'} = $object->getImage(); + if ($data->isInitialized('image') && null !== $data->getImage()) { + $dataArray['Image'] = $data->getImage(); } - if (null !== $object->getVolumes()) { - $values_3 = new \stdClass(); - foreach ($object->getVolumes() as $key_1 => $value_3) { - $values_3->{$key_1} = $value_3; + if ($data->isInitialized('volumes') && null !== $data->getVolumes()) { + $values_3 = []; + foreach ($data->getVolumes() as $key_1 => $value_3) { + $values_3[$key_1] = $this->normalizer->normalize($value_3, 'json', $context); } - $data->{'Volumes'} = $values_3; + $dataArray['Volumes'] = $values_3; } - if (null !== $object->getWorkingDir()) { - $data->{'WorkingDir'} = $object->getWorkingDir(); + if ($data->isInitialized('workingDir') && null !== $data->getWorkingDir()) { + $dataArray['WorkingDir'] = $data->getWorkingDir(); } - if (null !== $object->getEntrypoint()) { + if ($data->isInitialized('entrypoint') && null !== $data->getEntrypoint()) { $values_4 = []; - foreach ($object->getEntrypoint() as $value_4) { + foreach ($data->getEntrypoint() as $value_4) { $values_4[] = $value_4; } - $data->{'Entrypoint'} = $values_4; + $dataArray['Entrypoint'] = $values_4; } - if (null !== $object->getNetworkDisabled()) { - $data->{'NetworkDisabled'} = $object->getNetworkDisabled(); + if ($data->isInitialized('networkDisabled') && null !== $data->getNetworkDisabled()) { + $dataArray['NetworkDisabled'] = $data->getNetworkDisabled(); } - if (null !== $object->getMacAddress()) { - $data->{'MacAddress'} = $object->getMacAddress(); + if ($data->isInitialized('macAddress') && null !== $data->getMacAddress()) { + $dataArray['MacAddress'] = $data->getMacAddress(); } - if (null !== $object->getOnBuild()) { + if ($data->isInitialized('onBuild') && null !== $data->getOnBuild()) { $values_5 = []; - foreach ($object->getOnBuild() as $value_5) { + foreach ($data->getOnBuild() as $value_5) { $values_5[] = $value_5; } - $data->{'OnBuild'} = $values_5; + $dataArray['OnBuild'] = $values_5; } - if (null !== $object->getLabels()) { - $values_6 = new \stdClass(); - foreach ($object->getLabels() as $key_2 => $value_6) { - $values_6->{$key_2} = $value_6; + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values_6 = []; + foreach ($data->getLabels() as $key_2 => $value_6) { + $values_6[$key_2] = $value_6; } - $data->{'Labels'} = $values_6; + $dataArray['Labels'] = $values_6; } - if (null !== $object->getStopSignal()) { - $data->{'StopSignal'} = $object->getStopSignal(); + if ($data->isInitialized('stopSignal') && null !== $data->getStopSignal()) { + $dataArray['StopSignal'] = $data->getStopSignal(); } - if (null !== $object->getStopTimeout()) { - $data->{'StopTimeout'} = $object->getStopTimeout(); + if ($data->isInitialized('stopTimeout') && null !== $data->getStopTimeout()) { + $dataArray['StopTimeout'] = $data->getStopTimeout(); } - if (null !== $object->getShell()) { + if ($data->isInitialized('shell') && null !== $data->getShell()) { $values_7 = []; - foreach ($object->getShell() as $value_7) { + foreach ($data->getShell() as $value_7) { $values_7[] = $value_7; } - $data->{'Shell'} = $values_7; + $dataArray['Shell'] = $values_7; } - if (null !== $object->getHostConfig()) { - $data->{'HostConfig'} = $this->normalizer->normalize($object->getHostConfig(), 'json', $context); + if ($data->isInitialized('hostConfig') && null !== $data->getHostConfig()) { + $dataArray['HostConfig'] = $this->normalizer->normalize($data->getHostConfig(), 'json', $context); } - if (null !== $object->getNetworkingConfig()) { - $data->{'NetworkingConfig'} = $this->normalizer->normalize($object->getNetworkingConfig(), 'json', $context); + if ($data->isInitialized('networkingConfig') && null !== $data->getNetworkingConfig()) { + $dataArray['NetworkingConfig'] = $this->normalizer->normalize($data->getNetworkingConfig(), 'json', $context); + } + foreach ($data as $key_3 => $value_8) { + if (preg_match('/.*/', (string) $key_3)) { + $dataArray[$key_3] = $value_8; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersCreatePostBody::class => false]; } } diff --git a/src/Normalizer/ContainersCreatePostResponse201Normalizer.php b/src/Normalizer/ContainersCreatePostResponse201Normalizer.php deleted file mode 100644 index 6a11e779..00000000 --- a/src/Normalizer/ContainersCreatePostResponse201Normalizer.php +++ /dev/null @@ -1,71 +0,0 @@ -{'Id'} !== null) { - $object->setId($data->{'Id'}); - } - if (property_exists($data, 'Warnings') && $data->{'Warnings'} !== null) { - $values = []; - foreach ($data->{'Warnings'} as $value) { - $values[] = $value; - } - $object->setWarnings($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - if (null !== $object->getWarnings()) { - $values = []; - foreach ($object->getWarnings() as $value) { - $values[] = $value; - } - $data->{'Warnings'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/ContainersIdArchiveGetResponse400Normalizer.php b/src/Normalizer/ContainersIdArchiveGetResponse400Normalizer.php deleted file mode 100644 index 522be888..00000000 --- a/src/Normalizer/ContainersIdArchiveGetResponse400Normalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -{'message'} !== null) { - $object->setMessage($data->{'message'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getMessage()) { - $data->{'message'} = $object->getMessage(); - } - - return $data; - } -} diff --git a/src/Normalizer/ContainersIdArchiveHeadResponse400Normalizer.php b/src/Normalizer/ContainersIdArchiveHeadResponse400Normalizer.php deleted file mode 100644 index acc43470..00000000 --- a/src/Normalizer/ContainersIdArchiveHeadResponse400Normalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -{'message'} !== null) { - $object->setMessage($data->{'message'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getMessage()) { - $data->{'message'} = $object->getMessage(); - } - - return $data; - } -} diff --git a/src/Normalizer/ContainersIdChangesGetResponse200ItemNormalizer.php b/src/Normalizer/ContainersIdChangesGetResponse200ItemNormalizer.php deleted file mode 100644 index d232f2f1..00000000 --- a/src/Normalizer/ContainersIdChangesGetResponse200ItemNormalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -{'Path'} !== null) { - $object->setPath($data->{'Path'}); - } - if (property_exists($data, 'Kind') && $data->{'Kind'} !== null) { - $object->setKind($data->{'Kind'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getPath()) { - $data->{'Path'} = $object->getPath(); - } - if (null !== $object->getKind()) { - $data->{'Kind'} = $object->getKind(); - } - - return $data; - } -} diff --git a/src/Normalizer/ContainersIdExecPostBodyNormalizer.php b/src/Normalizer/ContainersIdExecPostBodyNormalizer.php index 0b378336..d1a8cb8d 100644 --- a/src/Normalizer/ContainersIdExecPostBodyNormalizer.php +++ b/src/Normalizer/ContainersIdExecPostBodyNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,109 +16,194 @@ class ContainersIdExecPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ContainersIdExecPostBody'; + return \Docker\API\Model\ContainersIdExecPostBody::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ContainersIdExecPostBody; + return \is_object($data) && \Docker\API\Model\ContainersIdExecPostBody::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ContainersIdExecPostBody(); - if (property_exists($data, 'AttachStdin') && $data->{'AttachStdin'} !== null) { - $object->setAttachStdin($data->{'AttachStdin'}); + if (\array_key_exists('AttachStdin', $data) && \is_int($data['AttachStdin'])) { + $data['AttachStdin'] = (bool) $data['AttachStdin']; + } + if (\array_key_exists('AttachStdout', $data) && \is_int($data['AttachStdout'])) { + $data['AttachStdout'] = (bool) $data['AttachStdout']; + } + if (\array_key_exists('AttachStderr', $data) && \is_int($data['AttachStderr'])) { + $data['AttachStderr'] = (bool) $data['AttachStderr']; + } + if (\array_key_exists('Tty', $data) && \is_int($data['Tty'])) { + $data['Tty'] = (bool) $data['Tty']; + } + if (\array_key_exists('Privileged', $data) && \is_int($data['Privileged'])) { + $data['Privileged'] = (bool) $data['Privileged']; } - if (property_exists($data, 'AttachStdout') && $data->{'AttachStdout'} !== null) { - $object->setAttachStdout($data->{'AttachStdout'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'AttachStderr') && $data->{'AttachStderr'} !== null) { - $object->setAttachStderr($data->{'AttachStderr'}); + if (\array_key_exists('AttachStdin', $data) && null !== $data['AttachStdin']) { + $object->setAttachStdin($data['AttachStdin']); + unset($data['AttachStdin']); + } elseif (\array_key_exists('AttachStdin', $data) && null === $data['AttachStdin']) { + $object->setAttachStdin(null); } - if (property_exists($data, 'DetachKeys') && $data->{'DetachKeys'} !== null) { - $object->setDetachKeys($data->{'DetachKeys'}); + if (\array_key_exists('AttachStdout', $data) && null !== $data['AttachStdout']) { + $object->setAttachStdout($data['AttachStdout']); + unset($data['AttachStdout']); + } elseif (\array_key_exists('AttachStdout', $data) && null === $data['AttachStdout']) { + $object->setAttachStdout(null); } - if (property_exists($data, 'Tty') && $data->{'Tty'} !== null) { - $object->setTty($data->{'Tty'}); + if (\array_key_exists('AttachStderr', $data) && null !== $data['AttachStderr']) { + $object->setAttachStderr($data['AttachStderr']); + unset($data['AttachStderr']); + } elseif (\array_key_exists('AttachStderr', $data) && null === $data['AttachStderr']) { + $object->setAttachStderr(null); } - if (property_exists($data, 'Env') && $data->{'Env'} !== null) { + if (\array_key_exists('ConsoleSize', $data) && null !== $data['ConsoleSize']) { $values = []; - foreach ($data->{'Env'} as $value) { + foreach ($data['ConsoleSize'] as $value) { $values[] = $value; } - $object->setEnv($values); - } - if (property_exists($data, 'Cmd') && $data->{'Cmd'} !== null) { + $object->setConsoleSize($values); + unset($data['ConsoleSize']); + } elseif (\array_key_exists('ConsoleSize', $data) && null === $data['ConsoleSize']) { + $object->setConsoleSize(null); + } + if (\array_key_exists('DetachKeys', $data) && null !== $data['DetachKeys']) { + $object->setDetachKeys($data['DetachKeys']); + unset($data['DetachKeys']); + } elseif (\array_key_exists('DetachKeys', $data) && null === $data['DetachKeys']) { + $object->setDetachKeys(null); + } + if (\array_key_exists('Tty', $data) && null !== $data['Tty']) { + $object->setTty($data['Tty']); + unset($data['Tty']); + } elseif (\array_key_exists('Tty', $data) && null === $data['Tty']) { + $object->setTty(null); + } + if (\array_key_exists('Env', $data) && null !== $data['Env']) { $values_1 = []; - foreach ($data->{'Cmd'} as $value_1) { + foreach ($data['Env'] as $value_1) { $values_1[] = $value_1; } - $object->setCmd($values_1); - } - if (property_exists($data, 'Privileged') && $data->{'Privileged'} !== null) { - $object->setPrivileged($data->{'Privileged'}); - } - if (property_exists($data, 'User') && $data->{'User'} !== null) { - $object->setUser($data->{'User'}); - } - if (property_exists($data, 'WorkingDir') && $data->{'WorkingDir'} !== null) { - $object->setWorkingDir($data->{'WorkingDir'}); + $object->setEnv($values_1); + unset($data['Env']); + } elseif (\array_key_exists('Env', $data) && null === $data['Env']) { + $object->setEnv(null); + } + if (\array_key_exists('Cmd', $data) && null !== $data['Cmd']) { + $values_2 = []; + foreach ($data['Cmd'] as $value_2) { + $values_2[] = $value_2; + } + $object->setCmd($values_2); + unset($data['Cmd']); + } elseif (\array_key_exists('Cmd', $data) && null === $data['Cmd']) { + $object->setCmd(null); + } + if (\array_key_exists('Privileged', $data) && null !== $data['Privileged']) { + $object->setPrivileged($data['Privileged']); + unset($data['Privileged']); + } elseif (\array_key_exists('Privileged', $data) && null === $data['Privileged']) { + $object->setPrivileged(null); + } + if (\array_key_exists('User', $data) && null !== $data['User']) { + $object->setUser($data['User']); + unset($data['User']); + } elseif (\array_key_exists('User', $data) && null === $data['User']) { + $object->setUser(null); + } + if (\array_key_exists('WorkingDir', $data) && null !== $data['WorkingDir']) { + $object->setWorkingDir($data['WorkingDir']); + unset($data['WorkingDir']); + } elseif (\array_key_exists('WorkingDir', $data) && null === $data['WorkingDir']) { + $object->setWorkingDir(null); + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_3; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getAttachStdin()) { - $data->{'AttachStdin'} = $object->getAttachStdin(); + $dataArray = []; + if ($data->isInitialized('attachStdin') && null !== $data->getAttachStdin()) { + $dataArray['AttachStdin'] = $data->getAttachStdin(); } - if (null !== $object->getAttachStdout()) { - $data->{'AttachStdout'} = $object->getAttachStdout(); + if ($data->isInitialized('attachStdout') && null !== $data->getAttachStdout()) { + $dataArray['AttachStdout'] = $data->getAttachStdout(); } - if (null !== $object->getAttachStderr()) { - $data->{'AttachStderr'} = $object->getAttachStderr(); + if ($data->isInitialized('attachStderr') && null !== $data->getAttachStderr()) { + $dataArray['AttachStderr'] = $data->getAttachStderr(); } - if (null !== $object->getDetachKeys()) { - $data->{'DetachKeys'} = $object->getDetachKeys(); - } - if (null !== $object->getTty()) { - $data->{'Tty'} = $object->getTty(); - } - if (null !== $object->getEnv()) { + if ($data->isInitialized('consoleSize') && null !== $data->getConsoleSize()) { $values = []; - foreach ($object->getEnv() as $value) { + foreach ($data->getConsoleSize() as $value) { $values[] = $value; } - $data->{'Env'} = $values; + $dataArray['ConsoleSize'] = $values; + } + if ($data->isInitialized('detachKeys') && null !== $data->getDetachKeys()) { + $dataArray['DetachKeys'] = $data->getDetachKeys(); } - if (null !== $object->getCmd()) { + if ($data->isInitialized('tty') && null !== $data->getTty()) { + $dataArray['Tty'] = $data->getTty(); + } + if ($data->isInitialized('env') && null !== $data->getEnv()) { $values_1 = []; - foreach ($object->getCmd() as $value_1) { + foreach ($data->getEnv() as $value_1) { $values_1[] = $value_1; } - $data->{'Cmd'} = $values_1; + $dataArray['Env'] = $values_1; + } + if ($data->isInitialized('cmd') && null !== $data->getCmd()) { + $values_2 = []; + foreach ($data->getCmd() as $value_2) { + $values_2[] = $value_2; + } + $dataArray['Cmd'] = $values_2; } - if (null !== $object->getPrivileged()) { - $data->{'Privileged'} = $object->getPrivileged(); + if ($data->isInitialized('privileged') && null !== $data->getPrivileged()) { + $dataArray['Privileged'] = $data->getPrivileged(); } - if (null !== $object->getUser()) { - $data->{'User'} = $object->getUser(); + if ($data->isInitialized('user') && null !== $data->getUser()) { + $dataArray['User'] = $data->getUser(); } - if (null !== $object->getWorkingDir()) { - $data->{'WorkingDir'} = $object->getWorkingDir(); + if ($data->isInitialized('workingDir') && null !== $data->getWorkingDir()) { + $dataArray['WorkingDir'] = $data->getWorkingDir(); + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_3; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersIdExecPostBody::class => false]; } } diff --git a/src/Normalizer/ContainersIdJsonGetResponse200Normalizer.php b/src/Normalizer/ContainersIdJsonGetResponse200Normalizer.php index 6c37d13c..d1ba4f17 100644 --- a/src/Normalizer/ContainersIdJsonGetResponse200Normalizer.php +++ b/src/Normalizer/ContainersIdJsonGetResponse200Normalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,199 +16,305 @@ class ContainersIdJsonGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ContainersIdJsonGetResponse200'; + return \Docker\API\Model\ContainersIdJsonGetResponse200::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ContainersIdJsonGetResponse200; + return \is_object($data) && \Docker\API\Model\ContainersIdJsonGetResponse200::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\ContainersIdJsonGetResponse200(); - if (property_exists($data, 'Id') && $data->{'Id'} !== null) { - $object->setId($data->{'Id'}); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'Created') && $data->{'Created'} !== null) { - $object->setCreated($data->{'Created'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'Path') && $data->{'Path'} !== null) { - $object->setPath($data->{'Path'}); - } - if (property_exists($data, 'Args') && $data->{'Args'} !== null) { + $object = new \Docker\API\Model\ContainersIdJsonGetResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && null !== $data['Id']) { + $object->setId($data['Id']); + unset($data['Id']); + } elseif (\array_key_exists('Id', $data) && null === $data['Id']) { + $object->setId(null); + } + if (\array_key_exists('Created', $data) && null !== $data['Created']) { + $object->setCreated($data['Created']); + unset($data['Created']); + } elseif (\array_key_exists('Created', $data) && null === $data['Created']) { + $object->setCreated(null); + } + if (\array_key_exists('Path', $data) && null !== $data['Path']) { + $object->setPath($data['Path']); + unset($data['Path']); + } elseif (\array_key_exists('Path', $data) && null === $data['Path']) { + $object->setPath(null); + } + if (\array_key_exists('Args', $data) && null !== $data['Args']) { $values = []; - foreach ($data->{'Args'} as $value) { + foreach ($data['Args'] as $value) { $values[] = $value; } $object->setArgs($values); - } - if (property_exists($data, 'State') && $data->{'State'} !== null) { - $object->setState($this->denormalizer->denormalize($data->{'State'}, 'Docker\\API\\Model\\ContainersIdJsonGetResponse200State', 'json', $context)); - } - if (property_exists($data, 'Image') && $data->{'Image'} !== null) { - $object->setImage($data->{'Image'}); - } - if (property_exists($data, 'ResolvConfPath') && $data->{'ResolvConfPath'} !== null) { - $object->setResolvConfPath($data->{'ResolvConfPath'}); - } - if (property_exists($data, 'HostnamePath') && $data->{'HostnamePath'} !== null) { - $object->setHostnamePath($data->{'HostnamePath'}); - } - if (property_exists($data, 'HostsPath') && $data->{'HostsPath'} !== null) { - $object->setHostsPath($data->{'HostsPath'}); - } - if (property_exists($data, 'LogPath') && $data->{'LogPath'} !== null) { - $object->setLogPath($data->{'LogPath'}); - } - if (property_exists($data, 'Node') && $data->{'Node'} !== null) { - $object->setNode($data->{'Node'}); - } - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'RestartCount') && $data->{'RestartCount'} !== null) { - $object->setRestartCount($data->{'RestartCount'}); - } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($data->{'Driver'}); - } - if (property_exists($data, 'MountLabel') && $data->{'MountLabel'} !== null) { - $object->setMountLabel($data->{'MountLabel'}); - } - if (property_exists($data, 'ProcessLabel') && $data->{'ProcessLabel'} !== null) { - $object->setProcessLabel($data->{'ProcessLabel'}); - } - if (property_exists($data, 'AppArmorProfile') && $data->{'AppArmorProfile'} !== null) { - $object->setAppArmorProfile($data->{'AppArmorProfile'}); - } - if (property_exists($data, 'ExecIDs') && $data->{'ExecIDs'} !== null) { - $object->setExecIDs($data->{'ExecIDs'}); - } - if (property_exists($data, 'HostConfig') && $data->{'HostConfig'} !== null) { - $object->setHostConfig($this->denormalizer->denormalize($data->{'HostConfig'}, 'Docker\\API\\Model\\HostConfig', 'json', $context)); - } - if (property_exists($data, 'GraphDriver') && $data->{'GraphDriver'} !== null) { - $object->setGraphDriver($this->denormalizer->denormalize($data->{'GraphDriver'}, 'Docker\\API\\Model\\GraphDriverData', 'json', $context)); - } - if (property_exists($data, 'SizeRw') && $data->{'SizeRw'} !== null) { - $object->setSizeRw($data->{'SizeRw'}); - } - if (property_exists($data, 'SizeRootFs') && $data->{'SizeRootFs'} !== null) { - $object->setSizeRootFs($data->{'SizeRootFs'}); - } - if (property_exists($data, 'Mounts') && $data->{'Mounts'} !== null) { + unset($data['Args']); + } elseif (\array_key_exists('Args', $data) && null === $data['Args']) { + $object->setArgs(null); + } + if (\array_key_exists('State', $data) && null !== $data['State']) { + $object->setState($this->denormalizer->denormalize($data['State'], \Docker\API\Model\ContainerState::class, 'json', $context)); + unset($data['State']); + } elseif (\array_key_exists('State', $data) && null === $data['State']) { + $object->setState(null); + } + if (\array_key_exists('Image', $data) && null !== $data['Image']) { + $object->setImage($data['Image']); + unset($data['Image']); + } elseif (\array_key_exists('Image', $data) && null === $data['Image']) { + $object->setImage(null); + } + if (\array_key_exists('ResolvConfPath', $data) && null !== $data['ResolvConfPath']) { + $object->setResolvConfPath($data['ResolvConfPath']); + unset($data['ResolvConfPath']); + } elseif (\array_key_exists('ResolvConfPath', $data) && null === $data['ResolvConfPath']) { + $object->setResolvConfPath(null); + } + if (\array_key_exists('HostnamePath', $data) && null !== $data['HostnamePath']) { + $object->setHostnamePath($data['HostnamePath']); + unset($data['HostnamePath']); + } elseif (\array_key_exists('HostnamePath', $data) && null === $data['HostnamePath']) { + $object->setHostnamePath(null); + } + if (\array_key_exists('HostsPath', $data) && null !== $data['HostsPath']) { + $object->setHostsPath($data['HostsPath']); + unset($data['HostsPath']); + } elseif (\array_key_exists('HostsPath', $data) && null === $data['HostsPath']) { + $object->setHostsPath(null); + } + if (\array_key_exists('LogPath', $data) && null !== $data['LogPath']) { + $object->setLogPath($data['LogPath']); + unset($data['LogPath']); + } elseif (\array_key_exists('LogPath', $data) && null === $data['LogPath']) { + $object->setLogPath(null); + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('RestartCount', $data) && null !== $data['RestartCount']) { + $object->setRestartCount($data['RestartCount']); + unset($data['RestartCount']); + } elseif (\array_key_exists('RestartCount', $data) && null === $data['RestartCount']) { + $object->setRestartCount(null); + } + if (\array_key_exists('Driver', $data) && null !== $data['Driver']) { + $object->setDriver($data['Driver']); + unset($data['Driver']); + } elseif (\array_key_exists('Driver', $data) && null === $data['Driver']) { + $object->setDriver(null); + } + if (\array_key_exists('Platform', $data) && null !== $data['Platform']) { + $object->setPlatform($data['Platform']); + unset($data['Platform']); + } elseif (\array_key_exists('Platform', $data) && null === $data['Platform']) { + $object->setPlatform(null); + } + if (\array_key_exists('MountLabel', $data) && null !== $data['MountLabel']) { + $object->setMountLabel($data['MountLabel']); + unset($data['MountLabel']); + } elseif (\array_key_exists('MountLabel', $data) && null === $data['MountLabel']) { + $object->setMountLabel(null); + } + if (\array_key_exists('ProcessLabel', $data) && null !== $data['ProcessLabel']) { + $object->setProcessLabel($data['ProcessLabel']); + unset($data['ProcessLabel']); + } elseif (\array_key_exists('ProcessLabel', $data) && null === $data['ProcessLabel']) { + $object->setProcessLabel(null); + } + if (\array_key_exists('AppArmorProfile', $data) && null !== $data['AppArmorProfile']) { + $object->setAppArmorProfile($data['AppArmorProfile']); + unset($data['AppArmorProfile']); + } elseif (\array_key_exists('AppArmorProfile', $data) && null === $data['AppArmorProfile']) { + $object->setAppArmorProfile(null); + } + if (\array_key_exists('ExecIDs', $data) && null !== $data['ExecIDs']) { $values_1 = []; - foreach ($data->{'Mounts'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\MountPoint', 'json', $context); + foreach ($data['ExecIDs'] as $value_1) { + $values_1[] = $value_1; + } + $object->setExecIDs($values_1); + unset($data['ExecIDs']); + } elseif (\array_key_exists('ExecIDs', $data) && null === $data['ExecIDs']) { + $object->setExecIDs(null); + } + if (\array_key_exists('HostConfig', $data) && null !== $data['HostConfig']) { + $object->setHostConfig($this->denormalizer->denormalize($data['HostConfig'], \Docker\API\Model\HostConfig::class, 'json', $context)); + unset($data['HostConfig']); + } elseif (\array_key_exists('HostConfig', $data) && null === $data['HostConfig']) { + $object->setHostConfig(null); + } + if (\array_key_exists('GraphDriver', $data) && null !== $data['GraphDriver']) { + $object->setGraphDriver($this->denormalizer->denormalize($data['GraphDriver'], \Docker\API\Model\GraphDriverData::class, 'json', $context)); + unset($data['GraphDriver']); + } elseif (\array_key_exists('GraphDriver', $data) && null === $data['GraphDriver']) { + $object->setGraphDriver(null); + } + if (\array_key_exists('SizeRw', $data) && null !== $data['SizeRw']) { + $object->setSizeRw($data['SizeRw']); + unset($data['SizeRw']); + } elseif (\array_key_exists('SizeRw', $data) && null === $data['SizeRw']) { + $object->setSizeRw(null); + } + if (\array_key_exists('SizeRootFs', $data) && null !== $data['SizeRootFs']) { + $object->setSizeRootFs($data['SizeRootFs']); + unset($data['SizeRootFs']); + } elseif (\array_key_exists('SizeRootFs', $data) && null === $data['SizeRootFs']) { + $object->setSizeRootFs(null); + } + if (\array_key_exists('Mounts', $data) && null !== $data['Mounts']) { + $values_2 = []; + foreach ($data['Mounts'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\MountPoint::class, 'json', $context); + } + $object->setMounts($values_2); + unset($data['Mounts']); + } elseif (\array_key_exists('Mounts', $data) && null === $data['Mounts']) { + $object->setMounts(null); + } + if (\array_key_exists('Config', $data) && null !== $data['Config']) { + $object->setConfig($this->denormalizer->denormalize($data['Config'], \Docker\API\Model\ContainerConfig::class, 'json', $context)); + unset($data['Config']); + } elseif (\array_key_exists('Config', $data) && null === $data['Config']) { + $object->setConfig(null); + } + if (\array_key_exists('NetworkSettings', $data) && null !== $data['NetworkSettings']) { + $object->setNetworkSettings($this->denormalizer->denormalize($data['NetworkSettings'], \Docker\API\Model\NetworkSettings::class, 'json', $context)); + unset($data['NetworkSettings']); + } elseif (\array_key_exists('NetworkSettings', $data) && null === $data['NetworkSettings']) { + $object->setNetworkSettings(null); + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_3; } - $object->setMounts($values_1); - } - if (property_exists($data, 'Config') && $data->{'Config'} !== null) { - $object->setConfig($this->denormalizer->denormalize($data->{'Config'}, 'Docker\\API\\Model\\ContainerConfig', 'json', $context)); - } - if (property_exists($data, 'NetworkSettings') && $data->{'NetworkSettings'} !== null) { - $object->setNetworkSettings($this->denormalizer->denormalize($data->{'NetworkSettings'}, 'Docker\\API\\Model\\NetworkSettings', 'json', $context)); } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); + $dataArray = []; + if ($data->isInitialized('id') && null !== $data->getId()) { + $dataArray['Id'] = $data->getId(); } - if (null !== $object->getCreated()) { - $data->{'Created'} = $object->getCreated(); + if ($data->isInitialized('created') && null !== $data->getCreated()) { + $dataArray['Created'] = $data->getCreated(); } - if (null !== $object->getPath()) { - $data->{'Path'} = $object->getPath(); + if ($data->isInitialized('path') && null !== $data->getPath()) { + $dataArray['Path'] = $data->getPath(); } - if (null !== $object->getArgs()) { + if ($data->isInitialized('args') && null !== $data->getArgs()) { $values = []; - foreach ($object->getArgs() as $value) { + foreach ($data->getArgs() as $value) { $values[] = $value; } - $data->{'Args'} = $values; + $dataArray['Args'] = $values; } - if (null !== $object->getState()) { - $data->{'State'} = $this->normalizer->normalize($object->getState(), 'json', $context); + if ($data->isInitialized('state') && null !== $data->getState()) { + $dataArray['State'] = $this->normalizer->normalize($data->getState(), 'json', $context); } - if (null !== $object->getImage()) { - $data->{'Image'} = $object->getImage(); + if ($data->isInitialized('image') && null !== $data->getImage()) { + $dataArray['Image'] = $data->getImage(); } - if (null !== $object->getResolvConfPath()) { - $data->{'ResolvConfPath'} = $object->getResolvConfPath(); + if ($data->isInitialized('resolvConfPath') && null !== $data->getResolvConfPath()) { + $dataArray['ResolvConfPath'] = $data->getResolvConfPath(); } - if (null !== $object->getHostnamePath()) { - $data->{'HostnamePath'} = $object->getHostnamePath(); + if ($data->isInitialized('hostnamePath') && null !== $data->getHostnamePath()) { + $dataArray['HostnamePath'] = $data->getHostnamePath(); } - if (null !== $object->getHostsPath()) { - $data->{'HostsPath'} = $object->getHostsPath(); + if ($data->isInitialized('hostsPath') && null !== $data->getHostsPath()) { + $dataArray['HostsPath'] = $data->getHostsPath(); } - if (null !== $object->getLogPath()) { - $data->{'LogPath'} = $object->getLogPath(); + if ($data->isInitialized('logPath') && null !== $data->getLogPath()) { + $dataArray['LogPath'] = $data->getLogPath(); } - if (null !== $object->getNode()) { - $data->{'Node'} = $object->getNode(); + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + if ($data->isInitialized('restartCount') && null !== $data->getRestartCount()) { + $dataArray['RestartCount'] = $data->getRestartCount(); } - if (null !== $object->getRestartCount()) { - $data->{'RestartCount'} = $object->getRestartCount(); + if ($data->isInitialized('driver') && null !== $data->getDriver()) { + $dataArray['Driver'] = $data->getDriver(); } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); + if ($data->isInitialized('platform') && null !== $data->getPlatform()) { + $dataArray['Platform'] = $data->getPlatform(); } - if (null !== $object->getMountLabel()) { - $data->{'MountLabel'} = $object->getMountLabel(); + if ($data->isInitialized('mountLabel') && null !== $data->getMountLabel()) { + $dataArray['MountLabel'] = $data->getMountLabel(); } - if (null !== $object->getProcessLabel()) { - $data->{'ProcessLabel'} = $object->getProcessLabel(); + if ($data->isInitialized('processLabel') && null !== $data->getProcessLabel()) { + $dataArray['ProcessLabel'] = $data->getProcessLabel(); } - if (null !== $object->getAppArmorProfile()) { - $data->{'AppArmorProfile'} = $object->getAppArmorProfile(); + if ($data->isInitialized('appArmorProfile') && null !== $data->getAppArmorProfile()) { + $dataArray['AppArmorProfile'] = $data->getAppArmorProfile(); } - if (null !== $object->getExecIDs()) { - $data->{'ExecIDs'} = $object->getExecIDs(); + if ($data->isInitialized('execIDs') && null !== $data->getExecIDs()) { + $values_1 = []; + foreach ($data->getExecIDs() as $value_1) { + $values_1[] = $value_1; + } + $dataArray['ExecIDs'] = $values_1; } - if (null !== $object->getHostConfig()) { - $data->{'HostConfig'} = $this->normalizer->normalize($object->getHostConfig(), 'json', $context); + if ($data->isInitialized('hostConfig') && null !== $data->getHostConfig()) { + $dataArray['HostConfig'] = $this->normalizer->normalize($data->getHostConfig(), 'json', $context); } - if (null !== $object->getGraphDriver()) { - $data->{'GraphDriver'} = $this->normalizer->normalize($object->getGraphDriver(), 'json', $context); + if ($data->isInitialized('graphDriver') && null !== $data->getGraphDriver()) { + $dataArray['GraphDriver'] = $this->normalizer->normalize($data->getGraphDriver(), 'json', $context); } - if (null !== $object->getSizeRw()) { - $data->{'SizeRw'} = $object->getSizeRw(); + if ($data->isInitialized('sizeRw') && null !== $data->getSizeRw()) { + $dataArray['SizeRw'] = $data->getSizeRw(); } - if (null !== $object->getSizeRootFs()) { - $data->{'SizeRootFs'} = $object->getSizeRootFs(); + if ($data->isInitialized('sizeRootFs') && null !== $data->getSizeRootFs()) { + $dataArray['SizeRootFs'] = $data->getSizeRootFs(); } - if (null !== $object->getMounts()) { - $values_1 = []; - foreach ($object->getMounts() as $value_1) { - $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + if ($data->isInitialized('mounts') && null !== $data->getMounts()) { + $values_2 = []; + foreach ($data->getMounts() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); } - $data->{'Mounts'} = $values_1; + $dataArray['Mounts'] = $values_2; } - if (null !== $object->getConfig()) { - $data->{'Config'} = $this->normalizer->normalize($object->getConfig(), 'json', $context); + if ($data->isInitialized('config') && null !== $data->getConfig()) { + $dataArray['Config'] = $this->normalizer->normalize($data->getConfig(), 'json', $context); } - if (null !== $object->getNetworkSettings()) { - $data->{'NetworkSettings'} = $this->normalizer->normalize($object->getNetworkSettings(), 'json', $context); + if ($data->isInitialized('networkSettings') && null !== $data->getNetworkSettings()) { + $dataArray['NetworkSettings'] = $this->normalizer->normalize($data->getNetworkSettings(), 'json', $context); } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_3; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersIdJsonGetResponse200::class => false]; } } diff --git a/src/Normalizer/ContainersIdJsonGetResponse200StateNormalizer.php b/src/Normalizer/ContainersIdJsonGetResponse200StateNormalizer.php deleted file mode 100644 index 983f3ef5..00000000 --- a/src/Normalizer/ContainersIdJsonGetResponse200StateNormalizer.php +++ /dev/null @@ -1,117 +0,0 @@ -{'Status'} !== null) { - $object->setStatus($data->{'Status'}); - } - if (property_exists($data, 'Running') && $data->{'Running'} !== null) { - $object->setRunning($data->{'Running'}); - } - if (property_exists($data, 'Paused') && $data->{'Paused'} !== null) { - $object->setPaused($data->{'Paused'}); - } - if (property_exists($data, 'Restarting') && $data->{'Restarting'} !== null) { - $object->setRestarting($data->{'Restarting'}); - } - if (property_exists($data, 'OOMKilled') && $data->{'OOMKilled'} !== null) { - $object->setOOMKilled($data->{'OOMKilled'}); - } - if (property_exists($data, 'Dead') && $data->{'Dead'} !== null) { - $object->setDead($data->{'Dead'}); - } - if (property_exists($data, 'Pid') && $data->{'Pid'} !== null) { - $object->setPid($data->{'Pid'}); - } - if (property_exists($data, 'ExitCode') && $data->{'ExitCode'} !== null) { - $object->setExitCode($data->{'ExitCode'}); - } - if (property_exists($data, 'Error') && $data->{'Error'} !== null) { - $object->setError($data->{'Error'}); - } - if (property_exists($data, 'StartedAt') && $data->{'StartedAt'} !== null) { - $object->setStartedAt($data->{'StartedAt'}); - } - if (property_exists($data, 'FinishedAt') && $data->{'FinishedAt'} !== null) { - $object->setFinishedAt($data->{'FinishedAt'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getStatus()) { - $data->{'Status'} = $object->getStatus(); - } - if (null !== $object->getRunning()) { - $data->{'Running'} = $object->getRunning(); - } - if (null !== $object->getPaused()) { - $data->{'Paused'} = $object->getPaused(); - } - if (null !== $object->getRestarting()) { - $data->{'Restarting'} = $object->getRestarting(); - } - if (null !== $object->getOOMKilled()) { - $data->{'OOMKilled'} = $object->getOOMKilled(); - } - if (null !== $object->getDead()) { - $data->{'Dead'} = $object->getDead(); - } - if (null !== $object->getPid()) { - $data->{'Pid'} = $object->getPid(); - } - if (null !== $object->getExitCode()) { - $data->{'ExitCode'} = $object->getExitCode(); - } - if (null !== $object->getError()) { - $data->{'Error'} = $object->getError(); - } - if (null !== $object->getStartedAt()) { - $data->{'StartedAt'} = $object->getStartedAt(); - } - if (null !== $object->getFinishedAt()) { - $data->{'FinishedAt'} = $object->getFinishedAt(); - } - - return $data; - } -} diff --git a/src/Normalizer/ContainersIdTopGetJsonResponse200Normalizer.php b/src/Normalizer/ContainersIdTopGetJsonResponse200Normalizer.php new file mode 100644 index 00000000..2ca0049d --- /dev/null +++ b/src/Normalizer/ContainersIdTopGetJsonResponse200Normalizer.php @@ -0,0 +1,113 @@ +setTitles($values); + unset($data['Titles']); + } elseif (\array_key_exists('Titles', $data) && null === $data['Titles']) { + $object->setTitles(null); + } + if (\array_key_exists('Processes', $data) && null !== $data['Processes']) { + $values_1 = []; + foreach ($data['Processes'] as $value_1) { + $values_2 = []; + foreach ($value_1 as $value_2) { + $values_2[] = $value_2; + } + $values_1[] = $values_2; + } + $object->setProcesses($values_1); + unset($data['Processes']); + } elseif (\array_key_exists('Processes', $data) && null === $data['Processes']) { + $object->setProcesses(null); + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_3; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('titles') && null !== $data->getTitles()) { + $values = []; + foreach ($data->getTitles() as $value) { + $values[] = $value; + } + $dataArray['Titles'] = $values; + } + if ($data->isInitialized('processes') && null !== $data->getProcesses()) { + $values_1 = []; + foreach ($data->getProcesses() as $value_1) { + $values_2 = []; + foreach ($value_1 as $value_2) { + $values_2[] = $value_2; + } + $values_1[] = $values_2; + } + $dataArray['Processes'] = $values_1; + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_3; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersIdTopGetJsonResponse200::class => false]; + } +} diff --git a/src/Normalizer/ContainersIdTopGetResponse200Normalizer.php b/src/Normalizer/ContainersIdTopGetResponse200Normalizer.php deleted file mode 100644 index 60540844..00000000 --- a/src/Normalizer/ContainersIdTopGetResponse200Normalizer.php +++ /dev/null @@ -1,87 +0,0 @@ -{'Titles'} !== null) { - $values = []; - foreach ($data->{'Titles'} as $value) { - $values[] = $value; - } - $object->setTitles($values); - } - if (property_exists($data, 'Processes') && $data->{'Processes'} !== null) { - $values_1 = []; - foreach ($data->{'Processes'} as $value_1) { - $values_2 = []; - foreach ($value_1 as $value_2) { - $values_2[] = $value_2; - } - $values_1[] = $values_2; - } - $object->setProcesses($values_1); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getTitles()) { - $values = []; - foreach ($object->getTitles() as $value) { - $values[] = $value; - } - $data->{'Titles'} = $values; - } - if (null !== $object->getProcesses()) { - $values_1 = []; - foreach ($object->getProcesses() as $value_1) { - $values_2 = []; - foreach ($value_1 as $value_2) { - $values_2[] = $value_2; - } - $values_1[] = $values_2; - } - $data->{'Processes'} = $values_1; - } - - return $data; - } -} diff --git a/src/Normalizer/ContainersIdTopGetTextplainResponse200Normalizer.php b/src/Normalizer/ContainersIdTopGetTextplainResponse200Normalizer.php new file mode 100644 index 00000000..c5dda2af --- /dev/null +++ b/src/Normalizer/ContainersIdTopGetTextplainResponse200Normalizer.php @@ -0,0 +1,113 @@ +setTitles($values); + unset($data['Titles']); + } elseif (\array_key_exists('Titles', $data) && null === $data['Titles']) { + $object->setTitles(null); + } + if (\array_key_exists('Processes', $data) && null !== $data['Processes']) { + $values_1 = []; + foreach ($data['Processes'] as $value_1) { + $values_2 = []; + foreach ($value_1 as $value_2) { + $values_2[] = $value_2; + } + $values_1[] = $values_2; + } + $object->setProcesses($values_1); + unset($data['Processes']); + } elseif (\array_key_exists('Processes', $data) && null === $data['Processes']) { + $object->setProcesses(null); + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_3; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('titles') && null !== $data->getTitles()) { + $values = []; + foreach ($data->getTitles() as $value) { + $values[] = $value; + } + $dataArray['Titles'] = $values; + } + if ($data->isInitialized('processes') && null !== $data->getProcesses()) { + $values_1 = []; + foreach ($data->getProcesses() as $value_1) { + $values_2 = []; + foreach ($value_1 as $value_2) { + $values_2[] = $value_2; + } + $values_1[] = $values_2; + } + $dataArray['Processes'] = $values_1; + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_3; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersIdTopGetTextplainResponse200::class => false]; + } +} diff --git a/src/Normalizer/ContainersIdUpdatePostBodyNormalizer.php b/src/Normalizer/ContainersIdUpdatePostBodyNormalizer.php index 38ba58f7..9ba35318 100644 --- a/src/Normalizer/ContainersIdUpdatePostBodyNormalizer.php +++ b/src/Normalizer/ContainersIdUpdatePostBodyNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,283 +16,422 @@ class ContainersIdUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ContainersIdUpdatePostBody'; + return \Docker\API\Model\ContainersIdUpdatePostBody::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ContainersIdUpdatePostBody; + return \is_object($data) && \Docker\API\Model\ContainersIdUpdatePostBody::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\ContainersIdUpdatePostBody(); - if (property_exists($data, 'CpuShares') && $data->{'CpuShares'} !== null) { - $object->setCpuShares($data->{'CpuShares'}); - } - if (property_exists($data, 'Memory') && $data->{'Memory'} !== null) { - $object->setMemory($data->{'Memory'}); - } - if (property_exists($data, 'CgroupParent') && $data->{'CgroupParent'} !== null) { - $object->setCgroupParent($data->{'CgroupParent'}); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'BlkioWeight') && $data->{'BlkioWeight'} !== null) { - $object->setBlkioWeight($data->{'BlkioWeight'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'BlkioWeightDevice') && $data->{'BlkioWeightDevice'} !== null) { + $object = new \Docker\API\Model\ContainersIdUpdatePostBody(); + if (\array_key_exists('OomKillDisable', $data) && \is_int($data['OomKillDisable'])) { + $data['OomKillDisable'] = (bool) $data['OomKillDisable']; + } + if (\array_key_exists('Init', $data) && \is_int($data['Init'])) { + $data['Init'] = (bool) $data['Init']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CpuShares', $data) && null !== $data['CpuShares']) { + $object->setCpuShares($data['CpuShares']); + unset($data['CpuShares']); + } elseif (\array_key_exists('CpuShares', $data) && null === $data['CpuShares']) { + $object->setCpuShares(null); + } + if (\array_key_exists('Memory', $data) && null !== $data['Memory']) { + $object->setMemory($data['Memory']); + unset($data['Memory']); + } elseif (\array_key_exists('Memory', $data) && null === $data['Memory']) { + $object->setMemory(null); + } + if (\array_key_exists('CgroupParent', $data) && null !== $data['CgroupParent']) { + $object->setCgroupParent($data['CgroupParent']); + unset($data['CgroupParent']); + } elseif (\array_key_exists('CgroupParent', $data) && null === $data['CgroupParent']) { + $object->setCgroupParent(null); + } + if (\array_key_exists('BlkioWeight', $data) && null !== $data['BlkioWeight']) { + $object->setBlkioWeight($data['BlkioWeight']); + unset($data['BlkioWeight']); + } elseif (\array_key_exists('BlkioWeight', $data) && null === $data['BlkioWeight']) { + $object->setBlkioWeight(null); + } + if (\array_key_exists('BlkioWeightDevice', $data) && null !== $data['BlkioWeightDevice']) { $values = []; - foreach ($data->{'BlkioWeightDevice'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\ResourcesBlkioWeightDeviceItem', 'json', $context); + foreach ($data['BlkioWeightDevice'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class, 'json', $context); } $object->setBlkioWeightDevice($values); + unset($data['BlkioWeightDevice']); + } elseif (\array_key_exists('BlkioWeightDevice', $data) && null === $data['BlkioWeightDevice']) { + $object->setBlkioWeightDevice(null); } - if (property_exists($data, 'BlkioDeviceReadBps') && $data->{'BlkioDeviceReadBps'} !== null) { + if (\array_key_exists('BlkioDeviceReadBps', $data) && null !== $data['BlkioDeviceReadBps']) { $values_1 = []; - foreach ($data->{'BlkioDeviceReadBps'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); + foreach ($data['BlkioDeviceReadBps'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\ThrottleDevice::class, 'json', $context); } $object->setBlkioDeviceReadBps($values_1); + unset($data['BlkioDeviceReadBps']); + } elseif (\array_key_exists('BlkioDeviceReadBps', $data) && null === $data['BlkioDeviceReadBps']) { + $object->setBlkioDeviceReadBps(null); } - if (property_exists($data, 'BlkioDeviceWriteBps') && $data->{'BlkioDeviceWriteBps'} !== null) { + if (\array_key_exists('BlkioDeviceWriteBps', $data) && null !== $data['BlkioDeviceWriteBps']) { $values_2 = []; - foreach ($data->{'BlkioDeviceWriteBps'} as $value_2) { - $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); + foreach ($data['BlkioDeviceWriteBps'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\ThrottleDevice::class, 'json', $context); } $object->setBlkioDeviceWriteBps($values_2); + unset($data['BlkioDeviceWriteBps']); + } elseif (\array_key_exists('BlkioDeviceWriteBps', $data) && null === $data['BlkioDeviceWriteBps']) { + $object->setBlkioDeviceWriteBps(null); } - if (property_exists($data, 'BlkioDeviceReadIOps') && $data->{'BlkioDeviceReadIOps'} !== null) { + if (\array_key_exists('BlkioDeviceReadIOps', $data) && null !== $data['BlkioDeviceReadIOps']) { $values_3 = []; - foreach ($data->{'BlkioDeviceReadIOps'} as $value_3) { - $values_3[] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); + foreach ($data['BlkioDeviceReadIOps'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\ThrottleDevice::class, 'json', $context); } $object->setBlkioDeviceReadIOps($values_3); + unset($data['BlkioDeviceReadIOps']); + } elseif (\array_key_exists('BlkioDeviceReadIOps', $data) && null === $data['BlkioDeviceReadIOps']) { + $object->setBlkioDeviceReadIOps(null); } - if (property_exists($data, 'BlkioDeviceWriteIOps') && $data->{'BlkioDeviceWriteIOps'} !== null) { + if (\array_key_exists('BlkioDeviceWriteIOps', $data) && null !== $data['BlkioDeviceWriteIOps']) { $values_4 = []; - foreach ($data->{'BlkioDeviceWriteIOps'} as $value_4) { - $values_4[] = $this->denormalizer->denormalize($value_4, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); + foreach ($data['BlkioDeviceWriteIOps'] as $value_4) { + $values_4[] = $this->denormalizer->denormalize($value_4, \Docker\API\Model\ThrottleDevice::class, 'json', $context); } $object->setBlkioDeviceWriteIOps($values_4); - } - if (property_exists($data, 'CpuPeriod') && $data->{'CpuPeriod'} !== null) { - $object->setCpuPeriod($data->{'CpuPeriod'}); - } - if (property_exists($data, 'CpuQuota') && $data->{'CpuQuota'} !== null) { - $object->setCpuQuota($data->{'CpuQuota'}); - } - if (property_exists($data, 'CpuRealtimePeriod') && $data->{'CpuRealtimePeriod'} !== null) { - $object->setCpuRealtimePeriod($data->{'CpuRealtimePeriod'}); - } - if (property_exists($data, 'CpuRealtimeRuntime') && $data->{'CpuRealtimeRuntime'} !== null) { - $object->setCpuRealtimeRuntime($data->{'CpuRealtimeRuntime'}); - } - if (property_exists($data, 'CpusetCpus') && $data->{'CpusetCpus'} !== null) { - $object->setCpusetCpus($data->{'CpusetCpus'}); - } - if (property_exists($data, 'CpusetMems') && $data->{'CpusetMems'} !== null) { - $object->setCpusetMems($data->{'CpusetMems'}); - } - if (property_exists($data, 'Devices') && $data->{'Devices'} !== null) { + unset($data['BlkioDeviceWriteIOps']); + } elseif (\array_key_exists('BlkioDeviceWriteIOps', $data) && null === $data['BlkioDeviceWriteIOps']) { + $object->setBlkioDeviceWriteIOps(null); + } + if (\array_key_exists('CpuPeriod', $data) && null !== $data['CpuPeriod']) { + $object->setCpuPeriod($data['CpuPeriod']); + unset($data['CpuPeriod']); + } elseif (\array_key_exists('CpuPeriod', $data) && null === $data['CpuPeriod']) { + $object->setCpuPeriod(null); + } + if (\array_key_exists('CpuQuota', $data) && null !== $data['CpuQuota']) { + $object->setCpuQuota($data['CpuQuota']); + unset($data['CpuQuota']); + } elseif (\array_key_exists('CpuQuota', $data) && null === $data['CpuQuota']) { + $object->setCpuQuota(null); + } + if (\array_key_exists('CpuRealtimePeriod', $data) && null !== $data['CpuRealtimePeriod']) { + $object->setCpuRealtimePeriod($data['CpuRealtimePeriod']); + unset($data['CpuRealtimePeriod']); + } elseif (\array_key_exists('CpuRealtimePeriod', $data) && null === $data['CpuRealtimePeriod']) { + $object->setCpuRealtimePeriod(null); + } + if (\array_key_exists('CpuRealtimeRuntime', $data) && null !== $data['CpuRealtimeRuntime']) { + $object->setCpuRealtimeRuntime($data['CpuRealtimeRuntime']); + unset($data['CpuRealtimeRuntime']); + } elseif (\array_key_exists('CpuRealtimeRuntime', $data) && null === $data['CpuRealtimeRuntime']) { + $object->setCpuRealtimeRuntime(null); + } + if (\array_key_exists('CpusetCpus', $data) && null !== $data['CpusetCpus']) { + $object->setCpusetCpus($data['CpusetCpus']); + unset($data['CpusetCpus']); + } elseif (\array_key_exists('CpusetCpus', $data) && null === $data['CpusetCpus']) { + $object->setCpusetCpus(null); + } + if (\array_key_exists('CpusetMems', $data) && null !== $data['CpusetMems']) { + $object->setCpusetMems($data['CpusetMems']); + unset($data['CpusetMems']); + } elseif (\array_key_exists('CpusetMems', $data) && null === $data['CpusetMems']) { + $object->setCpusetMems(null); + } + if (\array_key_exists('Devices', $data) && null !== $data['Devices']) { $values_5 = []; - foreach ($data->{'Devices'} as $value_5) { - $values_5[] = $this->denormalizer->denormalize($value_5, 'Docker\\API\\Model\\DeviceMapping', 'json', $context); + foreach ($data['Devices'] as $value_5) { + $values_5[] = $this->denormalizer->denormalize($value_5, \Docker\API\Model\DeviceMapping::class, 'json', $context); } $object->setDevices($values_5); + unset($data['Devices']); + } elseif (\array_key_exists('Devices', $data) && null === $data['Devices']) { + $object->setDevices(null); } - if (property_exists($data, 'DeviceCgroupRules') && $data->{'DeviceCgroupRules'} !== null) { + if (\array_key_exists('DeviceCgroupRules', $data) && null !== $data['DeviceCgroupRules']) { $values_6 = []; - foreach ($data->{'DeviceCgroupRules'} as $value_6) { + foreach ($data['DeviceCgroupRules'] as $value_6) { $values_6[] = $value_6; } $object->setDeviceCgroupRules($values_6); + unset($data['DeviceCgroupRules']); + } elseif (\array_key_exists('DeviceCgroupRules', $data) && null === $data['DeviceCgroupRules']) { + $object->setDeviceCgroupRules(null); } - if (property_exists($data, 'DiskQuota') && $data->{'DiskQuota'} !== null) { - $object->setDiskQuota($data->{'DiskQuota'}); - } - if (property_exists($data, 'KernelMemory') && $data->{'KernelMemory'} !== null) { - $object->setKernelMemory($data->{'KernelMemory'}); - } - if (property_exists($data, 'MemoryReservation') && $data->{'MemoryReservation'} !== null) { - $object->setMemoryReservation($data->{'MemoryReservation'}); - } - if (property_exists($data, 'MemorySwap') && $data->{'MemorySwap'} !== null) { - $object->setMemorySwap($data->{'MemorySwap'}); - } - if (property_exists($data, 'MemorySwappiness') && $data->{'MemorySwappiness'} !== null) { - $object->setMemorySwappiness($data->{'MemorySwappiness'}); - } - if (property_exists($data, 'NanoCPUs') && $data->{'NanoCPUs'} !== null) { - $object->setNanoCPUs($data->{'NanoCPUs'}); - } - if (property_exists($data, 'OomKillDisable') && $data->{'OomKillDisable'} !== null) { - $object->setOomKillDisable($data->{'OomKillDisable'}); - } - if (property_exists($data, 'PidsLimit') && $data->{'PidsLimit'} !== null) { - $object->setPidsLimit($data->{'PidsLimit'}); - } - if (property_exists($data, 'Ulimits') && $data->{'Ulimits'} !== null) { + if (\array_key_exists('DeviceRequests', $data) && null !== $data['DeviceRequests']) { $values_7 = []; - foreach ($data->{'Ulimits'} as $value_7) { - $values_7[] = $this->denormalizer->denormalize($value_7, 'Docker\\API\\Model\\ResourcesUlimitsItem', 'json', $context); + foreach ($data['DeviceRequests'] as $value_7) { + $values_7[] = $this->denormalizer->denormalize($value_7, \Docker\API\Model\DeviceRequest::class, 'json', $context); + } + $object->setDeviceRequests($values_7); + unset($data['DeviceRequests']); + } elseif (\array_key_exists('DeviceRequests', $data) && null === $data['DeviceRequests']) { + $object->setDeviceRequests(null); + } + if (\array_key_exists('KernelMemoryTCP', $data) && null !== $data['KernelMemoryTCP']) { + $object->setKernelMemoryTCP($data['KernelMemoryTCP']); + unset($data['KernelMemoryTCP']); + } elseif (\array_key_exists('KernelMemoryTCP', $data) && null === $data['KernelMemoryTCP']) { + $object->setKernelMemoryTCP(null); + } + if (\array_key_exists('MemoryReservation', $data) && null !== $data['MemoryReservation']) { + $object->setMemoryReservation($data['MemoryReservation']); + unset($data['MemoryReservation']); + } elseif (\array_key_exists('MemoryReservation', $data) && null === $data['MemoryReservation']) { + $object->setMemoryReservation(null); + } + if (\array_key_exists('MemorySwap', $data) && null !== $data['MemorySwap']) { + $object->setMemorySwap($data['MemorySwap']); + unset($data['MemorySwap']); + } elseif (\array_key_exists('MemorySwap', $data) && null === $data['MemorySwap']) { + $object->setMemorySwap(null); + } + if (\array_key_exists('MemorySwappiness', $data) && null !== $data['MemorySwappiness']) { + $object->setMemorySwappiness($data['MemorySwappiness']); + unset($data['MemorySwappiness']); + } elseif (\array_key_exists('MemorySwappiness', $data) && null === $data['MemorySwappiness']) { + $object->setMemorySwappiness(null); + } + if (\array_key_exists('NanoCpus', $data) && null !== $data['NanoCpus']) { + $object->setNanoCpus($data['NanoCpus']); + unset($data['NanoCpus']); + } elseif (\array_key_exists('NanoCpus', $data) && null === $data['NanoCpus']) { + $object->setNanoCpus(null); + } + if (\array_key_exists('OomKillDisable', $data) && null !== $data['OomKillDisable']) { + $object->setOomKillDisable($data['OomKillDisable']); + unset($data['OomKillDisable']); + } elseif (\array_key_exists('OomKillDisable', $data) && null === $data['OomKillDisable']) { + $object->setOomKillDisable(null); + } + if (\array_key_exists('Init', $data) && null !== $data['Init']) { + $object->setInit($data['Init']); + unset($data['Init']); + } elseif (\array_key_exists('Init', $data) && null === $data['Init']) { + $object->setInit(null); + } + if (\array_key_exists('PidsLimit', $data) && null !== $data['PidsLimit']) { + $object->setPidsLimit($data['PidsLimit']); + unset($data['PidsLimit']); + } elseif (\array_key_exists('PidsLimit', $data) && null === $data['PidsLimit']) { + $object->setPidsLimit(null); + } + if (\array_key_exists('Ulimits', $data) && null !== $data['Ulimits']) { + $values_8 = []; + foreach ($data['Ulimits'] as $value_8) { + $values_8[] = $this->denormalizer->denormalize($value_8, \Docker\API\Model\ResourcesUlimitsItem::class, 'json', $context); + } + $object->setUlimits($values_8); + unset($data['Ulimits']); + } elseif (\array_key_exists('Ulimits', $data) && null === $data['Ulimits']) { + $object->setUlimits(null); + } + if (\array_key_exists('CpuCount', $data) && null !== $data['CpuCount']) { + $object->setCpuCount($data['CpuCount']); + unset($data['CpuCount']); + } elseif (\array_key_exists('CpuCount', $data) && null === $data['CpuCount']) { + $object->setCpuCount(null); + } + if (\array_key_exists('CpuPercent', $data) && null !== $data['CpuPercent']) { + $object->setCpuPercent($data['CpuPercent']); + unset($data['CpuPercent']); + } elseif (\array_key_exists('CpuPercent', $data) && null === $data['CpuPercent']) { + $object->setCpuPercent(null); + } + if (\array_key_exists('IOMaximumIOps', $data) && null !== $data['IOMaximumIOps']) { + $object->setIOMaximumIOps($data['IOMaximumIOps']); + unset($data['IOMaximumIOps']); + } elseif (\array_key_exists('IOMaximumIOps', $data) && null === $data['IOMaximumIOps']) { + $object->setIOMaximumIOps(null); + } + if (\array_key_exists('IOMaximumBandwidth', $data) && null !== $data['IOMaximumBandwidth']) { + $object->setIOMaximumBandwidth($data['IOMaximumBandwidth']); + unset($data['IOMaximumBandwidth']); + } elseif (\array_key_exists('IOMaximumBandwidth', $data) && null === $data['IOMaximumBandwidth']) { + $object->setIOMaximumBandwidth(null); + } + if (\array_key_exists('RestartPolicy', $data) && null !== $data['RestartPolicy']) { + $object->setRestartPolicy($this->denormalizer->denormalize($data['RestartPolicy'], \Docker\API\Model\RestartPolicy::class, 'json', $context)); + unset($data['RestartPolicy']); + } elseif (\array_key_exists('RestartPolicy', $data) && null === $data['RestartPolicy']) { + $object->setRestartPolicy(null); + } + foreach ($data as $key => $value_9) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_9; } - $object->setUlimits($values_7); - } - if (property_exists($data, 'CpuCount') && $data->{'CpuCount'} !== null) { - $object->setCpuCount($data->{'CpuCount'}); - } - if (property_exists($data, 'CpuPercent') && $data->{'CpuPercent'} !== null) { - $object->setCpuPercent($data->{'CpuPercent'}); - } - if (property_exists($data, 'IOMaximumIOps') && $data->{'IOMaximumIOps'} !== null) { - $object->setIOMaximumIOps($data->{'IOMaximumIOps'}); - } - if (property_exists($data, 'IOMaximumBandwidth') && $data->{'IOMaximumBandwidth'} !== null) { - $object->setIOMaximumBandwidth($data->{'IOMaximumBandwidth'}); - } - if (property_exists($data, 'RestartPolicy') && $data->{'RestartPolicy'} !== null) { - $object->setRestartPolicy($this->denormalizer->denormalize($data->{'RestartPolicy'}, 'Docker\\API\\Model\\RestartPolicy', 'json', $context)); } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getCpuShares()) { - $data->{'CpuShares'} = $object->getCpuShares(); + $dataArray = []; + if ($data->isInitialized('cpuShares') && null !== $data->getCpuShares()) { + $dataArray['CpuShares'] = $data->getCpuShares(); } - if (null !== $object->getMemory()) { - $data->{'Memory'} = $object->getMemory(); + if ($data->isInitialized('memory') && null !== $data->getMemory()) { + $dataArray['Memory'] = $data->getMemory(); } - if (null !== $object->getCgroupParent()) { - $data->{'CgroupParent'} = $object->getCgroupParent(); + if ($data->isInitialized('cgroupParent') && null !== $data->getCgroupParent()) { + $dataArray['CgroupParent'] = $data->getCgroupParent(); } - if (null !== $object->getBlkioWeight()) { - $data->{'BlkioWeight'} = $object->getBlkioWeight(); + if ($data->isInitialized('blkioWeight') && null !== $data->getBlkioWeight()) { + $dataArray['BlkioWeight'] = $data->getBlkioWeight(); } - if (null !== $object->getBlkioWeightDevice()) { + if ($data->isInitialized('blkioWeightDevice') && null !== $data->getBlkioWeightDevice()) { $values = []; - foreach ($object->getBlkioWeightDevice() as $value) { + foreach ($data->getBlkioWeightDevice() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'BlkioWeightDevice'} = $values; + $dataArray['BlkioWeightDevice'] = $values; } - if (null !== $object->getBlkioDeviceReadBps()) { + if ($data->isInitialized('blkioDeviceReadBps') && null !== $data->getBlkioDeviceReadBps()) { $values_1 = []; - foreach ($object->getBlkioDeviceReadBps() as $value_1) { + foreach ($data->getBlkioDeviceReadBps() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'BlkioDeviceReadBps'} = $values_1; + $dataArray['BlkioDeviceReadBps'] = $values_1; } - if (null !== $object->getBlkioDeviceWriteBps()) { + if ($data->isInitialized('blkioDeviceWriteBps') && null !== $data->getBlkioDeviceWriteBps()) { $values_2 = []; - foreach ($object->getBlkioDeviceWriteBps() as $value_2) { + foreach ($data->getBlkioDeviceWriteBps() as $value_2) { $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); } - $data->{'BlkioDeviceWriteBps'} = $values_2; + $dataArray['BlkioDeviceWriteBps'] = $values_2; } - if (null !== $object->getBlkioDeviceReadIOps()) { + if ($data->isInitialized('blkioDeviceReadIOps') && null !== $data->getBlkioDeviceReadIOps()) { $values_3 = []; - foreach ($object->getBlkioDeviceReadIOps() as $value_3) { + foreach ($data->getBlkioDeviceReadIOps() as $value_3) { $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); } - $data->{'BlkioDeviceReadIOps'} = $values_3; + $dataArray['BlkioDeviceReadIOps'] = $values_3; } - if (null !== $object->getBlkioDeviceWriteIOps()) { + if ($data->isInitialized('blkioDeviceWriteIOps') && null !== $data->getBlkioDeviceWriteIOps()) { $values_4 = []; - foreach ($object->getBlkioDeviceWriteIOps() as $value_4) { + foreach ($data->getBlkioDeviceWriteIOps() as $value_4) { $values_4[] = $this->normalizer->normalize($value_4, 'json', $context); } - $data->{'BlkioDeviceWriteIOps'} = $values_4; + $dataArray['BlkioDeviceWriteIOps'] = $values_4; } - if (null !== $object->getCpuPeriod()) { - $data->{'CpuPeriod'} = $object->getCpuPeriod(); + if ($data->isInitialized('cpuPeriod') && null !== $data->getCpuPeriod()) { + $dataArray['CpuPeriod'] = $data->getCpuPeriod(); } - if (null !== $object->getCpuQuota()) { - $data->{'CpuQuota'} = $object->getCpuQuota(); + if ($data->isInitialized('cpuQuota') && null !== $data->getCpuQuota()) { + $dataArray['CpuQuota'] = $data->getCpuQuota(); } - if (null !== $object->getCpuRealtimePeriod()) { - $data->{'CpuRealtimePeriod'} = $object->getCpuRealtimePeriod(); + if ($data->isInitialized('cpuRealtimePeriod') && null !== $data->getCpuRealtimePeriod()) { + $dataArray['CpuRealtimePeriod'] = $data->getCpuRealtimePeriod(); } - if (null !== $object->getCpuRealtimeRuntime()) { - $data->{'CpuRealtimeRuntime'} = $object->getCpuRealtimeRuntime(); + if ($data->isInitialized('cpuRealtimeRuntime') && null !== $data->getCpuRealtimeRuntime()) { + $dataArray['CpuRealtimeRuntime'] = $data->getCpuRealtimeRuntime(); } - if (null !== $object->getCpusetCpus()) { - $data->{'CpusetCpus'} = $object->getCpusetCpus(); + if ($data->isInitialized('cpusetCpus') && null !== $data->getCpusetCpus()) { + $dataArray['CpusetCpus'] = $data->getCpusetCpus(); } - if (null !== $object->getCpusetMems()) { - $data->{'CpusetMems'} = $object->getCpusetMems(); + if ($data->isInitialized('cpusetMems') && null !== $data->getCpusetMems()) { + $dataArray['CpusetMems'] = $data->getCpusetMems(); } - if (null !== $object->getDevices()) { + if ($data->isInitialized('devices') && null !== $data->getDevices()) { $values_5 = []; - foreach ($object->getDevices() as $value_5) { + foreach ($data->getDevices() as $value_5) { $values_5[] = $this->normalizer->normalize($value_5, 'json', $context); } - $data->{'Devices'} = $values_5; + $dataArray['Devices'] = $values_5; } - if (null !== $object->getDeviceCgroupRules()) { + if ($data->isInitialized('deviceCgroupRules') && null !== $data->getDeviceCgroupRules()) { $values_6 = []; - foreach ($object->getDeviceCgroupRules() as $value_6) { + foreach ($data->getDeviceCgroupRules() as $value_6) { $values_6[] = $value_6; } - $data->{'DeviceCgroupRules'} = $values_6; + $dataArray['DeviceCgroupRules'] = $values_6; } - if (null !== $object->getDiskQuota()) { - $data->{'DiskQuota'} = $object->getDiskQuota(); + if ($data->isInitialized('deviceRequests') && null !== $data->getDeviceRequests()) { + $values_7 = []; + foreach ($data->getDeviceRequests() as $value_7) { + $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + } + $dataArray['DeviceRequests'] = $values_7; } - if (null !== $object->getKernelMemory()) { - $data->{'KernelMemory'} = $object->getKernelMemory(); + if ($data->isInitialized('kernelMemoryTCP') && null !== $data->getKernelMemoryTCP()) { + $dataArray['KernelMemoryTCP'] = $data->getKernelMemoryTCP(); } - if (null !== $object->getMemoryReservation()) { - $data->{'MemoryReservation'} = $object->getMemoryReservation(); + if ($data->isInitialized('memoryReservation') && null !== $data->getMemoryReservation()) { + $dataArray['MemoryReservation'] = $data->getMemoryReservation(); } - if (null !== $object->getMemorySwap()) { - $data->{'MemorySwap'} = $object->getMemorySwap(); + if ($data->isInitialized('memorySwap') && null !== $data->getMemorySwap()) { + $dataArray['MemorySwap'] = $data->getMemorySwap(); } - if (null !== $object->getMemorySwappiness()) { - $data->{'MemorySwappiness'} = $object->getMemorySwappiness(); + if ($data->isInitialized('memorySwappiness') && null !== $data->getMemorySwappiness()) { + $dataArray['MemorySwappiness'] = $data->getMemorySwappiness(); } - if (null !== $object->getNanoCPUs()) { - $data->{'NanoCPUs'} = $object->getNanoCPUs(); + if ($data->isInitialized('nanoCpus') && null !== $data->getNanoCpus()) { + $dataArray['NanoCpus'] = $data->getNanoCpus(); } - if (null !== $object->getOomKillDisable()) { - $data->{'OomKillDisable'} = $object->getOomKillDisable(); + if ($data->isInitialized('oomKillDisable') && null !== $data->getOomKillDisable()) { + $dataArray['OomKillDisable'] = $data->getOomKillDisable(); } - if (null !== $object->getPidsLimit()) { - $data->{'PidsLimit'} = $object->getPidsLimit(); + if ($data->isInitialized('init') && null !== $data->getInit()) { + $dataArray['Init'] = $data->getInit(); } - if (null !== $object->getUlimits()) { - $values_7 = []; - foreach ($object->getUlimits() as $value_7) { - $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + if ($data->isInitialized('pidsLimit') && null !== $data->getPidsLimit()) { + $dataArray['PidsLimit'] = $data->getPidsLimit(); + } + if ($data->isInitialized('ulimits') && null !== $data->getUlimits()) { + $values_8 = []; + foreach ($data->getUlimits() as $value_8) { + $values_8[] = $this->normalizer->normalize($value_8, 'json', $context); } - $data->{'Ulimits'} = $values_7; + $dataArray['Ulimits'] = $values_8; } - if (null !== $object->getCpuCount()) { - $data->{'CpuCount'} = $object->getCpuCount(); + if ($data->isInitialized('cpuCount') && null !== $data->getCpuCount()) { + $dataArray['CpuCount'] = $data->getCpuCount(); } - if (null !== $object->getCpuPercent()) { - $data->{'CpuPercent'} = $object->getCpuPercent(); + if ($data->isInitialized('cpuPercent') && null !== $data->getCpuPercent()) { + $dataArray['CpuPercent'] = $data->getCpuPercent(); } - if (null !== $object->getIOMaximumIOps()) { - $data->{'IOMaximumIOps'} = $object->getIOMaximumIOps(); + if ($data->isInitialized('iOMaximumIOps') && null !== $data->getIOMaximumIOps()) { + $dataArray['IOMaximumIOps'] = $data->getIOMaximumIOps(); } - if (null !== $object->getIOMaximumBandwidth()) { - $data->{'IOMaximumBandwidth'} = $object->getIOMaximumBandwidth(); + if ($data->isInitialized('iOMaximumBandwidth') && null !== $data->getIOMaximumBandwidth()) { + $dataArray['IOMaximumBandwidth'] = $data->getIOMaximumBandwidth(); } - if (null !== $object->getRestartPolicy()) { - $data->{'RestartPolicy'} = $this->normalizer->normalize($object->getRestartPolicy(), 'json', $context); + if ($data->isInitialized('restartPolicy') && null !== $data->getRestartPolicy()) { + $dataArray['RestartPolicy'] = $this->normalizer->normalize($data->getRestartPolicy(), 'json', $context); } + foreach ($data as $key => $value_9) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_9; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersIdUpdatePostBody::class => false]; } } diff --git a/src/Normalizer/ContainersIdUpdatePostResponse200Normalizer.php b/src/Normalizer/ContainersIdUpdatePostResponse200Normalizer.php index d5e2d09e..ccc819bb 100644 --- a/src/Normalizer/ContainersIdUpdatePostResponse200Normalizer.php +++ b/src/Normalizer/ContainersIdUpdatePostResponse200Normalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,47 +16,73 @@ class ContainersIdUpdatePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ContainersIdUpdatePostResponse200'; + return \Docker\API\Model\ContainersIdUpdatePostResponse200::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ContainersIdUpdatePostResponse200; + return \is_object($data) && \Docker\API\Model\ContainersIdUpdatePostResponse200::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ContainersIdUpdatePostResponse200(); - if (property_exists($data, 'Warnings') && $data->{'Warnings'} !== null) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Warnings', $data) && null !== $data['Warnings']) { $values = []; - foreach ($data->{'Warnings'} as $value) { + foreach ($data['Warnings'] as $value) { $values[] = $value; } $object->setWarnings($values); + unset($data['Warnings']); + } elseif (\array_key_exists('Warnings', $data) && null === $data['Warnings']) { + $object->setWarnings(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getWarnings()) { + $dataArray = []; + if ($data->isInitialized('warnings') && null !== $data->getWarnings()) { $values = []; - foreach ($object->getWarnings() as $value) { + foreach ($data->getWarnings() as $value) { $values[] = $value; } - $data->{'Warnings'} = $values; + $dataArray['Warnings'] = $values; + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersIdUpdatePostResponse200::class => false]; } } diff --git a/src/Normalizer/ContainersIdWaitPostResponse200ErrorNormalizer.php b/src/Normalizer/ContainersIdWaitPostResponse200ErrorNormalizer.php deleted file mode 100644 index 52af6a05..00000000 --- a/src/Normalizer/ContainersIdWaitPostResponse200ErrorNormalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -{'Message'} !== null) { - $object->setMessage($data->{'Message'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getMessage()) { - $data->{'Message'} = $object->getMessage(); - } - - return $data; - } -} diff --git a/src/Normalizer/ContainersIdWaitPostResponse200Normalizer.php b/src/Normalizer/ContainersIdWaitPostResponse200Normalizer.php deleted file mode 100644 index b884c957..00000000 --- a/src/Normalizer/ContainersIdWaitPostResponse200Normalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -{'StatusCode'} !== null) { - $object->setStatusCode($data->{'StatusCode'}); - } - if (property_exists($data, 'Error') && $data->{'Error'} !== null) { - $object->setError($this->denormalizer->denormalize($data->{'Error'}, 'Docker\\API\\Model\\ContainersIdWaitPostResponse200Error', 'json', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getStatusCode()) { - $data->{'StatusCode'} = $object->getStatusCode(); - } - if (null !== $object->getError()) { - $data->{'Error'} = $this->normalizer->normalize($object->getError(), 'json', $context); - } - - return $data; - } -} diff --git a/src/Normalizer/ContainersPrunePostResponse200Normalizer.php b/src/Normalizer/ContainersPrunePostResponse200Normalizer.php index 29ae6de9..6109dab5 100644 --- a/src/Normalizer/ContainersPrunePostResponse200Normalizer.php +++ b/src/Normalizer/ContainersPrunePostResponse200Normalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,53 +16,82 @@ class ContainersPrunePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ContainersPrunePostResponse200'; + return \Docker\API\Model\ContainersPrunePostResponse200::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ContainersPrunePostResponse200; + return \is_object($data) && \Docker\API\Model\ContainersPrunePostResponse200::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ContainersPrunePostResponse200(); - if (property_exists($data, 'ContainersDeleted') && $data->{'ContainersDeleted'} !== null) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ContainersDeleted', $data) && null !== $data['ContainersDeleted']) { $values = []; - foreach ($data->{'ContainersDeleted'} as $value) { + foreach ($data['ContainersDeleted'] as $value) { $values[] = $value; } $object->setContainersDeleted($values); + unset($data['ContainersDeleted']); + } elseif (\array_key_exists('ContainersDeleted', $data) && null === $data['ContainersDeleted']) { + $object->setContainersDeleted(null); } - if (property_exists($data, 'SpaceReclaimed') && $data->{'SpaceReclaimed'} !== null) { - $object->setSpaceReclaimed($data->{'SpaceReclaimed'}); + if (\array_key_exists('SpaceReclaimed', $data) && null !== $data['SpaceReclaimed']) { + $object->setSpaceReclaimed($data['SpaceReclaimed']); + unset($data['SpaceReclaimed']); + } elseif (\array_key_exists('SpaceReclaimed', $data) && null === $data['SpaceReclaimed']) { + $object->setSpaceReclaimed(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getContainersDeleted()) { + $dataArray = []; + if ($data->isInitialized('containersDeleted') && null !== $data->getContainersDeleted()) { $values = []; - foreach ($object->getContainersDeleted() as $value) { + foreach ($data->getContainersDeleted() as $value) { $values[] = $value; } - $data->{'ContainersDeleted'} = $values; + $dataArray['ContainersDeleted'] = $values; } - if (null !== $object->getSpaceReclaimed()) { - $data->{'SpaceReclaimed'} = $object->getSpaceReclaimed(); + if ($data->isInitialized('spaceReclaimed') && null !== $data->getSpaceReclaimed()) { + $dataArray['SpaceReclaimed'] = $data->getSpaceReclaimed(); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ContainersPrunePostResponse200::class => false]; } } diff --git a/src/Normalizer/CreateImageInfoNormalizer.php b/src/Normalizer/CreateImageInfoNormalizer.php index 6510661d..16bbcdb0 100644 --- a/src/Normalizer/CreateImageInfoNormalizer.php +++ b/src/Normalizer/CreateImageInfoNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,63 +16,110 @@ class CreateImageInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\CreateImageInfo'; + return \Docker\API\Model\CreateImageInfo::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\CreateImageInfo; + return \is_object($data) && \Docker\API\Model\CreateImageInfo::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\CreateImageInfo(); - if (property_exists($data, 'id') && $data->{'id'} !== null) { - $object->setId($data->{'id'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + unset($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('error', $data) && null !== $data['error']) { + $object->setError($data['error']); + unset($data['error']); + } elseif (\array_key_exists('error', $data) && null === $data['error']) { + $object->setError(null); + } + if (\array_key_exists('errorDetail', $data) && null !== $data['errorDetail']) { + $object->setErrorDetail($this->denormalizer->denormalize($data['errorDetail'], \Docker\API\Model\ErrorDetail::class, 'json', $context)); + unset($data['errorDetail']); + } elseif (\array_key_exists('errorDetail', $data) && null === $data['errorDetail']) { + $object->setErrorDetail(null); } - if (property_exists($data, 'error') && $data->{'error'} !== null) { - $object->setError($data->{'error'}); + if (\array_key_exists('status', $data) && null !== $data['status']) { + $object->setStatus($data['status']); + unset($data['status']); + } elseif (\array_key_exists('status', $data) && null === $data['status']) { + $object->setStatus(null); } - if (property_exists($data, 'status') && $data->{'status'} !== null) { - $object->setStatus($data->{'status'}); + if (\array_key_exists('progress', $data) && null !== $data['progress']) { + $object->setProgress($data['progress']); + unset($data['progress']); + } elseif (\array_key_exists('progress', $data) && null === $data['progress']) { + $object->setProgress(null); } - if (property_exists($data, 'progress') && $data->{'progress'} !== null) { - $object->setProgress($data->{'progress'}); + if (\array_key_exists('progressDetail', $data) && null !== $data['progressDetail']) { + $object->setProgressDetail($this->denormalizer->denormalize($data['progressDetail'], \Docker\API\Model\ProgressDetail::class, 'json', $context)); + unset($data['progressDetail']); + } elseif (\array_key_exists('progressDetail', $data) && null === $data['progressDetail']) { + $object->setProgressDetail(null); } - if (property_exists($data, 'progressDetail') && $data->{'progressDetail'} !== null) { - $object->setProgressDetail($this->denormalizer->denormalize($data->{'progressDetail'}, 'Docker\\API\\Model\\ProgressDetail', 'json', $context)); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'id'} = $object->getId(); + $dataArray = []; + if ($data->isInitialized('id') && null !== $data->getId()) { + $dataArray['id'] = $data->getId(); } - if (null !== $object->getError()) { - $data->{'error'} = $object->getError(); + if ($data->isInitialized('error') && null !== $data->getError()) { + $dataArray['error'] = $data->getError(); } - if (null !== $object->getStatus()) { - $data->{'status'} = $object->getStatus(); + if ($data->isInitialized('errorDetail') && null !== $data->getErrorDetail()) { + $dataArray['errorDetail'] = $this->normalizer->normalize($data->getErrorDetail(), 'json', $context); } - if (null !== $object->getProgress()) { - $data->{'progress'} = $object->getProgress(); + if ($data->isInitialized('status') && null !== $data->getStatus()) { + $dataArray['status'] = $data->getStatus(); } - if (null !== $object->getProgressDetail()) { - $data->{'progressDetail'} = $this->normalizer->normalize($object->getProgressDetail(), 'json', $context); + if ($data->isInitialized('progress') && null !== $data->getProgress()) { + $dataArray['progress'] = $data->getProgress(); + } + if ($data->isInitialized('progressDetail') && null !== $data->getProgressDetail()) { + $dataArray['progressDetail'] = $this->normalizer->normalize($data->getProgressDetail(), 'json', $context); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\CreateImageInfo::class => false]; } } diff --git a/src/Normalizer/DeviceMappingNormalizer.php b/src/Normalizer/DeviceMappingNormalizer.php index 8c30df2a..05e69513 100644 --- a/src/Normalizer/DeviceMappingNormalizer.php +++ b/src/Normalizer/DeviceMappingNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,51 +16,83 @@ class DeviceMappingNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\DeviceMapping'; + return \Docker\API\Model\DeviceMapping::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\DeviceMapping; + return \is_object($data) && \Docker\API\Model\DeviceMapping::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\DeviceMapping(); - if (property_exists($data, 'PathOnHost') && $data->{'PathOnHost'} !== null) { - $object->setPathOnHost($data->{'PathOnHost'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('PathOnHost', $data) && null !== $data['PathOnHost']) { + $object->setPathOnHost($data['PathOnHost']); + unset($data['PathOnHost']); + } elseif (\array_key_exists('PathOnHost', $data) && null === $data['PathOnHost']) { + $object->setPathOnHost(null); + } + if (\array_key_exists('PathInContainer', $data) && null !== $data['PathInContainer']) { + $object->setPathInContainer($data['PathInContainer']); + unset($data['PathInContainer']); + } elseif (\array_key_exists('PathInContainer', $data) && null === $data['PathInContainer']) { + $object->setPathInContainer(null); } - if (property_exists($data, 'PathInContainer') && $data->{'PathInContainer'} !== null) { - $object->setPathInContainer($data->{'PathInContainer'}); + if (\array_key_exists('CgroupPermissions', $data) && null !== $data['CgroupPermissions']) { + $object->setCgroupPermissions($data['CgroupPermissions']); + unset($data['CgroupPermissions']); + } elseif (\array_key_exists('CgroupPermissions', $data) && null === $data['CgroupPermissions']) { + $object->setCgroupPermissions(null); } - if (property_exists($data, 'CgroupPermissions') && $data->{'CgroupPermissions'} !== null) { - $object->setCgroupPermissions($data->{'CgroupPermissions'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getPathOnHost()) { - $data->{'PathOnHost'} = $object->getPathOnHost(); + $dataArray = []; + if ($data->isInitialized('pathOnHost') && null !== $data->getPathOnHost()) { + $dataArray['PathOnHost'] = $data->getPathOnHost(); } - if (null !== $object->getPathInContainer()) { - $data->{'PathInContainer'} = $object->getPathInContainer(); + if ($data->isInitialized('pathInContainer') && null !== $data->getPathInContainer()) { + $dataArray['PathInContainer'] = $data->getPathInContainer(); } - if (null !== $object->getCgroupPermissions()) { - $data->{'CgroupPermissions'} = $object->getCgroupPermissions(); + if ($data->isInitialized('cgroupPermissions') && null !== $data->getCgroupPermissions()) { + $dataArray['CgroupPermissions'] = $data->getCgroupPermissions(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\DeviceMapping::class => false]; } } diff --git a/src/Normalizer/DeviceRequestNormalizer.php b/src/Normalizer/DeviceRequestNormalizer.php new file mode 100644 index 00000000..6b31cfe1 --- /dev/null +++ b/src/Normalizer/DeviceRequestNormalizer.php @@ -0,0 +1,148 @@ +setDriver($data['Driver']); + unset($data['Driver']); + } elseif (\array_key_exists('Driver', $data) && null === $data['Driver']) { + $object->setDriver(null); + } + if (\array_key_exists('Count', $data) && null !== $data['Count']) { + $object->setCount($data['Count']); + unset($data['Count']); + } elseif (\array_key_exists('Count', $data) && null === $data['Count']) { + $object->setCount(null); + } + if (\array_key_exists('DeviceIDs', $data) && null !== $data['DeviceIDs']) { + $values = []; + foreach ($data['DeviceIDs'] as $value) { + $values[] = $value; + } + $object->setDeviceIDs($values); + unset($data['DeviceIDs']); + } elseif (\array_key_exists('DeviceIDs', $data) && null === $data['DeviceIDs']) { + $object->setDeviceIDs(null); + } + if (\array_key_exists('Capabilities', $data) && null !== $data['Capabilities']) { + $values_1 = []; + foreach ($data['Capabilities'] as $value_1) { + $values_2 = []; + foreach ($value_1 as $value_2) { + $values_2[] = $value_2; + } + $values_1[] = $values_2; + } + $object->setCapabilities($values_1); + unset($data['Capabilities']); + } elseif (\array_key_exists('Capabilities', $data) && null === $data['Capabilities']) { + $object->setCapabilities(null); + } + if (\array_key_exists('Options', $data) && null !== $data['Options']) { + $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value_3) { + $values_3[$key] = $value_3; + } + $object->setOptions($values_3); + unset($data['Options']); + } elseif (\array_key_exists('Options', $data) && null === $data['Options']) { + $object->setOptions(null); + } + foreach ($data as $key_1 => $value_4) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_4; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('driver') && null !== $data->getDriver()) { + $dataArray['Driver'] = $data->getDriver(); + } + if ($data->isInitialized('count') && null !== $data->getCount()) { + $dataArray['Count'] = $data->getCount(); + } + if ($data->isInitialized('deviceIDs') && null !== $data->getDeviceIDs()) { + $values = []; + foreach ($data->getDeviceIDs() as $value) { + $values[] = $value; + } + $dataArray['DeviceIDs'] = $values; + } + if ($data->isInitialized('capabilities') && null !== $data->getCapabilities()) { + $values_1 = []; + foreach ($data->getCapabilities() as $value_1) { + $values_2 = []; + foreach ($value_1 as $value_2) { + $values_2[] = $value_2; + } + $values_1[] = $values_2; + } + $dataArray['Capabilities'] = $values_1; + } + if ($data->isInitialized('options') && null !== $data->getOptions()) { + $values_3 = []; + foreach ($data->getOptions() as $key => $value_3) { + $values_3[$key] = $value_3; + } + $dataArray['Options'] = $values_3; + } + foreach ($data as $key_1 => $value_4) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_4; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\DeviceRequest::class => false]; + } +} diff --git a/src/Normalizer/DistributionInspectNormalizer.php b/src/Normalizer/DistributionInspectNormalizer.php new file mode 100644 index 00000000..f3bff572 --- /dev/null +++ b/src/Normalizer/DistributionInspectNormalizer.php @@ -0,0 +1,93 @@ +setDescriptor($this->denormalizer->denormalize($data['Descriptor'], \Docker\API\Model\OCIDescriptor::class, 'json', $context)); + unset($data['Descriptor']); + } elseif (\array_key_exists('Descriptor', $data) && null === $data['Descriptor']) { + $object->setDescriptor(null); + } + if (\array_key_exists('Platforms', $data) && null !== $data['Platforms']) { + $values = []; + foreach ($data['Platforms'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\OCIPlatform::class, 'json', $context); + } + $object->setPlatforms($values); + unset($data['Platforms']); + } elseif (\array_key_exists('Platforms', $data) && null === $data['Platforms']) { + $object->setPlatforms(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + $dataArray['Descriptor'] = $this->normalizer->normalize($data->getDescriptor(), 'json', $context); + $values = []; + foreach ($data->getPlatforms() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $dataArray['Platforms'] = $values; + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\DistributionInspect::class => false]; + } +} diff --git a/src/Normalizer/DistributionNameJsonGetResponse200DescriptorNormalizer.php b/src/Normalizer/DistributionNameJsonGetResponse200DescriptorNormalizer.php deleted file mode 100644 index 22ae13a0..00000000 --- a/src/Normalizer/DistributionNameJsonGetResponse200DescriptorNormalizer.php +++ /dev/null @@ -1,83 +0,0 @@ -{'MediaType'} !== null) { - $object->setMediaType($data->{'MediaType'}); - } - if (property_exists($data, 'Size') && $data->{'Size'} !== null) { - $object->setSize($data->{'Size'}); - } - if (property_exists($data, 'Digest') && $data->{'Digest'} !== null) { - $object->setDigest($data->{'Digest'}); - } - if (property_exists($data, 'URLs') && $data->{'URLs'} !== null) { - $values = []; - foreach ($data->{'URLs'} as $value) { - $values[] = $value; - } - $object->setURLs($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getMediaType()) { - $data->{'MediaType'} = $object->getMediaType(); - } - if (null !== $object->getSize()) { - $data->{'Size'} = $object->getSize(); - } - if (null !== $object->getDigest()) { - $data->{'Digest'} = $object->getDigest(); - } - if (null !== $object->getURLs()) { - $values = []; - foreach ($object->getURLs() as $value) { - $values[] = $value; - } - $data->{'URLs'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/DistributionNameJsonGetResponse200Normalizer.php b/src/Normalizer/DistributionNameJsonGetResponse200Normalizer.php deleted file mode 100644 index 81fc207e..00000000 --- a/src/Normalizer/DistributionNameJsonGetResponse200Normalizer.php +++ /dev/null @@ -1,71 +0,0 @@ -{'Descriptor'} !== null) { - $object->setDescriptor($this->denormalizer->denormalize($data->{'Descriptor'}, 'Docker\\API\\Model\\DistributionNameJsonGetResponse200Descriptor', 'json', $context)); - } - if (property_exists($data, 'Platforms') && $data->{'Platforms'} !== null) { - $values = []; - foreach ($data->{'Platforms'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\DistributionNameJsonGetResponse200PlatformsItem', 'json', $context); - } - $object->setPlatforms($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getDescriptor()) { - $data->{'Descriptor'} = $this->normalizer->normalize($object->getDescriptor(), 'json', $context); - } - if (null !== $object->getPlatforms()) { - $values = []; - foreach ($object->getPlatforms() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data->{'Platforms'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/DistributionNameJsonGetResponse200PlatformsItemNormalizer.php b/src/Normalizer/DistributionNameJsonGetResponse200PlatformsItemNormalizer.php deleted file mode 100644 index b9d5662d..00000000 --- a/src/Normalizer/DistributionNameJsonGetResponse200PlatformsItemNormalizer.php +++ /dev/null @@ -1,103 +0,0 @@ -{'Architecture'} !== null) { - $object->setArchitecture($data->{'Architecture'}); - } - if (property_exists($data, 'OS') && $data->{'OS'} !== null) { - $object->setOS($data->{'OS'}); - } - if (property_exists($data, 'OSVersion') && $data->{'OSVersion'} !== null) { - $object->setOSVersion($data->{'OSVersion'}); - } - if (property_exists($data, 'OSFeatures') && $data->{'OSFeatures'} !== null) { - $values = []; - foreach ($data->{'OSFeatures'} as $value) { - $values[] = $value; - } - $object->setOSFeatures($values); - } - if (property_exists($data, 'Variant') && $data->{'Variant'} !== null) { - $object->setVariant($data->{'Variant'}); - } - if (property_exists($data, 'Features') && $data->{'Features'} !== null) { - $values_1 = []; - foreach ($data->{'Features'} as $value_1) { - $values_1[] = $value_1; - } - $object->setFeatures($values_1); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getArchitecture()) { - $data->{'Architecture'} = $object->getArchitecture(); - } - if (null !== $object->getOS()) { - $data->{'OS'} = $object->getOS(); - } - if (null !== $object->getOSVersion()) { - $data->{'OSVersion'} = $object->getOSVersion(); - } - if (null !== $object->getOSFeatures()) { - $values = []; - foreach ($object->getOSFeatures() as $value) { - $values[] = $value; - } - $data->{'OSFeatures'} = $values; - } - if (null !== $object->getVariant()) { - $data->{'Variant'} = $object->getVariant(); - } - if (null !== $object->getFeatures()) { - $values_1 = []; - foreach ($object->getFeatures() as $value_1) { - $values_1[] = $value_1; - } - $data->{'Features'} = $values_1; - } - - return $data; - } -} diff --git a/src/Normalizer/DriverNormalizer.php b/src/Normalizer/DriverNormalizer.php index 1450dc88..0a2e1bfb 100644 --- a/src/Normalizer/DriverNormalizer.php +++ b/src/Normalizer/DriverNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,53 +16,80 @@ class DriverNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Driver'; + return \Docker\API\Model\Driver::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Driver; + return \is_object($data) && \Docker\API\Model\Driver::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\Driver(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { + if (\array_key_exists('Options', $data) && null !== $data['Options']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key => $value) { + foreach ($data['Options'] as $key => $value) { $values[$key] = $value; } $object->setOptions($values); + unset($data['Options']); + } elseif (\array_key_exists('Options', $data) && null === $data['Options']) { + $object->setOptions(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + $dataArray['Name'] = $data->getName(); + if ($data->isInitialized('options') && null !== $data->getOptions()) { + $values = []; + foreach ($data->getOptions() as $key => $value) { + $values[$key] = $value; + } + $dataArray['Options'] = $values; } - if (null !== $object->getOptions()) { - $values = new \stdClass(); - foreach ($object->getOptions() as $key => $value) { - $values->{$key} = $value; + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; } - $data->{'Options'} = $values; } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Driver::class => false]; } } diff --git a/src/Normalizer/EndpointIPAMConfigNormalizer.php b/src/Normalizer/EndpointIPAMConfigNormalizer.php index 01c7bfc7..a17dd574 100644 --- a/src/Normalizer/EndpointIPAMConfigNormalizer.php +++ b/src/Normalizer/EndpointIPAMConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,59 +16,91 @@ class EndpointIPAMConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\EndpointIPAMConfig'; + return \Docker\API\Model\EndpointIPAMConfig::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\EndpointIPAMConfig; + return \is_object($data) && \Docker\API\Model\EndpointIPAMConfig::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\EndpointIPAMConfig(); - if (property_exists($data, 'IPv4Address') && $data->{'IPv4Address'} !== null) { - $object->setIPv4Address($data->{'IPv4Address'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('IPv4Address', $data) && null !== $data['IPv4Address']) { + $object->setIPv4Address($data['IPv4Address']); + unset($data['IPv4Address']); + } elseif (\array_key_exists('IPv4Address', $data) && null === $data['IPv4Address']) { + $object->setIPv4Address(null); } - if (property_exists($data, 'IPv6Address') && $data->{'IPv6Address'} !== null) { - $object->setIPv6Address($data->{'IPv6Address'}); + if (\array_key_exists('IPv6Address', $data) && null !== $data['IPv6Address']) { + $object->setIPv6Address($data['IPv6Address']); + unset($data['IPv6Address']); + } elseif (\array_key_exists('IPv6Address', $data) && null === $data['IPv6Address']) { + $object->setIPv6Address(null); } - if (property_exists($data, 'LinkLocalIPs') && $data->{'LinkLocalIPs'} !== null) { + if (\array_key_exists('LinkLocalIPs', $data) && null !== $data['LinkLocalIPs']) { $values = []; - foreach ($data->{'LinkLocalIPs'} as $value) { + foreach ($data['LinkLocalIPs'] as $value) { $values[] = $value; } $object->setLinkLocalIPs($values); + unset($data['LinkLocalIPs']); + } elseif (\array_key_exists('LinkLocalIPs', $data) && null === $data['LinkLocalIPs']) { + $object->setLinkLocalIPs(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getIPv4Address()) { - $data->{'IPv4Address'} = $object->getIPv4Address(); + $dataArray = []; + if ($data->isInitialized('iPv4Address') && null !== $data->getIPv4Address()) { + $dataArray['IPv4Address'] = $data->getIPv4Address(); } - if (null !== $object->getIPv6Address()) { - $data->{'IPv6Address'} = $object->getIPv6Address(); + if ($data->isInitialized('iPv6Address') && null !== $data->getIPv6Address()) { + $dataArray['IPv6Address'] = $data->getIPv6Address(); } - if (null !== $object->getLinkLocalIPs()) { + if ($data->isInitialized('linkLocalIPs') && null !== $data->getLinkLocalIPs()) { $values = []; - foreach ($object->getLinkLocalIPs() as $value) { + foreach ($data->getLinkLocalIPs() as $value) { $values[] = $value; } - $data->{'LinkLocalIPs'} = $values; + $dataArray['LinkLocalIPs'] = $values; + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EndpointIPAMConfig::class => false]; } } diff --git a/src/Normalizer/EndpointPortConfigNormalizer.php b/src/Normalizer/EndpointPortConfigNormalizer.php index 4af7fdfb..15b37f16 100644 --- a/src/Normalizer/EndpointPortConfigNormalizer.php +++ b/src/Normalizer/EndpointPortConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,63 +16,101 @@ class EndpointPortConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\EndpointPortConfig'; + return \Docker\API\Model\EndpointPortConfig::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\EndpointPortConfig; + return \is_object($data) && \Docker\API\Model\EndpointPortConfig::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\EndpointPortConfig(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Protocol', $data) && null !== $data['Protocol']) { + $object->setProtocol($data['Protocol']); + unset($data['Protocol']); + } elseif (\array_key_exists('Protocol', $data) && null === $data['Protocol']) { + $object->setProtocol(null); } - if (property_exists($data, 'Protocol') && $data->{'Protocol'} !== null) { - $object->setProtocol($data->{'Protocol'}); + if (\array_key_exists('TargetPort', $data) && null !== $data['TargetPort']) { + $object->setTargetPort($data['TargetPort']); + unset($data['TargetPort']); + } elseif (\array_key_exists('TargetPort', $data) && null === $data['TargetPort']) { + $object->setTargetPort(null); } - if (property_exists($data, 'TargetPort') && $data->{'TargetPort'} !== null) { - $object->setTargetPort($data->{'TargetPort'}); + if (\array_key_exists('PublishedPort', $data) && null !== $data['PublishedPort']) { + $object->setPublishedPort($data['PublishedPort']); + unset($data['PublishedPort']); + } elseif (\array_key_exists('PublishedPort', $data) && null === $data['PublishedPort']) { + $object->setPublishedPort(null); } - if (property_exists($data, 'PublishedPort') && $data->{'PublishedPort'} !== null) { - $object->setPublishedPort($data->{'PublishedPort'}); + if (\array_key_exists('PublishMode', $data) && null !== $data['PublishMode']) { + $object->setPublishMode($data['PublishMode']); + unset($data['PublishMode']); + } elseif (\array_key_exists('PublishMode', $data) && null === $data['PublishMode']) { + $object->setPublishMode(null); } - if (property_exists($data, 'PublishMode') && $data->{'PublishMode'} !== null) { - $object->setPublishMode($data->{'PublishMode'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getProtocol()) { - $data->{'Protocol'} = $object->getProtocol(); + if ($data->isInitialized('protocol') && null !== $data->getProtocol()) { + $dataArray['Protocol'] = $data->getProtocol(); } - if (null !== $object->getTargetPort()) { - $data->{'TargetPort'} = $object->getTargetPort(); + if ($data->isInitialized('targetPort') && null !== $data->getTargetPort()) { + $dataArray['TargetPort'] = $data->getTargetPort(); } - if (null !== $object->getPublishedPort()) { - $data->{'PublishedPort'} = $object->getPublishedPort(); + if ($data->isInitialized('publishedPort') && null !== $data->getPublishedPort()) { + $dataArray['PublishedPort'] = $data->getPublishedPort(); } - if (null !== $object->getPublishMode()) { - $data->{'PublishMode'} = $object->getPublishMode(); + if ($data->isInitialized('publishMode') && null !== $data->getPublishMode()) { + $dataArray['PublishMode'] = $data->getPublishMode(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EndpointPortConfig::class => false]; } } diff --git a/src/Normalizer/EndpointSettingsNormalizer.php b/src/Normalizer/EndpointSettingsNormalizer.php index 26ef1fb3..2331484e 100644 --- a/src/Normalizer/EndpointSettingsNormalizer.php +++ b/src/Normalizer/EndpointSettingsNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,135 +16,214 @@ class EndpointSettingsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\EndpointSettings'; + return \Docker\API\Model\EndpointSettings::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\EndpointSettings; + return \is_object($data) && \Docker\API\Model\EndpointSettings::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\EndpointSettings(); - if (property_exists($data, 'IPAMConfig') && $data->{'IPAMConfig'} !== null) { - $object->setIPAMConfig($this->denormalizer->denormalize($data->{'IPAMConfig'}, 'Docker\\API\\Model\\EndpointIPAMConfig', 'json', $context)); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('IPAMConfig', $data) && null !== $data['IPAMConfig']) { + $object->setIPAMConfig($this->denormalizer->denormalize($data['IPAMConfig'], \Docker\API\Model\EndpointIPAMConfig::class, 'json', $context)); + unset($data['IPAMConfig']); + } elseif (\array_key_exists('IPAMConfig', $data) && null === $data['IPAMConfig']) { + $object->setIPAMConfig(null); } - if (property_exists($data, 'Links') && $data->{'Links'} !== null) { + if (\array_key_exists('Links', $data) && null !== $data['Links']) { $values = []; - foreach ($data->{'Links'} as $value) { + foreach ($data['Links'] as $value) { $values[] = $value; } $object->setLinks($values); + unset($data['Links']); + } elseif (\array_key_exists('Links', $data) && null === $data['Links']) { + $object->setLinks(null); } - if (property_exists($data, 'Aliases') && $data->{'Aliases'} !== null) { + if (\array_key_exists('MacAddress', $data) && null !== $data['MacAddress']) { + $object->setMacAddress($data['MacAddress']); + unset($data['MacAddress']); + } elseif (\array_key_exists('MacAddress', $data) && null === $data['MacAddress']) { + $object->setMacAddress(null); + } + if (\array_key_exists('Aliases', $data) && null !== $data['Aliases']) { $values_1 = []; - foreach ($data->{'Aliases'} as $value_1) { + foreach ($data['Aliases'] as $value_1) { $values_1[] = $value_1; } $object->setAliases($values_1); - } - if (property_exists($data, 'NetworkID') && $data->{'NetworkID'} !== null) { - $object->setNetworkID($data->{'NetworkID'}); - } - if (property_exists($data, 'EndpointID') && $data->{'EndpointID'} !== null) { - $object->setEndpointID($data->{'EndpointID'}); - } - if (property_exists($data, 'Gateway') && $data->{'Gateway'} !== null) { - $object->setGateway($data->{'Gateway'}); - } - if (property_exists($data, 'IPAddress') && $data->{'IPAddress'} !== null) { - $object->setIPAddress($data->{'IPAddress'}); - } - if (property_exists($data, 'IPPrefixLen') && $data->{'IPPrefixLen'} !== null) { - $object->setIPPrefixLen($data->{'IPPrefixLen'}); - } - if (property_exists($data, 'IPv6Gateway') && $data->{'IPv6Gateway'} !== null) { - $object->setIPv6Gateway($data->{'IPv6Gateway'}); - } - if (property_exists($data, 'GlobalIPv6Address') && $data->{'GlobalIPv6Address'} !== null) { - $object->setGlobalIPv6Address($data->{'GlobalIPv6Address'}); - } - if (property_exists($data, 'GlobalIPv6PrefixLen') && $data->{'GlobalIPv6PrefixLen'} !== null) { - $object->setGlobalIPv6PrefixLen($data->{'GlobalIPv6PrefixLen'}); - } - if (property_exists($data, 'MacAddress') && $data->{'MacAddress'} !== null) { - $object->setMacAddress($data->{'MacAddress'}); - } - if (property_exists($data, 'DriverOpts') && $data->{'DriverOpts'} !== null) { + unset($data['Aliases']); + } elseif (\array_key_exists('Aliases', $data) && null === $data['Aliases']) { + $object->setAliases(null); + } + if (\array_key_exists('NetworkID', $data) && null !== $data['NetworkID']) { + $object->setNetworkID($data['NetworkID']); + unset($data['NetworkID']); + } elseif (\array_key_exists('NetworkID', $data) && null === $data['NetworkID']) { + $object->setNetworkID(null); + } + if (\array_key_exists('EndpointID', $data) && null !== $data['EndpointID']) { + $object->setEndpointID($data['EndpointID']); + unset($data['EndpointID']); + } elseif (\array_key_exists('EndpointID', $data) && null === $data['EndpointID']) { + $object->setEndpointID(null); + } + if (\array_key_exists('Gateway', $data) && null !== $data['Gateway']) { + $object->setGateway($data['Gateway']); + unset($data['Gateway']); + } elseif (\array_key_exists('Gateway', $data) && null === $data['Gateway']) { + $object->setGateway(null); + } + if (\array_key_exists('IPAddress', $data) && null !== $data['IPAddress']) { + $object->setIPAddress($data['IPAddress']); + unset($data['IPAddress']); + } elseif (\array_key_exists('IPAddress', $data) && null === $data['IPAddress']) { + $object->setIPAddress(null); + } + if (\array_key_exists('IPPrefixLen', $data) && null !== $data['IPPrefixLen']) { + $object->setIPPrefixLen($data['IPPrefixLen']); + unset($data['IPPrefixLen']); + } elseif (\array_key_exists('IPPrefixLen', $data) && null === $data['IPPrefixLen']) { + $object->setIPPrefixLen(null); + } + if (\array_key_exists('IPv6Gateway', $data) && null !== $data['IPv6Gateway']) { + $object->setIPv6Gateway($data['IPv6Gateway']); + unset($data['IPv6Gateway']); + } elseif (\array_key_exists('IPv6Gateway', $data) && null === $data['IPv6Gateway']) { + $object->setIPv6Gateway(null); + } + if (\array_key_exists('GlobalIPv6Address', $data) && null !== $data['GlobalIPv6Address']) { + $object->setGlobalIPv6Address($data['GlobalIPv6Address']); + unset($data['GlobalIPv6Address']); + } elseif (\array_key_exists('GlobalIPv6Address', $data) && null === $data['GlobalIPv6Address']) { + $object->setGlobalIPv6Address(null); + } + if (\array_key_exists('GlobalIPv6PrefixLen', $data) && null !== $data['GlobalIPv6PrefixLen']) { + $object->setGlobalIPv6PrefixLen($data['GlobalIPv6PrefixLen']); + unset($data['GlobalIPv6PrefixLen']); + } elseif (\array_key_exists('GlobalIPv6PrefixLen', $data) && null === $data['GlobalIPv6PrefixLen']) { + $object->setGlobalIPv6PrefixLen(null); + } + if (\array_key_exists('DriverOpts', $data) && null !== $data['DriverOpts']) { $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'DriverOpts'} as $key => $value_2) { + foreach ($data['DriverOpts'] as $key => $value_2) { $values_2[$key] = $value_2; } $object->setDriverOpts($values_2); + unset($data['DriverOpts']); + } elseif (\array_key_exists('DriverOpts', $data) && null === $data['DriverOpts']) { + $object->setDriverOpts(null); + } + if (\array_key_exists('DNSNames', $data) && null !== $data['DNSNames']) { + $values_3 = []; + foreach ($data['DNSNames'] as $value_3) { + $values_3[] = $value_3; + } + $object->setDNSNames($values_3); + unset($data['DNSNames']); + } elseif (\array_key_exists('DNSNames', $data) && null === $data['DNSNames']) { + $object->setDNSNames(null); + } + foreach ($data as $key_1 => $value_4) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_4; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getIPAMConfig()) { - $data->{'IPAMConfig'} = $this->normalizer->normalize($object->getIPAMConfig(), 'json', $context); + $dataArray = []; + if ($data->isInitialized('iPAMConfig') && null !== $data->getIPAMConfig()) { + $dataArray['IPAMConfig'] = $this->normalizer->normalize($data->getIPAMConfig(), 'json', $context); } - if (null !== $object->getLinks()) { + if ($data->isInitialized('links') && null !== $data->getLinks()) { $values = []; - foreach ($object->getLinks() as $value) { + foreach ($data->getLinks() as $value) { $values[] = $value; } - $data->{'Links'} = $values; + $dataArray['Links'] = $values; + } + if ($data->isInitialized('macAddress') && null !== $data->getMacAddress()) { + $dataArray['MacAddress'] = $data->getMacAddress(); } - if (null !== $object->getAliases()) { + if ($data->isInitialized('aliases') && null !== $data->getAliases()) { $values_1 = []; - foreach ($object->getAliases() as $value_1) { + foreach ($data->getAliases() as $value_1) { $values_1[] = $value_1; } - $data->{'Aliases'} = $values_1; + $dataArray['Aliases'] = $values_1; + } + if ($data->isInitialized('networkID') && null !== $data->getNetworkID()) { + $dataArray['NetworkID'] = $data->getNetworkID(); } - if (null !== $object->getNetworkID()) { - $data->{'NetworkID'} = $object->getNetworkID(); + if ($data->isInitialized('endpointID') && null !== $data->getEndpointID()) { + $dataArray['EndpointID'] = $data->getEndpointID(); } - if (null !== $object->getEndpointID()) { - $data->{'EndpointID'} = $object->getEndpointID(); + if ($data->isInitialized('gateway') && null !== $data->getGateway()) { + $dataArray['Gateway'] = $data->getGateway(); } - if (null !== $object->getGateway()) { - $data->{'Gateway'} = $object->getGateway(); + if ($data->isInitialized('iPAddress') && null !== $data->getIPAddress()) { + $dataArray['IPAddress'] = $data->getIPAddress(); } - if (null !== $object->getIPAddress()) { - $data->{'IPAddress'} = $object->getIPAddress(); + if ($data->isInitialized('iPPrefixLen') && null !== $data->getIPPrefixLen()) { + $dataArray['IPPrefixLen'] = $data->getIPPrefixLen(); } - if (null !== $object->getIPPrefixLen()) { - $data->{'IPPrefixLen'} = $object->getIPPrefixLen(); + if ($data->isInitialized('iPv6Gateway') && null !== $data->getIPv6Gateway()) { + $dataArray['IPv6Gateway'] = $data->getIPv6Gateway(); } - if (null !== $object->getIPv6Gateway()) { - $data->{'IPv6Gateway'} = $object->getIPv6Gateway(); + if ($data->isInitialized('globalIPv6Address') && null !== $data->getGlobalIPv6Address()) { + $dataArray['GlobalIPv6Address'] = $data->getGlobalIPv6Address(); } - if (null !== $object->getGlobalIPv6Address()) { - $data->{'GlobalIPv6Address'} = $object->getGlobalIPv6Address(); + if ($data->isInitialized('globalIPv6PrefixLen') && null !== $data->getGlobalIPv6PrefixLen()) { + $dataArray['GlobalIPv6PrefixLen'] = $data->getGlobalIPv6PrefixLen(); } - if (null !== $object->getGlobalIPv6PrefixLen()) { - $data->{'GlobalIPv6PrefixLen'} = $object->getGlobalIPv6PrefixLen(); + if ($data->isInitialized('driverOpts') && null !== $data->getDriverOpts()) { + $values_2 = []; + foreach ($data->getDriverOpts() as $key => $value_2) { + $values_2[$key] = $value_2; + } + $dataArray['DriverOpts'] = $values_2; } - if (null !== $object->getMacAddress()) { - $data->{'MacAddress'} = $object->getMacAddress(); + if ($data->isInitialized('dNSNames') && null !== $data->getDNSNames()) { + $values_3 = []; + foreach ($data->getDNSNames() as $value_3) { + $values_3[] = $value_3; + } + $dataArray['DNSNames'] = $values_3; } - if (null !== $object->getDriverOpts()) { - $values_2 = new \stdClass(); - foreach ($object->getDriverOpts() as $key => $value_2) { - $values_2->{$key} = $value_2; + foreach ($data as $key_1 => $value_4) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_4; } - $data->{'DriverOpts'} = $values_2; } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EndpointSettings::class => false]; } } diff --git a/src/Normalizer/EndpointSpecNormalizer.php b/src/Normalizer/EndpointSpecNormalizer.php index 55138de3..24d7b355 100644 --- a/src/Normalizer/EndpointSpecNormalizer.php +++ b/src/Normalizer/EndpointSpecNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,53 +16,82 @@ class EndpointSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\EndpointSpec'; + return \Docker\API\Model\EndpointSpec::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\EndpointSpec; + return \is_object($data) && \Docker\API\Model\EndpointSpec::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\EndpointSpec(); - if (property_exists($data, 'Mode') && $data->{'Mode'} !== null) { - $object->setMode($data->{'Mode'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Mode', $data) && null !== $data['Mode']) { + $object->setMode($data['Mode']); + unset($data['Mode']); + } elseif (\array_key_exists('Mode', $data) && null === $data['Mode']) { + $object->setMode(null); } - if (property_exists($data, 'Ports') && $data->{'Ports'} !== null) { + if (\array_key_exists('Ports', $data) && null !== $data['Ports']) { $values = []; - foreach ($data->{'Ports'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\EndpointPortConfig', 'json', $context); + foreach ($data['Ports'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\EndpointPortConfig::class, 'json', $context); } $object->setPorts($values); + unset($data['Ports']); + } elseif (\array_key_exists('Ports', $data) && null === $data['Ports']) { + $object->setPorts(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getMode()) { - $data->{'Mode'} = $object->getMode(); + $dataArray = []; + if ($data->isInitialized('mode') && null !== $data->getMode()) { + $dataArray['Mode'] = $data->getMode(); } - if (null !== $object->getPorts()) { + if ($data->isInitialized('ports') && null !== $data->getPorts()) { $values = []; - foreach ($object->getPorts() as $value) { + foreach ($data->getPorts() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'Ports'} = $values; + $dataArray['Ports'] = $values; + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EndpointSpec::class => false]; } } diff --git a/src/Normalizer/EngineDescriptionNormalizer.php b/src/Normalizer/EngineDescriptionNormalizer.php index 181a6989..055e0758 100644 --- a/src/Normalizer/EngineDescriptionNormalizer.php +++ b/src/Normalizer/EngineDescriptionNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,67 +16,99 @@ class EngineDescriptionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\EngineDescription'; + return \Docker\API\Model\EngineDescription::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\EngineDescription; + return \is_object($data) && \Docker\API\Model\EngineDescription::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\EngineDescription(); - if (property_exists($data, 'EngineVersion') && $data->{'EngineVersion'} !== null) { - $object->setEngineVersion($data->{'EngineVersion'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('EngineVersion', $data) && null !== $data['EngineVersion']) { + $object->setEngineVersion($data['EngineVersion']); + unset($data['EngineVersion']); + } elseif (\array_key_exists('EngineVersion', $data) && null === $data['EngineVersion']) { + $object->setEngineVersion(null); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); } - if (property_exists($data, 'Plugins') && $data->{'Plugins'} !== null) { + if (\array_key_exists('Plugins', $data) && null !== $data['Plugins']) { $values_1 = []; - foreach ($data->{'Plugins'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\EngineDescriptionPluginsItem', 'json', $context); + foreach ($data['Plugins'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\EngineDescriptionPluginsItem::class, 'json', $context); } $object->setPlugins($values_1); + unset($data['Plugins']); + } elseif (\array_key_exists('Plugins', $data) && null === $data['Plugins']) { + $object->setPlugins(null); + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getEngineVersion()) { - $data->{'EngineVersion'} = $object->getEngineVersion(); + $dataArray = []; + if ($data->isInitialized('engineVersion') && null !== $data->getEngineVersion()) { + $dataArray['EngineVersion'] = $data->getEngineVersion(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values = []; + foreach ($data->getLabels() as $key => $value) { + $values[$key] = $value; } - $data->{'Labels'} = $values; + $dataArray['Labels'] = $values; } - if (null !== $object->getPlugins()) { + if ($data->isInitialized('plugins') && null !== $data->getPlugins()) { $values_1 = []; - foreach ($object->getPlugins() as $value_1) { + foreach ($data->getPlugins() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'Plugins'} = $values_1; + $dataArray['Plugins'] = $values_1; + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_2; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EngineDescription::class => false]; } } diff --git a/src/Normalizer/EngineDescriptionPluginsItemNormalizer.php b/src/Normalizer/EngineDescriptionPluginsItemNormalizer.php index 1972bec7..f528c961 100644 --- a/src/Normalizer/EngineDescriptionPluginsItemNormalizer.php +++ b/src/Normalizer/EngineDescriptionPluginsItemNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class EngineDescriptionPluginsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\EngineDescriptionPluginsItem'; + return \Docker\API\Model\EngineDescriptionPluginsItem::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\EngineDescriptionPluginsItem; + return \is_object($data) && \Docker\API\Model\EngineDescriptionPluginsItem::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\EngineDescriptionPluginsItem(); - if (property_exists($data, 'Type') && $data->{'Type'} !== null) { - $object->setType($data->{'Type'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && null !== $data['Type']) { + $object->setType($data['Type']); + unset($data['Type']); + } elseif (\array_key_exists('Type', $data) && null === $data['Type']) { + $object->setType(null); + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); } - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); + $dataArray = []; + if ($data->isInitialized('type') && null !== $data->getType()) { + $dataArray['Type'] = $data->getType(); } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EngineDescriptionPluginsItem::class => false]; } } diff --git a/src/Normalizer/ErrorDetailNormalizer.php b/src/Normalizer/ErrorDetailNormalizer.php index 9a9d855a..d23b05f0 100644 --- a/src/Normalizer/ErrorDetailNormalizer.php +++ b/src/Normalizer/ErrorDetailNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class ErrorDetailNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ErrorDetail'; + return \Docker\API\Model\ErrorDetail::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ErrorDetail; + return \is_object($data) && \Docker\API\Model\ErrorDetail::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ErrorDetail(); - if (property_exists($data, 'code') && $data->{'code'} !== null) { - $object->setCode($data->{'code'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('code', $data) && null !== $data['code']) { + $object->setCode($data['code']); + unset($data['code']); + } elseif (\array_key_exists('code', $data) && null === $data['code']) { + $object->setCode(null); + } + if (\array_key_exists('message', $data) && null !== $data['message']) { + $object->setMessage($data['message']); + unset($data['message']); + } elseif (\array_key_exists('message', $data) && null === $data['message']) { + $object->setMessage(null); } - if (property_exists($data, 'message') && $data->{'message'} !== null) { - $object->setMessage($data->{'message'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getCode()) { - $data->{'code'} = $object->getCode(); + $dataArray = []; + if ($data->isInitialized('code') && null !== $data->getCode()) { + $dataArray['code'] = $data->getCode(); } - if (null !== $object->getMessage()) { - $data->{'message'} = $object->getMessage(); + if ($data->isInitialized('message') && null !== $data->getMessage()) { + $dataArray['message'] = $data->getMessage(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ErrorDetail::class => false]; } } diff --git a/src/Normalizer/ErrorResponseNormalizer.php b/src/Normalizer/ErrorResponseNormalizer.php index 39e8e130..1c5b976a 100644 --- a/src/Normalizer/ErrorResponseNormalizer.php +++ b/src/Normalizer/ErrorResponseNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,39 +16,63 @@ class ErrorResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ErrorResponse'; + return \Docker\API\Model\ErrorResponse::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ErrorResponse; + return \is_object($data) && \Docker\API\Model\ErrorResponse::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ErrorResponse(); - if (property_exists($data, 'message') && $data->{'message'} !== null) { - $object->setMessage($data->{'message'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('message', $data) && null !== $data['message']) { + $object->setMessage($data['message']); + unset($data['message']); + } elseif (\array_key_exists('message', $data) && null === $data['message']) { + $object->setMessage(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getMessage()) { - $data->{'message'} = $object->getMessage(); + $dataArray = []; + $dataArray['message'] = $data->getMessage(); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ErrorResponse::class => false]; } } diff --git a/src/Normalizer/EventActorNormalizer.php b/src/Normalizer/EventActorNormalizer.php new file mode 100644 index 00000000..8a857a7c --- /dev/null +++ b/src/Normalizer/EventActorNormalizer.php @@ -0,0 +1,97 @@ +setID($data['ID']); + unset($data['ID']); + } elseif (\array_key_exists('ID', $data) && null === $data['ID']) { + $object->setID(null); + } + if (\array_key_exists('Attributes', $data) && null !== $data['Attributes']) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Attributes'] as $key => $value) { + $values[$key] = $value; + } + $object->setAttributes($values); + unset($data['Attributes']); + } elseif (\array_key_exists('Attributes', $data) && null === $data['Attributes']) { + $object->setAttributes(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('iD') && null !== $data->getID()) { + $dataArray['ID'] = $data->getID(); + } + if ($data->isInitialized('attributes') && null !== $data->getAttributes()) { + $values = []; + foreach ($data->getAttributes() as $key => $value) { + $values[$key] = $value; + } + $dataArray['Attributes'] = $values; + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EventActor::class => false]; + } +} diff --git a/src/Normalizer/EventMessageNormalizer.php b/src/Normalizer/EventMessageNormalizer.php new file mode 100644 index 00000000..10f33cfe --- /dev/null +++ b/src/Normalizer/EventMessageNormalizer.php @@ -0,0 +1,125 @@ +setType($data['Type']); + unset($data['Type']); + } elseif (\array_key_exists('Type', $data) && null === $data['Type']) { + $object->setType(null); + } + if (\array_key_exists('Action', $data) && null !== $data['Action']) { + $object->setAction($data['Action']); + unset($data['Action']); + } elseif (\array_key_exists('Action', $data) && null === $data['Action']) { + $object->setAction(null); + } + if (\array_key_exists('Actor', $data) && null !== $data['Actor']) { + $object->setActor($this->denormalizer->denormalize($data['Actor'], \Docker\API\Model\EventActor::class, 'json', $context)); + unset($data['Actor']); + } elseif (\array_key_exists('Actor', $data) && null === $data['Actor']) { + $object->setActor(null); + } + if (\array_key_exists('scope', $data) && null !== $data['scope']) { + $object->setScope($data['scope']); + unset($data['scope']); + } elseif (\array_key_exists('scope', $data) && null === $data['scope']) { + $object->setScope(null); + } + if (\array_key_exists('time', $data) && null !== $data['time']) { + $object->setTime($data['time']); + unset($data['time']); + } elseif (\array_key_exists('time', $data) && null === $data['time']) { + $object->setTime(null); + } + if (\array_key_exists('timeNano', $data) && null !== $data['timeNano']) { + $object->setTimeNano($data['timeNano']); + unset($data['timeNano']); + } elseif (\array_key_exists('timeNano', $data) && null === $data['timeNano']) { + $object->setTimeNano(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('type') && null !== $data->getType()) { + $dataArray['Type'] = $data->getType(); + } + if ($data->isInitialized('action') && null !== $data->getAction()) { + $dataArray['Action'] = $data->getAction(); + } + if ($data->isInitialized('actor') && null !== $data->getActor()) { + $dataArray['Actor'] = $this->normalizer->normalize($data->getActor(), 'json', $context); + } + if ($data->isInitialized('scope') && null !== $data->getScope()) { + $dataArray['scope'] = $data->getScope(); + } + if ($data->isInitialized('time') && null !== $data->getTime()) { + $dataArray['time'] = $data->getTime(); + } + if ($data->isInitialized('timeNano') && null !== $data->getTimeNano()) { + $dataArray['timeNano'] = $data->getTimeNano(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\EventMessage::class => false]; + } +} diff --git a/src/Normalizer/EventsGetResponse200ActorNormalizer.php b/src/Normalizer/EventsGetResponse200ActorNormalizer.php deleted file mode 100644 index 9ca4966f..00000000 --- a/src/Normalizer/EventsGetResponse200ActorNormalizer.php +++ /dev/null @@ -1,71 +0,0 @@ -{'ID'} !== null) { - $object->setID($data->{'ID'}); - } - if (property_exists($data, 'Attributes') && $data->{'Attributes'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Attributes'} as $key => $value) { - $values[$key] = $value; - } - $object->setAttributes($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); - } - if (null !== $object->getAttributes()) { - $values = new \stdClass(); - foreach ($object->getAttributes() as $key => $value) { - $values->{$key} = $value; - } - $data->{'Attributes'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/EventsGetResponse200Normalizer.php b/src/Normalizer/EventsGetResponse200Normalizer.php deleted file mode 100644 index 0e79adac..00000000 --- a/src/Normalizer/EventsGetResponse200Normalizer.php +++ /dev/null @@ -1,81 +0,0 @@ -{'Type'} !== null) { - $object->setType($data->{'Type'}); - } - if (property_exists($data, 'Action') && $data->{'Action'} !== null) { - $object->setAction($data->{'Action'}); - } - if (property_exists($data, 'Actor') && $data->{'Actor'} !== null) { - $object->setActor($this->denormalizer->denormalize($data->{'Actor'}, 'Docker\\API\\Model\\EventsGetResponse200Actor', 'json', $context)); - } - if (property_exists($data, 'time') && $data->{'time'} !== null) { - $object->setTime($data->{'time'}); - } - if (property_exists($data, 'timeNano') && $data->{'timeNano'} !== null) { - $object->setTimeNano($data->{'timeNano'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); - } - if (null !== $object->getAction()) { - $data->{'Action'} = $object->getAction(); - } - if (null !== $object->getActor()) { - $data->{'Actor'} = $this->normalizer->normalize($object->getActor(), 'json', $context); - } - if (null !== $object->getTime()) { - $data->{'time'} = $object->getTime(); - } - if (null !== $object->getTimeNano()) { - $data->{'timeNano'} = $object->getTimeNano(); - } - - return $data; - } -} diff --git a/src/Normalizer/ExecIdJsonGetResponse200Normalizer.php b/src/Normalizer/ExecIdJsonGetResponse200Normalizer.php index dc2b18db..37828cb0 100644 --- a/src/Normalizer/ExecIdJsonGetResponse200Normalizer.php +++ b/src/Normalizer/ExecIdJsonGetResponse200Normalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,99 +16,170 @@ class ExecIdJsonGetResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ExecIdJsonGetResponse200'; + return \Docker\API\Model\ExecIdJsonGetResponse200::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ExecIdJsonGetResponse200; + return \is_object($data) && \Docker\API\Model\ExecIdJsonGetResponse200::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\ExecIdJsonGetResponse200(); - if (property_exists($data, 'CanRemove') && $data->{'CanRemove'} !== null) { - $object->setCanRemove($data->{'CanRemove'}); - } - if (property_exists($data, 'DetachKeys') && $data->{'DetachKeys'} !== null) { - $object->setDetachKeys($data->{'DetachKeys'}); - } - if (property_exists($data, 'ID') && $data->{'ID'} !== null) { - $object->setID($data->{'ID'}); - } - if (property_exists($data, 'Running') && $data->{'Running'} !== null) { - $object->setRunning($data->{'Running'}); - } - if (property_exists($data, 'ExitCode') && $data->{'ExitCode'} !== null) { - $object->setExitCode($data->{'ExitCode'}); - } - if (property_exists($data, 'ProcessConfig') && $data->{'ProcessConfig'} !== null) { - $object->setProcessConfig($this->denormalizer->denormalize($data->{'ProcessConfig'}, 'Docker\\API\\Model\\ProcessConfig', 'json', $context)); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'OpenStdin') && $data->{'OpenStdin'} !== null) { - $object->setOpenStdin($data->{'OpenStdin'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'OpenStderr') && $data->{'OpenStderr'} !== null) { - $object->setOpenStderr($data->{'OpenStderr'}); - } - if (property_exists($data, 'OpenStdout') && $data->{'OpenStdout'} !== null) { - $object->setOpenStdout($data->{'OpenStdout'}); - } - if (property_exists($data, 'ContainerID') && $data->{'ContainerID'} !== null) { - $object->setContainerID($data->{'ContainerID'}); - } - if (property_exists($data, 'Pid') && $data->{'Pid'} !== null) { - $object->setPid($data->{'Pid'}); + $object = new \Docker\API\Model\ExecIdJsonGetResponse200(); + if (\array_key_exists('CanRemove', $data) && \is_int($data['CanRemove'])) { + $data['CanRemove'] = (bool) $data['CanRemove']; + } + if (\array_key_exists('Running', $data) && \is_int($data['Running'])) { + $data['Running'] = (bool) $data['Running']; + } + if (\array_key_exists('OpenStdin', $data) && \is_int($data['OpenStdin'])) { + $data['OpenStdin'] = (bool) $data['OpenStdin']; + } + if (\array_key_exists('OpenStderr', $data) && \is_int($data['OpenStderr'])) { + $data['OpenStderr'] = (bool) $data['OpenStderr']; + } + if (\array_key_exists('OpenStdout', $data) && \is_int($data['OpenStdout'])) { + $data['OpenStdout'] = (bool) $data['OpenStdout']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CanRemove', $data) && null !== $data['CanRemove']) { + $object->setCanRemove($data['CanRemove']); + unset($data['CanRemove']); + } elseif (\array_key_exists('CanRemove', $data) && null === $data['CanRemove']) { + $object->setCanRemove(null); + } + if (\array_key_exists('DetachKeys', $data) && null !== $data['DetachKeys']) { + $object->setDetachKeys($data['DetachKeys']); + unset($data['DetachKeys']); + } elseif (\array_key_exists('DetachKeys', $data) && null === $data['DetachKeys']) { + $object->setDetachKeys(null); + } + if (\array_key_exists('ID', $data) && null !== $data['ID']) { + $object->setID($data['ID']); + unset($data['ID']); + } elseif (\array_key_exists('ID', $data) && null === $data['ID']) { + $object->setID(null); + } + if (\array_key_exists('Running', $data) && null !== $data['Running']) { + $object->setRunning($data['Running']); + unset($data['Running']); + } elseif (\array_key_exists('Running', $data) && null === $data['Running']) { + $object->setRunning(null); + } + if (\array_key_exists('ExitCode', $data) && null !== $data['ExitCode']) { + $object->setExitCode($data['ExitCode']); + unset($data['ExitCode']); + } elseif (\array_key_exists('ExitCode', $data) && null === $data['ExitCode']) { + $object->setExitCode(null); + } + if (\array_key_exists('ProcessConfig', $data) && null !== $data['ProcessConfig']) { + $object->setProcessConfig($this->denormalizer->denormalize($data['ProcessConfig'], \Docker\API\Model\ProcessConfig::class, 'json', $context)); + unset($data['ProcessConfig']); + } elseif (\array_key_exists('ProcessConfig', $data) && null === $data['ProcessConfig']) { + $object->setProcessConfig(null); + } + if (\array_key_exists('OpenStdin', $data) && null !== $data['OpenStdin']) { + $object->setOpenStdin($data['OpenStdin']); + unset($data['OpenStdin']); + } elseif (\array_key_exists('OpenStdin', $data) && null === $data['OpenStdin']) { + $object->setOpenStdin(null); + } + if (\array_key_exists('OpenStderr', $data) && null !== $data['OpenStderr']) { + $object->setOpenStderr($data['OpenStderr']); + unset($data['OpenStderr']); + } elseif (\array_key_exists('OpenStderr', $data) && null === $data['OpenStderr']) { + $object->setOpenStderr(null); + } + if (\array_key_exists('OpenStdout', $data) && null !== $data['OpenStdout']) { + $object->setOpenStdout($data['OpenStdout']); + unset($data['OpenStdout']); + } elseif (\array_key_exists('OpenStdout', $data) && null === $data['OpenStdout']) { + $object->setOpenStdout(null); + } + if (\array_key_exists('ContainerID', $data) && null !== $data['ContainerID']) { + $object->setContainerID($data['ContainerID']); + unset($data['ContainerID']); + } elseif (\array_key_exists('ContainerID', $data) && null === $data['ContainerID']) { + $object->setContainerID(null); + } + if (\array_key_exists('Pid', $data) && null !== $data['Pid']) { + $object->setPid($data['Pid']); + unset($data['Pid']); + } elseif (\array_key_exists('Pid', $data) && null === $data['Pid']) { + $object->setPid(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getCanRemove()) { - $data->{'CanRemove'} = $object->getCanRemove(); + $dataArray = []; + if ($data->isInitialized('canRemove') && null !== $data->getCanRemove()) { + $dataArray['CanRemove'] = $data->getCanRemove(); } - if (null !== $object->getDetachKeys()) { - $data->{'DetachKeys'} = $object->getDetachKeys(); + if ($data->isInitialized('detachKeys') && null !== $data->getDetachKeys()) { + $dataArray['DetachKeys'] = $data->getDetachKeys(); } - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + if ($data->isInitialized('iD') && null !== $data->getID()) { + $dataArray['ID'] = $data->getID(); } - if (null !== $object->getRunning()) { - $data->{'Running'} = $object->getRunning(); + if ($data->isInitialized('running') && null !== $data->getRunning()) { + $dataArray['Running'] = $data->getRunning(); } - if (null !== $object->getExitCode()) { - $data->{'ExitCode'} = $object->getExitCode(); + if ($data->isInitialized('exitCode') && null !== $data->getExitCode()) { + $dataArray['ExitCode'] = $data->getExitCode(); } - if (null !== $object->getProcessConfig()) { - $data->{'ProcessConfig'} = $this->normalizer->normalize($object->getProcessConfig(), 'json', $context); + if ($data->isInitialized('processConfig') && null !== $data->getProcessConfig()) { + $dataArray['ProcessConfig'] = $this->normalizer->normalize($data->getProcessConfig(), 'json', $context); } - if (null !== $object->getOpenStdin()) { - $data->{'OpenStdin'} = $object->getOpenStdin(); + if ($data->isInitialized('openStdin') && null !== $data->getOpenStdin()) { + $dataArray['OpenStdin'] = $data->getOpenStdin(); } - if (null !== $object->getOpenStderr()) { - $data->{'OpenStderr'} = $object->getOpenStderr(); + if ($data->isInitialized('openStderr') && null !== $data->getOpenStderr()) { + $dataArray['OpenStderr'] = $data->getOpenStderr(); } - if (null !== $object->getOpenStdout()) { - $data->{'OpenStdout'} = $object->getOpenStdout(); + if ($data->isInitialized('openStdout') && null !== $data->getOpenStdout()) { + $dataArray['OpenStdout'] = $data->getOpenStdout(); } - if (null !== $object->getContainerID()) { - $data->{'ContainerID'} = $object->getContainerID(); + if ($data->isInitialized('containerID') && null !== $data->getContainerID()) { + $dataArray['ContainerID'] = $data->getContainerID(); } - if (null !== $object->getPid()) { - $data->{'Pid'} = $object->getPid(); + if ($data->isInitialized('pid') && null !== $data->getPid()) { + $dataArray['Pid'] = $data->getPid(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ExecIdJsonGetResponse200::class => false]; } } diff --git a/src/Normalizer/ExecIdStartPostBodyNormalizer.php b/src/Normalizer/ExecIdStartPostBodyNormalizer.php index 7f5de7c4..3237e1b0 100644 --- a/src/Normalizer/ExecIdStartPostBodyNormalizer.php +++ b/src/Normalizer/ExecIdStartPostBodyNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,97 @@ class ExecIdStartPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ExecIdStartPostBody'; + return \Docker\API\Model\ExecIdStartPostBody::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ExecIdStartPostBody; + return \is_object($data) && \Docker\API\Model\ExecIdStartPostBody::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ExecIdStartPostBody(); - if (property_exists($data, 'Detach') && $data->{'Detach'} !== null) { - $object->setDetach($data->{'Detach'}); + if (\array_key_exists('Detach', $data) && \is_int($data['Detach'])) { + $data['Detach'] = (bool) $data['Detach']; + } + if (\array_key_exists('Tty', $data) && \is_int($data['Tty'])) { + $data['Tty'] = (bool) $data['Tty']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Detach', $data) && null !== $data['Detach']) { + $object->setDetach($data['Detach']); + unset($data['Detach']); + } elseif (\array_key_exists('Detach', $data) && null === $data['Detach']) { + $object->setDetach(null); + } + if (\array_key_exists('Tty', $data) && null !== $data['Tty']) { + $object->setTty($data['Tty']); + unset($data['Tty']); + } elseif (\array_key_exists('Tty', $data) && null === $data['Tty']) { + $object->setTty(null); } - if (property_exists($data, 'Tty') && $data->{'Tty'} !== null) { - $object->setTty($data->{'Tty'}); + if (\array_key_exists('ConsoleSize', $data) && null !== $data['ConsoleSize']) { + $values = []; + foreach ($data['ConsoleSize'] as $value) { + $values[] = $value; + } + $object->setConsoleSize($values); + unset($data['ConsoleSize']); + } elseif (\array_key_exists('ConsoleSize', $data) && null === $data['ConsoleSize']) { + $object->setConsoleSize(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getDetach()) { - $data->{'Detach'} = $object->getDetach(); + $dataArray = []; + if ($data->isInitialized('detach') && null !== $data->getDetach()) { + $dataArray['Detach'] = $data->getDetach(); + } + if ($data->isInitialized('tty') && null !== $data->getTty()) { + $dataArray['Tty'] = $data->getTty(); + } + if ($data->isInitialized('consoleSize') && null !== $data->getConsoleSize()) { + $values = []; + foreach ($data->getConsoleSize() as $value) { + $values[] = $value; + } + $dataArray['ConsoleSize'] = $values; } - if (null !== $object->getTty()) { - $data->{'Tty'} = $object->getTty(); + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ExecIdStartPostBody::class => false]; } } diff --git a/src/Normalizer/FilesystemChangeNormalizer.php b/src/Normalizer/FilesystemChangeNormalizer.php new file mode 100644 index 00000000..376b2b39 --- /dev/null +++ b/src/Normalizer/FilesystemChangeNormalizer.php @@ -0,0 +1,85 @@ +setPath($data['Path']); + unset($data['Path']); + } elseif (\array_key_exists('Path', $data) && null === $data['Path']) { + $object->setPath(null); + } + if (\array_key_exists('Kind', $data) && null !== $data['Kind']) { + $object->setKind($data['Kind']); + unset($data['Kind']); + } elseif (\array_key_exists('Kind', $data) && null === $data['Kind']) { + $object->setKind(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + $dataArray['Path'] = $data->getPath(); + $dataArray['Kind'] = $data->getKind(); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\FilesystemChange::class => false]; + } +} diff --git a/src/Normalizer/GenericResourcesItemDiscreteResourceSpecNormalizer.php b/src/Normalizer/GenericResourcesItemDiscreteResourceSpecNormalizer.php index 7047a956..bcbc9a5f 100644 --- a/src/Normalizer/GenericResourcesItemDiscreteResourceSpecNormalizer.php +++ b/src/Normalizer/GenericResourcesItemDiscreteResourceSpecNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class GenericResourcesItemDiscreteResourceSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\GenericResourcesItemDiscreteResourceSpec'; + return \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec; + return \is_object($data) && \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec(); - if (property_exists($data, 'Kind') && $data->{'Kind'} !== null) { - $object->setKind($data->{'Kind'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Kind', $data) && null !== $data['Kind']) { + $object->setKind($data['Kind']); + unset($data['Kind']); + } elseif (\array_key_exists('Kind', $data) && null === $data['Kind']) { + $object->setKind(null); + } + if (\array_key_exists('Value', $data) && null !== $data['Value']) { + $object->setValue($data['Value']); + unset($data['Value']); + } elseif (\array_key_exists('Value', $data) && null === $data['Value']) { + $object->setValue(null); } - if (property_exists($data, 'Value') && $data->{'Value'} !== null) { - $object->setValue($data->{'Value'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getKind()) { - $data->{'Kind'} = $object->getKind(); + $dataArray = []; + if ($data->isInitialized('kind') && null !== $data->getKind()) { + $dataArray['Kind'] = $data->getKind(); } - if (null !== $object->getValue()) { - $data->{'Value'} = $object->getValue(); + if ($data->isInitialized('value') && null !== $data->getValue()) { + $dataArray['Value'] = $data->getValue(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class => false]; } } diff --git a/src/Normalizer/GenericResourcesItemNamedResourceSpecNormalizer.php b/src/Normalizer/GenericResourcesItemNamedResourceSpecNormalizer.php index 51978ce3..e3282848 100644 --- a/src/Normalizer/GenericResourcesItemNamedResourceSpecNormalizer.php +++ b/src/Normalizer/GenericResourcesItemNamedResourceSpecNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class GenericResourcesItemNamedResourceSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\GenericResourcesItemNamedResourceSpec'; + return \Docker\API\Model\GenericResourcesItemNamedResourceSpec::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\GenericResourcesItemNamedResourceSpec; + return \is_object($data) && \Docker\API\Model\GenericResourcesItemNamedResourceSpec::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\GenericResourcesItemNamedResourceSpec(); - if (property_exists($data, 'Kind') && $data->{'Kind'} !== null) { - $object->setKind($data->{'Kind'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Kind', $data) && null !== $data['Kind']) { + $object->setKind($data['Kind']); + unset($data['Kind']); + } elseif (\array_key_exists('Kind', $data) && null === $data['Kind']) { + $object->setKind(null); + } + if (\array_key_exists('Value', $data) && null !== $data['Value']) { + $object->setValue($data['Value']); + unset($data['Value']); + } elseif (\array_key_exists('Value', $data) && null === $data['Value']) { + $object->setValue(null); } - if (property_exists($data, 'Value') && $data->{'Value'} !== null) { - $object->setValue($data->{'Value'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getKind()) { - $data->{'Kind'} = $object->getKind(); + $dataArray = []; + if ($data->isInitialized('kind') && null !== $data->getKind()) { + $dataArray['Kind'] = $data->getKind(); } - if (null !== $object->getValue()) { - $data->{'Value'} = $object->getValue(); + if ($data->isInitialized('value') && null !== $data->getValue()) { + $dataArray['Value'] = $data->getValue(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\GenericResourcesItemNamedResourceSpec::class => false]; } } diff --git a/src/Normalizer/GenericResourcesItemNormalizer.php b/src/Normalizer/GenericResourcesItemNormalizer.php index 32ef2fc8..c92fe7b8 100644 --- a/src/Normalizer/GenericResourcesItemNormalizer.php +++ b/src/Normalizer/GenericResourcesItemNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class GenericResourcesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\GenericResourcesItem'; + return \Docker\API\Model\GenericResourcesItem::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\GenericResourcesItem; + return \is_object($data) && \Docker\API\Model\GenericResourcesItem::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\GenericResourcesItem(); - if (property_exists($data, 'NamedResourceSpec') && $data->{'NamedResourceSpec'} !== null) { - $object->setNamedResourceSpec($this->denormalizer->denormalize($data->{'NamedResourceSpec'}, 'Docker\\API\\Model\\GenericResourcesItemNamedResourceSpec', 'json', $context)); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NamedResourceSpec', $data) && null !== $data['NamedResourceSpec']) { + $object->setNamedResourceSpec($this->denormalizer->denormalize($data['NamedResourceSpec'], \Docker\API\Model\GenericResourcesItemNamedResourceSpec::class, 'json', $context)); + unset($data['NamedResourceSpec']); + } elseif (\array_key_exists('NamedResourceSpec', $data) && null === $data['NamedResourceSpec']) { + $object->setNamedResourceSpec(null); + } + if (\array_key_exists('DiscreteResourceSpec', $data) && null !== $data['DiscreteResourceSpec']) { + $object->setDiscreteResourceSpec($this->denormalizer->denormalize($data['DiscreteResourceSpec'], \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class, 'json', $context)); + unset($data['DiscreteResourceSpec']); + } elseif (\array_key_exists('DiscreteResourceSpec', $data) && null === $data['DiscreteResourceSpec']) { + $object->setDiscreteResourceSpec(null); } - if (property_exists($data, 'DiscreteResourceSpec') && $data->{'DiscreteResourceSpec'} !== null) { - $object->setDiscreteResourceSpec($this->denormalizer->denormalize($data->{'DiscreteResourceSpec'}, 'Docker\\API\\Model\\GenericResourcesItemDiscreteResourceSpec', 'json', $context)); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getNamedResourceSpec()) { - $data->{'NamedResourceSpec'} = $this->normalizer->normalize($object->getNamedResourceSpec(), 'json', $context); + $dataArray = []; + if ($data->isInitialized('namedResourceSpec') && null !== $data->getNamedResourceSpec()) { + $dataArray['NamedResourceSpec'] = $this->normalizer->normalize($data->getNamedResourceSpec(), 'json', $context); } - if (null !== $object->getDiscreteResourceSpec()) { - $data->{'DiscreteResourceSpec'} = $this->normalizer->normalize($object->getDiscreteResourceSpec(), 'json', $context); + if ($data->isInitialized('discreteResourceSpec') && null !== $data->getDiscreteResourceSpec()) { + $dataArray['DiscreteResourceSpec'] = $this->normalizer->normalize($data->getDiscreteResourceSpec(), 'json', $context); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\GenericResourcesItem::class => false]; } } diff --git a/src/Normalizer/GraphDriverDataNormalizer.php b/src/Normalizer/GraphDriverDataNormalizer.php index dd2df29f..5dd94703 100644 --- a/src/Normalizer/GraphDriverDataNormalizer.php +++ b/src/Normalizer/GraphDriverDataNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,53 +16,78 @@ class GraphDriverDataNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\GraphDriverData'; + return \Docker\API\Model\GraphDriverData::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\GraphDriverData; + return \is_object($data) && \Docker\API\Model\GraphDriverData::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\GraphDriverData(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Data') && $data->{'Data'} !== null) { + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Data', $data) && null !== $data['Data']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Data'} as $key => $value) { + foreach ($data['Data'] as $key => $value) { $values[$key] = $value; } $object->setData($values); + unset($data['Data']); + } elseif (\array_key_exists('Data', $data) && null === $data['Data']) { + $object->setData(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + $dataArray['Name'] = $data->getName(); + $values = []; + foreach ($data->getData() as $key => $value) { + $values[$key] = $value; } - if (null !== $object->getData()) { - $values = new \stdClass(); - foreach ($object->getData() as $key => $value) { - $values->{$key} = $value; + $dataArray['Data'] = $values; + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; } - $data->{'Data'} = $values; } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\GraphDriverData::class => false]; } } diff --git a/src/Normalizer/HealthConfigNormalizer.php b/src/Normalizer/HealthConfigNormalizer.php index 14b6b9c9..6aedbc76 100644 --- a/src/Normalizer/HealthConfigNormalizer.php +++ b/src/Normalizer/HealthConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,71 +16,118 @@ class HealthConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\HealthConfig'; + return \Docker\API\Model\HealthConfig::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\HealthConfig; + return \is_object($data) && \Docker\API\Model\HealthConfig::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\HealthConfig(); - if (property_exists($data, 'Test') && $data->{'Test'} !== null) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Test', $data) && null !== $data['Test']) { $values = []; - foreach ($data->{'Test'} as $value) { + foreach ($data['Test'] as $value) { $values[] = $value; } $object->setTest($values); + unset($data['Test']); + } elseif (\array_key_exists('Test', $data) && null === $data['Test']) { + $object->setTest(null); } - if (property_exists($data, 'Interval') && $data->{'Interval'} !== null) { - $object->setInterval($data->{'Interval'}); + if (\array_key_exists('Interval', $data) && null !== $data['Interval']) { + $object->setInterval($data['Interval']); + unset($data['Interval']); + } elseif (\array_key_exists('Interval', $data) && null === $data['Interval']) { + $object->setInterval(null); } - if (property_exists($data, 'Timeout') && $data->{'Timeout'} !== null) { - $object->setTimeout($data->{'Timeout'}); + if (\array_key_exists('Timeout', $data) && null !== $data['Timeout']) { + $object->setTimeout($data['Timeout']); + unset($data['Timeout']); + } elseif (\array_key_exists('Timeout', $data) && null === $data['Timeout']) { + $object->setTimeout(null); } - if (property_exists($data, 'Retries') && $data->{'Retries'} !== null) { - $object->setRetries($data->{'Retries'}); + if (\array_key_exists('Retries', $data) && null !== $data['Retries']) { + $object->setRetries($data['Retries']); + unset($data['Retries']); + } elseif (\array_key_exists('Retries', $data) && null === $data['Retries']) { + $object->setRetries(null); } - if (property_exists($data, 'StartPeriod') && $data->{'StartPeriod'} !== null) { - $object->setStartPeriod($data->{'StartPeriod'}); + if (\array_key_exists('StartPeriod', $data) && null !== $data['StartPeriod']) { + $object->setStartPeriod($data['StartPeriod']); + unset($data['StartPeriod']); + } elseif (\array_key_exists('StartPeriod', $data) && null === $data['StartPeriod']) { + $object->setStartPeriod(null); + } + if (\array_key_exists('StartInterval', $data) && null !== $data['StartInterval']) { + $object->setStartInterval($data['StartInterval']); + unset($data['StartInterval']); + } elseif (\array_key_exists('StartInterval', $data) && null === $data['StartInterval']) { + $object->setStartInterval(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getTest()) { + $dataArray = []; + if ($data->isInitialized('test') && null !== $data->getTest()) { $values = []; - foreach ($object->getTest() as $value) { + foreach ($data->getTest() as $value) { $values[] = $value; } - $data->{'Test'} = $values; + $dataArray['Test'] = $values; } - if (null !== $object->getInterval()) { - $data->{'Interval'} = $object->getInterval(); + if ($data->isInitialized('interval') && null !== $data->getInterval()) { + $dataArray['Interval'] = $data->getInterval(); } - if (null !== $object->getTimeout()) { - $data->{'Timeout'} = $object->getTimeout(); + if ($data->isInitialized('timeout') && null !== $data->getTimeout()) { + $dataArray['Timeout'] = $data->getTimeout(); } - if (null !== $object->getRetries()) { - $data->{'Retries'} = $object->getRetries(); + if ($data->isInitialized('retries') && null !== $data->getRetries()) { + $dataArray['Retries'] = $data->getRetries(); } - if (null !== $object->getStartPeriod()) { - $data->{'StartPeriod'} = $object->getStartPeriod(); + if ($data->isInitialized('startPeriod') && null !== $data->getStartPeriod()) { + $dataArray['StartPeriod'] = $data->getStartPeriod(); + } + if ($data->isInitialized('startInterval') && null !== $data->getStartInterval()) { + $dataArray['StartInterval'] = $data->getStartInterval(); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\HealthConfig::class => false]; } } diff --git a/src/Normalizer/HealthNormalizer.php b/src/Normalizer/HealthNormalizer.php new file mode 100644 index 00000000..e9d7fa06 --- /dev/null +++ b/src/Normalizer/HealthNormalizer.php @@ -0,0 +1,106 @@ +setStatus($data['Status']); + unset($data['Status']); + } elseif (\array_key_exists('Status', $data) && null === $data['Status']) { + $object->setStatus(null); + } + if (\array_key_exists('FailingStreak', $data) && null !== $data['FailingStreak']) { + $object->setFailingStreak($data['FailingStreak']); + unset($data['FailingStreak']); + } elseif (\array_key_exists('FailingStreak', $data) && null === $data['FailingStreak']) { + $object->setFailingStreak(null); + } + if (\array_key_exists('Log', $data) && null !== $data['Log']) { + $values = []; + foreach ($data['Log'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\HealthcheckResult::class, 'json', $context); + } + $object->setLog($values); + unset($data['Log']); + } elseif (\array_key_exists('Log', $data) && null === $data['Log']) { + $object->setLog(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('status') && null !== $data->getStatus()) { + $dataArray['Status'] = $data->getStatus(); + } + if ($data->isInitialized('failingStreak') && null !== $data->getFailingStreak()) { + $dataArray['FailingStreak'] = $data->getFailingStreak(); + } + if ($data->isInitialized('log') && null !== $data->getLog()) { + $values = []; + foreach ($data->getLog() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $dataArray['Log'] = $values; + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Health::class => false]; + } +} diff --git a/src/Normalizer/HealthcheckResultNormalizer.php b/src/Normalizer/HealthcheckResultNormalizer.php new file mode 100644 index 00000000..b3962a2b --- /dev/null +++ b/src/Normalizer/HealthcheckResultNormalizer.php @@ -0,0 +1,107 @@ +setStart(\DateTime::createFromFormat('Y-m-d\TH:i:s.uuP', $data['Start'])); + unset($data['Start']); + } elseif (\array_key_exists('Start', $data) && null === $data['Start']) { + $object->setStart(null); + } + if (\array_key_exists('End', $data) && null !== $data['End']) { + $object->setEnd($data['End']); + unset($data['End']); + } elseif (\array_key_exists('End', $data) && null === $data['End']) { + $object->setEnd(null); + } + if (\array_key_exists('ExitCode', $data) && null !== $data['ExitCode']) { + $object->setExitCode($data['ExitCode']); + unset($data['ExitCode']); + } elseif (\array_key_exists('ExitCode', $data) && null === $data['ExitCode']) { + $object->setExitCode(null); + } + if (\array_key_exists('Output', $data) && null !== $data['Output']) { + $object->setOutput($data['Output']); + unset($data['Output']); + } elseif (\array_key_exists('Output', $data) && null === $data['Output']) { + $object->setOutput(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('start') && null !== $data->getStart()) { + $dataArray['Start'] = $data->getStart()?->format('Y-m-d\TH:i:sP'); + } + if ($data->isInitialized('end') && null !== $data->getEnd()) { + $dataArray['End'] = $data->getEnd(); + } + if ($data->isInitialized('exitCode') && null !== $data->getExitCode()) { + $dataArray['ExitCode'] = $data->getExitCode(); + } + if ($data->isInitialized('output') && null !== $data->getOutput()) { + $dataArray['Output'] = $data->getOutput(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\HealthcheckResult::class => false]; + } +} diff --git a/src/Normalizer/HostConfigLogConfigNormalizer.php b/src/Normalizer/HostConfigLogConfigNormalizer.php index d9ebf12e..a0732e94 100644 --- a/src/Normalizer/HostConfigLogConfigNormalizer.php +++ b/src/Normalizer/HostConfigLogConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,53 +16,82 @@ class HostConfigLogConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\HostConfigLogConfig'; + return \Docker\API\Model\HostConfigLogConfig::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\HostConfigLogConfig; + return \is_object($data) && \Docker\API\Model\HostConfigLogConfig::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\HostConfigLogConfig(); - if (property_exists($data, 'Type') && $data->{'Type'} !== null) { - $object->setType($data->{'Type'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && null !== $data['Type']) { + $object->setType($data['Type']); + unset($data['Type']); + } elseif (\array_key_exists('Type', $data) && null === $data['Type']) { + $object->setType(null); } - if (property_exists($data, 'Config') && $data->{'Config'} !== null) { + if (\array_key_exists('Config', $data) && null !== $data['Config']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Config'} as $key => $value) { + foreach ($data['Config'] as $key => $value) { $values[$key] = $value; } $object->setConfig($values); + unset($data['Config']); + } elseif (\array_key_exists('Config', $data) && null === $data['Config']) { + $object->setConfig(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); + $dataArray = []; + if ($data->isInitialized('type') && null !== $data->getType()) { + $dataArray['Type'] = $data->getType(); } - if (null !== $object->getConfig()) { - $values = new \stdClass(); - foreach ($object->getConfig() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('config') && null !== $data->getConfig()) { + $values = []; + foreach ($data->getConfig() as $key => $value) { + $values[$key] = $value; + } + $dataArray['Config'] = $values; + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; } - $data->{'Config'} = $values; } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\HostConfigLogConfig::class => false]; } } diff --git a/src/Normalizer/HostConfigNormalizer.php b/src/Normalizer/HostConfigNormalizer.php index 52bdece6..cbaaeaf8 100644 --- a/src/Normalizer/HostConfigNormalizer.php +++ b/src/Normalizer/HostConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,631 +16,944 @@ class HostConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\HostConfig'; + return \Docker\API\Model\HostConfig::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\HostConfig; + return \is_object($data) && \Docker\API\Model\HostConfig::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\HostConfig(); - if (property_exists($data, 'CpuShares') && $data->{'CpuShares'} !== null) { - $object->setCpuShares($data->{'CpuShares'}); + if (\array_key_exists('OomKillDisable', $data) && \is_int($data['OomKillDisable'])) { + $data['OomKillDisable'] = (bool) $data['OomKillDisable']; + } + if (\array_key_exists('Init', $data) && \is_int($data['Init'])) { + $data['Init'] = (bool) $data['Init']; + } + if (\array_key_exists('AutoRemove', $data) && \is_int($data['AutoRemove'])) { + $data['AutoRemove'] = (bool) $data['AutoRemove']; + } + if (\array_key_exists('Privileged', $data) && \is_int($data['Privileged'])) { + $data['Privileged'] = (bool) $data['Privileged']; + } + if (\array_key_exists('PublishAllPorts', $data) && \is_int($data['PublishAllPorts'])) { + $data['PublishAllPorts'] = (bool) $data['PublishAllPorts']; + } + if (\array_key_exists('ReadonlyRootfs', $data) && \is_int($data['ReadonlyRootfs'])) { + $data['ReadonlyRootfs'] = (bool) $data['ReadonlyRootfs']; } - if (property_exists($data, 'Memory') && $data->{'Memory'} !== null) { - $object->setMemory($data->{'Memory'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'CgroupParent') && $data->{'CgroupParent'} !== null) { - $object->setCgroupParent($data->{'CgroupParent'}); + if (\array_key_exists('CpuShares', $data) && null !== $data['CpuShares']) { + $object->setCpuShares($data['CpuShares']); + unset($data['CpuShares']); + } elseif (\array_key_exists('CpuShares', $data) && null === $data['CpuShares']) { + $object->setCpuShares(null); } - if (property_exists($data, 'BlkioWeight') && $data->{'BlkioWeight'} !== null) { - $object->setBlkioWeight($data->{'BlkioWeight'}); + if (\array_key_exists('Memory', $data) && null !== $data['Memory']) { + $object->setMemory($data['Memory']); + unset($data['Memory']); + } elseif (\array_key_exists('Memory', $data) && null === $data['Memory']) { + $object->setMemory(null); } - if (property_exists($data, 'BlkioWeightDevice') && $data->{'BlkioWeightDevice'} !== null) { + if (\array_key_exists('CgroupParent', $data) && null !== $data['CgroupParent']) { + $object->setCgroupParent($data['CgroupParent']); + unset($data['CgroupParent']); + } elseif (\array_key_exists('CgroupParent', $data) && null === $data['CgroupParent']) { + $object->setCgroupParent(null); + } + if (\array_key_exists('BlkioWeight', $data) && null !== $data['BlkioWeight']) { + $object->setBlkioWeight($data['BlkioWeight']); + unset($data['BlkioWeight']); + } elseif (\array_key_exists('BlkioWeight', $data) && null === $data['BlkioWeight']) { + $object->setBlkioWeight(null); + } + if (\array_key_exists('BlkioWeightDevice', $data) && null !== $data['BlkioWeightDevice']) { $values = []; - foreach ($data->{'BlkioWeightDevice'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\ResourcesBlkioWeightDeviceItem', 'json', $context); + foreach ($data['BlkioWeightDevice'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class, 'json', $context); } $object->setBlkioWeightDevice($values); + unset($data['BlkioWeightDevice']); + } elseif (\array_key_exists('BlkioWeightDevice', $data) && null === $data['BlkioWeightDevice']) { + $object->setBlkioWeightDevice(null); } - if (property_exists($data, 'BlkioDeviceReadBps') && $data->{'BlkioDeviceReadBps'} !== null) { + if (\array_key_exists('BlkioDeviceReadBps', $data) && null !== $data['BlkioDeviceReadBps']) { $values_1 = []; - foreach ($data->{'BlkioDeviceReadBps'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); + foreach ($data['BlkioDeviceReadBps'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\ThrottleDevice::class, 'json', $context); } $object->setBlkioDeviceReadBps($values_1); + unset($data['BlkioDeviceReadBps']); + } elseif (\array_key_exists('BlkioDeviceReadBps', $data) && null === $data['BlkioDeviceReadBps']) { + $object->setBlkioDeviceReadBps(null); } - if (property_exists($data, 'BlkioDeviceWriteBps') && $data->{'BlkioDeviceWriteBps'} !== null) { + if (\array_key_exists('BlkioDeviceWriteBps', $data) && null !== $data['BlkioDeviceWriteBps']) { $values_2 = []; - foreach ($data->{'BlkioDeviceWriteBps'} as $value_2) { - $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); + foreach ($data['BlkioDeviceWriteBps'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\ThrottleDevice::class, 'json', $context); } $object->setBlkioDeviceWriteBps($values_2); + unset($data['BlkioDeviceWriteBps']); + } elseif (\array_key_exists('BlkioDeviceWriteBps', $data) && null === $data['BlkioDeviceWriteBps']) { + $object->setBlkioDeviceWriteBps(null); } - if (property_exists($data, 'BlkioDeviceReadIOps') && $data->{'BlkioDeviceReadIOps'} !== null) { + if (\array_key_exists('BlkioDeviceReadIOps', $data) && null !== $data['BlkioDeviceReadIOps']) { $values_3 = []; - foreach ($data->{'BlkioDeviceReadIOps'} as $value_3) { - $values_3[] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); + foreach ($data['BlkioDeviceReadIOps'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\ThrottleDevice::class, 'json', $context); } $object->setBlkioDeviceReadIOps($values_3); + unset($data['BlkioDeviceReadIOps']); + } elseif (\array_key_exists('BlkioDeviceReadIOps', $data) && null === $data['BlkioDeviceReadIOps']) { + $object->setBlkioDeviceReadIOps(null); } - if (property_exists($data, 'BlkioDeviceWriteIOps') && $data->{'BlkioDeviceWriteIOps'} !== null) { + if (\array_key_exists('BlkioDeviceWriteIOps', $data) && null !== $data['BlkioDeviceWriteIOps']) { $values_4 = []; - foreach ($data->{'BlkioDeviceWriteIOps'} as $value_4) { - $values_4[] = $this->denormalizer->denormalize($value_4, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); + foreach ($data['BlkioDeviceWriteIOps'] as $value_4) { + $values_4[] = $this->denormalizer->denormalize($value_4, \Docker\API\Model\ThrottleDevice::class, 'json', $context); } $object->setBlkioDeviceWriteIOps($values_4); - } - if (property_exists($data, 'CpuPeriod') && $data->{'CpuPeriod'} !== null) { - $object->setCpuPeriod($data->{'CpuPeriod'}); - } - if (property_exists($data, 'CpuQuota') && $data->{'CpuQuota'} !== null) { - $object->setCpuQuota($data->{'CpuQuota'}); - } - if (property_exists($data, 'CpuRealtimePeriod') && $data->{'CpuRealtimePeriod'} !== null) { - $object->setCpuRealtimePeriod($data->{'CpuRealtimePeriod'}); - } - if (property_exists($data, 'CpuRealtimeRuntime') && $data->{'CpuRealtimeRuntime'} !== null) { - $object->setCpuRealtimeRuntime($data->{'CpuRealtimeRuntime'}); - } - if (property_exists($data, 'CpusetCpus') && $data->{'CpusetCpus'} !== null) { - $object->setCpusetCpus($data->{'CpusetCpus'}); - } - if (property_exists($data, 'CpusetMems') && $data->{'CpusetMems'} !== null) { - $object->setCpusetMems($data->{'CpusetMems'}); - } - if (property_exists($data, 'Devices') && $data->{'Devices'} !== null) { + unset($data['BlkioDeviceWriteIOps']); + } elseif (\array_key_exists('BlkioDeviceWriteIOps', $data) && null === $data['BlkioDeviceWriteIOps']) { + $object->setBlkioDeviceWriteIOps(null); + } + if (\array_key_exists('CpuPeriod', $data) && null !== $data['CpuPeriod']) { + $object->setCpuPeriod($data['CpuPeriod']); + unset($data['CpuPeriod']); + } elseif (\array_key_exists('CpuPeriod', $data) && null === $data['CpuPeriod']) { + $object->setCpuPeriod(null); + } + if (\array_key_exists('CpuQuota', $data) && null !== $data['CpuQuota']) { + $object->setCpuQuota($data['CpuQuota']); + unset($data['CpuQuota']); + } elseif (\array_key_exists('CpuQuota', $data) && null === $data['CpuQuota']) { + $object->setCpuQuota(null); + } + if (\array_key_exists('CpuRealtimePeriod', $data) && null !== $data['CpuRealtimePeriod']) { + $object->setCpuRealtimePeriod($data['CpuRealtimePeriod']); + unset($data['CpuRealtimePeriod']); + } elseif (\array_key_exists('CpuRealtimePeriod', $data) && null === $data['CpuRealtimePeriod']) { + $object->setCpuRealtimePeriod(null); + } + if (\array_key_exists('CpuRealtimeRuntime', $data) && null !== $data['CpuRealtimeRuntime']) { + $object->setCpuRealtimeRuntime($data['CpuRealtimeRuntime']); + unset($data['CpuRealtimeRuntime']); + } elseif (\array_key_exists('CpuRealtimeRuntime', $data) && null === $data['CpuRealtimeRuntime']) { + $object->setCpuRealtimeRuntime(null); + } + if (\array_key_exists('CpusetCpus', $data) && null !== $data['CpusetCpus']) { + $object->setCpusetCpus($data['CpusetCpus']); + unset($data['CpusetCpus']); + } elseif (\array_key_exists('CpusetCpus', $data) && null === $data['CpusetCpus']) { + $object->setCpusetCpus(null); + } + if (\array_key_exists('CpusetMems', $data) && null !== $data['CpusetMems']) { + $object->setCpusetMems($data['CpusetMems']); + unset($data['CpusetMems']); + } elseif (\array_key_exists('CpusetMems', $data) && null === $data['CpusetMems']) { + $object->setCpusetMems(null); + } + if (\array_key_exists('Devices', $data) && null !== $data['Devices']) { $values_5 = []; - foreach ($data->{'Devices'} as $value_5) { - $values_5[] = $this->denormalizer->denormalize($value_5, 'Docker\\API\\Model\\DeviceMapping', 'json', $context); + foreach ($data['Devices'] as $value_5) { + $values_5[] = $this->denormalizer->denormalize($value_5, \Docker\API\Model\DeviceMapping::class, 'json', $context); } $object->setDevices($values_5); + unset($data['Devices']); + } elseif (\array_key_exists('Devices', $data) && null === $data['Devices']) { + $object->setDevices(null); } - if (property_exists($data, 'DeviceCgroupRules') && $data->{'DeviceCgroupRules'} !== null) { + if (\array_key_exists('DeviceCgroupRules', $data) && null !== $data['DeviceCgroupRules']) { $values_6 = []; - foreach ($data->{'DeviceCgroupRules'} as $value_6) { + foreach ($data['DeviceCgroupRules'] as $value_6) { $values_6[] = $value_6; } $object->setDeviceCgroupRules($values_6); + unset($data['DeviceCgroupRules']); + } elseif (\array_key_exists('DeviceCgroupRules', $data) && null === $data['DeviceCgroupRules']) { + $object->setDeviceCgroupRules(null); } - if (property_exists($data, 'DiskQuota') && $data->{'DiskQuota'} !== null) { - $object->setDiskQuota($data->{'DiskQuota'}); - } - if (property_exists($data, 'KernelMemory') && $data->{'KernelMemory'} !== null) { - $object->setKernelMemory($data->{'KernelMemory'}); - } - if (property_exists($data, 'MemoryReservation') && $data->{'MemoryReservation'} !== null) { - $object->setMemoryReservation($data->{'MemoryReservation'}); - } - if (property_exists($data, 'MemorySwap') && $data->{'MemorySwap'} !== null) { - $object->setMemorySwap($data->{'MemorySwap'}); - } - if (property_exists($data, 'MemorySwappiness') && $data->{'MemorySwappiness'} !== null) { - $object->setMemorySwappiness($data->{'MemorySwappiness'}); - } - if (property_exists($data, 'NanoCPUs') && $data->{'NanoCPUs'} !== null) { - $object->setNanoCPUs($data->{'NanoCPUs'}); - } - if (property_exists($data, 'OomKillDisable') && $data->{'OomKillDisable'} !== null) { - $object->setOomKillDisable($data->{'OomKillDisable'}); - } - if (property_exists($data, 'PidsLimit') && $data->{'PidsLimit'} !== null) { - $object->setPidsLimit($data->{'PidsLimit'}); - } - if (property_exists($data, 'Ulimits') && $data->{'Ulimits'} !== null) { + if (\array_key_exists('DeviceRequests', $data) && null !== $data['DeviceRequests']) { $values_7 = []; - foreach ($data->{'Ulimits'} as $value_7) { - $values_7[] = $this->denormalizer->denormalize($value_7, 'Docker\\API\\Model\\ResourcesUlimitsItem', 'json', $context); - } - $object->setUlimits($values_7); - } - if (property_exists($data, 'CpuCount') && $data->{'CpuCount'} !== null) { - $object->setCpuCount($data->{'CpuCount'}); - } - if (property_exists($data, 'CpuPercent') && $data->{'CpuPercent'} !== null) { - $object->setCpuPercent($data->{'CpuPercent'}); - } - if (property_exists($data, 'IOMaximumIOps') && $data->{'IOMaximumIOps'} !== null) { - $object->setIOMaximumIOps($data->{'IOMaximumIOps'}); - } - if (property_exists($data, 'IOMaximumBandwidth') && $data->{'IOMaximumBandwidth'} !== null) { - $object->setIOMaximumBandwidth($data->{'IOMaximumBandwidth'}); - } - if (property_exists($data, 'Binds') && $data->{'Binds'} !== null) { + foreach ($data['DeviceRequests'] as $value_7) { + $values_7[] = $this->denormalizer->denormalize($value_7, \Docker\API\Model\DeviceRequest::class, 'json', $context); + } + $object->setDeviceRequests($values_7); + unset($data['DeviceRequests']); + } elseif (\array_key_exists('DeviceRequests', $data) && null === $data['DeviceRequests']) { + $object->setDeviceRequests(null); + } + if (\array_key_exists('KernelMemoryTCP', $data) && null !== $data['KernelMemoryTCP']) { + $object->setKernelMemoryTCP($data['KernelMemoryTCP']); + unset($data['KernelMemoryTCP']); + } elseif (\array_key_exists('KernelMemoryTCP', $data) && null === $data['KernelMemoryTCP']) { + $object->setKernelMemoryTCP(null); + } + if (\array_key_exists('MemoryReservation', $data) && null !== $data['MemoryReservation']) { + $object->setMemoryReservation($data['MemoryReservation']); + unset($data['MemoryReservation']); + } elseif (\array_key_exists('MemoryReservation', $data) && null === $data['MemoryReservation']) { + $object->setMemoryReservation(null); + } + if (\array_key_exists('MemorySwap', $data) && null !== $data['MemorySwap']) { + $object->setMemorySwap($data['MemorySwap']); + unset($data['MemorySwap']); + } elseif (\array_key_exists('MemorySwap', $data) && null === $data['MemorySwap']) { + $object->setMemorySwap(null); + } + if (\array_key_exists('MemorySwappiness', $data) && null !== $data['MemorySwappiness']) { + $object->setMemorySwappiness($data['MemorySwappiness']); + unset($data['MemorySwappiness']); + } elseif (\array_key_exists('MemorySwappiness', $data) && null === $data['MemorySwappiness']) { + $object->setMemorySwappiness(null); + } + if (\array_key_exists('NanoCpus', $data) && null !== $data['NanoCpus']) { + $object->setNanoCpus($data['NanoCpus']); + unset($data['NanoCpus']); + } elseif (\array_key_exists('NanoCpus', $data) && null === $data['NanoCpus']) { + $object->setNanoCpus(null); + } + if (\array_key_exists('OomKillDisable', $data) && null !== $data['OomKillDisable']) { + $object->setOomKillDisable($data['OomKillDisable']); + unset($data['OomKillDisable']); + } elseif (\array_key_exists('OomKillDisable', $data) && null === $data['OomKillDisable']) { + $object->setOomKillDisable(null); + } + if (\array_key_exists('Init', $data) && null !== $data['Init']) { + $object->setInit($data['Init']); + unset($data['Init']); + } elseif (\array_key_exists('Init', $data) && null === $data['Init']) { + $object->setInit(null); + } + if (\array_key_exists('PidsLimit', $data) && null !== $data['PidsLimit']) { + $object->setPidsLimit($data['PidsLimit']); + unset($data['PidsLimit']); + } elseif (\array_key_exists('PidsLimit', $data) && null === $data['PidsLimit']) { + $object->setPidsLimit(null); + } + if (\array_key_exists('Ulimits', $data) && null !== $data['Ulimits']) { $values_8 = []; - foreach ($data->{'Binds'} as $value_8) { - $values_8[] = $value_8; - } - $object->setBinds($values_8); - } - if (property_exists($data, 'ContainerIDFile') && $data->{'ContainerIDFile'} !== null) { - $object->setContainerIDFile($data->{'ContainerIDFile'}); - } - if (property_exists($data, 'LogConfig') && $data->{'LogConfig'} !== null) { - $object->setLogConfig($this->denormalizer->denormalize($data->{'LogConfig'}, 'Docker\\API\\Model\\HostConfigLogConfig', 'json', $context)); - } - if (property_exists($data, 'NetworkMode') && $data->{'NetworkMode'} !== null) { - $object->setNetworkMode($data->{'NetworkMode'}); - } - if (property_exists($data, 'PortBindings') && $data->{'PortBindings'} !== null) { - $values_9 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'PortBindings'} as $key => $value_9) { - $values_10 = []; - foreach ($value_9 as $value_10) { - $values_10[] = $this->denormalizer->denormalize($value_10, 'Docker\\API\\Model\\PortBinding', 'json', $context); + foreach ($data['Ulimits'] as $value_8) { + $values_8[] = $this->denormalizer->denormalize($value_8, \Docker\API\Model\ResourcesUlimitsItem::class, 'json', $context); + } + $object->setUlimits($values_8); + unset($data['Ulimits']); + } elseif (\array_key_exists('Ulimits', $data) && null === $data['Ulimits']) { + $object->setUlimits(null); + } + if (\array_key_exists('CpuCount', $data) && null !== $data['CpuCount']) { + $object->setCpuCount($data['CpuCount']); + unset($data['CpuCount']); + } elseif (\array_key_exists('CpuCount', $data) && null === $data['CpuCount']) { + $object->setCpuCount(null); + } + if (\array_key_exists('CpuPercent', $data) && null !== $data['CpuPercent']) { + $object->setCpuPercent($data['CpuPercent']); + unset($data['CpuPercent']); + } elseif (\array_key_exists('CpuPercent', $data) && null === $data['CpuPercent']) { + $object->setCpuPercent(null); + } + if (\array_key_exists('IOMaximumIOps', $data) && null !== $data['IOMaximumIOps']) { + $object->setIOMaximumIOps($data['IOMaximumIOps']); + unset($data['IOMaximumIOps']); + } elseif (\array_key_exists('IOMaximumIOps', $data) && null === $data['IOMaximumIOps']) { + $object->setIOMaximumIOps(null); + } + if (\array_key_exists('IOMaximumBandwidth', $data) && null !== $data['IOMaximumBandwidth']) { + $object->setIOMaximumBandwidth($data['IOMaximumBandwidth']); + unset($data['IOMaximumBandwidth']); + } elseif (\array_key_exists('IOMaximumBandwidth', $data) && null === $data['IOMaximumBandwidth']) { + $object->setIOMaximumBandwidth(null); + } + if (\array_key_exists('Binds', $data) && null !== $data['Binds']) { + $values_9 = []; + foreach ($data['Binds'] as $value_9) { + $values_9[] = $value_9; + } + $object->setBinds($values_9); + unset($data['Binds']); + } elseif (\array_key_exists('Binds', $data) && null === $data['Binds']) { + $object->setBinds(null); + } + if (\array_key_exists('ContainerIDFile', $data) && null !== $data['ContainerIDFile']) { + $object->setContainerIDFile($data['ContainerIDFile']); + unset($data['ContainerIDFile']); + } elseif (\array_key_exists('ContainerIDFile', $data) && null === $data['ContainerIDFile']) { + $object->setContainerIDFile(null); + } + if (\array_key_exists('LogConfig', $data) && null !== $data['LogConfig']) { + $object->setLogConfig($this->denormalizer->denormalize($data['LogConfig'], \Docker\API\Model\HostConfigLogConfig::class, 'json', $context)); + unset($data['LogConfig']); + } elseif (\array_key_exists('LogConfig', $data) && null === $data['LogConfig']) { + $object->setLogConfig(null); + } + if (\array_key_exists('NetworkMode', $data) && null !== $data['NetworkMode']) { + $object->setNetworkMode($data['NetworkMode']); + unset($data['NetworkMode']); + } elseif (\array_key_exists('NetworkMode', $data) && null === $data['NetworkMode']) { + $object->setNetworkMode(null); + } + if (\array_key_exists('PortBindings', $data) && null !== $data['PortBindings']) { + $values_10 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['PortBindings'] as $key => $value_10) { + $values_11 = []; + foreach ($value_10 as $value_11) { + $values_11[] = $this->denormalizer->denormalize($value_11, \Docker\API\Model\PortBinding::class, 'json', $context); } - $values_9[$key] = $values_10; - } - $object->setPortBindings($values_9); - } - if (property_exists($data, 'RestartPolicy') && $data->{'RestartPolicy'} !== null) { - $object->setRestartPolicy($this->denormalizer->denormalize($data->{'RestartPolicy'}, 'Docker\\API\\Model\\RestartPolicy', 'json', $context)); - } - if (property_exists($data, 'AutoRemove') && $data->{'AutoRemove'} !== null) { - $object->setAutoRemove($data->{'AutoRemove'}); - } - if (property_exists($data, 'VolumeDriver') && $data->{'VolumeDriver'} !== null) { - $object->setVolumeDriver($data->{'VolumeDriver'}); - } - if (property_exists($data, 'VolumesFrom') && $data->{'VolumesFrom'} !== null) { - $values_11 = []; - foreach ($data->{'VolumesFrom'} as $value_11) { - $values_11[] = $value_11; - } - $object->setVolumesFrom($values_11); - } - if (property_exists($data, 'Mounts') && $data->{'Mounts'} !== null) { + $values_10[$key] = $values_11; + } + $object->setPortBindings($values_10); + unset($data['PortBindings']); + } elseif (\array_key_exists('PortBindings', $data) && null === $data['PortBindings']) { + $object->setPortBindings(null); + } + if (\array_key_exists('RestartPolicy', $data) && null !== $data['RestartPolicy']) { + $object->setRestartPolicy($this->denormalizer->denormalize($data['RestartPolicy'], \Docker\API\Model\RestartPolicy::class, 'json', $context)); + unset($data['RestartPolicy']); + } elseif (\array_key_exists('RestartPolicy', $data) && null === $data['RestartPolicy']) { + $object->setRestartPolicy(null); + } + if (\array_key_exists('AutoRemove', $data) && null !== $data['AutoRemove']) { + $object->setAutoRemove($data['AutoRemove']); + unset($data['AutoRemove']); + } elseif (\array_key_exists('AutoRemove', $data) && null === $data['AutoRemove']) { + $object->setAutoRemove(null); + } + if (\array_key_exists('VolumeDriver', $data) && null !== $data['VolumeDriver']) { + $object->setVolumeDriver($data['VolumeDriver']); + unset($data['VolumeDriver']); + } elseif (\array_key_exists('VolumeDriver', $data) && null === $data['VolumeDriver']) { + $object->setVolumeDriver(null); + } + if (\array_key_exists('VolumesFrom', $data) && null !== $data['VolumesFrom']) { $values_12 = []; - foreach ($data->{'Mounts'} as $value_12) { - $values_12[] = $this->denormalizer->denormalize($value_12, 'Docker\\API\\Model\\Mount', 'json', $context); + foreach ($data['VolumesFrom'] as $value_12) { + $values_12[] = $value_12; } - $object->setMounts($values_12); + $object->setVolumesFrom($values_12); + unset($data['VolumesFrom']); + } elseif (\array_key_exists('VolumesFrom', $data) && null === $data['VolumesFrom']) { + $object->setVolumesFrom(null); } - if (property_exists($data, 'CapAdd') && $data->{'CapAdd'} !== null) { + if (\array_key_exists('Mounts', $data) && null !== $data['Mounts']) { $values_13 = []; - foreach ($data->{'CapAdd'} as $value_13) { - $values_13[] = $value_13; + foreach ($data['Mounts'] as $value_13) { + $values_13[] = $this->denormalizer->denormalize($value_13, \Docker\API\Model\Mount::class, 'json', $context); } - $object->setCapAdd($values_13); + $object->setMounts($values_13); + unset($data['Mounts']); + } elseif (\array_key_exists('Mounts', $data) && null === $data['Mounts']) { + $object->setMounts(null); } - if (property_exists($data, 'CapDrop') && $data->{'CapDrop'} !== null) { + if (\array_key_exists('ConsoleSize', $data) && null !== $data['ConsoleSize']) { $values_14 = []; - foreach ($data->{'CapDrop'} as $value_14) { + foreach ($data['ConsoleSize'] as $value_14) { $values_14[] = $value_14; } - $object->setCapDrop($values_14); + $object->setConsoleSize($values_14); + unset($data['ConsoleSize']); + } elseif (\array_key_exists('ConsoleSize', $data) && null === $data['ConsoleSize']) { + $object->setConsoleSize(null); } - if (property_exists($data, 'Dns') && $data->{'Dns'} !== null) { - $values_15 = []; - foreach ($data->{'Dns'} as $value_15) { - $values_15[] = $value_15; + if (\array_key_exists('Annotations', $data) && null !== $data['Annotations']) { + $values_15 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Annotations'] as $key_1 => $value_15) { + $values_15[$key_1] = $value_15; } - $object->setDns($values_15); + $object->setAnnotations($values_15); + unset($data['Annotations']); + } elseif (\array_key_exists('Annotations', $data) && null === $data['Annotations']) { + $object->setAnnotations(null); } - if (property_exists($data, 'DnsOptions') && $data->{'DnsOptions'} !== null) { + if (\array_key_exists('CapAdd', $data) && null !== $data['CapAdd']) { $values_16 = []; - foreach ($data->{'DnsOptions'} as $value_16) { + foreach ($data['CapAdd'] as $value_16) { $values_16[] = $value_16; } - $object->setDnsOptions($values_16); + $object->setCapAdd($values_16); + unset($data['CapAdd']); + } elseif (\array_key_exists('CapAdd', $data) && null === $data['CapAdd']) { + $object->setCapAdd(null); } - if (property_exists($data, 'DnsSearch') && $data->{'DnsSearch'} !== null) { + if (\array_key_exists('CapDrop', $data) && null !== $data['CapDrop']) { $values_17 = []; - foreach ($data->{'DnsSearch'} as $value_17) { + foreach ($data['CapDrop'] as $value_17) { $values_17[] = $value_17; } - $object->setDnsSearch($values_17); + $object->setCapDrop($values_17); + unset($data['CapDrop']); + } elseif (\array_key_exists('CapDrop', $data) && null === $data['CapDrop']) { + $object->setCapDrop(null); } - if (property_exists($data, 'ExtraHosts') && $data->{'ExtraHosts'} !== null) { + if (\array_key_exists('CgroupnsMode', $data) && null !== $data['CgroupnsMode']) { + $object->setCgroupnsMode($data['CgroupnsMode']); + unset($data['CgroupnsMode']); + } elseif (\array_key_exists('CgroupnsMode', $data) && null === $data['CgroupnsMode']) { + $object->setCgroupnsMode(null); + } + if (\array_key_exists('Dns', $data) && null !== $data['Dns']) { $values_18 = []; - foreach ($data->{'ExtraHosts'} as $value_18) { + foreach ($data['Dns'] as $value_18) { $values_18[] = $value_18; } - $object->setExtraHosts($values_18); + $object->setDns($values_18); + unset($data['Dns']); + } elseif (\array_key_exists('Dns', $data) && null === $data['Dns']) { + $object->setDns(null); } - if (property_exists($data, 'GroupAdd') && $data->{'GroupAdd'} !== null) { + if (\array_key_exists('DnsOptions', $data) && null !== $data['DnsOptions']) { $values_19 = []; - foreach ($data->{'GroupAdd'} as $value_19) { + foreach ($data['DnsOptions'] as $value_19) { $values_19[] = $value_19; } - $object->setGroupAdd($values_19); - } - if (property_exists($data, 'IpcMode') && $data->{'IpcMode'} !== null) { - $object->setIpcMode($data->{'IpcMode'}); - } - if (property_exists($data, 'Cgroup') && $data->{'Cgroup'} !== null) { - $object->setCgroup($data->{'Cgroup'}); + $object->setDnsOptions($values_19); + unset($data['DnsOptions']); + } elseif (\array_key_exists('DnsOptions', $data) && null === $data['DnsOptions']) { + $object->setDnsOptions(null); } - if (property_exists($data, 'Links') && $data->{'Links'} !== null) { + if (\array_key_exists('DnsSearch', $data) && null !== $data['DnsSearch']) { $values_20 = []; - foreach ($data->{'Links'} as $value_20) { + foreach ($data['DnsSearch'] as $value_20) { $values_20[] = $value_20; } - $object->setLinks($values_20); - } - if (property_exists($data, 'OomScoreAdj') && $data->{'OomScoreAdj'} !== null) { - $object->setOomScoreAdj($data->{'OomScoreAdj'}); - } - if (property_exists($data, 'PidMode') && $data->{'PidMode'} !== null) { - $object->setPidMode($data->{'PidMode'}); - } - if (property_exists($data, 'Privileged') && $data->{'Privileged'} !== null) { - $object->setPrivileged($data->{'Privileged'}); + $object->setDnsSearch($values_20); + unset($data['DnsSearch']); + } elseif (\array_key_exists('DnsSearch', $data) && null === $data['DnsSearch']) { + $object->setDnsSearch(null); } - if (property_exists($data, 'PublishAllPorts') && $data->{'PublishAllPorts'} !== null) { - $object->setPublishAllPorts($data->{'PublishAllPorts'}); - } - if (property_exists($data, 'ReadonlyRootfs') && $data->{'ReadonlyRootfs'} !== null) { - $object->setReadonlyRootfs($data->{'ReadonlyRootfs'}); - } - if (property_exists($data, 'SecurityOpt') && $data->{'SecurityOpt'} !== null) { + if (\array_key_exists('ExtraHosts', $data) && null !== $data['ExtraHosts']) { $values_21 = []; - foreach ($data->{'SecurityOpt'} as $value_21) { + foreach ($data['ExtraHosts'] as $value_21) { $values_21[] = $value_21; } - $object->setSecurityOpt($values_21); - } - if (property_exists($data, 'StorageOpt') && $data->{'StorageOpt'} !== null) { - $values_22 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'StorageOpt'} as $key_1 => $value_22) { - $values_22[$key_1] = $value_22; + $object->setExtraHosts($values_21); + unset($data['ExtraHosts']); + } elseif (\array_key_exists('ExtraHosts', $data) && null === $data['ExtraHosts']) { + $object->setExtraHosts(null); + } + if (\array_key_exists('GroupAdd', $data) && null !== $data['GroupAdd']) { + $values_22 = []; + foreach ($data['GroupAdd'] as $value_22) { + $values_22[] = $value_22; + } + $object->setGroupAdd($values_22); + unset($data['GroupAdd']); + } elseif (\array_key_exists('GroupAdd', $data) && null === $data['GroupAdd']) { + $object->setGroupAdd(null); + } + if (\array_key_exists('IpcMode', $data) && null !== $data['IpcMode']) { + $object->setIpcMode($data['IpcMode']); + unset($data['IpcMode']); + } elseif (\array_key_exists('IpcMode', $data) && null === $data['IpcMode']) { + $object->setIpcMode(null); + } + if (\array_key_exists('Cgroup', $data) && null !== $data['Cgroup']) { + $object->setCgroup($data['Cgroup']); + unset($data['Cgroup']); + } elseif (\array_key_exists('Cgroup', $data) && null === $data['Cgroup']) { + $object->setCgroup(null); + } + if (\array_key_exists('Links', $data) && null !== $data['Links']) { + $values_23 = []; + foreach ($data['Links'] as $value_23) { + $values_23[] = $value_23; + } + $object->setLinks($values_23); + unset($data['Links']); + } elseif (\array_key_exists('Links', $data) && null === $data['Links']) { + $object->setLinks(null); + } + if (\array_key_exists('OomScoreAdj', $data) && null !== $data['OomScoreAdj']) { + $object->setOomScoreAdj($data['OomScoreAdj']); + unset($data['OomScoreAdj']); + } elseif (\array_key_exists('OomScoreAdj', $data) && null === $data['OomScoreAdj']) { + $object->setOomScoreAdj(null); + } + if (\array_key_exists('PidMode', $data) && null !== $data['PidMode']) { + $object->setPidMode($data['PidMode']); + unset($data['PidMode']); + } elseif (\array_key_exists('PidMode', $data) && null === $data['PidMode']) { + $object->setPidMode(null); + } + if (\array_key_exists('Privileged', $data) && null !== $data['Privileged']) { + $object->setPrivileged($data['Privileged']); + unset($data['Privileged']); + } elseif (\array_key_exists('Privileged', $data) && null === $data['Privileged']) { + $object->setPrivileged(null); + } + if (\array_key_exists('PublishAllPorts', $data) && null !== $data['PublishAllPorts']) { + $object->setPublishAllPorts($data['PublishAllPorts']); + unset($data['PublishAllPorts']); + } elseif (\array_key_exists('PublishAllPorts', $data) && null === $data['PublishAllPorts']) { + $object->setPublishAllPorts(null); + } + if (\array_key_exists('ReadonlyRootfs', $data) && null !== $data['ReadonlyRootfs']) { + $object->setReadonlyRootfs($data['ReadonlyRootfs']); + unset($data['ReadonlyRootfs']); + } elseif (\array_key_exists('ReadonlyRootfs', $data) && null === $data['ReadonlyRootfs']) { + $object->setReadonlyRootfs(null); + } + if (\array_key_exists('SecurityOpt', $data) && null !== $data['SecurityOpt']) { + $values_24 = []; + foreach ($data['SecurityOpt'] as $value_24) { + $values_24[] = $value_24; + } + $object->setSecurityOpt($values_24); + unset($data['SecurityOpt']); + } elseif (\array_key_exists('SecurityOpt', $data) && null === $data['SecurityOpt']) { + $object->setSecurityOpt(null); + } + if (\array_key_exists('StorageOpt', $data) && null !== $data['StorageOpt']) { + $values_25 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['StorageOpt'] as $key_2 => $value_25) { + $values_25[$key_2] = $value_25; + } + $object->setStorageOpt($values_25); + unset($data['StorageOpt']); + } elseif (\array_key_exists('StorageOpt', $data) && null === $data['StorageOpt']) { + $object->setStorageOpt(null); + } + if (\array_key_exists('Tmpfs', $data) && null !== $data['Tmpfs']) { + $values_26 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Tmpfs'] as $key_3 => $value_26) { + $values_26[$key_3] = $value_26; + } + $object->setTmpfs($values_26); + unset($data['Tmpfs']); + } elseif (\array_key_exists('Tmpfs', $data) && null === $data['Tmpfs']) { + $object->setTmpfs(null); + } + if (\array_key_exists('UTSMode', $data) && null !== $data['UTSMode']) { + $object->setUTSMode($data['UTSMode']); + unset($data['UTSMode']); + } elseif (\array_key_exists('UTSMode', $data) && null === $data['UTSMode']) { + $object->setUTSMode(null); + } + if (\array_key_exists('UsernsMode', $data) && null !== $data['UsernsMode']) { + $object->setUsernsMode($data['UsernsMode']); + unset($data['UsernsMode']); + } elseif (\array_key_exists('UsernsMode', $data) && null === $data['UsernsMode']) { + $object->setUsernsMode(null); + } + if (\array_key_exists('ShmSize', $data) && null !== $data['ShmSize']) { + $object->setShmSize($data['ShmSize']); + unset($data['ShmSize']); + } elseif (\array_key_exists('ShmSize', $data) && null === $data['ShmSize']) { + $object->setShmSize(null); + } + if (\array_key_exists('Sysctls', $data) && null !== $data['Sysctls']) { + $values_27 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Sysctls'] as $key_4 => $value_27) { + $values_27[$key_4] = $value_27; + } + $object->setSysctls($values_27); + unset($data['Sysctls']); + } elseif (\array_key_exists('Sysctls', $data) && null === $data['Sysctls']) { + $object->setSysctls(null); + } + if (\array_key_exists('Runtime', $data) && null !== $data['Runtime']) { + $object->setRuntime($data['Runtime']); + unset($data['Runtime']); + } elseif (\array_key_exists('Runtime', $data) && null === $data['Runtime']) { + $object->setRuntime(null); + } + if (\array_key_exists('Isolation', $data) && null !== $data['Isolation']) { + $object->setIsolation($data['Isolation']); + unset($data['Isolation']); + } elseif (\array_key_exists('Isolation', $data) && null === $data['Isolation']) { + $object->setIsolation(null); + } + if (\array_key_exists('MaskedPaths', $data) && null !== $data['MaskedPaths']) { + $values_28 = []; + foreach ($data['MaskedPaths'] as $value_28) { + $values_28[] = $value_28; + } + $object->setMaskedPaths($values_28); + unset($data['MaskedPaths']); + } elseif (\array_key_exists('MaskedPaths', $data) && null === $data['MaskedPaths']) { + $object->setMaskedPaths(null); + } + if (\array_key_exists('ReadonlyPaths', $data) && null !== $data['ReadonlyPaths']) { + $values_29 = []; + foreach ($data['ReadonlyPaths'] as $value_29) { + $values_29[] = $value_29; + } + $object->setReadonlyPaths($values_29); + unset($data['ReadonlyPaths']); + } elseif (\array_key_exists('ReadonlyPaths', $data) && null === $data['ReadonlyPaths']) { + $object->setReadonlyPaths(null); + } + foreach ($data as $key_5 => $value_30) { + if (preg_match('/.*/', (string) $key_5)) { + $object[$key_5] = $value_30; } - $object->setStorageOpt($values_22); - } - if (property_exists($data, 'Tmpfs') && $data->{'Tmpfs'} !== null) { - $values_23 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Tmpfs'} as $key_2 => $value_23) { - $values_23[$key_2] = $value_23; - } - $object->setTmpfs($values_23); - } - if (property_exists($data, 'UTSMode') && $data->{'UTSMode'} !== null) { - $object->setUTSMode($data->{'UTSMode'}); - } - if (property_exists($data, 'UsernsMode') && $data->{'UsernsMode'} !== null) { - $object->setUsernsMode($data->{'UsernsMode'}); - } - if (property_exists($data, 'ShmSize') && $data->{'ShmSize'} !== null) { - $object->setShmSize($data->{'ShmSize'}); - } - if (property_exists($data, 'Sysctls') && $data->{'Sysctls'} !== null) { - $values_24 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Sysctls'} as $key_3 => $value_24) { - $values_24[$key_3] = $value_24; - } - $object->setSysctls($values_24); - } - if (property_exists($data, 'Runtime') && $data->{'Runtime'} !== null) { - $object->setRuntime($data->{'Runtime'}); - } - if (property_exists($data, 'ConsoleSize') && $data->{'ConsoleSize'} !== null) { - $values_25 = []; - foreach ($data->{'ConsoleSize'} as $value_25) { - $values_25[] = $value_25; - } - $object->setConsoleSize($values_25); - } - if (property_exists($data, 'Isolation') && $data->{'Isolation'} !== null) { - $object->setIsolation($data->{'Isolation'}); } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getCpuShares()) { - $data->{'CpuShares'} = $object->getCpuShares(); + $dataArray = []; + if ($data->isInitialized('cpuShares') && null !== $data->getCpuShares()) { + $dataArray['CpuShares'] = $data->getCpuShares(); } - if (null !== $object->getMemory()) { - $data->{'Memory'} = $object->getMemory(); + if ($data->isInitialized('memory') && null !== $data->getMemory()) { + $dataArray['Memory'] = $data->getMemory(); } - if (null !== $object->getCgroupParent()) { - $data->{'CgroupParent'} = $object->getCgroupParent(); + if ($data->isInitialized('cgroupParent') && null !== $data->getCgroupParent()) { + $dataArray['CgroupParent'] = $data->getCgroupParent(); } - if (null !== $object->getBlkioWeight()) { - $data->{'BlkioWeight'} = $object->getBlkioWeight(); + if ($data->isInitialized('blkioWeight') && null !== $data->getBlkioWeight()) { + $dataArray['BlkioWeight'] = $data->getBlkioWeight(); } - if (null !== $object->getBlkioWeightDevice()) { + if ($data->isInitialized('blkioWeightDevice') && null !== $data->getBlkioWeightDevice()) { $values = []; - foreach ($object->getBlkioWeightDevice() as $value) { + foreach ($data->getBlkioWeightDevice() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'BlkioWeightDevice'} = $values; + $dataArray['BlkioWeightDevice'] = $values; } - if (null !== $object->getBlkioDeviceReadBps()) { + if ($data->isInitialized('blkioDeviceReadBps') && null !== $data->getBlkioDeviceReadBps()) { $values_1 = []; - foreach ($object->getBlkioDeviceReadBps() as $value_1) { + foreach ($data->getBlkioDeviceReadBps() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'BlkioDeviceReadBps'} = $values_1; + $dataArray['BlkioDeviceReadBps'] = $values_1; } - if (null !== $object->getBlkioDeviceWriteBps()) { + if ($data->isInitialized('blkioDeviceWriteBps') && null !== $data->getBlkioDeviceWriteBps()) { $values_2 = []; - foreach ($object->getBlkioDeviceWriteBps() as $value_2) { + foreach ($data->getBlkioDeviceWriteBps() as $value_2) { $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); } - $data->{'BlkioDeviceWriteBps'} = $values_2; + $dataArray['BlkioDeviceWriteBps'] = $values_2; } - if (null !== $object->getBlkioDeviceReadIOps()) { + if ($data->isInitialized('blkioDeviceReadIOps') && null !== $data->getBlkioDeviceReadIOps()) { $values_3 = []; - foreach ($object->getBlkioDeviceReadIOps() as $value_3) { + foreach ($data->getBlkioDeviceReadIOps() as $value_3) { $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); } - $data->{'BlkioDeviceReadIOps'} = $values_3; + $dataArray['BlkioDeviceReadIOps'] = $values_3; } - if (null !== $object->getBlkioDeviceWriteIOps()) { + if ($data->isInitialized('blkioDeviceWriteIOps') && null !== $data->getBlkioDeviceWriteIOps()) { $values_4 = []; - foreach ($object->getBlkioDeviceWriteIOps() as $value_4) { + foreach ($data->getBlkioDeviceWriteIOps() as $value_4) { $values_4[] = $this->normalizer->normalize($value_4, 'json', $context); } - $data->{'BlkioDeviceWriteIOps'} = $values_4; + $dataArray['BlkioDeviceWriteIOps'] = $values_4; } - if (null !== $object->getCpuPeriod()) { - $data->{'CpuPeriod'} = $object->getCpuPeriod(); + if ($data->isInitialized('cpuPeriod') && null !== $data->getCpuPeriod()) { + $dataArray['CpuPeriod'] = $data->getCpuPeriod(); } - if (null !== $object->getCpuQuota()) { - $data->{'CpuQuota'} = $object->getCpuQuota(); + if ($data->isInitialized('cpuQuota') && null !== $data->getCpuQuota()) { + $dataArray['CpuQuota'] = $data->getCpuQuota(); } - if (null !== $object->getCpuRealtimePeriod()) { - $data->{'CpuRealtimePeriod'} = $object->getCpuRealtimePeriod(); + if ($data->isInitialized('cpuRealtimePeriod') && null !== $data->getCpuRealtimePeriod()) { + $dataArray['CpuRealtimePeriod'] = $data->getCpuRealtimePeriod(); } - if (null !== $object->getCpuRealtimeRuntime()) { - $data->{'CpuRealtimeRuntime'} = $object->getCpuRealtimeRuntime(); + if ($data->isInitialized('cpuRealtimeRuntime') && null !== $data->getCpuRealtimeRuntime()) { + $dataArray['CpuRealtimeRuntime'] = $data->getCpuRealtimeRuntime(); } - if (null !== $object->getCpusetCpus()) { - $data->{'CpusetCpus'} = $object->getCpusetCpus(); + if ($data->isInitialized('cpusetCpus') && null !== $data->getCpusetCpus()) { + $dataArray['CpusetCpus'] = $data->getCpusetCpus(); } - if (null !== $object->getCpusetMems()) { - $data->{'CpusetMems'} = $object->getCpusetMems(); + if ($data->isInitialized('cpusetMems') && null !== $data->getCpusetMems()) { + $dataArray['CpusetMems'] = $data->getCpusetMems(); } - if (null !== $object->getDevices()) { + if ($data->isInitialized('devices') && null !== $data->getDevices()) { $values_5 = []; - foreach ($object->getDevices() as $value_5) { + foreach ($data->getDevices() as $value_5) { $values_5[] = $this->normalizer->normalize($value_5, 'json', $context); } - $data->{'Devices'} = $values_5; + $dataArray['Devices'] = $values_5; } - if (null !== $object->getDeviceCgroupRules()) { + if ($data->isInitialized('deviceCgroupRules') && null !== $data->getDeviceCgroupRules()) { $values_6 = []; - foreach ($object->getDeviceCgroupRules() as $value_6) { + foreach ($data->getDeviceCgroupRules() as $value_6) { $values_6[] = $value_6; } - $data->{'DeviceCgroupRules'} = $values_6; + $dataArray['DeviceCgroupRules'] = $values_6; } - if (null !== $object->getDiskQuota()) { - $data->{'DiskQuota'} = $object->getDiskQuota(); + if ($data->isInitialized('deviceRequests') && null !== $data->getDeviceRequests()) { + $values_7 = []; + foreach ($data->getDeviceRequests() as $value_7) { + $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + } + $dataArray['DeviceRequests'] = $values_7; } - if (null !== $object->getKernelMemory()) { - $data->{'KernelMemory'} = $object->getKernelMemory(); + if ($data->isInitialized('kernelMemoryTCP') && null !== $data->getKernelMemoryTCP()) { + $dataArray['KernelMemoryTCP'] = $data->getKernelMemoryTCP(); } - if (null !== $object->getMemoryReservation()) { - $data->{'MemoryReservation'} = $object->getMemoryReservation(); + if ($data->isInitialized('memoryReservation') && null !== $data->getMemoryReservation()) { + $dataArray['MemoryReservation'] = $data->getMemoryReservation(); } - if (null !== $object->getMemorySwap()) { - $data->{'MemorySwap'} = $object->getMemorySwap(); + if ($data->isInitialized('memorySwap') && null !== $data->getMemorySwap()) { + $dataArray['MemorySwap'] = $data->getMemorySwap(); } - if (null !== $object->getMemorySwappiness()) { - $data->{'MemorySwappiness'} = $object->getMemorySwappiness(); + if ($data->isInitialized('memorySwappiness') && null !== $data->getMemorySwappiness()) { + $dataArray['MemorySwappiness'] = $data->getMemorySwappiness(); } - if (null !== $object->getNanoCPUs()) { - $data->{'NanoCPUs'} = $object->getNanoCPUs(); + if ($data->isInitialized('nanoCpus') && null !== $data->getNanoCpus()) { + $dataArray['NanoCpus'] = $data->getNanoCpus(); } - if (null !== $object->getOomKillDisable()) { - $data->{'OomKillDisable'} = $object->getOomKillDisable(); + if ($data->isInitialized('oomKillDisable') && null !== $data->getOomKillDisable()) { + $dataArray['OomKillDisable'] = $data->getOomKillDisable(); } - if (null !== $object->getPidsLimit()) { - $data->{'PidsLimit'} = $object->getPidsLimit(); + if ($data->isInitialized('init') && null !== $data->getInit()) { + $dataArray['Init'] = $data->getInit(); } - if (null !== $object->getUlimits()) { - $values_7 = []; - foreach ($object->getUlimits() as $value_7) { - $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + if ($data->isInitialized('pidsLimit') && null !== $data->getPidsLimit()) { + $dataArray['PidsLimit'] = $data->getPidsLimit(); + } + if ($data->isInitialized('ulimits') && null !== $data->getUlimits()) { + $values_8 = []; + foreach ($data->getUlimits() as $value_8) { + $values_8[] = $this->normalizer->normalize($value_8, 'json', $context); } - $data->{'Ulimits'} = $values_7; + $dataArray['Ulimits'] = $values_8; } - if (null !== $object->getCpuCount()) { - $data->{'CpuCount'} = $object->getCpuCount(); + if ($data->isInitialized('cpuCount') && null !== $data->getCpuCount()) { + $dataArray['CpuCount'] = $data->getCpuCount(); } - if (null !== $object->getCpuPercent()) { - $data->{'CpuPercent'} = $object->getCpuPercent(); + if ($data->isInitialized('cpuPercent') && null !== $data->getCpuPercent()) { + $dataArray['CpuPercent'] = $data->getCpuPercent(); } - if (null !== $object->getIOMaximumIOps()) { - $data->{'IOMaximumIOps'} = $object->getIOMaximumIOps(); + if ($data->isInitialized('iOMaximumIOps') && null !== $data->getIOMaximumIOps()) { + $dataArray['IOMaximumIOps'] = $data->getIOMaximumIOps(); } - if (null !== $object->getIOMaximumBandwidth()) { - $data->{'IOMaximumBandwidth'} = $object->getIOMaximumBandwidth(); + if ($data->isInitialized('iOMaximumBandwidth') && null !== $data->getIOMaximumBandwidth()) { + $dataArray['IOMaximumBandwidth'] = $data->getIOMaximumBandwidth(); } - if (null !== $object->getBinds()) { - $values_8 = []; - foreach ($object->getBinds() as $value_8) { - $values_8[] = $value_8; + if ($data->isInitialized('binds') && null !== $data->getBinds()) { + $values_9 = []; + foreach ($data->getBinds() as $value_9) { + $values_9[] = $value_9; } - $data->{'Binds'} = $values_8; + $dataArray['Binds'] = $values_9; } - if (null !== $object->getContainerIDFile()) { - $data->{'ContainerIDFile'} = $object->getContainerIDFile(); + if ($data->isInitialized('containerIDFile') && null !== $data->getContainerIDFile()) { + $dataArray['ContainerIDFile'] = $data->getContainerIDFile(); } - if (null !== $object->getLogConfig()) { - $data->{'LogConfig'} = $this->normalizer->normalize($object->getLogConfig(), 'json', $context); + if ($data->isInitialized('logConfig') && null !== $data->getLogConfig()) { + $dataArray['LogConfig'] = $this->normalizer->normalize($data->getLogConfig(), 'json', $context); } - if (null !== $object->getNetworkMode()) { - $data->{'NetworkMode'} = $object->getNetworkMode(); + if ($data->isInitialized('networkMode') && null !== $data->getNetworkMode()) { + $dataArray['NetworkMode'] = $data->getNetworkMode(); } - if (null !== $object->getPortBindings()) { - $values_9 = new \stdClass(); - foreach ($object->getPortBindings() as $key => $value_9) { - $values_10 = []; - foreach ($value_9 as $value_10) { - $values_10[] = $this->normalizer->normalize($value_10, 'json', $context); + if ($data->isInitialized('portBindings') && null !== $data->getPortBindings()) { + $values_10 = []; + foreach ($data->getPortBindings() as $key => $value_10) { + $values_11 = []; + foreach ($value_10 as $value_11) { + $values_11[] = $this->normalizer->normalize($value_11, 'json', $context); } - $values_9->{$key} = $values_10; + $values_10[$key] = $values_11; } - $data->{'PortBindings'} = $values_9; - } - if (null !== $object->getRestartPolicy()) { - $data->{'RestartPolicy'} = $this->normalizer->normalize($object->getRestartPolicy(), 'json', $context); + $dataArray['PortBindings'] = $values_10; } - if (null !== $object->getAutoRemove()) { - $data->{'AutoRemove'} = $object->getAutoRemove(); + if ($data->isInitialized('restartPolicy') && null !== $data->getRestartPolicy()) { + $dataArray['RestartPolicy'] = $this->normalizer->normalize($data->getRestartPolicy(), 'json', $context); } - if (null !== $object->getVolumeDriver()) { - $data->{'VolumeDriver'} = $object->getVolumeDriver(); + if ($data->isInitialized('autoRemove') && null !== $data->getAutoRemove()) { + $dataArray['AutoRemove'] = $data->getAutoRemove(); } - if (null !== $object->getVolumesFrom()) { - $values_11 = []; - foreach ($object->getVolumesFrom() as $value_11) { - $values_11[] = $value_11; - } - $data->{'VolumesFrom'} = $values_11; + if ($data->isInitialized('volumeDriver') && null !== $data->getVolumeDriver()) { + $dataArray['VolumeDriver'] = $data->getVolumeDriver(); } - if (null !== $object->getMounts()) { + if ($data->isInitialized('volumesFrom') && null !== $data->getVolumesFrom()) { $values_12 = []; - foreach ($object->getMounts() as $value_12) { - $values_12[] = $this->normalizer->normalize($value_12, 'json', $context); + foreach ($data->getVolumesFrom() as $value_12) { + $values_12[] = $value_12; } - $data->{'Mounts'} = $values_12; + $dataArray['VolumesFrom'] = $values_12; } - if (null !== $object->getCapAdd()) { + if ($data->isInitialized('mounts') && null !== $data->getMounts()) { $values_13 = []; - foreach ($object->getCapAdd() as $value_13) { - $values_13[] = $value_13; + foreach ($data->getMounts() as $value_13) { + $values_13[] = $this->normalizer->normalize($value_13, 'json', $context); } - $data->{'CapAdd'} = $values_13; + $dataArray['Mounts'] = $values_13; } - if (null !== $object->getCapDrop()) { + if ($data->isInitialized('consoleSize') && null !== $data->getConsoleSize()) { $values_14 = []; - foreach ($object->getCapDrop() as $value_14) { + foreach ($data->getConsoleSize() as $value_14) { $values_14[] = $value_14; } - $data->{'CapDrop'} = $values_14; + $dataArray['ConsoleSize'] = $values_14; } - if (null !== $object->getDns()) { + if ($data->isInitialized('annotations') && null !== $data->getAnnotations()) { $values_15 = []; - foreach ($object->getDns() as $value_15) { - $values_15[] = $value_15; + foreach ($data->getAnnotations() as $key_1 => $value_15) { + $values_15[$key_1] = $value_15; } - $data->{'Dns'} = $values_15; + $dataArray['Annotations'] = $values_15; } - if (null !== $object->getDnsOptions()) { + if ($data->isInitialized('capAdd') && null !== $data->getCapAdd()) { $values_16 = []; - foreach ($object->getDnsOptions() as $value_16) { + foreach ($data->getCapAdd() as $value_16) { $values_16[] = $value_16; } - $data->{'DnsOptions'} = $values_16; + $dataArray['CapAdd'] = $values_16; } - if (null !== $object->getDnsSearch()) { + if ($data->isInitialized('capDrop') && null !== $data->getCapDrop()) { $values_17 = []; - foreach ($object->getDnsSearch() as $value_17) { + foreach ($data->getCapDrop() as $value_17) { $values_17[] = $value_17; } - $data->{'DnsSearch'} = $values_17; + $dataArray['CapDrop'] = $values_17; } - if (null !== $object->getExtraHosts()) { + if ($data->isInitialized('cgroupnsMode') && null !== $data->getCgroupnsMode()) { + $dataArray['CgroupnsMode'] = $data->getCgroupnsMode(); + } + if ($data->isInitialized('dns') && null !== $data->getDns()) { $values_18 = []; - foreach ($object->getExtraHosts() as $value_18) { + foreach ($data->getDns() as $value_18) { $values_18[] = $value_18; } - $data->{'ExtraHosts'} = $values_18; + $dataArray['Dns'] = $values_18; } - if (null !== $object->getGroupAdd()) { + if ($data->isInitialized('dnsOptions') && null !== $data->getDnsOptions()) { $values_19 = []; - foreach ($object->getGroupAdd() as $value_19) { + foreach ($data->getDnsOptions() as $value_19) { $values_19[] = $value_19; } - $data->{'GroupAdd'} = $values_19; - } - if (null !== $object->getIpcMode()) { - $data->{'IpcMode'} = $object->getIpcMode(); - } - if (null !== $object->getCgroup()) { - $data->{'Cgroup'} = $object->getCgroup(); + $dataArray['DnsOptions'] = $values_19; } - if (null !== $object->getLinks()) { + if ($data->isInitialized('dnsSearch') && null !== $data->getDnsSearch()) { $values_20 = []; - foreach ($object->getLinks() as $value_20) { + foreach ($data->getDnsSearch() as $value_20) { $values_20[] = $value_20; } - $data->{'Links'} = $values_20; + $dataArray['DnsSearch'] = $values_20; + } + if ($data->isInitialized('extraHosts') && null !== $data->getExtraHosts()) { + $values_21 = []; + foreach ($data->getExtraHosts() as $value_21) { + $values_21[] = $value_21; + } + $dataArray['ExtraHosts'] = $values_21; + } + if ($data->isInitialized('groupAdd') && null !== $data->getGroupAdd()) { + $values_22 = []; + foreach ($data->getGroupAdd() as $value_22) { + $values_22[] = $value_22; + } + $dataArray['GroupAdd'] = $values_22; } - if (null !== $object->getOomScoreAdj()) { - $data->{'OomScoreAdj'} = $object->getOomScoreAdj(); + if ($data->isInitialized('ipcMode') && null !== $data->getIpcMode()) { + $dataArray['IpcMode'] = $data->getIpcMode(); } - if (null !== $object->getPidMode()) { - $data->{'PidMode'} = $object->getPidMode(); + if ($data->isInitialized('cgroup') && null !== $data->getCgroup()) { + $dataArray['Cgroup'] = $data->getCgroup(); } - if (null !== $object->getPrivileged()) { - $data->{'Privileged'} = $object->getPrivileged(); + if ($data->isInitialized('links') && null !== $data->getLinks()) { + $values_23 = []; + foreach ($data->getLinks() as $value_23) { + $values_23[] = $value_23; + } + $dataArray['Links'] = $values_23; } - if (null !== $object->getPublishAllPorts()) { - $data->{'PublishAllPorts'} = $object->getPublishAllPorts(); + if ($data->isInitialized('oomScoreAdj') && null !== $data->getOomScoreAdj()) { + $dataArray['OomScoreAdj'] = $data->getOomScoreAdj(); } - if (null !== $object->getReadonlyRootfs()) { - $data->{'ReadonlyRootfs'} = $object->getReadonlyRootfs(); + if ($data->isInitialized('pidMode') && null !== $data->getPidMode()) { + $dataArray['PidMode'] = $data->getPidMode(); } - if (null !== $object->getSecurityOpt()) { - $values_21 = []; - foreach ($object->getSecurityOpt() as $value_21) { - $values_21[] = $value_21; + if ($data->isInitialized('privileged') && null !== $data->getPrivileged()) { + $dataArray['Privileged'] = $data->getPrivileged(); + } + if ($data->isInitialized('publishAllPorts') && null !== $data->getPublishAllPorts()) { + $dataArray['PublishAllPorts'] = $data->getPublishAllPorts(); + } + if ($data->isInitialized('readonlyRootfs') && null !== $data->getReadonlyRootfs()) { + $dataArray['ReadonlyRootfs'] = $data->getReadonlyRootfs(); + } + if ($data->isInitialized('securityOpt') && null !== $data->getSecurityOpt()) { + $values_24 = []; + foreach ($data->getSecurityOpt() as $value_24) { + $values_24[] = $value_24; } - $data->{'SecurityOpt'} = $values_21; + $dataArray['SecurityOpt'] = $values_24; } - if (null !== $object->getStorageOpt()) { - $values_22 = new \stdClass(); - foreach ($object->getStorageOpt() as $key_1 => $value_22) { - $values_22->{$key_1} = $value_22; + if ($data->isInitialized('storageOpt') && null !== $data->getStorageOpt()) { + $values_25 = []; + foreach ($data->getStorageOpt() as $key_2 => $value_25) { + $values_25[$key_2] = $value_25; } - $data->{'StorageOpt'} = $values_22; + $dataArray['StorageOpt'] = $values_25; } - if (null !== $object->getTmpfs()) { - $values_23 = new \stdClass(); - foreach ($object->getTmpfs() as $key_2 => $value_23) { - $values_23->{$key_2} = $value_23; + if ($data->isInitialized('tmpfs') && null !== $data->getTmpfs()) { + $values_26 = []; + foreach ($data->getTmpfs() as $key_3 => $value_26) { + $values_26[$key_3] = $value_26; } - $data->{'Tmpfs'} = $values_23; + $dataArray['Tmpfs'] = $values_26; } - if (null !== $object->getUTSMode()) { - $data->{'UTSMode'} = $object->getUTSMode(); + if ($data->isInitialized('uTSMode') && null !== $data->getUTSMode()) { + $dataArray['UTSMode'] = $data->getUTSMode(); } - if (null !== $object->getUsernsMode()) { - $data->{'UsernsMode'} = $object->getUsernsMode(); + if ($data->isInitialized('usernsMode') && null !== $data->getUsernsMode()) { + $dataArray['UsernsMode'] = $data->getUsernsMode(); } - if (null !== $object->getShmSize()) { - $data->{'ShmSize'} = $object->getShmSize(); + if ($data->isInitialized('shmSize') && null !== $data->getShmSize()) { + $dataArray['ShmSize'] = $data->getShmSize(); } - if (null !== $object->getSysctls()) { - $values_24 = new \stdClass(); - foreach ($object->getSysctls() as $key_3 => $value_24) { - $values_24->{$key_3} = $value_24; + if ($data->isInitialized('sysctls') && null !== $data->getSysctls()) { + $values_27 = []; + foreach ($data->getSysctls() as $key_4 => $value_27) { + $values_27[$key_4] = $value_27; } - $data->{'Sysctls'} = $values_24; + $dataArray['Sysctls'] = $values_27; } - if (null !== $object->getRuntime()) { - $data->{'Runtime'} = $object->getRuntime(); + if ($data->isInitialized('runtime') && null !== $data->getRuntime()) { + $dataArray['Runtime'] = $data->getRuntime(); } - if (null !== $object->getConsoleSize()) { - $values_25 = []; - foreach ($object->getConsoleSize() as $value_25) { - $values_25[] = $value_25; + if ($data->isInitialized('isolation') && null !== $data->getIsolation()) { + $dataArray['Isolation'] = $data->getIsolation(); + } + if ($data->isInitialized('maskedPaths') && null !== $data->getMaskedPaths()) { + $values_28 = []; + foreach ($data->getMaskedPaths() as $value_28) { + $values_28[] = $value_28; } - $data->{'ConsoleSize'} = $values_25; + $dataArray['MaskedPaths'] = $values_28; } - if (null !== $object->getIsolation()) { - $data->{'Isolation'} = $object->getIsolation(); + if ($data->isInitialized('readonlyPaths') && null !== $data->getReadonlyPaths()) { + $values_29 = []; + foreach ($data->getReadonlyPaths() as $value_29) { + $values_29[] = $value_29; + } + $dataArray['ReadonlyPaths'] = $values_29; + } + foreach ($data as $key_5 => $value_30) { + if (preg_match('/.*/', (string) $key_5)) { + $dataArray[$key_5] = $value_30; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\HostConfig::class => false]; } } diff --git a/src/Normalizer/IPAMConfigNormalizer.php b/src/Normalizer/IPAMConfigNormalizer.php new file mode 100644 index 00000000..97eada1c --- /dev/null +++ b/src/Normalizer/IPAMConfigNormalizer.php @@ -0,0 +1,115 @@ +setSubnet($data['Subnet']); + unset($data['Subnet']); + } elseif (\array_key_exists('Subnet', $data) && null === $data['Subnet']) { + $object->setSubnet(null); + } + if (\array_key_exists('IPRange', $data) && null !== $data['IPRange']) { + $object->setIPRange($data['IPRange']); + unset($data['IPRange']); + } elseif (\array_key_exists('IPRange', $data) && null === $data['IPRange']) { + $object->setIPRange(null); + } + if (\array_key_exists('Gateway', $data) && null !== $data['Gateway']) { + $object->setGateway($data['Gateway']); + unset($data['Gateway']); + } elseif (\array_key_exists('Gateway', $data) && null === $data['Gateway']) { + $object->setGateway(null); + } + if (\array_key_exists('AuxiliaryAddresses', $data) && null !== $data['AuxiliaryAddresses']) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['AuxiliaryAddresses'] as $key => $value) { + $values[$key] = $value; + } + $object->setAuxiliaryAddresses($values); + unset($data['AuxiliaryAddresses']); + } elseif (\array_key_exists('AuxiliaryAddresses', $data) && null === $data['AuxiliaryAddresses']) { + $object->setAuxiliaryAddresses(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('subnet') && null !== $data->getSubnet()) { + $dataArray['Subnet'] = $data->getSubnet(); + } + if ($data->isInitialized('iPRange') && null !== $data->getIPRange()) { + $dataArray['IPRange'] = $data->getIPRange(); + } + if ($data->isInitialized('gateway') && null !== $data->getGateway()) { + $dataArray['Gateway'] = $data->getGateway(); + } + if ($data->isInitialized('auxiliaryAddresses') && null !== $data->getAuxiliaryAddresses()) { + $values = []; + foreach ($data->getAuxiliaryAddresses() as $key => $value) { + $values[$key] = $value; + } + $dataArray['AuxiliaryAddresses'] = $values; + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\IPAMConfig::class => false]; + } +} diff --git a/src/Normalizer/IPAMNormalizer.php b/src/Normalizer/IPAMNormalizer.php index 086bbc00..7f9c3d04 100644 --- a/src/Normalizer/IPAMNormalizer.php +++ b/src/Normalizer/IPAMNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,83 +16,99 @@ class IPAMNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\IPAM'; + return \Docker\API\Model\IPAM::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\IPAM; + return \is_object($data) && \Docker\API\Model\IPAM::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\IPAM(); - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($data->{'Driver'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Driver', $data) && null !== $data['Driver']) { + $object->setDriver($data['Driver']); + unset($data['Driver']); + } elseif (\array_key_exists('Driver', $data) && null === $data['Driver']) { + $object->setDriver(null); } - if (property_exists($data, 'Config') && $data->{'Config'} !== null) { + if (\array_key_exists('Config', $data) && null !== $data['Config']) { $values = []; - foreach ($data->{'Config'} as $value) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($value as $key => $value_1) { - $values_1[$key] = $value_1; - } - $values[] = $values_1; + foreach ($data['Config'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\IPAMConfig::class, 'json', $context); } $object->setConfig($values); + unset($data['Config']); + } elseif (\array_key_exists('Config', $data) && null === $data['Config']) { + $object->setConfig(null); + } + if (\array_key_exists('Options', $data) && null !== $data['Options']) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Options'] as $key => $value_1) { + $values_1[$key] = $value_1; + } + $object->setOptions($values_1); + unset($data['Options']); + } elseif (\array_key_exists('Options', $data) && null === $data['Options']) { + $object->setOptions(null); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { - $values_2 = []; - foreach ($data->{'Options'} as $value_2) { - $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($value_2 as $key_1 => $value_3) { - $values_3[$key_1] = $value_3; - } - $values_2[] = $values_3; + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; } - $object->setOptions($values_2); } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); + $dataArray = []; + if ($data->isInitialized('driver') && null !== $data->getDriver()) { + $dataArray['Driver'] = $data->getDriver(); } - if (null !== $object->getConfig()) { + if ($data->isInitialized('config') && null !== $data->getConfig()) { $values = []; - foreach ($object->getConfig() as $value) { - $values_1 = new \stdClass(); - foreach ($value as $key => $value_1) { - $values_1->{$key} = $value_1; - } - $values[] = $values_1; + foreach ($data->getConfig() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'Config'} = $values; + $dataArray['Config'] = $values; } - if (null !== $object->getOptions()) { - $values_2 = []; - foreach ($object->getOptions() as $value_2) { - $values_3 = new \stdClass(); - foreach ($value_2 as $key_1 => $value_3) { - $values_3->{$key_1} = $value_3; - } - $values_2[] = $values_3; + if ($data->isInitialized('options') && null !== $data->getOptions()) { + $values_1 = []; + foreach ($data->getOptions() as $key => $value_1) { + $values_1[$key] = $value_1; + } + $dataArray['Options'] = $values_1; + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_2; } - $data->{'Options'} = $values_2; } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\IPAM::class => false]; } } diff --git a/src/Normalizer/IdResponseNormalizer.php b/src/Normalizer/IdResponseNormalizer.php index 1b185197..eb44ba36 100644 --- a/src/Normalizer/IdResponseNormalizer.php +++ b/src/Normalizer/IdResponseNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,39 +16,63 @@ class IdResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\IdResponse'; + return \Docker\API\Model\IdResponse::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\IdResponse; + return \is_object($data) && \Docker\API\Model\IdResponse::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\IdResponse(); - if (property_exists($data, 'Id') && $data->{'Id'} !== null) { - $object->setId($data->{'Id'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && null !== $data['Id']) { + $object->setId($data['Id']); + unset($data['Id']); + } elseif (\array_key_exists('Id', $data) && null === $data['Id']) { + $object->setId(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); + $dataArray = []; + $dataArray['Id'] = $data->getId(); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\IdResponse::class => false]; } } diff --git a/src/Normalizer/ImageDeleteResponseItemNormalizer.php b/src/Normalizer/ImageDeleteResponseItemNormalizer.php index f3592462..f68fdf9a 100644 --- a/src/Normalizer/ImageDeleteResponseItemNormalizer.php +++ b/src/Normalizer/ImageDeleteResponseItemNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class ImageDeleteResponseItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ImageDeleteResponseItem'; + return \Docker\API\Model\ImageDeleteResponseItem::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ImageDeleteResponseItem; + return \is_object($data) && \Docker\API\Model\ImageDeleteResponseItem::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ImageDeleteResponseItem(); - if (property_exists($data, 'Untagged') && $data->{'Untagged'} !== null) { - $object->setUntagged($data->{'Untagged'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Untagged', $data) && null !== $data['Untagged']) { + $object->setUntagged($data['Untagged']); + unset($data['Untagged']); + } elseif (\array_key_exists('Untagged', $data) && null === $data['Untagged']) { + $object->setUntagged(null); + } + if (\array_key_exists('Deleted', $data) && null !== $data['Deleted']) { + $object->setDeleted($data['Deleted']); + unset($data['Deleted']); + } elseif (\array_key_exists('Deleted', $data) && null === $data['Deleted']) { + $object->setDeleted(null); } - if (property_exists($data, 'Deleted') && $data->{'Deleted'} !== null) { - $object->setDeleted($data->{'Deleted'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getUntagged()) { - $data->{'Untagged'} = $object->getUntagged(); + $dataArray = []; + if ($data->isInitialized('untagged') && null !== $data->getUntagged()) { + $dataArray['Untagged'] = $data->getUntagged(); } - if (null !== $object->getDeleted()) { - $data->{'Deleted'} = $object->getDeleted(); + if ($data->isInitialized('deleted') && null !== $data->getDeleted()) { + $dataArray['Deleted'] = $data->getDeleted(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageDeleteResponseItem::class => false]; } } diff --git a/src/Normalizer/ImageIDNormalizer.php b/src/Normalizer/ImageIDNormalizer.php index 9bd6d9b5..0136eb38 100644 --- a/src/Normalizer/ImageIDNormalizer.php +++ b/src/Normalizer/ImageIDNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,39 +16,65 @@ class ImageIDNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ImageID'; + return \Docker\API\Model\ImageID::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ImageID; + return \is_object($data) && \Docker\API\Model\ImageID::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ImageID(); - if (property_exists($data, 'ID') && $data->{'ID'} !== null) { - $object->setID($data->{'ID'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && null !== $data['ID']) { + $object->setID($data['ID']); + unset($data['ID']); + } elseif (\array_key_exists('ID', $data) && null === $data['ID']) { + $object->setID(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $dataArray = []; + if ($data->isInitialized('iD') && null !== $data->getID()) { + $dataArray['ID'] = $data->getID(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageID::class => false]; } } diff --git a/src/Normalizer/ImageInspectMetadataNormalizer.php b/src/Normalizer/ImageInspectMetadataNormalizer.php new file mode 100644 index 00000000..278ec358 --- /dev/null +++ b/src/Normalizer/ImageInspectMetadataNormalizer.php @@ -0,0 +1,80 @@ +setLastTagTime($data['LastTagTime']); + unset($data['LastTagTime']); + } elseif (\array_key_exists('LastTagTime', $data) && null === $data['LastTagTime']) { + $object->setLastTagTime(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('lastTagTime') && null !== $data->getLastTagTime()) { + $dataArray['LastTagTime'] = $data->getLastTagTime(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageInspectMetadata::class => false]; + } +} diff --git a/src/Normalizer/ImageInspectNormalizer.php b/src/Normalizer/ImageInspectNormalizer.php new file mode 100644 index 00000000..2a4589ab --- /dev/null +++ b/src/Normalizer/ImageInspectNormalizer.php @@ -0,0 +1,267 @@ +setId($data['Id']); + unset($data['Id']); + } elseif (\array_key_exists('Id', $data) && null === $data['Id']) { + $object->setId(null); + } + if (\array_key_exists('RepoTags', $data) && null !== $data['RepoTags']) { + $values = []; + foreach ($data['RepoTags'] as $value) { + $values[] = $value; + } + $object->setRepoTags($values); + unset($data['RepoTags']); + } elseif (\array_key_exists('RepoTags', $data) && null === $data['RepoTags']) { + $object->setRepoTags(null); + } + if (\array_key_exists('RepoDigests', $data) && null !== $data['RepoDigests']) { + $values_1 = []; + foreach ($data['RepoDigests'] as $value_1) { + $values_1[] = $value_1; + } + $object->setRepoDigests($values_1); + unset($data['RepoDigests']); + } elseif (\array_key_exists('RepoDigests', $data) && null === $data['RepoDigests']) { + $object->setRepoDigests(null); + } + if (\array_key_exists('Parent', $data) && null !== $data['Parent']) { + $object->setParent($data['Parent']); + unset($data['Parent']); + } elseif (\array_key_exists('Parent', $data) && null === $data['Parent']) { + $object->setParent(null); + } + if (\array_key_exists('Comment', $data) && null !== $data['Comment']) { + $object->setComment($data['Comment']); + unset($data['Comment']); + } elseif (\array_key_exists('Comment', $data) && null === $data['Comment']) { + $object->setComment(null); + } + if (\array_key_exists('Created', $data) && null !== $data['Created']) { + $object->setCreated($data['Created']); + unset($data['Created']); + } elseif (\array_key_exists('Created', $data) && null === $data['Created']) { + $object->setCreated(null); + } + if (\array_key_exists('Container', $data) && null !== $data['Container']) { + $object->setContainer($data['Container']); + unset($data['Container']); + } elseif (\array_key_exists('Container', $data) && null === $data['Container']) { + $object->setContainer(null); + } + if (\array_key_exists('ContainerConfig', $data) && null !== $data['ContainerConfig']) { + $object->setContainerConfig($this->denormalizer->denormalize($data['ContainerConfig'], \Docker\API\Model\ContainerConfig::class, 'json', $context)); + unset($data['ContainerConfig']); + } elseif (\array_key_exists('ContainerConfig', $data) && null === $data['ContainerConfig']) { + $object->setContainerConfig(null); + } + if (\array_key_exists('DockerVersion', $data) && null !== $data['DockerVersion']) { + $object->setDockerVersion($data['DockerVersion']); + unset($data['DockerVersion']); + } elseif (\array_key_exists('DockerVersion', $data) && null === $data['DockerVersion']) { + $object->setDockerVersion(null); + } + if (\array_key_exists('Author', $data) && null !== $data['Author']) { + $object->setAuthor($data['Author']); + unset($data['Author']); + } elseif (\array_key_exists('Author', $data) && null === $data['Author']) { + $object->setAuthor(null); + } + if (\array_key_exists('Config', $data) && null !== $data['Config']) { + $object->setConfig($this->denormalizer->denormalize($data['Config'], \Docker\API\Model\ContainerConfig::class, 'json', $context)); + unset($data['Config']); + } elseif (\array_key_exists('Config', $data) && null === $data['Config']) { + $object->setConfig(null); + } + if (\array_key_exists('Architecture', $data) && null !== $data['Architecture']) { + $object->setArchitecture($data['Architecture']); + unset($data['Architecture']); + } elseif (\array_key_exists('Architecture', $data) && null === $data['Architecture']) { + $object->setArchitecture(null); + } + if (\array_key_exists('Variant', $data) && null !== $data['Variant']) { + $object->setVariant($data['Variant']); + unset($data['Variant']); + } elseif (\array_key_exists('Variant', $data) && null === $data['Variant']) { + $object->setVariant(null); + } + if (\array_key_exists('Os', $data) && null !== $data['Os']) { + $object->setOs($data['Os']); + unset($data['Os']); + } elseif (\array_key_exists('Os', $data) && null === $data['Os']) { + $object->setOs(null); + } + if (\array_key_exists('OsVersion', $data) && null !== $data['OsVersion']) { + $object->setOsVersion($data['OsVersion']); + unset($data['OsVersion']); + } elseif (\array_key_exists('OsVersion', $data) && null === $data['OsVersion']) { + $object->setOsVersion(null); + } + if (\array_key_exists('Size', $data) && null !== $data['Size']) { + $object->setSize($data['Size']); + unset($data['Size']); + } elseif (\array_key_exists('Size', $data) && null === $data['Size']) { + $object->setSize(null); + } + if (\array_key_exists('VirtualSize', $data) && null !== $data['VirtualSize']) { + $object->setVirtualSize($data['VirtualSize']); + unset($data['VirtualSize']); + } elseif (\array_key_exists('VirtualSize', $data) && null === $data['VirtualSize']) { + $object->setVirtualSize(null); + } + if (\array_key_exists('GraphDriver', $data) && null !== $data['GraphDriver']) { + $object->setGraphDriver($this->denormalizer->denormalize($data['GraphDriver'], \Docker\API\Model\GraphDriverData::class, 'json', $context)); + unset($data['GraphDriver']); + } elseif (\array_key_exists('GraphDriver', $data) && null === $data['GraphDriver']) { + $object->setGraphDriver(null); + } + if (\array_key_exists('RootFS', $data) && null !== $data['RootFS']) { + $object->setRootFS($this->denormalizer->denormalize($data['RootFS'], \Docker\API\Model\ImageInspectRootFS::class, 'json', $context)); + unset($data['RootFS']); + } elseif (\array_key_exists('RootFS', $data) && null === $data['RootFS']) { + $object->setRootFS(null); + } + if (\array_key_exists('Metadata', $data) && null !== $data['Metadata']) { + $object->setMetadata($this->denormalizer->denormalize($data['Metadata'], \Docker\API\Model\ImageInspectMetadata::class, 'json', $context)); + unset($data['Metadata']); + } elseif (\array_key_exists('Metadata', $data) && null === $data['Metadata']) { + $object->setMetadata(null); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('id') && null !== $data->getId()) { + $dataArray['Id'] = $data->getId(); + } + if ($data->isInitialized('repoTags') && null !== $data->getRepoTags()) { + $values = []; + foreach ($data->getRepoTags() as $value) { + $values[] = $value; + } + $dataArray['RepoTags'] = $values; + } + if ($data->isInitialized('repoDigests') && null !== $data->getRepoDigests()) { + $values_1 = []; + foreach ($data->getRepoDigests() as $value_1) { + $values_1[] = $value_1; + } + $dataArray['RepoDigests'] = $values_1; + } + if ($data->isInitialized('parent') && null !== $data->getParent()) { + $dataArray['Parent'] = $data->getParent(); + } + if ($data->isInitialized('comment') && null !== $data->getComment()) { + $dataArray['Comment'] = $data->getComment(); + } + if ($data->isInitialized('created') && null !== $data->getCreated()) { + $dataArray['Created'] = $data->getCreated(); + } + if ($data->isInitialized('container') && null !== $data->getContainer()) { + $dataArray['Container'] = $data->getContainer(); + } + if ($data->isInitialized('containerConfig') && null !== $data->getContainerConfig()) { + $dataArray['ContainerConfig'] = $this->normalizer->normalize($data->getContainerConfig(), 'json', $context); + } + if ($data->isInitialized('dockerVersion') && null !== $data->getDockerVersion()) { + $dataArray['DockerVersion'] = $data->getDockerVersion(); + } + if ($data->isInitialized('author') && null !== $data->getAuthor()) { + $dataArray['Author'] = $data->getAuthor(); + } + if ($data->isInitialized('config') && null !== $data->getConfig()) { + $dataArray['Config'] = $this->normalizer->normalize($data->getConfig(), 'json', $context); + } + if ($data->isInitialized('architecture') && null !== $data->getArchitecture()) { + $dataArray['Architecture'] = $data->getArchitecture(); + } + if ($data->isInitialized('variant') && null !== $data->getVariant()) { + $dataArray['Variant'] = $data->getVariant(); + } + if ($data->isInitialized('os') && null !== $data->getOs()) { + $dataArray['Os'] = $data->getOs(); + } + if ($data->isInitialized('osVersion') && null !== $data->getOsVersion()) { + $dataArray['OsVersion'] = $data->getOsVersion(); + } + if ($data->isInitialized('size') && null !== $data->getSize()) { + $dataArray['Size'] = $data->getSize(); + } + if ($data->isInitialized('virtualSize') && null !== $data->getVirtualSize()) { + $dataArray['VirtualSize'] = $data->getVirtualSize(); + } + if ($data->isInitialized('graphDriver') && null !== $data->getGraphDriver()) { + $dataArray['GraphDriver'] = $this->normalizer->normalize($data->getGraphDriver(), 'json', $context); + } + if ($data->isInitialized('rootFS') && null !== $data->getRootFS()) { + $dataArray['RootFS'] = $this->normalizer->normalize($data->getRootFS(), 'json', $context); + } + if ($data->isInitialized('metadata') && null !== $data->getMetadata()) { + $dataArray['Metadata'] = $this->normalizer->normalize($data->getMetadata(), 'json', $context); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_2; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageInspect::class => false]; + } +} diff --git a/src/Normalizer/ImageInspectRootFSNormalizer.php b/src/Normalizer/ImageInspectRootFSNormalizer.php new file mode 100644 index 00000000..6bfa8e6a --- /dev/null +++ b/src/Normalizer/ImageInspectRootFSNormalizer.php @@ -0,0 +1,95 @@ +setType($data['Type']); + unset($data['Type']); + } elseif (\array_key_exists('Type', $data) && null === $data['Type']) { + $object->setType(null); + } + if (\array_key_exists('Layers', $data) && null !== $data['Layers']) { + $values = []; + foreach ($data['Layers'] as $value) { + $values[] = $value; + } + $object->setLayers($values); + unset($data['Layers']); + } elseif (\array_key_exists('Layers', $data) && null === $data['Layers']) { + $object->setLayers(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + $dataArray['Type'] = $data->getType(); + if ($data->isInitialized('layers') && null !== $data->getLayers()) { + $values = []; + foreach ($data->getLayers() as $value) { + $values[] = $value; + } + $dataArray['Layers'] = $values; + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageInspectRootFS::class => false]; + } +} diff --git a/src/Normalizer/ImageMetadataNormalizer.php b/src/Normalizer/ImageMetadataNormalizer.php deleted file mode 100644 index b641670c..00000000 --- a/src/Normalizer/ImageMetadataNormalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -{'LastTagTime'} !== null) { - $object->setLastTagTime($data->{'LastTagTime'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getLastTagTime()) { - $data->{'LastTagTime'} = $object->getLastTagTime(); - } - - return $data; - } -} diff --git a/src/Normalizer/ImageNormalizer.php b/src/Normalizer/ImageNormalizer.php deleted file mode 100644 index 35c7ed01..00000000 --- a/src/Normalizer/ImageNormalizer.php +++ /dev/null @@ -1,181 +0,0 @@ -{'Id'} !== null) { - $object->setId($data->{'Id'}); - } - if (property_exists($data, 'RepoTags') && $data->{'RepoTags'} !== null) { - $values = []; - foreach ($data->{'RepoTags'} as $value) { - $values[] = $value; - } - $object->setRepoTags($values); - } - if (property_exists($data, 'RepoDigests') && $data->{'RepoDigests'} !== null) { - $values_1 = []; - foreach ($data->{'RepoDigests'} as $value_1) { - $values_1[] = $value_1; - } - $object->setRepoDigests($values_1); - } - if (property_exists($data, 'Parent') && $data->{'Parent'} !== null) { - $object->setParent($data->{'Parent'}); - } - if (property_exists($data, 'Comment') && $data->{'Comment'} !== null) { - $object->setComment($data->{'Comment'}); - } - if (property_exists($data, 'Created') && $data->{'Created'} !== null) { - $object->setCreated($data->{'Created'}); - } - if (property_exists($data, 'Container') && $data->{'Container'} !== null) { - $object->setContainer($data->{'Container'}); - } - if (property_exists($data, 'ContainerConfig') && $data->{'ContainerConfig'} !== null) { - $object->setContainerConfig($this->denormalizer->denormalize($data->{'ContainerConfig'}, 'Docker\\API\\Model\\ContainerConfig', 'json', $context)); - } - if (property_exists($data, 'DockerVersion') && $data->{'DockerVersion'} !== null) { - $object->setDockerVersion($data->{'DockerVersion'}); - } - if (property_exists($data, 'Author') && $data->{'Author'} !== null) { - $object->setAuthor($data->{'Author'}); - } - if (property_exists($data, 'Config') && $data->{'Config'} !== null) { - $object->setConfig($this->denormalizer->denormalize($data->{'Config'}, 'Docker\\API\\Model\\ContainerConfig', 'json', $context)); - } - if (property_exists($data, 'Architecture') && $data->{'Architecture'} !== null) { - $object->setArchitecture($data->{'Architecture'}); - } - if (property_exists($data, 'Os') && $data->{'Os'} !== null) { - $object->setOs($data->{'Os'}); - } - if (property_exists($data, 'OsVersion') && $data->{'OsVersion'} !== null) { - $object->setOsVersion($data->{'OsVersion'}); - } - if (property_exists($data, 'Size') && $data->{'Size'} !== null) { - $object->setSize($data->{'Size'}); - } - if (property_exists($data, 'VirtualSize') && $data->{'VirtualSize'} !== null) { - $object->setVirtualSize($data->{'VirtualSize'}); - } - if (property_exists($data, 'GraphDriver') && $data->{'GraphDriver'} !== null) { - $object->setGraphDriver($this->denormalizer->denormalize($data->{'GraphDriver'}, 'Docker\\API\\Model\\GraphDriverData', 'json', $context)); - } - if (property_exists($data, 'RootFS') && $data->{'RootFS'} !== null) { - $object->setRootFS($this->denormalizer->denormalize($data->{'RootFS'}, 'Docker\\API\\Model\\ImageRootFS', 'json', $context)); - } - if (property_exists($data, 'Metadata') && $data->{'Metadata'} !== null) { - $object->setMetadata($this->denormalizer->denormalize($data->{'Metadata'}, 'Docker\\API\\Model\\ImageMetadata', 'json', $context)); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - if (null !== $object->getRepoTags()) { - $values = []; - foreach ($object->getRepoTags() as $value) { - $values[] = $value; - } - $data->{'RepoTags'} = $values; - } - if (null !== $object->getRepoDigests()) { - $values_1 = []; - foreach ($object->getRepoDigests() as $value_1) { - $values_1[] = $value_1; - } - $data->{'RepoDigests'} = $values_1; - } - if (null !== $object->getParent()) { - $data->{'Parent'} = $object->getParent(); - } - if (null !== $object->getComment()) { - $data->{'Comment'} = $object->getComment(); - } - if (null !== $object->getCreated()) { - $data->{'Created'} = $object->getCreated(); - } - if (null !== $object->getContainer()) { - $data->{'Container'} = $object->getContainer(); - } - if (null !== $object->getContainerConfig()) { - $data->{'ContainerConfig'} = $this->normalizer->normalize($object->getContainerConfig(), 'json', $context); - } - if (null !== $object->getDockerVersion()) { - $data->{'DockerVersion'} = $object->getDockerVersion(); - } - if (null !== $object->getAuthor()) { - $data->{'Author'} = $object->getAuthor(); - } - if (null !== $object->getConfig()) { - $data->{'Config'} = $this->normalizer->normalize($object->getConfig(), 'json', $context); - } - if (null !== $object->getArchitecture()) { - $data->{'Architecture'} = $object->getArchitecture(); - } - if (null !== $object->getOs()) { - $data->{'Os'} = $object->getOs(); - } - if (null !== $object->getOsVersion()) { - $data->{'OsVersion'} = $object->getOsVersion(); - } - if (null !== $object->getSize()) { - $data->{'Size'} = $object->getSize(); - } - if (null !== $object->getVirtualSize()) { - $data->{'VirtualSize'} = $object->getVirtualSize(); - } - if (null !== $object->getGraphDriver()) { - $data->{'GraphDriver'} = $this->normalizer->normalize($object->getGraphDriver(), 'json', $context); - } - if (null !== $object->getRootFS()) { - $data->{'RootFS'} = $this->normalizer->normalize($object->getRootFS(), 'json', $context); - } - if (null !== $object->getMetadata()) { - $data->{'Metadata'} = $this->normalizer->normalize($object->getMetadata(), 'json', $context); - } - - return $data; - } -} diff --git a/src/Normalizer/ImageRootFSNormalizer.php b/src/Normalizer/ImageRootFSNormalizer.php deleted file mode 100644 index 75074971..00000000 --- a/src/Normalizer/ImageRootFSNormalizer.php +++ /dev/null @@ -1,77 +0,0 @@ -{'Type'} !== null) { - $object->setType($data->{'Type'}); - } - if (property_exists($data, 'Layers') && $data->{'Layers'} !== null) { - $values = []; - foreach ($data->{'Layers'} as $value) { - $values[] = $value; - } - $object->setLayers($values); - } - if (property_exists($data, 'BaseLayer') && $data->{'BaseLayer'} !== null) { - $object->setBaseLayer($data->{'BaseLayer'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); - } - if (null !== $object->getLayers()) { - $values = []; - foreach ($object->getLayers() as $value) { - $values[] = $value; - } - $data->{'Layers'} = $values; - } - if (null !== $object->getBaseLayer()) { - $data->{'BaseLayer'} = $object->getBaseLayer(); - } - - return $data; - } -} diff --git a/src/Normalizer/ImageSummaryNormalizer.php b/src/Normalizer/ImageSummaryNormalizer.php index 82706799..c859b864 100644 --- a/src/Normalizer/ImageSummaryNormalizer.php +++ b/src/Normalizer/ImageSummaryNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,117 +16,152 @@ class ImageSummaryNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ImageSummary'; + return \Docker\API\Model\ImageSummary::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ImageSummary; + return \is_object($data) && \Docker\API\Model\ImageSummary::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\ImageSummary(); - if (property_exists($data, 'Id') && $data->{'Id'} !== null) { - $object->setId($data->{'Id'}); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'ParentId') && $data->{'ParentId'} !== null) { - $object->setParentId($data->{'ParentId'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'RepoTags') && $data->{'RepoTags'} !== null) { + $object = new \Docker\API\Model\ImageSummary(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && null !== $data['Id']) { + $object->setId($data['Id']); + unset($data['Id']); + } elseif (\array_key_exists('Id', $data) && null === $data['Id']) { + $object->setId(null); + } + if (\array_key_exists('ParentId', $data) && null !== $data['ParentId']) { + $object->setParentId($data['ParentId']); + unset($data['ParentId']); + } elseif (\array_key_exists('ParentId', $data) && null === $data['ParentId']) { + $object->setParentId(null); + } + if (\array_key_exists('RepoTags', $data) && null !== $data['RepoTags']) { $values = []; - foreach ($data->{'RepoTags'} as $value) { + foreach ($data['RepoTags'] as $value) { $values[] = $value; } $object->setRepoTags($values); + unset($data['RepoTags']); + } elseif (\array_key_exists('RepoTags', $data) && null === $data['RepoTags']) { + $object->setRepoTags(null); } - if (property_exists($data, 'RepoDigests') && $data->{'RepoDigests'} !== null) { + if (\array_key_exists('RepoDigests', $data) && null !== $data['RepoDigests']) { $values_1 = []; - foreach ($data->{'RepoDigests'} as $value_1) { + foreach ($data['RepoDigests'] as $value_1) { $values_1[] = $value_1; } $object->setRepoDigests($values_1); - } - if (property_exists($data, 'Created') && $data->{'Created'} !== null) { - $object->setCreated($data->{'Created'}); - } - if (property_exists($data, 'Size') && $data->{'Size'} !== null) { - $object->setSize($data->{'Size'}); - } - if (property_exists($data, 'SharedSize') && $data->{'SharedSize'} !== null) { - $object->setSharedSize($data->{'SharedSize'}); - } - if (property_exists($data, 'VirtualSize') && $data->{'VirtualSize'} !== null) { - $object->setVirtualSize($data->{'VirtualSize'}); - } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + unset($data['RepoDigests']); + } elseif (\array_key_exists('RepoDigests', $data) && null === $data['RepoDigests']) { + $object->setRepoDigests(null); + } + if (\array_key_exists('Created', $data) && null !== $data['Created']) { + $object->setCreated($data['Created']); + unset($data['Created']); + } elseif (\array_key_exists('Created', $data) && null === $data['Created']) { + $object->setCreated(null); + } + if (\array_key_exists('Size', $data) && null !== $data['Size']) { + $object->setSize($data['Size']); + unset($data['Size']); + } elseif (\array_key_exists('Size', $data) && null === $data['Size']) { + $object->setSize(null); + } + if (\array_key_exists('SharedSize', $data) && null !== $data['SharedSize']) { + $object->setSharedSize($data['SharedSize']); + unset($data['SharedSize']); + } elseif (\array_key_exists('SharedSize', $data) && null === $data['SharedSize']) { + $object->setSharedSize(null); + } + if (\array_key_exists('VirtualSize', $data) && null !== $data['VirtualSize']) { + $object->setVirtualSize($data['VirtualSize']); + unset($data['VirtualSize']); + } elseif (\array_key_exists('VirtualSize', $data) && null === $data['VirtualSize']) { + $object->setVirtualSize(null); + } + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value_2) { + foreach ($data['Labels'] as $key => $value_2) { $values_2[$key] = $value_2; } $object->setLabels($values_2); - } - if (property_exists($data, 'Containers') && $data->{'Containers'} !== null) { - $object->setContainers($data->{'Containers'}); + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + if (\array_key_exists('Containers', $data) && null !== $data['Containers']) { + $object->setContainers($data['Containers']); + unset($data['Containers']); + } elseif (\array_key_exists('Containers', $data) && null === $data['Containers']) { + $object->setContainers(null); + } + foreach ($data as $key_1 => $value_3) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_3; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - if (null !== $object->getParentId()) { - $data->{'ParentId'} = $object->getParentId(); - } - if (null !== $object->getRepoTags()) { - $values = []; - foreach ($object->getRepoTags() as $value) { - $values[] = $value; + $dataArray = []; + $dataArray['Id'] = $data->getId(); + $dataArray['ParentId'] = $data->getParentId(); + $values = []; + foreach ($data->getRepoTags() as $value) { + $values[] = $value; + } + $dataArray['RepoTags'] = $values; + $values_1 = []; + foreach ($data->getRepoDigests() as $value_1) { + $values_1[] = $value_1; + } + $dataArray['RepoDigests'] = $values_1; + $dataArray['Created'] = $data->getCreated(); + $dataArray['Size'] = $data->getSize(); + $dataArray['SharedSize'] = $data->getSharedSize(); + if ($data->isInitialized('virtualSize') && null !== $data->getVirtualSize()) { + $dataArray['VirtualSize'] = $data->getVirtualSize(); + } + $values_2 = []; + foreach ($data->getLabels() as $key => $value_2) { + $values_2[$key] = $value_2; + } + $dataArray['Labels'] = $values_2; + $dataArray['Containers'] = $data->getContainers(); + foreach ($data as $key_1 => $value_3) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_3; } - $data->{'RepoTags'} = $values; - } - if (null !== $object->getRepoDigests()) { - $values_1 = []; - foreach ($object->getRepoDigests() as $value_1) { - $values_1[] = $value_1; - } - $data->{'RepoDigests'} = $values_1; - } - if (null !== $object->getCreated()) { - $data->{'Created'} = $object->getCreated(); - } - if (null !== $object->getSize()) { - $data->{'Size'} = $object->getSize(); - } - if (null !== $object->getSharedSize()) { - $data->{'SharedSize'} = $object->getSharedSize(); - } - if (null !== $object->getVirtualSize()) { - $data->{'VirtualSize'} = $object->getVirtualSize(); - } - if (null !== $object->getLabels()) { - $values_2 = new \stdClass(); - foreach ($object->getLabels() as $key => $value_2) { - $values_2->{$key} = $value_2; - } - $data->{'Labels'} = $values_2; - } - if (null !== $object->getContainers()) { - $data->{'Containers'} = $object->getContainers(); } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImageSummary::class => false]; } } diff --git a/src/Normalizer/ImagesNameHistoryGetResponse200ItemNormalizer.php b/src/Normalizer/ImagesNameHistoryGetResponse200ItemNormalizer.php index 4dbeb964..8a508772 100644 --- a/src/Normalizer/ImagesNameHistoryGetResponse200ItemNormalizer.php +++ b/src/Normalizer/ImagesNameHistoryGetResponse200ItemNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,77 +16,106 @@ class ImagesNameHistoryGetResponse200ItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ImagesNameHistoryGetResponse200Item'; + return \Docker\API\Model\ImagesNameHistoryGetResponse200Item::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ImagesNameHistoryGetResponse200Item; + return \is_object($data) && \Docker\API\Model\ImagesNameHistoryGetResponse200Item::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ImagesNameHistoryGetResponse200Item(); - if (property_exists($data, 'Id') && $data->{'Id'} !== null) { - $object->setId($data->{'Id'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Created') && $data->{'Created'} !== null) { - $object->setCreated($data->{'Created'}); + if (\array_key_exists('Id', $data) && null !== $data['Id']) { + $object->setId($data['Id']); + unset($data['Id']); + } elseif (\array_key_exists('Id', $data) && null === $data['Id']) { + $object->setId(null); } - if (property_exists($data, 'CreatedBy') && $data->{'CreatedBy'} !== null) { - $object->setCreatedBy($data->{'CreatedBy'}); + if (\array_key_exists('Created', $data) && null !== $data['Created']) { + $object->setCreated($data['Created']); + unset($data['Created']); + } elseif (\array_key_exists('Created', $data) && null === $data['Created']) { + $object->setCreated(null); } - if (property_exists($data, 'Tags') && $data->{'Tags'} !== null) { + if (\array_key_exists('CreatedBy', $data) && null !== $data['CreatedBy']) { + $object->setCreatedBy($data['CreatedBy']); + unset($data['CreatedBy']); + } elseif (\array_key_exists('CreatedBy', $data) && null === $data['CreatedBy']) { + $object->setCreatedBy(null); + } + if (\array_key_exists('Tags', $data) && null !== $data['Tags']) { $values = []; - foreach ($data->{'Tags'} as $value) { + foreach ($data['Tags'] as $value) { $values[] = $value; } $object->setTags($values); + unset($data['Tags']); + } elseif (\array_key_exists('Tags', $data) && null === $data['Tags']) { + $object->setTags(null); } - if (property_exists($data, 'Size') && $data->{'Size'} !== null) { - $object->setSize($data->{'Size'}); + if (\array_key_exists('Size', $data) && null !== $data['Size']) { + $object->setSize($data['Size']); + unset($data['Size']); + } elseif (\array_key_exists('Size', $data) && null === $data['Size']) { + $object->setSize(null); } - if (property_exists($data, 'Comment') && $data->{'Comment'} !== null) { - $object->setComment($data->{'Comment'}); + if (\array_key_exists('Comment', $data) && null !== $data['Comment']) { + $object->setComment($data['Comment']); + unset($data['Comment']); + } elseif (\array_key_exists('Comment', $data) && null === $data['Comment']) { + $object->setComment(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - if (null !== $object->getCreated()) { - $data->{'Created'} = $object->getCreated(); - } - if (null !== $object->getCreatedBy()) { - $data->{'CreatedBy'} = $object->getCreatedBy(); + $dataArray = []; + $dataArray['Id'] = $data->getId(); + $dataArray['Created'] = $data->getCreated(); + $dataArray['CreatedBy'] = $data->getCreatedBy(); + $values = []; + foreach ($data->getTags() as $value) { + $values[] = $value; } - if (null !== $object->getTags()) { - $values = []; - foreach ($object->getTags() as $value) { - $values[] = $value; + $dataArray['Tags'] = $values; + $dataArray['Size'] = $data->getSize(); + $dataArray['Comment'] = $data->getComment(); + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; } - $data->{'Tags'} = $values; - } - if (null !== $object->getSize()) { - $data->{'Size'} = $object->getSize(); - } - if (null !== $object->getComment()) { - $data->{'Comment'} = $object->getComment(); } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImagesNameHistoryGetResponse200Item::class => false]; } } diff --git a/src/Normalizer/ImagesPrunePostResponse200Normalizer.php b/src/Normalizer/ImagesPrunePostResponse200Normalizer.php index 11ea6825..5f8ab525 100644 --- a/src/Normalizer/ImagesPrunePostResponse200Normalizer.php +++ b/src/Normalizer/ImagesPrunePostResponse200Normalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,53 +16,82 @@ class ImagesPrunePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ImagesPrunePostResponse200'; + return \Docker\API\Model\ImagesPrunePostResponse200::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ImagesPrunePostResponse200; + return \is_object($data) && \Docker\API\Model\ImagesPrunePostResponse200::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ImagesPrunePostResponse200(); - if (property_exists($data, 'ImagesDeleted') && $data->{'ImagesDeleted'} !== null) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ImagesDeleted', $data) && null !== $data['ImagesDeleted']) { $values = []; - foreach ($data->{'ImagesDeleted'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\ImageDeleteResponseItem', 'json', $context); + foreach ($data['ImagesDeleted'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ImageDeleteResponseItem::class, 'json', $context); } $object->setImagesDeleted($values); + unset($data['ImagesDeleted']); + } elseif (\array_key_exists('ImagesDeleted', $data) && null === $data['ImagesDeleted']) { + $object->setImagesDeleted(null); } - if (property_exists($data, 'SpaceReclaimed') && $data->{'SpaceReclaimed'} !== null) { - $object->setSpaceReclaimed($data->{'SpaceReclaimed'}); + if (\array_key_exists('SpaceReclaimed', $data) && null !== $data['SpaceReclaimed']) { + $object->setSpaceReclaimed($data['SpaceReclaimed']); + unset($data['SpaceReclaimed']); + } elseif (\array_key_exists('SpaceReclaimed', $data) && null === $data['SpaceReclaimed']) { + $object->setSpaceReclaimed(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getImagesDeleted()) { + $dataArray = []; + if ($data->isInitialized('imagesDeleted') && null !== $data->getImagesDeleted()) { $values = []; - foreach ($object->getImagesDeleted() as $value) { + foreach ($data->getImagesDeleted() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'ImagesDeleted'} = $values; + $dataArray['ImagesDeleted'] = $values; } - if (null !== $object->getSpaceReclaimed()) { - $data->{'SpaceReclaimed'} = $object->getSpaceReclaimed(); + if ($data->isInitialized('spaceReclaimed') && null !== $data->getSpaceReclaimed()) { + $dataArray['SpaceReclaimed'] = $data->getSpaceReclaimed(); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImagesPrunePostResponse200::class => false]; } } diff --git a/src/Normalizer/ImagesSearchGetResponse200ItemNormalizer.php b/src/Normalizer/ImagesSearchGetResponse200ItemNormalizer.php index df4cef7f..f9ae204b 100644 --- a/src/Normalizer/ImagesSearchGetResponse200ItemNormalizer.php +++ b/src/Normalizer/ImagesSearchGetResponse200ItemNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,63 +16,107 @@ class ImagesSearchGetResponse200ItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ImagesSearchGetResponse200Item'; + return \Docker\API\Model\ImagesSearchGetResponse200Item::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ImagesSearchGetResponse200Item; + return \is_object($data) && \Docker\API\Model\ImagesSearchGetResponse200Item::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ImagesSearchGetResponse200Item(); - if (property_exists($data, 'description') && $data->{'description'} !== null) { - $object->setDescription($data->{'description'}); + if (\array_key_exists('is_official', $data) && \is_int($data['is_official'])) { + $data['is_official'] = (bool) $data['is_official']; + } + if (\array_key_exists('is_automated', $data) && \is_int($data['is_automated'])) { + $data['is_automated'] = (bool) $data['is_automated']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('description', $data) && null !== $data['description']) { + $object->setDescription($data['description']); + unset($data['description']); + } elseif (\array_key_exists('description', $data) && null === $data['description']) { + $object->setDescription(null); } - if (property_exists($data, 'is_official') && $data->{'is_official'} !== null) { - $object->setIsOfficial($data->{'is_official'}); + if (\array_key_exists('is_official', $data) && null !== $data['is_official']) { + $object->setIsOfficial($data['is_official']); + unset($data['is_official']); + } elseif (\array_key_exists('is_official', $data) && null === $data['is_official']) { + $object->setIsOfficial(null); } - if (property_exists($data, 'is_automated') && $data->{'is_automated'} !== null) { - $object->setIsAutomated($data->{'is_automated'}); + if (\array_key_exists('is_automated', $data) && null !== $data['is_automated']) { + $object->setIsAutomated($data['is_automated']); + unset($data['is_automated']); + } elseif (\array_key_exists('is_automated', $data) && null === $data['is_automated']) { + $object->setIsAutomated(null); } - if (property_exists($data, 'name') && $data->{'name'} !== null) { - $object->setName($data->{'name'}); + if (\array_key_exists('name', $data) && null !== $data['name']) { + $object->setName($data['name']); + unset($data['name']); + } elseif (\array_key_exists('name', $data) && null === $data['name']) { + $object->setName(null); } - if (property_exists($data, 'star_count') && $data->{'star_count'} !== null) { - $object->setStarCount($data->{'star_count'}); + if (\array_key_exists('star_count', $data) && null !== $data['star_count']) { + $object->setStarCount($data['star_count']); + unset($data['star_count']); + } elseif (\array_key_exists('star_count', $data) && null === $data['star_count']) { + $object->setStarCount(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getDescription()) { - $data->{'description'} = $object->getDescription(); + $dataArray = []; + if ($data->isInitialized('description') && null !== $data->getDescription()) { + $dataArray['description'] = $data->getDescription(); + } + if ($data->isInitialized('isOfficial') && null !== $data->getIsOfficial()) { + $dataArray['is_official'] = $data->getIsOfficial(); } - if (null !== $object->getIsOfficial()) { - $data->{'is_official'} = $object->getIsOfficial(); + if ($data->isInitialized('isAutomated') && null !== $data->getIsAutomated()) { + $dataArray['is_automated'] = $data->getIsAutomated(); } - if (null !== $object->getIsAutomated()) { - $data->{'is_automated'} = $object->getIsAutomated(); + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['name'] = $data->getName(); } - if (null !== $object->getName()) { - $data->{'name'} = $object->getName(); + if ($data->isInitialized('starCount') && null !== $data->getStarCount()) { + $dataArray['star_count'] = $data->getStarCount(); } - if (null !== $object->getStarCount()) { - $data->{'star_count'} = $object->getStarCount(); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ImagesSearchGetResponse200Item::class => false]; } } diff --git a/src/Normalizer/IndexInfoNormalizer.php b/src/Normalizer/IndexInfoNormalizer.php index 4aaea82e..aa7ba494 100644 --- a/src/Normalizer/IndexInfoNormalizer.php +++ b/src/Normalizer/IndexInfoNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,65 +16,106 @@ class IndexInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\IndexInfo'; + return \Docker\API\Model\IndexInfo::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\IndexInfo; + return \is_object($data) && \Docker\API\Model\IndexInfo::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\IndexInfo(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (\array_key_exists('Secure', $data) && \is_int($data['Secure'])) { + $data['Secure'] = (bool) $data['Secure']; + } + if (\array_key_exists('Official', $data) && \is_int($data['Official'])) { + $data['Official'] = (bool) $data['Official']; } - if (property_exists($data, 'Mirrors') && $data->{'Mirrors'} !== null) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Mirrors', $data) && null !== $data['Mirrors']) { $values = []; - foreach ($data->{'Mirrors'} as $value) { + foreach ($data['Mirrors'] as $value) { $values[] = $value; } $object->setMirrors($values); + unset($data['Mirrors']); + } elseif (\array_key_exists('Mirrors', $data) && null === $data['Mirrors']) { + $object->setMirrors(null); + } + if (\array_key_exists('Secure', $data) && null !== $data['Secure']) { + $object->setSecure($data['Secure']); + unset($data['Secure']); + } elseif (\array_key_exists('Secure', $data) && null === $data['Secure']) { + $object->setSecure(null); } - if (property_exists($data, 'Secure') && $data->{'Secure'} !== null) { - $object->setSecure($data->{'Secure'}); + if (\array_key_exists('Official', $data) && null !== $data['Official']) { + $object->setOfficial($data['Official']); + unset($data['Official']); + } elseif (\array_key_exists('Official', $data) && null === $data['Official']) { + $object->setOfficial(null); } - if (property_exists($data, 'Official') && $data->{'Official'} !== null) { - $object->setOfficial($data->{'Official'}); + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getMirrors()) { + if ($data->isInitialized('mirrors') && null !== $data->getMirrors()) { $values = []; - foreach ($object->getMirrors() as $value) { + foreach ($data->getMirrors() as $value) { $values[] = $value; } - $data->{'Mirrors'} = $values; + $dataArray['Mirrors'] = $values; + } + if ($data->isInitialized('secure') && null !== $data->getSecure()) { + $dataArray['Secure'] = $data->getSecure(); } - if (null !== $object->getSecure()) { - $data->{'Secure'} = $object->getSecure(); + if ($data->isInitialized('official') && null !== $data->getOfficial()) { + $dataArray['Official'] = $data->getOfficial(); } - if (null !== $object->getOfficial()) { - $data->{'Official'} = $object->getOfficial(); + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\IndexInfo::class => false]; } } diff --git a/src/Normalizer/JaneObjectNormalizer.php b/src/Normalizer/JaneObjectNormalizer.php new file mode 100644 index 00000000..efc99905 --- /dev/null +++ b/src/Normalizer/JaneObjectNormalizer.php @@ -0,0 +1,713 @@ + PortNormalizer::class, + + \Docker\API\Model\MountPoint::class => MountPointNormalizer::class, + + \Docker\API\Model\DeviceMapping::class => DeviceMappingNormalizer::class, + + \Docker\API\Model\DeviceRequest::class => DeviceRequestNormalizer::class, + + \Docker\API\Model\ThrottleDevice::class => ThrottleDeviceNormalizer::class, + + \Docker\API\Model\Mount::class => MountNormalizer::class, + + \Docker\API\Model\MountBindOptions::class => MountBindOptionsNormalizer::class, + + \Docker\API\Model\MountVolumeOptions::class => MountVolumeOptionsNormalizer::class, + + \Docker\API\Model\MountVolumeOptionsDriverConfig::class => MountVolumeOptionsDriverConfigNormalizer::class, + + \Docker\API\Model\MountTmpfsOptions::class => MountTmpfsOptionsNormalizer::class, + + \Docker\API\Model\RestartPolicy::class => RestartPolicyNormalizer::class, + + \Docker\API\Model\Resources::class => ResourcesNormalizer::class, + + \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class => ResourcesBlkioWeightDeviceItemNormalizer::class, + + \Docker\API\Model\ResourcesUlimitsItem::class => ResourcesUlimitsItemNormalizer::class, + + \Docker\API\Model\Limit::class => LimitNormalizer::class, + + \Docker\API\Model\ResourceObject::class => ResourceObjectNormalizer::class, + + \Docker\API\Model\GenericResourcesItem::class => GenericResourcesItemNormalizer::class, + + \Docker\API\Model\GenericResourcesItemNamedResourceSpec::class => GenericResourcesItemNamedResourceSpecNormalizer::class, + + \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class => GenericResourcesItemDiscreteResourceSpecNormalizer::class, + + \Docker\API\Model\HealthConfig::class => HealthConfigNormalizer::class, + + \Docker\API\Model\Health::class => HealthNormalizer::class, + + \Docker\API\Model\HealthcheckResult::class => HealthcheckResultNormalizer::class, + + \Docker\API\Model\HostConfig::class => HostConfigNormalizer::class, + + \Docker\API\Model\HostConfigLogConfig::class => HostConfigLogConfigNormalizer::class, + + \Docker\API\Model\ContainerConfig::class => ContainerConfigNormalizer::class, + + \Docker\API\Model\ContainerConfigExposedPortsItem::class => ContainerConfigExposedPortsItemNormalizer::class, + + \Docker\API\Model\ContainerConfigVolumesItem::class => ContainerConfigVolumesItemNormalizer::class, + + \Docker\API\Model\NetworkingConfig::class => NetworkingConfigNormalizer::class, + + \Docker\API\Model\NetworkSettings::class => NetworkSettingsNormalizer::class, + + \Docker\API\Model\Address::class => AddressNormalizer::class, + + \Docker\API\Model\PortBinding::class => PortBindingNormalizer::class, + + \Docker\API\Model\GraphDriverData::class => GraphDriverDataNormalizer::class, + + \Docker\API\Model\FilesystemChange::class => FilesystemChangeNormalizer::class, + + \Docker\API\Model\ImageInspect::class => ImageInspectNormalizer::class, + + \Docker\API\Model\ImageInspectRootFS::class => ImageInspectRootFSNormalizer::class, + + \Docker\API\Model\ImageInspectMetadata::class => ImageInspectMetadataNormalizer::class, + + \Docker\API\Model\ImageSummary::class => ImageSummaryNormalizer::class, + + \Docker\API\Model\AuthConfig::class => AuthConfigNormalizer::class, + + \Docker\API\Model\ProcessConfig::class => ProcessConfigNormalizer::class, + + \Docker\API\Model\Volume::class => VolumeNormalizer::class, + + \Docker\API\Model\VolumeStatusItem::class => VolumeStatusItemNormalizer::class, + + \Docker\API\Model\VolumeUsageData::class => VolumeUsageDataNormalizer::class, + + \Docker\API\Model\VolumeCreateOptions::class => VolumeCreateOptionsNormalizer::class, + + \Docker\API\Model\VolumeListResponse::class => VolumeListResponseNormalizer::class, + + \Docker\API\Model\Network::class => NetworkNormalizer::class, + + \Docker\API\Model\IPAM::class => IPAMNormalizer::class, + + \Docker\API\Model\IPAMConfig::class => IPAMConfigNormalizer::class, + + \Docker\API\Model\NetworkContainer::class => NetworkContainerNormalizer::class, + + \Docker\API\Model\BuildInfo::class => BuildInfoNormalizer::class, + + \Docker\API\Model\BuildCache::class => BuildCacheNormalizer::class, + + \Docker\API\Model\ImageID::class => ImageIDNormalizer::class, + + \Docker\API\Model\CreateImageInfo::class => CreateImageInfoNormalizer::class, + + \Docker\API\Model\PushImageInfo::class => PushImageInfoNormalizer::class, + + \Docker\API\Model\ErrorDetail::class => ErrorDetailNormalizer::class, + + \Docker\API\Model\ProgressDetail::class => ProgressDetailNormalizer::class, + + \Docker\API\Model\ErrorResponse::class => ErrorResponseNormalizer::class, + + \Docker\API\Model\IdResponse::class => IdResponseNormalizer::class, + + \Docker\API\Model\EndpointSettings::class => EndpointSettingsNormalizer::class, + + \Docker\API\Model\EndpointIPAMConfig::class => EndpointIPAMConfigNormalizer::class, + + \Docker\API\Model\PluginMount::class => PluginMountNormalizer::class, + + \Docker\API\Model\PluginDevice::class => PluginDeviceNormalizer::class, + + \Docker\API\Model\PluginEnv::class => PluginEnvNormalizer::class, + + \Docker\API\Model\PluginInterfaceType::class => PluginInterfaceTypeNormalizer::class, + + \Docker\API\Model\PluginPrivilege::class => PluginPrivilegeNormalizer::class, + + \Docker\API\Model\Plugin::class => PluginNormalizer::class, + + \Docker\API\Model\PluginSettings::class => PluginSettingsNormalizer::class, + + \Docker\API\Model\PluginConfig::class => PluginConfigNormalizer::class, + + \Docker\API\Model\PluginConfigInterface::class => PluginConfigInterfaceNormalizer::class, + + \Docker\API\Model\PluginConfigUser::class => PluginConfigUserNormalizer::class, + + \Docker\API\Model\PluginConfigNetwork::class => PluginConfigNetworkNormalizer::class, + + \Docker\API\Model\PluginConfigLinux::class => PluginConfigLinuxNormalizer::class, + + \Docker\API\Model\PluginConfigArgs::class => PluginConfigArgsNormalizer::class, + + \Docker\API\Model\PluginConfigRootfs::class => PluginConfigRootfsNormalizer::class, + + \Docker\API\Model\ObjectVersion::class => ObjectVersionNormalizer::class, + + \Docker\API\Model\NodeSpec::class => NodeSpecNormalizer::class, + + \Docker\API\Model\Node::class => NodeNormalizer::class, + + \Docker\API\Model\NodeDescription::class => NodeDescriptionNormalizer::class, + + \Docker\API\Model\Platform::class => PlatformNormalizer::class, + + \Docker\API\Model\EngineDescription::class => EngineDescriptionNormalizer::class, + + \Docker\API\Model\EngineDescriptionPluginsItem::class => EngineDescriptionPluginsItemNormalizer::class, + + \Docker\API\Model\TLSInfo::class => TLSInfoNormalizer::class, + + \Docker\API\Model\NodeStatus::class => NodeStatusNormalizer::class, + + \Docker\API\Model\ManagerStatus::class => ManagerStatusNormalizer::class, + + \Docker\API\Model\SwarmSpec::class => SwarmSpecNormalizer::class, + + \Docker\API\Model\SwarmSpecOrchestration::class => SwarmSpecOrchestrationNormalizer::class, + + \Docker\API\Model\SwarmSpecRaft::class => SwarmSpecRaftNormalizer::class, + + \Docker\API\Model\SwarmSpecDispatcher::class => SwarmSpecDispatcherNormalizer::class, + + \Docker\API\Model\SwarmSpecCAConfig::class => SwarmSpecCAConfigNormalizer::class, + + \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class => SwarmSpecCAConfigExternalCAsItemNormalizer::class, + + \Docker\API\Model\SwarmSpecEncryptionConfig::class => SwarmSpecEncryptionConfigNormalizer::class, + + \Docker\API\Model\SwarmSpecTaskDefaults::class => SwarmSpecTaskDefaultsNormalizer::class, + + \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class => SwarmSpecTaskDefaultsLogDriverNormalizer::class, + + \Docker\API\Model\ClusterInfo::class => ClusterInfoNormalizer::class, + + \Docker\API\Model\JoinTokens::class => JoinTokensNormalizer::class, + + \Docker\API\Model\Swarm::class => SwarmNormalizer::class, + + \Docker\API\Model\TaskSpec::class => TaskSpecNormalizer::class, + + \Docker\API\Model\TaskSpecPluginSpec::class => TaskSpecPluginSpecNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpec::class => TaskSpecContainerSpecNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecPrivileges::class => TaskSpecContainerSpecPrivilegesNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class => TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class => TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp::class => TaskSpecContainerSpecPrivilegesSeccompNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor::class => TaskSpecContainerSpecPrivilegesAppArmorNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecDNSConfig::class => TaskSpecContainerSpecDNSConfigNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecSecretsItem::class => TaskSpecContainerSpecSecretsItemNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class => TaskSpecContainerSpecSecretsItemFileNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecConfigsItem::class => TaskSpecContainerSpecConfigsItemNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class => TaskSpecContainerSpecConfigsItemFileNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecConfigsItemRuntime::class => TaskSpecContainerSpecConfigsItemRuntimeNormalizer::class, + + \Docker\API\Model\TaskSpecContainerSpecUlimitsItem::class => TaskSpecContainerSpecUlimitsItemNormalizer::class, + + \Docker\API\Model\TaskSpecNetworkAttachmentSpec::class => TaskSpecNetworkAttachmentSpecNormalizer::class, + + \Docker\API\Model\TaskSpecResources::class => TaskSpecResourcesNormalizer::class, + + \Docker\API\Model\TaskSpecRestartPolicy::class => TaskSpecRestartPolicyNormalizer::class, + + \Docker\API\Model\TaskSpecPlacement::class => TaskSpecPlacementNormalizer::class, + + \Docker\API\Model\TaskSpecPlacementPreferencesItem::class => TaskSpecPlacementPreferencesItemNormalizer::class, + + \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class => TaskSpecPlacementPreferencesItemSpreadNormalizer::class, + + \Docker\API\Model\TaskSpecLogDriver::class => TaskSpecLogDriverNormalizer::class, + + \Docker\API\Model\ContainerStatus::class => ContainerStatusNormalizer::class, + + \Docker\API\Model\PortStatus::class => PortStatusNormalizer::class, + + \Docker\API\Model\TaskStatus::class => TaskStatusNormalizer::class, + + \Docker\API\Model\Task::class => TaskNormalizer::class, + + \Docker\API\Model\ServiceSpec::class => ServiceSpecNormalizer::class, + + \Docker\API\Model\ServiceSpecMode::class => ServiceSpecModeNormalizer::class, + + \Docker\API\Model\ServiceSpecModeReplicated::class => ServiceSpecModeReplicatedNormalizer::class, + + \Docker\API\Model\ServiceSpecModeGlobal::class => ServiceSpecModeGlobalNormalizer::class, + + \Docker\API\Model\ServiceSpecModeReplicatedJob::class => ServiceSpecModeReplicatedJobNormalizer::class, + + \Docker\API\Model\ServiceSpecModeGlobalJob::class => ServiceSpecModeGlobalJobNormalizer::class, + + \Docker\API\Model\ServiceSpecUpdateConfig::class => ServiceSpecUpdateConfigNormalizer::class, + + \Docker\API\Model\ServiceSpecRollbackConfig::class => ServiceSpecRollbackConfigNormalizer::class, + + \Docker\API\Model\EndpointPortConfig::class => EndpointPortConfigNormalizer::class, + + \Docker\API\Model\EndpointSpec::class => EndpointSpecNormalizer::class, + + \Docker\API\Model\Service::class => ServiceNormalizer::class, + + \Docker\API\Model\ServiceEndpoint::class => ServiceEndpointNormalizer::class, + + \Docker\API\Model\ServiceEndpointVirtualIPsItem::class => ServiceEndpointVirtualIPsItemNormalizer::class, + + \Docker\API\Model\ServiceUpdateStatus::class => ServiceUpdateStatusNormalizer::class, + + \Docker\API\Model\ServiceServiceStatus::class => ServiceServiceStatusNormalizer::class, + + \Docker\API\Model\ServiceJobStatus::class => ServiceJobStatusNormalizer::class, + + \Docker\API\Model\ImageDeleteResponseItem::class => ImageDeleteResponseItemNormalizer::class, + + \Docker\API\Model\ServiceCreateResponse::class => ServiceCreateResponseNormalizer::class, + + \Docker\API\Model\ServiceUpdateResponse::class => ServiceUpdateResponseNormalizer::class, + + \Docker\API\Model\ContainerSummary::class => ContainerSummaryNormalizer::class, + + \Docker\API\Model\ContainerSummaryHostConfig::class => ContainerSummaryHostConfigNormalizer::class, + + \Docker\API\Model\ContainerSummaryNetworkSettings::class => ContainerSummaryNetworkSettingsNormalizer::class, + + \Docker\API\Model\Driver::class => DriverNormalizer::class, + + \Docker\API\Model\SecretSpec::class => SecretSpecNormalizer::class, + + \Docker\API\Model\Secret::class => SecretNormalizer::class, + + \Docker\API\Model\ConfigSpec::class => ConfigSpecNormalizer::class, + + \Docker\API\Model\Config::class => ConfigNormalizer::class, + + \Docker\API\Model\ContainerState::class => ContainerStateNormalizer::class, + + \Docker\API\Model\ContainerCreateResponse::class => ContainerCreateResponseNormalizer::class, + + \Docker\API\Model\ContainerWaitResponse::class => ContainerWaitResponseNormalizer::class, + + \Docker\API\Model\ContainerWaitExitError::class => ContainerWaitExitErrorNormalizer::class, + + \Docker\API\Model\SystemVersion::class => SystemVersionNormalizer::class, + + \Docker\API\Model\SystemVersionPlatform::class => SystemVersionPlatformNormalizer::class, + + \Docker\API\Model\SystemVersionComponentsItem::class => SystemVersionComponentsItemNormalizer::class, + + \Docker\API\Model\SystemVersionComponentsItemDetails::class => SystemVersionComponentsItemDetailsNormalizer::class, + + \Docker\API\Model\SystemInfo::class => SystemInfoNormalizer::class, + + \Docker\API\Model\SystemInfoDefaultAddressPoolsItem::class => SystemInfoDefaultAddressPoolsItemNormalizer::class, + + \Docker\API\Model\PluginsInfo::class => PluginsInfoNormalizer::class, + + \Docker\API\Model\RegistryServiceConfig::class => RegistryServiceConfigNormalizer::class, + + \Docker\API\Model\IndexInfo::class => IndexInfoNormalizer::class, + + \Docker\API\Model\Runtime::class => RuntimeNormalizer::class, + + \Docker\API\Model\Commit::class => CommitNormalizer::class, + + \Docker\API\Model\SwarmInfo::class => SwarmInfoNormalizer::class, + + \Docker\API\Model\PeerNode::class => PeerNodeNormalizer::class, + + \Docker\API\Model\NetworkAttachmentConfig::class => NetworkAttachmentConfigNormalizer::class, + + \Docker\API\Model\EventActor::class => EventActorNormalizer::class, + + \Docker\API\Model\EventMessage::class => EventMessageNormalizer::class, + + \Docker\API\Model\OCIDescriptor::class => OCIDescriptorNormalizer::class, + + \Docker\API\Model\OCIPlatform::class => OCIPlatformNormalizer::class, + + \Docker\API\Model\DistributionInspect::class => DistributionInspectNormalizer::class, + + \Docker\API\Model\ClusterVolume::class => ClusterVolumeNormalizer::class, + + \Docker\API\Model\ClusterVolumeInfo::class => ClusterVolumeInfoNormalizer::class, + + \Docker\API\Model\ClusterVolumePublishStatusItem::class => ClusterVolumePublishStatusItemNormalizer::class, + + \Docker\API\Model\ClusterVolumeSpec::class => ClusterVolumeSpecNormalizer::class, + + \Docker\API\Model\ClusterVolumeSpecAccessMode::class => ClusterVolumeSpecAccessModeNormalizer::class, + + \Docker\API\Model\ClusterVolumeSpecAccessModeMountVolume::class => ClusterVolumeSpecAccessModeMountVolumeNormalizer::class, + + \Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem::class => ClusterVolumeSpecAccessModeSecretsItemNormalizer::class, + + \Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements::class => ClusterVolumeSpecAccessModeAccessibilityRequirementsNormalizer::class, + + \Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange::class => ClusterVolumeSpecAccessModeCapacityRangeNormalizer::class, + + \Docker\API\Model\ContainersCreatePostBody::class => ContainersCreatePostBodyNormalizer::class, + + \Docker\API\Model\ContainersIdJsonGetResponse200::class => ContainersIdJsonGetResponse200Normalizer::class, + + \Docker\API\Model\ContainersIdTopGetJsonResponse200::class => ContainersIdTopGetJsonResponse200Normalizer::class, + + \Docker\API\Model\ContainersIdTopGetTextplainResponse200::class => ContainersIdTopGetTextplainResponse200Normalizer::class, + + \Docker\API\Model\ContainersIdUpdatePostBody::class => ContainersIdUpdatePostBodyNormalizer::class, + + \Docker\API\Model\ContainersIdUpdatePostResponse200::class => ContainersIdUpdatePostResponse200Normalizer::class, + + \Docker\API\Model\ContainersPrunePostResponse200::class => ContainersPrunePostResponse200Normalizer::class, + + \Docker\API\Model\BuildPrunePostResponse200::class => BuildPrunePostResponse200Normalizer::class, + + \Docker\API\Model\ImagesNameHistoryGetResponse200Item::class => ImagesNameHistoryGetResponse200ItemNormalizer::class, + + \Docker\API\Model\ImagesSearchGetResponse200Item::class => ImagesSearchGetResponse200ItemNormalizer::class, + + \Docker\API\Model\ImagesPrunePostResponse200::class => ImagesPrunePostResponse200Normalizer::class, + + \Docker\API\Model\AuthPostResponse200::class => AuthPostResponse200Normalizer::class, + + \Docker\API\Model\SystemDfGetJsonResponse200::class => SystemDfGetJsonResponse200Normalizer::class, + + \Docker\API\Model\SystemDfGetTextplainResponse200::class => SystemDfGetTextplainResponse200Normalizer::class, + + \Docker\API\Model\ContainersIdExecPostBody::class => ContainersIdExecPostBodyNormalizer::class, + + \Docker\API\Model\ExecIdStartPostBody::class => ExecIdStartPostBodyNormalizer::class, + + \Docker\API\Model\ExecIdJsonGetResponse200::class => ExecIdJsonGetResponse200Normalizer::class, + + \Docker\API\Model\VolumesNamePutBody::class => VolumesNamePutBodyNormalizer::class, + + \Docker\API\Model\VolumesPrunePostResponse200::class => VolumesPrunePostResponse200Normalizer::class, + + \Docker\API\Model\NetworksCreatePostBody::class => NetworksCreatePostBodyNormalizer::class, + + \Docker\API\Model\NetworksCreatePostResponse201::class => NetworksCreatePostResponse201Normalizer::class, + + \Docker\API\Model\NetworksIdConnectPostBody::class => NetworksIdConnectPostBodyNormalizer::class, + + \Docker\API\Model\NetworksIdDisconnectPostBody::class => NetworksIdDisconnectPostBodyNormalizer::class, + + \Docker\API\Model\NetworksPrunePostResponse200::class => NetworksPrunePostResponse200Normalizer::class, + + \Docker\API\Model\SwarmInitPostBody::class => SwarmInitPostBodyNormalizer::class, + + \Docker\API\Model\SwarmJoinPostBody::class => SwarmJoinPostBodyNormalizer::class, + + \Docker\API\Model\SwarmUnlockkeyGetJsonResponse200::class => SwarmUnlockkeyGetJsonResponse200Normalizer::class, + + \Docker\API\Model\SwarmUnlockkeyGetTextplainResponse200::class => SwarmUnlockkeyGetTextplainResponse200Normalizer::class, + + \Docker\API\Model\SwarmUnlockPostBody::class => SwarmUnlockPostBodyNormalizer::class, + + \Docker\API\Model\ServicesCreatePostBody::class => ServicesCreatePostBodyNormalizer::class, + + \Docker\API\Model\ServicesIdUpdatePostBody::class => ServicesIdUpdatePostBodyNormalizer::class, + + \Docker\API\Model\SecretsCreatePostBody::class => SecretsCreatePostBodyNormalizer::class, + + \Docker\API\Model\ConfigsCreatePostBody::class => ConfigsCreatePostBodyNormalizer::class, + + \Jane\Component\JsonSchemaRuntime\Reference::class => \Docker\API\Runtime\Normalizer\ReferenceNormalizer::class, + ]; + protected $normalizersCache = []; + + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool + { + return \array_key_exists($type, $this->normalizers); + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && \array_key_exists($data::class, $this->normalizers); + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $normalizerClass = $this->normalizers[$data::class]; + $normalizer = $this->getNormalizer($normalizerClass); + + return $normalizer->normalize($data, $format, $context); + } + + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed + { + $denormalizerClass = $this->normalizers[$type]; + $denormalizer = $this->getNormalizer($denormalizerClass); + + return $denormalizer->denormalize($data, $type, $format, $context); + } + + private function getNormalizer(string $normalizerClass) + { + return $this->normalizersCache[$normalizerClass] ?? $this->initNormalizer($normalizerClass); + } + + private function initNormalizer(string $normalizerClass) + { + $normalizer = new $normalizerClass(); + $normalizer->setNormalizer($this->normalizer); + $normalizer->setDenormalizer($this->denormalizer); + $this->normalizersCache[$normalizerClass] = $normalizer; + + return $normalizer; + } + + public function getSupportedTypes(?string $format = null): array + { + return [ + \Docker\API\Model\Port::class => false, + \Docker\API\Model\MountPoint::class => false, + \Docker\API\Model\DeviceMapping::class => false, + \Docker\API\Model\DeviceRequest::class => false, + \Docker\API\Model\ThrottleDevice::class => false, + \Docker\API\Model\Mount::class => false, + \Docker\API\Model\MountBindOptions::class => false, + \Docker\API\Model\MountVolumeOptions::class => false, + \Docker\API\Model\MountVolumeOptionsDriverConfig::class => false, + \Docker\API\Model\MountTmpfsOptions::class => false, + \Docker\API\Model\RestartPolicy::class => false, + \Docker\API\Model\Resources::class => false, + \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class => false, + \Docker\API\Model\ResourcesUlimitsItem::class => false, + \Docker\API\Model\Limit::class => false, + \Docker\API\Model\ResourceObject::class => false, + \Docker\API\Model\GenericResourcesItem::class => false, + \Docker\API\Model\GenericResourcesItemNamedResourceSpec::class => false, + \Docker\API\Model\GenericResourcesItemDiscreteResourceSpec::class => false, + \Docker\API\Model\HealthConfig::class => false, + \Docker\API\Model\Health::class => false, + \Docker\API\Model\HealthcheckResult::class => false, + \Docker\API\Model\HostConfig::class => false, + \Docker\API\Model\HostConfigLogConfig::class => false, + \Docker\API\Model\ContainerConfig::class => false, + \Docker\API\Model\ContainerConfigExposedPortsItem::class => false, + \Docker\API\Model\ContainerConfigVolumesItem::class => false, + \Docker\API\Model\NetworkingConfig::class => false, + \Docker\API\Model\NetworkSettings::class => false, + \Docker\API\Model\Address::class => false, + \Docker\API\Model\PortBinding::class => false, + \Docker\API\Model\GraphDriverData::class => false, + \Docker\API\Model\FilesystemChange::class => false, + \Docker\API\Model\ImageInspect::class => false, + \Docker\API\Model\ImageInspectRootFS::class => false, + \Docker\API\Model\ImageInspectMetadata::class => false, + \Docker\API\Model\ImageSummary::class => false, + \Docker\API\Model\AuthConfig::class => false, + \Docker\API\Model\ProcessConfig::class => false, + \Docker\API\Model\Volume::class => false, + \Docker\API\Model\VolumeStatusItem::class => false, + \Docker\API\Model\VolumeUsageData::class => false, + \Docker\API\Model\VolumeCreateOptions::class => false, + \Docker\API\Model\VolumeListResponse::class => false, + \Docker\API\Model\Network::class => false, + \Docker\API\Model\IPAM::class => false, + \Docker\API\Model\IPAMConfig::class => false, + \Docker\API\Model\NetworkContainer::class => false, + \Docker\API\Model\BuildInfo::class => false, + \Docker\API\Model\BuildCache::class => false, + \Docker\API\Model\ImageID::class => false, + \Docker\API\Model\CreateImageInfo::class => false, + \Docker\API\Model\PushImageInfo::class => false, + \Docker\API\Model\ErrorDetail::class => false, + \Docker\API\Model\ProgressDetail::class => false, + \Docker\API\Model\ErrorResponse::class => false, + \Docker\API\Model\IdResponse::class => false, + \Docker\API\Model\EndpointSettings::class => false, + \Docker\API\Model\EndpointIPAMConfig::class => false, + \Docker\API\Model\PluginMount::class => false, + \Docker\API\Model\PluginDevice::class => false, + \Docker\API\Model\PluginEnv::class => false, + \Docker\API\Model\PluginInterfaceType::class => false, + \Docker\API\Model\PluginPrivilege::class => false, + \Docker\API\Model\Plugin::class => false, + \Docker\API\Model\PluginSettings::class => false, + \Docker\API\Model\PluginConfig::class => false, + \Docker\API\Model\PluginConfigInterface::class => false, + \Docker\API\Model\PluginConfigUser::class => false, + \Docker\API\Model\PluginConfigNetwork::class => false, + \Docker\API\Model\PluginConfigLinux::class => false, + \Docker\API\Model\PluginConfigArgs::class => false, + \Docker\API\Model\PluginConfigRootfs::class => false, + \Docker\API\Model\ObjectVersion::class => false, + \Docker\API\Model\NodeSpec::class => false, + \Docker\API\Model\Node::class => false, + \Docker\API\Model\NodeDescription::class => false, + \Docker\API\Model\Platform::class => false, + \Docker\API\Model\EngineDescription::class => false, + \Docker\API\Model\EngineDescriptionPluginsItem::class => false, + \Docker\API\Model\TLSInfo::class => false, + \Docker\API\Model\NodeStatus::class => false, + \Docker\API\Model\ManagerStatus::class => false, + \Docker\API\Model\SwarmSpec::class => false, + \Docker\API\Model\SwarmSpecOrchestration::class => false, + \Docker\API\Model\SwarmSpecRaft::class => false, + \Docker\API\Model\SwarmSpecDispatcher::class => false, + \Docker\API\Model\SwarmSpecCAConfig::class => false, + \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class => false, + \Docker\API\Model\SwarmSpecEncryptionConfig::class => false, + \Docker\API\Model\SwarmSpecTaskDefaults::class => false, + \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class => false, + \Docker\API\Model\ClusterInfo::class => false, + \Docker\API\Model\JoinTokens::class => false, + \Docker\API\Model\Swarm::class => false, + \Docker\API\Model\TaskSpec::class => false, + \Docker\API\Model\TaskSpecPluginSpec::class => false, + \Docker\API\Model\TaskSpecContainerSpec::class => false, + \Docker\API\Model\TaskSpecContainerSpecPrivileges::class => false, + \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class => false, + \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class => false, + \Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp::class => false, + \Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor::class => false, + \Docker\API\Model\TaskSpecContainerSpecDNSConfig::class => false, + \Docker\API\Model\TaskSpecContainerSpecSecretsItem::class => false, + \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class => false, + \Docker\API\Model\TaskSpecContainerSpecConfigsItem::class => false, + \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class => false, + \Docker\API\Model\TaskSpecContainerSpecConfigsItemRuntime::class => false, + \Docker\API\Model\TaskSpecContainerSpecUlimitsItem::class => false, + \Docker\API\Model\TaskSpecNetworkAttachmentSpec::class => false, + \Docker\API\Model\TaskSpecResources::class => false, + \Docker\API\Model\TaskSpecRestartPolicy::class => false, + \Docker\API\Model\TaskSpecPlacement::class => false, + \Docker\API\Model\TaskSpecPlacementPreferencesItem::class => false, + \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class => false, + \Docker\API\Model\TaskSpecLogDriver::class => false, + \Docker\API\Model\ContainerStatus::class => false, + \Docker\API\Model\PortStatus::class => false, + \Docker\API\Model\TaskStatus::class => false, + \Docker\API\Model\Task::class => false, + \Docker\API\Model\ServiceSpec::class => false, + \Docker\API\Model\ServiceSpecMode::class => false, + \Docker\API\Model\ServiceSpecModeReplicated::class => false, + \Docker\API\Model\ServiceSpecModeGlobal::class => false, + \Docker\API\Model\ServiceSpecModeReplicatedJob::class => false, + \Docker\API\Model\ServiceSpecModeGlobalJob::class => false, + \Docker\API\Model\ServiceSpecUpdateConfig::class => false, + \Docker\API\Model\ServiceSpecRollbackConfig::class => false, + \Docker\API\Model\EndpointPortConfig::class => false, + \Docker\API\Model\EndpointSpec::class => false, + \Docker\API\Model\Service::class => false, + \Docker\API\Model\ServiceEndpoint::class => false, + \Docker\API\Model\ServiceEndpointVirtualIPsItem::class => false, + \Docker\API\Model\ServiceUpdateStatus::class => false, + \Docker\API\Model\ServiceServiceStatus::class => false, + \Docker\API\Model\ServiceJobStatus::class => false, + \Docker\API\Model\ImageDeleteResponseItem::class => false, + \Docker\API\Model\ServiceCreateResponse::class => false, + \Docker\API\Model\ServiceUpdateResponse::class => false, + \Docker\API\Model\ContainerSummary::class => false, + \Docker\API\Model\ContainerSummaryHostConfig::class => false, + \Docker\API\Model\ContainerSummaryNetworkSettings::class => false, + \Docker\API\Model\Driver::class => false, + \Docker\API\Model\SecretSpec::class => false, + \Docker\API\Model\Secret::class => false, + \Docker\API\Model\ConfigSpec::class => false, + \Docker\API\Model\Config::class => false, + \Docker\API\Model\ContainerState::class => false, + \Docker\API\Model\ContainerCreateResponse::class => false, + \Docker\API\Model\ContainerWaitResponse::class => false, + \Docker\API\Model\ContainerWaitExitError::class => false, + \Docker\API\Model\SystemVersion::class => false, + \Docker\API\Model\SystemVersionPlatform::class => false, + \Docker\API\Model\SystemVersionComponentsItem::class => false, + \Docker\API\Model\SystemVersionComponentsItemDetails::class => false, + \Docker\API\Model\SystemInfo::class => false, + \Docker\API\Model\SystemInfoDefaultAddressPoolsItem::class => false, + \Docker\API\Model\PluginsInfo::class => false, + \Docker\API\Model\RegistryServiceConfig::class => false, + \Docker\API\Model\IndexInfo::class => false, + \Docker\API\Model\Runtime::class => false, + \Docker\API\Model\Commit::class => false, + \Docker\API\Model\SwarmInfo::class => false, + \Docker\API\Model\PeerNode::class => false, + \Docker\API\Model\NetworkAttachmentConfig::class => false, + \Docker\API\Model\EventActor::class => false, + \Docker\API\Model\EventMessage::class => false, + \Docker\API\Model\OCIDescriptor::class => false, + \Docker\API\Model\OCIPlatform::class => false, + \Docker\API\Model\DistributionInspect::class => false, + \Docker\API\Model\ClusterVolume::class => false, + \Docker\API\Model\ClusterVolumeInfo::class => false, + \Docker\API\Model\ClusterVolumePublishStatusItem::class => false, + \Docker\API\Model\ClusterVolumeSpec::class => false, + \Docker\API\Model\ClusterVolumeSpecAccessMode::class => false, + \Docker\API\Model\ClusterVolumeSpecAccessModeMountVolume::class => false, + \Docker\API\Model\ClusterVolumeSpecAccessModeSecretsItem::class => false, + \Docker\API\Model\ClusterVolumeSpecAccessModeAccessibilityRequirements::class => false, + \Docker\API\Model\ClusterVolumeSpecAccessModeCapacityRange::class => false, + \Docker\API\Model\ContainersCreatePostBody::class => false, + \Docker\API\Model\ContainersIdJsonGetResponse200::class => false, + \Docker\API\Model\ContainersIdTopGetJsonResponse200::class => false, + \Docker\API\Model\ContainersIdTopGetTextplainResponse200::class => false, + \Docker\API\Model\ContainersIdUpdatePostBody::class => false, + \Docker\API\Model\ContainersIdUpdatePostResponse200::class => false, + \Docker\API\Model\ContainersPrunePostResponse200::class => false, + \Docker\API\Model\BuildPrunePostResponse200::class => false, + \Docker\API\Model\ImagesNameHistoryGetResponse200Item::class => false, + \Docker\API\Model\ImagesSearchGetResponse200Item::class => false, + \Docker\API\Model\ImagesPrunePostResponse200::class => false, + \Docker\API\Model\AuthPostResponse200::class => false, + \Docker\API\Model\SystemDfGetJsonResponse200::class => false, + \Docker\API\Model\SystemDfGetTextplainResponse200::class => false, + \Docker\API\Model\ContainersIdExecPostBody::class => false, + \Docker\API\Model\ExecIdStartPostBody::class => false, + \Docker\API\Model\ExecIdJsonGetResponse200::class => false, + \Docker\API\Model\VolumesNamePutBody::class => false, + \Docker\API\Model\VolumesPrunePostResponse200::class => false, + \Docker\API\Model\NetworksCreatePostBody::class => false, + \Docker\API\Model\NetworksCreatePostResponse201::class => false, + \Docker\API\Model\NetworksIdConnectPostBody::class => false, + \Docker\API\Model\NetworksIdDisconnectPostBody::class => false, + \Docker\API\Model\NetworksPrunePostResponse200::class => false, + \Docker\API\Model\SwarmInitPostBody::class => false, + \Docker\API\Model\SwarmJoinPostBody::class => false, + \Docker\API\Model\SwarmUnlockkeyGetJsonResponse200::class => false, + \Docker\API\Model\SwarmUnlockkeyGetTextplainResponse200::class => false, + \Docker\API\Model\SwarmUnlockPostBody::class => false, + \Docker\API\Model\ServicesCreatePostBody::class => false, + \Docker\API\Model\ServicesIdUpdatePostBody::class => false, + \Docker\API\Model\SecretsCreatePostBody::class => false, + \Docker\API\Model\ConfigsCreatePostBody::class => false, + \Jane\Component\JsonSchemaRuntime\Reference::class => false, + ]; + } +} diff --git a/src/Normalizer/JoinTokensNormalizer.php b/src/Normalizer/JoinTokensNormalizer.php index fab6c93f..9583dff7 100644 --- a/src/Normalizer/JoinTokensNormalizer.php +++ b/src/Normalizer/JoinTokensNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class JoinTokensNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\JoinTokens'; + return \Docker\API\Model\JoinTokens::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\JoinTokens; + return \is_object($data) && \Docker\API\Model\JoinTokens::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\JoinTokens(); - if (property_exists($data, 'Worker') && $data->{'Worker'} !== null) { - $object->setWorker($data->{'Worker'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Worker', $data) && null !== $data['Worker']) { + $object->setWorker($data['Worker']); + unset($data['Worker']); + } elseif (\array_key_exists('Worker', $data) && null === $data['Worker']) { + $object->setWorker(null); + } + if (\array_key_exists('Manager', $data) && null !== $data['Manager']) { + $object->setManager($data['Manager']); + unset($data['Manager']); + } elseif (\array_key_exists('Manager', $data) && null === $data['Manager']) { + $object->setManager(null); } - if (property_exists($data, 'Manager') && $data->{'Manager'} !== null) { - $object->setManager($data->{'Manager'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getWorker()) { - $data->{'Worker'} = $object->getWorker(); + $dataArray = []; + if ($data->isInitialized('worker') && null !== $data->getWorker()) { + $dataArray['Worker'] = $data->getWorker(); } - if (null !== $object->getManager()) { - $data->{'Manager'} = $object->getManager(); + if ($data->isInitialized('manager') && null !== $data->getManager()) { + $dataArray['Manager'] = $data->getManager(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\JoinTokens::class => false]; } } diff --git a/src/Normalizer/LimitNormalizer.php b/src/Normalizer/LimitNormalizer.php new file mode 100644 index 00000000..22fc43a6 --- /dev/null +++ b/src/Normalizer/LimitNormalizer.php @@ -0,0 +1,98 @@ +setNanoCPUs($data['NanoCPUs']); + unset($data['NanoCPUs']); + } elseif (\array_key_exists('NanoCPUs', $data) && null === $data['NanoCPUs']) { + $object->setNanoCPUs(null); + } + if (\array_key_exists('MemoryBytes', $data) && null !== $data['MemoryBytes']) { + $object->setMemoryBytes($data['MemoryBytes']); + unset($data['MemoryBytes']); + } elseif (\array_key_exists('MemoryBytes', $data) && null === $data['MemoryBytes']) { + $object->setMemoryBytes(null); + } + if (\array_key_exists('Pids', $data) && null !== $data['Pids']) { + $object->setPids($data['Pids']); + unset($data['Pids']); + } elseif (\array_key_exists('Pids', $data) && null === $data['Pids']) { + $object->setPids(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('nanoCPUs') && null !== $data->getNanoCPUs()) { + $dataArray['NanoCPUs'] = $data->getNanoCPUs(); + } + if ($data->isInitialized('memoryBytes') && null !== $data->getMemoryBytes()) { + $dataArray['MemoryBytes'] = $data->getMemoryBytes(); + } + if ($data->isInitialized('pids') && null !== $data->getPids()) { + $dataArray['Pids'] = $data->getPids(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Limit::class => false]; + } +} diff --git a/src/Normalizer/ManagerStatusNormalizer.php b/src/Normalizer/ManagerStatusNormalizer.php index ac2c9bf9..3af3e42f 100644 --- a/src/Normalizer/ManagerStatusNormalizer.php +++ b/src/Normalizer/ManagerStatusNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,51 +16,86 @@ class ManagerStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ManagerStatus'; + return \Docker\API\Model\ManagerStatus::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ManagerStatus; + return \is_object($data) && \Docker\API\Model\ManagerStatus::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ManagerStatus(); - if (property_exists($data, 'Leader') && $data->{'Leader'} !== null) { - $object->setLeader($data->{'Leader'}); + if (\array_key_exists('Leader', $data) && \is_int($data['Leader'])) { + $data['Leader'] = (bool) $data['Leader']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Leader', $data) && null !== $data['Leader']) { + $object->setLeader($data['Leader']); + unset($data['Leader']); + } elseif (\array_key_exists('Leader', $data) && null === $data['Leader']) { + $object->setLeader(null); + } + if (\array_key_exists('Reachability', $data) && null !== $data['Reachability']) { + $object->setReachability($data['Reachability']); + unset($data['Reachability']); + } elseif (\array_key_exists('Reachability', $data) && null === $data['Reachability']) { + $object->setReachability(null); } - if (property_exists($data, 'Reachability') && $data->{'Reachability'} !== null) { - $object->setReachability($data->{'Reachability'}); + if (\array_key_exists('Addr', $data) && null !== $data['Addr']) { + $object->setAddr($data['Addr']); + unset($data['Addr']); + } elseif (\array_key_exists('Addr', $data) && null === $data['Addr']) { + $object->setAddr(null); } - if (property_exists($data, 'Addr') && $data->{'Addr'} !== null) { - $object->setAddr($data->{'Addr'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getLeader()) { - $data->{'Leader'} = $object->getLeader(); + $dataArray = []; + if ($data->isInitialized('leader') && null !== $data->getLeader()) { + $dataArray['Leader'] = $data->getLeader(); } - if (null !== $object->getReachability()) { - $data->{'Reachability'} = $object->getReachability(); + if ($data->isInitialized('reachability') && null !== $data->getReachability()) { + $dataArray['Reachability'] = $data->getReachability(); } - if (null !== $object->getAddr()) { - $data->{'Addr'} = $object->getAddr(); + if ($data->isInitialized('addr') && null !== $data->getAddr()) { + $dataArray['Addr'] = $data->getAddr(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ManagerStatus::class => false]; } } diff --git a/src/Normalizer/MountBindOptionsNormalizer.php b/src/Normalizer/MountBindOptionsNormalizer.php index 1d1d1f79..bcc742ea 100644 --- a/src/Normalizer/MountBindOptionsNormalizer.php +++ b/src/Normalizer/MountBindOptionsNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,39 +16,113 @@ class MountBindOptionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\MountBindOptions'; + return \Docker\API\Model\MountBindOptions::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\MountBindOptions; + return \is_object($data) && \Docker\API\Model\MountBindOptions::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\MountBindOptions(); - if (property_exists($data, 'Propagation') && $data->{'Propagation'} !== null) { - $object->setPropagation($data->{'Propagation'}); + if (\array_key_exists('NonRecursive', $data) && \is_int($data['NonRecursive'])) { + $data['NonRecursive'] = (bool) $data['NonRecursive']; + } + if (\array_key_exists('CreateMountpoint', $data) && \is_int($data['CreateMountpoint'])) { + $data['CreateMountpoint'] = (bool) $data['CreateMountpoint']; + } + if (\array_key_exists('ReadOnlyNonRecursive', $data) && \is_int($data['ReadOnlyNonRecursive'])) { + $data['ReadOnlyNonRecursive'] = (bool) $data['ReadOnlyNonRecursive']; + } + if (\array_key_exists('ReadOnlyForceRecursive', $data) && \is_int($data['ReadOnlyForceRecursive'])) { + $data['ReadOnlyForceRecursive'] = (bool) $data['ReadOnlyForceRecursive']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Propagation', $data) && null !== $data['Propagation']) { + $object->setPropagation($data['Propagation']); + unset($data['Propagation']); + } elseif (\array_key_exists('Propagation', $data) && null === $data['Propagation']) { + $object->setPropagation(null); + } + if (\array_key_exists('NonRecursive', $data) && null !== $data['NonRecursive']) { + $object->setNonRecursive($data['NonRecursive']); + unset($data['NonRecursive']); + } elseif (\array_key_exists('NonRecursive', $data) && null === $data['NonRecursive']) { + $object->setNonRecursive(null); + } + if (\array_key_exists('CreateMountpoint', $data) && null !== $data['CreateMountpoint']) { + $object->setCreateMountpoint($data['CreateMountpoint']); + unset($data['CreateMountpoint']); + } elseif (\array_key_exists('CreateMountpoint', $data) && null === $data['CreateMountpoint']) { + $object->setCreateMountpoint(null); + } + if (\array_key_exists('ReadOnlyNonRecursive', $data) && null !== $data['ReadOnlyNonRecursive']) { + $object->setReadOnlyNonRecursive($data['ReadOnlyNonRecursive']); + unset($data['ReadOnlyNonRecursive']); + } elseif (\array_key_exists('ReadOnlyNonRecursive', $data) && null === $data['ReadOnlyNonRecursive']) { + $object->setReadOnlyNonRecursive(null); + } + if (\array_key_exists('ReadOnlyForceRecursive', $data) && null !== $data['ReadOnlyForceRecursive']) { + $object->setReadOnlyForceRecursive($data['ReadOnlyForceRecursive']); + unset($data['ReadOnlyForceRecursive']); + } elseif (\array_key_exists('ReadOnlyForceRecursive', $data) && null === $data['ReadOnlyForceRecursive']) { + $object->setReadOnlyForceRecursive(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getPropagation()) { - $data->{'Propagation'} = $object->getPropagation(); + $dataArray = []; + if ($data->isInitialized('propagation') && null !== $data->getPropagation()) { + $dataArray['Propagation'] = $data->getPropagation(); + } + if ($data->isInitialized('nonRecursive') && null !== $data->getNonRecursive()) { + $dataArray['NonRecursive'] = $data->getNonRecursive(); + } + if ($data->isInitialized('createMountpoint') && null !== $data->getCreateMountpoint()) { + $dataArray['CreateMountpoint'] = $data->getCreateMountpoint(); + } + if ($data->isInitialized('readOnlyNonRecursive') && null !== $data->getReadOnlyNonRecursive()) { + $dataArray['ReadOnlyNonRecursive'] = $data->getReadOnlyNonRecursive(); + } + if ($data->isInitialized('readOnlyForceRecursive') && null !== $data->getReadOnlyForceRecursive()) { + $dataArray['ReadOnlyForceRecursive'] = $data->getReadOnlyForceRecursive(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\MountBindOptions::class => false]; } } diff --git a/src/Normalizer/MountNormalizer.php b/src/Normalizer/MountNormalizer.php index e2cb656e..2986f538 100644 --- a/src/Normalizer/MountNormalizer.php +++ b/src/Normalizer/MountNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,81 +16,131 @@ class MountNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Mount'; + return \Docker\API\Model\Mount::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Mount; + return \is_object($data) && \Docker\API\Model\Mount::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\Mount(); - if (property_exists($data, 'Target') && $data->{'Target'} !== null) { - $object->setTarget($data->{'Target'}); - } - if (property_exists($data, 'Source') && $data->{'Source'} !== null) { - $object->setSource($data->{'Source'}); - } - if (property_exists($data, 'Type') && $data->{'Type'} !== null) { - $object->setType($data->{'Type'}); - } - if (property_exists($data, 'ReadOnly') && $data->{'ReadOnly'} !== null) { - $object->setReadOnly($data->{'ReadOnly'}); - } - if (property_exists($data, 'Consistency') && $data->{'Consistency'} !== null) { - $object->setConsistency($data->{'Consistency'}); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'BindOptions') && $data->{'BindOptions'} !== null) { - $object->setBindOptions($this->denormalizer->denormalize($data->{'BindOptions'}, 'Docker\\API\\Model\\MountBindOptions', 'json', $context)); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'VolumeOptions') && $data->{'VolumeOptions'} !== null) { - $object->setVolumeOptions($this->denormalizer->denormalize($data->{'VolumeOptions'}, 'Docker\\API\\Model\\MountVolumeOptions', 'json', $context)); - } - if (property_exists($data, 'TmpfsOptions') && $data->{'TmpfsOptions'} !== null) { - $object->setTmpfsOptions($this->denormalizer->denormalize($data->{'TmpfsOptions'}, 'Docker\\API\\Model\\MountTmpfsOptions', 'json', $context)); + $object = new \Docker\API\Model\Mount(); + if (\array_key_exists('ReadOnly', $data) && \is_int($data['ReadOnly'])) { + $data['ReadOnly'] = (bool) $data['ReadOnly']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Target', $data) && null !== $data['Target']) { + $object->setTarget($data['Target']); + unset($data['Target']); + } elseif (\array_key_exists('Target', $data) && null === $data['Target']) { + $object->setTarget(null); + } + if (\array_key_exists('Source', $data) && null !== $data['Source']) { + $object->setSource($data['Source']); + unset($data['Source']); + } elseif (\array_key_exists('Source', $data) && null === $data['Source']) { + $object->setSource(null); + } + if (\array_key_exists('Type', $data) && null !== $data['Type']) { + $object->setType($data['Type']); + unset($data['Type']); + } elseif (\array_key_exists('Type', $data) && null === $data['Type']) { + $object->setType(null); + } + if (\array_key_exists('ReadOnly', $data) && null !== $data['ReadOnly']) { + $object->setReadOnly($data['ReadOnly']); + unset($data['ReadOnly']); + } elseif (\array_key_exists('ReadOnly', $data) && null === $data['ReadOnly']) { + $object->setReadOnly(null); + } + if (\array_key_exists('Consistency', $data) && null !== $data['Consistency']) { + $object->setConsistency($data['Consistency']); + unset($data['Consistency']); + } elseif (\array_key_exists('Consistency', $data) && null === $data['Consistency']) { + $object->setConsistency(null); + } + if (\array_key_exists('BindOptions', $data) && null !== $data['BindOptions']) { + $object->setBindOptions($this->denormalizer->denormalize($data['BindOptions'], \Docker\API\Model\MountBindOptions::class, 'json', $context)); + unset($data['BindOptions']); + } elseif (\array_key_exists('BindOptions', $data) && null === $data['BindOptions']) { + $object->setBindOptions(null); + } + if (\array_key_exists('VolumeOptions', $data) && null !== $data['VolumeOptions']) { + $object->setVolumeOptions($this->denormalizer->denormalize($data['VolumeOptions'], \Docker\API\Model\MountVolumeOptions::class, 'json', $context)); + unset($data['VolumeOptions']); + } elseif (\array_key_exists('VolumeOptions', $data) && null === $data['VolumeOptions']) { + $object->setVolumeOptions(null); + } + if (\array_key_exists('TmpfsOptions', $data) && null !== $data['TmpfsOptions']) { + $object->setTmpfsOptions($this->denormalizer->denormalize($data['TmpfsOptions'], \Docker\API\Model\MountTmpfsOptions::class, 'json', $context)); + unset($data['TmpfsOptions']); + } elseif (\array_key_exists('TmpfsOptions', $data) && null === $data['TmpfsOptions']) { + $object->setTmpfsOptions(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getTarget()) { - $data->{'Target'} = $object->getTarget(); + $dataArray = []; + if ($data->isInitialized('target') && null !== $data->getTarget()) { + $dataArray['Target'] = $data->getTarget(); + } + if ($data->isInitialized('source') && null !== $data->getSource()) { + $dataArray['Source'] = $data->getSource(); } - if (null !== $object->getSource()) { - $data->{'Source'} = $object->getSource(); + if ($data->isInitialized('type') && null !== $data->getType()) { + $dataArray['Type'] = $data->getType(); } - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); + if ($data->isInitialized('readOnly') && null !== $data->getReadOnly()) { + $dataArray['ReadOnly'] = $data->getReadOnly(); } - if (null !== $object->getReadOnly()) { - $data->{'ReadOnly'} = $object->getReadOnly(); + if ($data->isInitialized('consistency') && null !== $data->getConsistency()) { + $dataArray['Consistency'] = $data->getConsistency(); } - if (null !== $object->getConsistency()) { - $data->{'Consistency'} = $object->getConsistency(); + if ($data->isInitialized('bindOptions') && null !== $data->getBindOptions()) { + $dataArray['BindOptions'] = $this->normalizer->normalize($data->getBindOptions(), 'json', $context); } - if (null !== $object->getBindOptions()) { - $data->{'BindOptions'} = $this->normalizer->normalize($object->getBindOptions(), 'json', $context); + if ($data->isInitialized('volumeOptions') && null !== $data->getVolumeOptions()) { + $dataArray['VolumeOptions'] = $this->normalizer->normalize($data->getVolumeOptions(), 'json', $context); } - if (null !== $object->getVolumeOptions()) { - $data->{'VolumeOptions'} = $this->normalizer->normalize($object->getVolumeOptions(), 'json', $context); + if ($data->isInitialized('tmpfsOptions') && null !== $data->getTmpfsOptions()) { + $dataArray['TmpfsOptions'] = $this->normalizer->normalize($data->getTmpfsOptions(), 'json', $context); } - if (null !== $object->getTmpfsOptions()) { - $data->{'TmpfsOptions'} = $this->normalizer->normalize($object->getTmpfsOptions(), 'json', $context); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Mount::class => false]; } } diff --git a/src/Normalizer/MountPointNormalizer.php b/src/Normalizer/MountPointNormalizer.php index 5a5f2cf7..9b92d883 100644 --- a/src/Normalizer/MountPointNormalizer.php +++ b/src/Normalizer/MountPointNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,81 +16,131 @@ class MountPointNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\MountPoint'; + return \Docker\API\Model\MountPoint::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\MountPoint; + return \is_object($data) && \Docker\API\Model\MountPoint::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\MountPoint(); - if (property_exists($data, 'Type') && $data->{'Type'} !== null) { - $object->setType($data->{'Type'}); - } - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Source') && $data->{'Source'} !== null) { - $object->setSource($data->{'Source'}); - } - if (property_exists($data, 'Destination') && $data->{'Destination'} !== null) { - $object->setDestination($data->{'Destination'}); - } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($data->{'Driver'}); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'Mode') && $data->{'Mode'} !== null) { - $object->setMode($data->{'Mode'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'RW') && $data->{'RW'} !== null) { - $object->setRW($data->{'RW'}); - } - if (property_exists($data, 'Propagation') && $data->{'Propagation'} !== null) { - $object->setPropagation($data->{'Propagation'}); + $object = new \Docker\API\Model\MountPoint(); + if (\array_key_exists('RW', $data) && \is_int($data['RW'])) { + $data['RW'] = (bool) $data['RW']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && null !== $data['Type']) { + $object->setType($data['Type']); + unset($data['Type']); + } elseif (\array_key_exists('Type', $data) && null === $data['Type']) { + $object->setType(null); + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Source', $data) && null !== $data['Source']) { + $object->setSource($data['Source']); + unset($data['Source']); + } elseif (\array_key_exists('Source', $data) && null === $data['Source']) { + $object->setSource(null); + } + if (\array_key_exists('Destination', $data) && null !== $data['Destination']) { + $object->setDestination($data['Destination']); + unset($data['Destination']); + } elseif (\array_key_exists('Destination', $data) && null === $data['Destination']) { + $object->setDestination(null); + } + if (\array_key_exists('Driver', $data) && null !== $data['Driver']) { + $object->setDriver($data['Driver']); + unset($data['Driver']); + } elseif (\array_key_exists('Driver', $data) && null === $data['Driver']) { + $object->setDriver(null); + } + if (\array_key_exists('Mode', $data) && null !== $data['Mode']) { + $object->setMode($data['Mode']); + unset($data['Mode']); + } elseif (\array_key_exists('Mode', $data) && null === $data['Mode']) { + $object->setMode(null); + } + if (\array_key_exists('RW', $data) && null !== $data['RW']) { + $object->setRW($data['RW']); + unset($data['RW']); + } elseif (\array_key_exists('RW', $data) && null === $data['RW']) { + $object->setRW(null); + } + if (\array_key_exists('Propagation', $data) && null !== $data['Propagation']) { + $object->setPropagation($data['Propagation']); + unset($data['Propagation']); + } elseif (\array_key_exists('Propagation', $data) && null === $data['Propagation']) { + $object->setPropagation(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); + $dataArray = []; + if ($data->isInitialized('type') && null !== $data->getType()) { + $dataArray['Type'] = $data->getType(); + } + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + if ($data->isInitialized('source') && null !== $data->getSource()) { + $dataArray['Source'] = $data->getSource(); } - if (null !== $object->getSource()) { - $data->{'Source'} = $object->getSource(); + if ($data->isInitialized('destination') && null !== $data->getDestination()) { + $dataArray['Destination'] = $data->getDestination(); } - if (null !== $object->getDestination()) { - $data->{'Destination'} = $object->getDestination(); + if ($data->isInitialized('driver') && null !== $data->getDriver()) { + $dataArray['Driver'] = $data->getDriver(); } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); + if ($data->isInitialized('mode') && null !== $data->getMode()) { + $dataArray['Mode'] = $data->getMode(); } - if (null !== $object->getMode()) { - $data->{'Mode'} = $object->getMode(); + if ($data->isInitialized('rW') && null !== $data->getRW()) { + $dataArray['RW'] = $data->getRW(); } - if (null !== $object->getRW()) { - $data->{'RW'} = $object->getRW(); + if ($data->isInitialized('propagation') && null !== $data->getPropagation()) { + $dataArray['Propagation'] = $data->getPropagation(); } - if (null !== $object->getPropagation()) { - $data->{'Propagation'} = $object->getPropagation(); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\MountPoint::class => false]; } } diff --git a/src/Normalizer/MountTmpfsOptionsNormalizer.php b/src/Normalizer/MountTmpfsOptionsNormalizer.php index fd9f9347..4fbcf4ac 100644 --- a/src/Normalizer/MountTmpfsOptionsNormalizer.php +++ b/src/Normalizer/MountTmpfsOptionsNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class MountTmpfsOptionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\MountTmpfsOptions'; + return \Docker\API\Model\MountTmpfsOptions::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\MountTmpfsOptions; + return \is_object($data) && \Docker\API\Model\MountTmpfsOptions::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\MountTmpfsOptions(); - if (property_exists($data, 'SizeBytes') && $data->{'SizeBytes'} !== null) { - $object->setSizeBytes($data->{'SizeBytes'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('SizeBytes', $data) && null !== $data['SizeBytes']) { + $object->setSizeBytes($data['SizeBytes']); + unset($data['SizeBytes']); + } elseif (\array_key_exists('SizeBytes', $data) && null === $data['SizeBytes']) { + $object->setSizeBytes(null); + } + if (\array_key_exists('Mode', $data) && null !== $data['Mode']) { + $object->setMode($data['Mode']); + unset($data['Mode']); + } elseif (\array_key_exists('Mode', $data) && null === $data['Mode']) { + $object->setMode(null); } - if (property_exists($data, 'Mode') && $data->{'Mode'} !== null) { - $object->setMode($data->{'Mode'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getSizeBytes()) { - $data->{'SizeBytes'} = $object->getSizeBytes(); + $dataArray = []; + if ($data->isInitialized('sizeBytes') && null !== $data->getSizeBytes()) { + $dataArray['SizeBytes'] = $data->getSizeBytes(); } - if (null !== $object->getMode()) { - $data->{'Mode'} = $object->getMode(); + if ($data->isInitialized('mode') && null !== $data->getMode()) { + $dataArray['Mode'] = $data->getMode(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\MountTmpfsOptions::class => false]; } } diff --git a/src/Normalizer/MountVolumeOptionsDriverConfigNormalizer.php b/src/Normalizer/MountVolumeOptionsDriverConfigNormalizer.php index 0297f51e..1eb60141 100644 --- a/src/Normalizer/MountVolumeOptionsDriverConfigNormalizer.php +++ b/src/Normalizer/MountVolumeOptionsDriverConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,53 +16,82 @@ class MountVolumeOptionsDriverConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\MountVolumeOptionsDriverConfig'; + return \Docker\API\Model\MountVolumeOptionsDriverConfig::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\MountVolumeOptionsDriverConfig; + return \is_object($data) && \Docker\API\Model\MountVolumeOptionsDriverConfig::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\MountVolumeOptionsDriverConfig(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { + if (\array_key_exists('Options', $data) && null !== $data['Options']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key => $value) { + foreach ($data['Options'] as $key => $value) { $values[$key] = $value; } $object->setOptions($values); + unset($data['Options']); + } elseif (\array_key_exists('Options', $data) && null === $data['Options']) { + $object->setOptions(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getOptions()) { - $values = new \stdClass(); - foreach ($object->getOptions() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('options') && null !== $data->getOptions()) { + $values = []; + foreach ($data->getOptions() as $key => $value) { + $values[$key] = $value; + } + $dataArray['Options'] = $values; + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; } - $data->{'Options'} = $values; } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\MountVolumeOptionsDriverConfig::class => false]; } } diff --git a/src/Normalizer/MountVolumeOptionsNormalizer.php b/src/Normalizer/MountVolumeOptionsNormalizer.php index cb7a42ac..d0969dde 100644 --- a/src/Normalizer/MountVolumeOptionsNormalizer.php +++ b/src/Normalizer/MountVolumeOptionsNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,59 +16,103 @@ class MountVolumeOptionsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\MountVolumeOptions'; + return \Docker\API\Model\MountVolumeOptions::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\MountVolumeOptions; + return \is_object($data) && \Docker\API\Model\MountVolumeOptions::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\MountVolumeOptions(); - if (property_exists($data, 'NoCopy') && $data->{'NoCopy'} !== null) { - $object->setNoCopy($data->{'NoCopy'}); + if (\array_key_exists('NoCopy', $data) && \is_int($data['NoCopy'])) { + $data['NoCopy'] = (bool) $data['NoCopy']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NoCopy', $data) && null !== $data['NoCopy']) { + $object->setNoCopy($data['NoCopy']); + unset($data['NoCopy']); + } elseif (\array_key_exists('NoCopy', $data) && null === $data['NoCopy']) { + $object->setNoCopy(null); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); } - if (property_exists($data, 'DriverConfig') && $data->{'DriverConfig'} !== null) { - $object->setDriverConfig($this->denormalizer->denormalize($data->{'DriverConfig'}, 'Docker\\API\\Model\\MountVolumeOptionsDriverConfig', 'json', $context)); + if (\array_key_exists('DriverConfig', $data) && null !== $data['DriverConfig']) { + $object->setDriverConfig($this->denormalizer->denormalize($data['DriverConfig'], \Docker\API\Model\MountVolumeOptionsDriverConfig::class, 'json', $context)); + unset($data['DriverConfig']); + } elseif (\array_key_exists('DriverConfig', $data) && null === $data['DriverConfig']) { + $object->setDriverConfig(null); + } + if (\array_key_exists('Subpath', $data) && null !== $data['Subpath']) { + $object->setSubpath($data['Subpath']); + unset($data['Subpath']); + } elseif (\array_key_exists('Subpath', $data) && null === $data['Subpath']) { + $object->setSubpath(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getNoCopy()) { - $data->{'NoCopy'} = $object->getNoCopy(); + $dataArray = []; + if ($data->isInitialized('noCopy') && null !== $data->getNoCopy()) { + $dataArray['NoCopy'] = $data->getNoCopy(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values = []; + foreach ($data->getLabels() as $key => $value) { + $values[$key] = $value; } - $data->{'Labels'} = $values; + $dataArray['Labels'] = $values; + } + if ($data->isInitialized('driverConfig') && null !== $data->getDriverConfig()) { + $dataArray['DriverConfig'] = $this->normalizer->normalize($data->getDriverConfig(), 'json', $context); } - if (null !== $object->getDriverConfig()) { - $data->{'DriverConfig'} = $this->normalizer->normalize($object->getDriverConfig(), 'json', $context); + if ($data->isInitialized('subpath') && null !== $data->getSubpath()) { + $dataArray['Subpath'] = $data->getSubpath(); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\MountVolumeOptions::class => false]; } } diff --git a/src/Normalizer/NetworkAttachmentConfigNormalizer.php b/src/Normalizer/NetworkAttachmentConfigNormalizer.php new file mode 100644 index 00000000..ea6e15d9 --- /dev/null +++ b/src/Normalizer/NetworkAttachmentConfigNormalizer.php @@ -0,0 +1,114 @@ +setTarget($data['Target']); + unset($data['Target']); + } elseif (\array_key_exists('Target', $data) && null === $data['Target']) { + $object->setTarget(null); + } + if (\array_key_exists('Aliases', $data) && null !== $data['Aliases']) { + $values = []; + foreach ($data['Aliases'] as $value) { + $values[] = $value; + } + $object->setAliases($values); + unset($data['Aliases']); + } elseif (\array_key_exists('Aliases', $data) && null === $data['Aliases']) { + $object->setAliases(null); + } + if (\array_key_exists('DriverOpts', $data) && null !== $data['DriverOpts']) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['DriverOpts'] as $key => $value_1) { + $values_1[$key] = $value_1; + } + $object->setDriverOpts($values_1); + unset($data['DriverOpts']); + } elseif (\array_key_exists('DriverOpts', $data) && null === $data['DriverOpts']) { + $object->setDriverOpts(null); + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('target') && null !== $data->getTarget()) { + $dataArray['Target'] = $data->getTarget(); + } + if ($data->isInitialized('aliases') && null !== $data->getAliases()) { + $values = []; + foreach ($data->getAliases() as $value) { + $values[] = $value; + } + $dataArray['Aliases'] = $values; + } + if ($data->isInitialized('driverOpts') && null !== $data->getDriverOpts()) { + $values_1 = []; + foreach ($data->getDriverOpts() as $key => $value_1) { + $values_1[$key] = $value_1; + } + $dataArray['DriverOpts'] = $values_1; + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_2; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworkAttachmentConfig::class => false]; + } +} diff --git a/src/Normalizer/NetworkContainerNormalizer.php b/src/Normalizer/NetworkContainerNormalizer.php index d1bc94a4..fbf9b5a7 100644 --- a/src/Normalizer/NetworkContainerNormalizer.php +++ b/src/Normalizer/NetworkContainerNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,63 +16,101 @@ class NetworkContainerNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\NetworkContainer'; + return \Docker\API\Model\NetworkContainer::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\NetworkContainer; + return \is_object($data) && \Docker\API\Model\NetworkContainer::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\NetworkContainer(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('EndpointID', $data) && null !== $data['EndpointID']) { + $object->setEndpointID($data['EndpointID']); + unset($data['EndpointID']); + } elseif (\array_key_exists('EndpointID', $data) && null === $data['EndpointID']) { + $object->setEndpointID(null); } - if (property_exists($data, 'EndpointID') && $data->{'EndpointID'} !== null) { - $object->setEndpointID($data->{'EndpointID'}); + if (\array_key_exists('MacAddress', $data) && null !== $data['MacAddress']) { + $object->setMacAddress($data['MacAddress']); + unset($data['MacAddress']); + } elseif (\array_key_exists('MacAddress', $data) && null === $data['MacAddress']) { + $object->setMacAddress(null); } - if (property_exists($data, 'MacAddress') && $data->{'MacAddress'} !== null) { - $object->setMacAddress($data->{'MacAddress'}); + if (\array_key_exists('IPv4Address', $data) && null !== $data['IPv4Address']) { + $object->setIPv4Address($data['IPv4Address']); + unset($data['IPv4Address']); + } elseif (\array_key_exists('IPv4Address', $data) && null === $data['IPv4Address']) { + $object->setIPv4Address(null); } - if (property_exists($data, 'IPv4Address') && $data->{'IPv4Address'} !== null) { - $object->setIPv4Address($data->{'IPv4Address'}); + if (\array_key_exists('IPv6Address', $data) && null !== $data['IPv6Address']) { + $object->setIPv6Address($data['IPv6Address']); + unset($data['IPv6Address']); + } elseif (\array_key_exists('IPv6Address', $data) && null === $data['IPv6Address']) { + $object->setIPv6Address(null); } - if (property_exists($data, 'IPv6Address') && $data->{'IPv6Address'} !== null) { - $object->setIPv6Address($data->{'IPv6Address'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getEndpointID()) { - $data->{'EndpointID'} = $object->getEndpointID(); + if ($data->isInitialized('endpointID') && null !== $data->getEndpointID()) { + $dataArray['EndpointID'] = $data->getEndpointID(); } - if (null !== $object->getMacAddress()) { - $data->{'MacAddress'} = $object->getMacAddress(); + if ($data->isInitialized('macAddress') && null !== $data->getMacAddress()) { + $dataArray['MacAddress'] = $data->getMacAddress(); } - if (null !== $object->getIPv4Address()) { - $data->{'IPv4Address'} = $object->getIPv4Address(); + if ($data->isInitialized('iPv4Address') && null !== $data->getIPv4Address()) { + $dataArray['IPv4Address'] = $data->getIPv4Address(); } - if (null !== $object->getIPv6Address()) { - $data->{'IPv6Address'} = $object->getIPv6Address(); + if ($data->isInitialized('iPv6Address') && null !== $data->getIPv6Address()) { + $dataArray['IPv6Address'] = $data->getIPv6Address(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworkContainer::class => false]; } } diff --git a/src/Normalizer/NetworkNormalizer.php b/src/Normalizer/NetworkNormalizer.php index 3e881b32..d382ff53 100644 --- a/src/Normalizer/NetworkNormalizer.php +++ b/src/Normalizer/NetworkNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,135 +16,209 @@ class NetworkNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Network'; + return \Docker\API\Model\Network::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Network; + return \is_object($data) && \Docker\API\Model\Network::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\Network(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Id') && $data->{'Id'} !== null) { - $object->setId($data->{'Id'}); - } - if (property_exists($data, 'Created') && $data->{'Created'} !== null) { - $object->setCreated($data->{'Created'}); - } - if (property_exists($data, 'Scope') && $data->{'Scope'} !== null) { - $object->setScope($data->{'Scope'}); - } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($data->{'Driver'}); - } - if (property_exists($data, 'EnableIPv6') && $data->{'EnableIPv6'} !== null) { - $object->setEnableIPv6($data->{'EnableIPv6'}); - } - if (property_exists($data, 'IPAM') && $data->{'IPAM'} !== null) { - $object->setIPAM($this->denormalizer->denormalize($data->{'IPAM'}, 'Docker\\API\\Model\\IPAM', 'json', $context)); - } - if (property_exists($data, 'Internal') && $data->{'Internal'} !== null) { - $object->setInternal($data->{'Internal'}); - } - if (property_exists($data, 'Attachable') && $data->{'Attachable'} !== null) { - $object->setAttachable($data->{'Attachable'}); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'Ingress') && $data->{'Ingress'} !== null) { - $object->setIngress($data->{'Ingress'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'Containers') && $data->{'Containers'} !== null) { + $object = new \Docker\API\Model\Network(); + if (\array_key_exists('EnableIPv6', $data) && \is_int($data['EnableIPv6'])) { + $data['EnableIPv6'] = (bool) $data['EnableIPv6']; + } + if (\array_key_exists('Internal', $data) && \is_int($data['Internal'])) { + $data['Internal'] = (bool) $data['Internal']; + } + if (\array_key_exists('Attachable', $data) && \is_int($data['Attachable'])) { + $data['Attachable'] = (bool) $data['Attachable']; + } + if (\array_key_exists('Ingress', $data) && \is_int($data['Ingress'])) { + $data['Ingress'] = (bool) $data['Ingress']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Id', $data) && null !== $data['Id']) { + $object->setId($data['Id']); + unset($data['Id']); + } elseif (\array_key_exists('Id', $data) && null === $data['Id']) { + $object->setId(null); + } + if (\array_key_exists('Created', $data) && null !== $data['Created']) { + $object->setCreated($data['Created']); + unset($data['Created']); + } elseif (\array_key_exists('Created', $data) && null === $data['Created']) { + $object->setCreated(null); + } + if (\array_key_exists('Scope', $data) && null !== $data['Scope']) { + $object->setScope($data['Scope']); + unset($data['Scope']); + } elseif (\array_key_exists('Scope', $data) && null === $data['Scope']) { + $object->setScope(null); + } + if (\array_key_exists('Driver', $data) && null !== $data['Driver']) { + $object->setDriver($data['Driver']); + unset($data['Driver']); + } elseif (\array_key_exists('Driver', $data) && null === $data['Driver']) { + $object->setDriver(null); + } + if (\array_key_exists('EnableIPv6', $data) && null !== $data['EnableIPv6']) { + $object->setEnableIPv6($data['EnableIPv6']); + unset($data['EnableIPv6']); + } elseif (\array_key_exists('EnableIPv6', $data) && null === $data['EnableIPv6']) { + $object->setEnableIPv6(null); + } + if (\array_key_exists('IPAM', $data) && null !== $data['IPAM']) { + $object->setIPAM($this->denormalizer->denormalize($data['IPAM'], \Docker\API\Model\IPAM::class, 'json', $context)); + unset($data['IPAM']); + } elseif (\array_key_exists('IPAM', $data) && null === $data['IPAM']) { + $object->setIPAM(null); + } + if (\array_key_exists('Internal', $data) && null !== $data['Internal']) { + $object->setInternal($data['Internal']); + unset($data['Internal']); + } elseif (\array_key_exists('Internal', $data) && null === $data['Internal']) { + $object->setInternal(null); + } + if (\array_key_exists('Attachable', $data) && null !== $data['Attachable']) { + $object->setAttachable($data['Attachable']); + unset($data['Attachable']); + } elseif (\array_key_exists('Attachable', $data) && null === $data['Attachable']) { + $object->setAttachable(null); + } + if (\array_key_exists('Ingress', $data) && null !== $data['Ingress']) { + $object->setIngress($data['Ingress']); + unset($data['Ingress']); + } elseif (\array_key_exists('Ingress', $data) && null === $data['Ingress']) { + $object->setIngress(null); + } + if (\array_key_exists('Containers', $data) && null !== $data['Containers']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Containers'} as $key => $value) { - $values[$key] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\NetworkContainer', 'json', $context); + foreach ($data['Containers'] as $key => $value) { + $values[$key] = $this->denormalizer->denormalize($value, \Docker\API\Model\NetworkContainer::class, 'json', $context); } $object->setContainers($values); + unset($data['Containers']); + } elseif (\array_key_exists('Containers', $data) && null === $data['Containers']) { + $object->setContainers(null); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { + if (\array_key_exists('Options', $data) && null !== $data['Options']) { $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key_1 => $value_1) { + foreach ($data['Options'] as $key_1 => $value_1) { $values_1[$key_1] = $value_1; } $object->setOptions($values_1); + unset($data['Options']); + } elseif (\array_key_exists('Options', $data) && null === $data['Options']) { + $object->setOptions(null); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key_2 => $value_2) { + foreach ($data['Labels'] as $key_2 => $value_2) { $values_2[$key_2] = $value_2; } $object->setLabels($values_2); + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + foreach ($data as $key_3 => $value_3) { + if (preg_match('/.*/', (string) $key_3)) { + $object[$key_3] = $value_3; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); + if ($data->isInitialized('id') && null !== $data->getId()) { + $dataArray['Id'] = $data->getId(); } - if (null !== $object->getCreated()) { - $data->{'Created'} = $object->getCreated(); + if ($data->isInitialized('created') && null !== $data->getCreated()) { + $dataArray['Created'] = $data->getCreated(); } - if (null !== $object->getScope()) { - $data->{'Scope'} = $object->getScope(); + if ($data->isInitialized('scope') && null !== $data->getScope()) { + $dataArray['Scope'] = $data->getScope(); } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); + if ($data->isInitialized('driver') && null !== $data->getDriver()) { + $dataArray['Driver'] = $data->getDriver(); } - if (null !== $object->getEnableIPv6()) { - $data->{'EnableIPv6'} = $object->getEnableIPv6(); + if ($data->isInitialized('enableIPv6') && null !== $data->getEnableIPv6()) { + $dataArray['EnableIPv6'] = $data->getEnableIPv6(); } - if (null !== $object->getIPAM()) { - $data->{'IPAM'} = $this->normalizer->normalize($object->getIPAM(), 'json', $context); + if ($data->isInitialized('iPAM') && null !== $data->getIPAM()) { + $dataArray['IPAM'] = $this->normalizer->normalize($data->getIPAM(), 'json', $context); } - if (null !== $object->getInternal()) { - $data->{'Internal'} = $object->getInternal(); + if ($data->isInitialized('internal') && null !== $data->getInternal()) { + $dataArray['Internal'] = $data->getInternal(); } - if (null !== $object->getAttachable()) { - $data->{'Attachable'} = $object->getAttachable(); + if ($data->isInitialized('attachable') && null !== $data->getAttachable()) { + $dataArray['Attachable'] = $data->getAttachable(); } - if (null !== $object->getIngress()) { - $data->{'Ingress'} = $object->getIngress(); + if ($data->isInitialized('ingress') && null !== $data->getIngress()) { + $dataArray['Ingress'] = $data->getIngress(); + } + if ($data->isInitialized('containers') && null !== $data->getContainers()) { + $values = []; + foreach ($data->getContainers() as $key => $value) { + $values[$key] = $this->normalizer->normalize($value, 'json', $context); + } + $dataArray['Containers'] = $values; } - if (null !== $object->getContainers()) { - $values = new \stdClass(); - foreach ($object->getContainers() as $key => $value) { - $values->{$key} = $this->normalizer->normalize($value, 'json', $context); + if ($data->isInitialized('options') && null !== $data->getOptions()) { + $values_1 = []; + foreach ($data->getOptions() as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; } - $data->{'Containers'} = $values; + $dataArray['Options'] = $values_1; } - if (null !== $object->getOptions()) { - $values_1 = new \stdClass(); - foreach ($object->getOptions() as $key_1 => $value_1) { - $values_1->{$key_1} = $value_1; + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values_2 = []; + foreach ($data->getLabels() as $key_2 => $value_2) { + $values_2[$key_2] = $value_2; } - $data->{'Options'} = $values_1; + $dataArray['Labels'] = $values_2; } - if (null !== $object->getLabels()) { - $values_2 = new \stdClass(); - foreach ($object->getLabels() as $key_2 => $value_2) { - $values_2->{$key_2} = $value_2; + foreach ($data as $key_3 => $value_3) { + if (preg_match('/.*/', (string) $key_3)) { + $dataArray[$key_3] = $value_3; } - $data->{'Labels'} = $values_2; } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Network::class => false]; } } diff --git a/src/Normalizer/NetworkSettingsNormalizer.php b/src/Normalizer/NetworkSettingsNormalizer.php index 6d82a9e6..f0835488 100644 --- a/src/Normalizer/NetworkSettingsNormalizer.php +++ b/src/Normalizer/NetworkSettingsNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,181 +16,269 @@ class NetworkSettingsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\NetworkSettings'; + return \Docker\API\Model\NetworkSettings::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\NetworkSettings; + return \is_object($data) && \Docker\API\Model\NetworkSettings::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\NetworkSettings(); - if (property_exists($data, 'Bridge') && $data->{'Bridge'} !== null) { - $object->setBridge($data->{'Bridge'}); - } - if (property_exists($data, 'SandboxID') && $data->{'SandboxID'} !== null) { - $object->setSandboxID($data->{'SandboxID'}); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'HairpinMode') && $data->{'HairpinMode'} !== null) { - $object->setHairpinMode($data->{'HairpinMode'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'LinkLocalIPv6Address') && $data->{'LinkLocalIPv6Address'} !== null) { - $object->setLinkLocalIPv6Address($data->{'LinkLocalIPv6Address'}); - } - if (property_exists($data, 'LinkLocalIPv6PrefixLen') && $data->{'LinkLocalIPv6PrefixLen'} !== null) { - $object->setLinkLocalIPv6PrefixLen($data->{'LinkLocalIPv6PrefixLen'}); - } - if (property_exists($data, 'Ports') && $data->{'Ports'} !== null) { + $object = new \Docker\API\Model\NetworkSettings(); + if (\array_key_exists('HairpinMode', $data) && \is_int($data['HairpinMode'])) { + $data['HairpinMode'] = (bool) $data['HairpinMode']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Bridge', $data) && null !== $data['Bridge']) { + $object->setBridge($data['Bridge']); + unset($data['Bridge']); + } elseif (\array_key_exists('Bridge', $data) && null === $data['Bridge']) { + $object->setBridge(null); + } + if (\array_key_exists('SandboxID', $data) && null !== $data['SandboxID']) { + $object->setSandboxID($data['SandboxID']); + unset($data['SandboxID']); + } elseif (\array_key_exists('SandboxID', $data) && null === $data['SandboxID']) { + $object->setSandboxID(null); + } + if (\array_key_exists('HairpinMode', $data) && null !== $data['HairpinMode']) { + $object->setHairpinMode($data['HairpinMode']); + unset($data['HairpinMode']); + } elseif (\array_key_exists('HairpinMode', $data) && null === $data['HairpinMode']) { + $object->setHairpinMode(null); + } + if (\array_key_exists('LinkLocalIPv6Address', $data) && null !== $data['LinkLocalIPv6Address']) { + $object->setLinkLocalIPv6Address($data['LinkLocalIPv6Address']); + unset($data['LinkLocalIPv6Address']); + } elseif (\array_key_exists('LinkLocalIPv6Address', $data) && null === $data['LinkLocalIPv6Address']) { + $object->setLinkLocalIPv6Address(null); + } + if (\array_key_exists('LinkLocalIPv6PrefixLen', $data) && null !== $data['LinkLocalIPv6PrefixLen']) { + $object->setLinkLocalIPv6PrefixLen($data['LinkLocalIPv6PrefixLen']); + unset($data['LinkLocalIPv6PrefixLen']); + } elseif (\array_key_exists('LinkLocalIPv6PrefixLen', $data) && null === $data['LinkLocalIPv6PrefixLen']) { + $object->setLinkLocalIPv6PrefixLen(null); + } + if (\array_key_exists('Ports', $data) && null !== $data['Ports']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Ports'} as $key => $value) { + foreach ($data['Ports'] as $key => $value) { + if (null === $value) { + $values[$key] = null; + continue; + } $values_1 = []; foreach ($value as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PortBinding', 'json', $context); + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\PortBinding::class, 'json', $context); } $values[$key] = $values_1; } $object->setPorts($values); + unset($data['Ports']); + } elseif (\array_key_exists('Ports', $data) && null === $data['Ports']) { + $object->setPorts(null); } - if (property_exists($data, 'SandboxKey') && $data->{'SandboxKey'} !== null) { - $object->setSandboxKey($data->{'SandboxKey'}); + if (\array_key_exists('SandboxKey', $data) && null !== $data['SandboxKey']) { + $object->setSandboxKey($data['SandboxKey']); + unset($data['SandboxKey']); + } elseif (\array_key_exists('SandboxKey', $data) && null === $data['SandboxKey']) { + $object->setSandboxKey(null); } - if (property_exists($data, 'SecondaryIPAddresses') && $data->{'SecondaryIPAddresses'} !== null) { + if (\array_key_exists('SecondaryIPAddresses', $data) && null !== $data['SecondaryIPAddresses']) { $values_2 = []; - foreach ($data->{'SecondaryIPAddresses'} as $value_2) { - $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\Address', 'json', $context); + foreach ($data['SecondaryIPAddresses'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\Address::class, 'json', $context); } $object->setSecondaryIPAddresses($values_2); + unset($data['SecondaryIPAddresses']); + } elseif (\array_key_exists('SecondaryIPAddresses', $data) && null === $data['SecondaryIPAddresses']) { + $object->setSecondaryIPAddresses(null); } - if (property_exists($data, 'SecondaryIPv6Addresses') && $data->{'SecondaryIPv6Addresses'} !== null) { + if (\array_key_exists('SecondaryIPv6Addresses', $data) && null !== $data['SecondaryIPv6Addresses']) { $values_3 = []; - foreach ($data->{'SecondaryIPv6Addresses'} as $value_3) { - $values_3[] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\Address', 'json', $context); + foreach ($data['SecondaryIPv6Addresses'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\Address::class, 'json', $context); } $object->setSecondaryIPv6Addresses($values_3); - } - if (property_exists($data, 'EndpointID') && $data->{'EndpointID'} !== null) { - $object->setEndpointID($data->{'EndpointID'}); - } - if (property_exists($data, 'Gateway') && $data->{'Gateway'} !== null) { - $object->setGateway($data->{'Gateway'}); - } - if (property_exists($data, 'GlobalIPv6Address') && $data->{'GlobalIPv6Address'} !== null) { - $object->setGlobalIPv6Address($data->{'GlobalIPv6Address'}); - } - if (property_exists($data, 'GlobalIPv6PrefixLen') && $data->{'GlobalIPv6PrefixLen'} !== null) { - $object->setGlobalIPv6PrefixLen($data->{'GlobalIPv6PrefixLen'}); - } - if (property_exists($data, 'IPAddress') && $data->{'IPAddress'} !== null) { - $object->setIPAddress($data->{'IPAddress'}); - } - if (property_exists($data, 'IPPrefixLen') && $data->{'IPPrefixLen'} !== null) { - $object->setIPPrefixLen($data->{'IPPrefixLen'}); - } - if (property_exists($data, 'IPv6Gateway') && $data->{'IPv6Gateway'} !== null) { - $object->setIPv6Gateway($data->{'IPv6Gateway'}); - } - if (property_exists($data, 'MacAddress') && $data->{'MacAddress'} !== null) { - $object->setMacAddress($data->{'MacAddress'}); - } - if (property_exists($data, 'Networks') && $data->{'Networks'} !== null) { + unset($data['SecondaryIPv6Addresses']); + } elseif (\array_key_exists('SecondaryIPv6Addresses', $data) && null === $data['SecondaryIPv6Addresses']) { + $object->setSecondaryIPv6Addresses(null); + } + if (\array_key_exists('EndpointID', $data) && null !== $data['EndpointID']) { + $object->setEndpointID($data['EndpointID']); + unset($data['EndpointID']); + } elseif (\array_key_exists('EndpointID', $data) && null === $data['EndpointID']) { + $object->setEndpointID(null); + } + if (\array_key_exists('Gateway', $data) && null !== $data['Gateway']) { + $object->setGateway($data['Gateway']); + unset($data['Gateway']); + } elseif (\array_key_exists('Gateway', $data) && null === $data['Gateway']) { + $object->setGateway(null); + } + if (\array_key_exists('GlobalIPv6Address', $data) && null !== $data['GlobalIPv6Address']) { + $object->setGlobalIPv6Address($data['GlobalIPv6Address']); + unset($data['GlobalIPv6Address']); + } elseif (\array_key_exists('GlobalIPv6Address', $data) && null === $data['GlobalIPv6Address']) { + $object->setGlobalIPv6Address(null); + } + if (\array_key_exists('GlobalIPv6PrefixLen', $data) && null !== $data['GlobalIPv6PrefixLen']) { + $object->setGlobalIPv6PrefixLen($data['GlobalIPv6PrefixLen']); + unset($data['GlobalIPv6PrefixLen']); + } elseif (\array_key_exists('GlobalIPv6PrefixLen', $data) && null === $data['GlobalIPv6PrefixLen']) { + $object->setGlobalIPv6PrefixLen(null); + } + if (\array_key_exists('IPAddress', $data) && null !== $data['IPAddress']) { + $object->setIPAddress($data['IPAddress']); + unset($data['IPAddress']); + } elseif (\array_key_exists('IPAddress', $data) && null === $data['IPAddress']) { + $object->setIPAddress(null); + } + if (\array_key_exists('IPPrefixLen', $data) && null !== $data['IPPrefixLen']) { + $object->setIPPrefixLen($data['IPPrefixLen']); + unset($data['IPPrefixLen']); + } elseif (\array_key_exists('IPPrefixLen', $data) && null === $data['IPPrefixLen']) { + $object->setIPPrefixLen(null); + } + if (\array_key_exists('IPv6Gateway', $data) && null !== $data['IPv6Gateway']) { + $object->setIPv6Gateway($data['IPv6Gateway']); + unset($data['IPv6Gateway']); + } elseif (\array_key_exists('IPv6Gateway', $data) && null === $data['IPv6Gateway']) { + $object->setIPv6Gateway(null); + } + if (\array_key_exists('MacAddress', $data) && null !== $data['MacAddress']) { + $object->setMacAddress($data['MacAddress']); + unset($data['MacAddress']); + } elseif (\array_key_exists('MacAddress', $data) && null === $data['MacAddress']) { + $object->setMacAddress(null); + } + if (\array_key_exists('Networks', $data) && null !== $data['Networks']) { $values_4 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Networks'} as $key_1 => $value_4) { - $values_4[$key_1] = $this->denormalizer->denormalize($value_4, 'Docker\\API\\Model\\EndpointSettings', 'json', $context); + foreach ($data['Networks'] as $key_1 => $value_4) { + $values_4[$key_1] = $this->denormalizer->denormalize($value_4, \Docker\API\Model\EndpointSettings::class, 'json', $context); } $object->setNetworks($values_4); + unset($data['Networks']); + } elseif (\array_key_exists('Networks', $data) && null === $data['Networks']) { + $object->setNetworks(null); + } + foreach ($data as $key_2 => $value_5) { + if (preg_match('/.*/', (string) $key_2)) { + $object[$key_2] = $value_5; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getBridge()) { - $data->{'Bridge'} = $object->getBridge(); + $dataArray = []; + if ($data->isInitialized('bridge') && null !== $data->getBridge()) { + $dataArray['Bridge'] = $data->getBridge(); } - if (null !== $object->getSandboxID()) { - $data->{'SandboxID'} = $object->getSandboxID(); + if ($data->isInitialized('sandboxID') && null !== $data->getSandboxID()) { + $dataArray['SandboxID'] = $data->getSandboxID(); } - if (null !== $object->getHairpinMode()) { - $data->{'HairpinMode'} = $object->getHairpinMode(); + if ($data->isInitialized('hairpinMode') && null !== $data->getHairpinMode()) { + $dataArray['HairpinMode'] = $data->getHairpinMode(); } - if (null !== $object->getLinkLocalIPv6Address()) { - $data->{'LinkLocalIPv6Address'} = $object->getLinkLocalIPv6Address(); + if ($data->isInitialized('linkLocalIPv6Address') && null !== $data->getLinkLocalIPv6Address()) { + $dataArray['LinkLocalIPv6Address'] = $data->getLinkLocalIPv6Address(); } - if (null !== $object->getLinkLocalIPv6PrefixLen()) { - $data->{'LinkLocalIPv6PrefixLen'} = $object->getLinkLocalIPv6PrefixLen(); + if ($data->isInitialized('linkLocalIPv6PrefixLen') && null !== $data->getLinkLocalIPv6PrefixLen()) { + $dataArray['LinkLocalIPv6PrefixLen'] = $data->getLinkLocalIPv6PrefixLen(); } - if (null !== $object->getPorts()) { - $values = new \stdClass(); - foreach ($object->getPorts() as $key => $value) { + if ($data->isInitialized('ports') && null !== $data->getPorts()) { + $values = []; + foreach ($data->getPorts() as $key => $value) { + if (null === $value) { + $values[$key] = null; + continue; + } $values_1 = []; foreach ($value as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $values->{$key} = $values_1; + $values[$key] = $values_1; } - $data->{'Ports'} = $values; + $dataArray['Ports'] = $values; } - if (null !== $object->getSandboxKey()) { - $data->{'SandboxKey'} = $object->getSandboxKey(); + if ($data->isInitialized('sandboxKey') && null !== $data->getSandboxKey()) { + $dataArray['SandboxKey'] = $data->getSandboxKey(); } - if (null !== $object->getSecondaryIPAddresses()) { + if ($data->isInitialized('secondaryIPAddresses') && null !== $data->getSecondaryIPAddresses()) { $values_2 = []; - foreach ($object->getSecondaryIPAddresses() as $value_2) { + foreach ($data->getSecondaryIPAddresses() as $value_2) { $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); } - $data->{'SecondaryIPAddresses'} = $values_2; + $dataArray['SecondaryIPAddresses'] = $values_2; } - if (null !== $object->getSecondaryIPv6Addresses()) { + if ($data->isInitialized('secondaryIPv6Addresses') && null !== $data->getSecondaryIPv6Addresses()) { $values_3 = []; - foreach ($object->getSecondaryIPv6Addresses() as $value_3) { + foreach ($data->getSecondaryIPv6Addresses() as $value_3) { $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); } - $data->{'SecondaryIPv6Addresses'} = $values_3; + $dataArray['SecondaryIPv6Addresses'] = $values_3; + } + if ($data->isInitialized('endpointID') && null !== $data->getEndpointID()) { + $dataArray['EndpointID'] = $data->getEndpointID(); } - if (null !== $object->getEndpointID()) { - $data->{'EndpointID'} = $object->getEndpointID(); + if ($data->isInitialized('gateway') && null !== $data->getGateway()) { + $dataArray['Gateway'] = $data->getGateway(); } - if (null !== $object->getGateway()) { - $data->{'Gateway'} = $object->getGateway(); + if ($data->isInitialized('globalIPv6Address') && null !== $data->getGlobalIPv6Address()) { + $dataArray['GlobalIPv6Address'] = $data->getGlobalIPv6Address(); } - if (null !== $object->getGlobalIPv6Address()) { - $data->{'GlobalIPv6Address'} = $object->getGlobalIPv6Address(); + if ($data->isInitialized('globalIPv6PrefixLen') && null !== $data->getGlobalIPv6PrefixLen()) { + $dataArray['GlobalIPv6PrefixLen'] = $data->getGlobalIPv6PrefixLen(); } - if (null !== $object->getGlobalIPv6PrefixLen()) { - $data->{'GlobalIPv6PrefixLen'} = $object->getGlobalIPv6PrefixLen(); + if ($data->isInitialized('iPAddress') && null !== $data->getIPAddress()) { + $dataArray['IPAddress'] = $data->getIPAddress(); } - if (null !== $object->getIPAddress()) { - $data->{'IPAddress'} = $object->getIPAddress(); + if ($data->isInitialized('iPPrefixLen') && null !== $data->getIPPrefixLen()) { + $dataArray['IPPrefixLen'] = $data->getIPPrefixLen(); } - if (null !== $object->getIPPrefixLen()) { - $data->{'IPPrefixLen'} = $object->getIPPrefixLen(); + if ($data->isInitialized('iPv6Gateway') && null !== $data->getIPv6Gateway()) { + $dataArray['IPv6Gateway'] = $data->getIPv6Gateway(); } - if (null !== $object->getIPv6Gateway()) { - $data->{'IPv6Gateway'} = $object->getIPv6Gateway(); + if ($data->isInitialized('macAddress') && null !== $data->getMacAddress()) { + $dataArray['MacAddress'] = $data->getMacAddress(); } - if (null !== $object->getMacAddress()) { - $data->{'MacAddress'} = $object->getMacAddress(); + if ($data->isInitialized('networks') && null !== $data->getNetworks()) { + $values_4 = []; + foreach ($data->getNetworks() as $key_1 => $value_4) { + $values_4[$key_1] = $this->normalizer->normalize($value_4, 'json', $context); + } + $dataArray['Networks'] = $values_4; } - if (null !== $object->getNetworks()) { - $values_4 = new \stdClass(); - foreach ($object->getNetworks() as $key_1 => $value_4) { - $values_4->{$key_1} = $this->normalizer->normalize($value_4, 'json', $context); + foreach ($data as $key_2 => $value_5) { + if (preg_match('/.*/', (string) $key_2)) { + $dataArray[$key_2] = $value_5; } - $data->{'Networks'} = $values_4; } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworkSettings::class => false]; } } diff --git a/src/Normalizer/NetworkingConfigNormalizer.php b/src/Normalizer/NetworkingConfigNormalizer.php new file mode 100644 index 00000000..2f809449 --- /dev/null +++ b/src/Normalizer/NetworkingConfigNormalizer.php @@ -0,0 +1,88 @@ + $value) { + $values[$key] = $this->denormalizer->denormalize($value, \Docker\API\Model\EndpointSettings::class, 'json', $context); + } + $object->setEndpointsConfig($values); + unset($data['EndpointsConfig']); + } elseif (\array_key_exists('EndpointsConfig', $data) && null === $data['EndpointsConfig']) { + $object->setEndpointsConfig(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('endpointsConfig') && null !== $data->getEndpointsConfig()) { + $values = []; + foreach ($data->getEndpointsConfig() as $key => $value) { + $values[$key] = $this->normalizer->normalize($value, 'json', $context); + } + $dataArray['EndpointsConfig'] = $values; + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworkingConfig::class => false]; + } +} diff --git a/src/Normalizer/NetworksCreatePostBodyNormalizer.php b/src/Normalizer/NetworksCreatePostBodyNormalizer.php index 3b8ab3a1..14440a86 100644 --- a/src/Normalizer/NetworksCreatePostBodyNormalizer.php +++ b/src/Normalizer/NetworksCreatePostBodyNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,109 +16,175 @@ class NetworksCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\NetworksCreatePostBody'; + return \Docker\API\Model\NetworksCreatePostBody::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\NetworksCreatePostBody; + return \is_object($data) && \Docker\API\Model\NetworksCreatePostBody::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\NetworksCreatePostBody(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'CheckDuplicate') && $data->{'CheckDuplicate'} !== null) { - $object->setCheckDuplicate($data->{'CheckDuplicate'}); - } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($data->{'Driver'}); - } - if (property_exists($data, 'Internal') && $data->{'Internal'} !== null) { - $object->setInternal($data->{'Internal'}); - } - if (property_exists($data, 'Attachable') && $data->{'Attachable'} !== null) { - $object->setAttachable($data->{'Attachable'}); - } - if (property_exists($data, 'Ingress') && $data->{'Ingress'} !== null) { - $object->setIngress($data->{'Ingress'}); - } - if (property_exists($data, 'IPAM') && $data->{'IPAM'} !== null) { - $object->setIPAM($this->denormalizer->denormalize($data->{'IPAM'}, 'Docker\\API\\Model\\IPAM', 'json', $context)); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'EnableIPv6') && $data->{'EnableIPv6'} !== null) { - $object->setEnableIPv6($data->{'EnableIPv6'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { + $object = new \Docker\API\Model\NetworksCreatePostBody(); + if (\array_key_exists('CheckDuplicate', $data) && \is_int($data['CheckDuplicate'])) { + $data['CheckDuplicate'] = (bool) $data['CheckDuplicate']; + } + if (\array_key_exists('Internal', $data) && \is_int($data['Internal'])) { + $data['Internal'] = (bool) $data['Internal']; + } + if (\array_key_exists('Attachable', $data) && \is_int($data['Attachable'])) { + $data['Attachable'] = (bool) $data['Attachable']; + } + if (\array_key_exists('Ingress', $data) && \is_int($data['Ingress'])) { + $data['Ingress'] = (bool) $data['Ingress']; + } + if (\array_key_exists('EnableIPv6', $data) && \is_int($data['EnableIPv6'])) { + $data['EnableIPv6'] = (bool) $data['EnableIPv6']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('CheckDuplicate', $data) && null !== $data['CheckDuplicate']) { + $object->setCheckDuplicate($data['CheckDuplicate']); + unset($data['CheckDuplicate']); + } elseif (\array_key_exists('CheckDuplicate', $data) && null === $data['CheckDuplicate']) { + $object->setCheckDuplicate(null); + } + if (\array_key_exists('Driver', $data) && null !== $data['Driver']) { + $object->setDriver($data['Driver']); + unset($data['Driver']); + } elseif (\array_key_exists('Driver', $data) && null === $data['Driver']) { + $object->setDriver(null); + } + if (\array_key_exists('Internal', $data) && null !== $data['Internal']) { + $object->setInternal($data['Internal']); + unset($data['Internal']); + } elseif (\array_key_exists('Internal', $data) && null === $data['Internal']) { + $object->setInternal(null); + } + if (\array_key_exists('Attachable', $data) && null !== $data['Attachable']) { + $object->setAttachable($data['Attachable']); + unset($data['Attachable']); + } elseif (\array_key_exists('Attachable', $data) && null === $data['Attachable']) { + $object->setAttachable(null); + } + if (\array_key_exists('Ingress', $data) && null !== $data['Ingress']) { + $object->setIngress($data['Ingress']); + unset($data['Ingress']); + } elseif (\array_key_exists('Ingress', $data) && null === $data['Ingress']) { + $object->setIngress(null); + } + if (\array_key_exists('IPAM', $data) && null !== $data['IPAM']) { + $object->setIPAM($this->denormalizer->denormalize($data['IPAM'], \Docker\API\Model\IPAM::class, 'json', $context)); + unset($data['IPAM']); + } elseif (\array_key_exists('IPAM', $data) && null === $data['IPAM']) { + $object->setIPAM(null); + } + if (\array_key_exists('EnableIPv6', $data) && null !== $data['EnableIPv6']) { + $object->setEnableIPv6($data['EnableIPv6']); + unset($data['EnableIPv6']); + } elseif (\array_key_exists('EnableIPv6', $data) && null === $data['EnableIPv6']) { + $object->setEnableIPv6(null); + } + if (\array_key_exists('Options', $data) && null !== $data['Options']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key => $value) { + foreach ($data['Options'] as $key => $value) { $values[$key] = $value; } $object->setOptions($values); + unset($data['Options']); + } elseif (\array_key_exists('Options', $data) && null === $data['Options']) { + $object->setOptions(null); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key_1 => $value_1) { + foreach ($data['Labels'] as $key_1 => $value_1) { $values_1[$key_1] = $value_1; } $object->setLabels($values_1); + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + foreach ($data as $key_2 => $value_2) { + if (preg_match('/.*/', (string) $key_2)) { + $object[$key_2] = $value_2; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + $dataArray['Name'] = $data->getName(); + if ($data->isInitialized('checkDuplicate') && null !== $data->getCheckDuplicate()) { + $dataArray['CheckDuplicate'] = $data->getCheckDuplicate(); } - if (null !== $object->getCheckDuplicate()) { - $data->{'CheckDuplicate'} = $object->getCheckDuplicate(); + if ($data->isInitialized('driver') && null !== $data->getDriver()) { + $dataArray['Driver'] = $data->getDriver(); } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); + if ($data->isInitialized('internal') && null !== $data->getInternal()) { + $dataArray['Internal'] = $data->getInternal(); } - if (null !== $object->getInternal()) { - $data->{'Internal'} = $object->getInternal(); + if ($data->isInitialized('attachable') && null !== $data->getAttachable()) { + $dataArray['Attachable'] = $data->getAttachable(); } - if (null !== $object->getAttachable()) { - $data->{'Attachable'} = $object->getAttachable(); + if ($data->isInitialized('ingress') && null !== $data->getIngress()) { + $dataArray['Ingress'] = $data->getIngress(); } - if (null !== $object->getIngress()) { - $data->{'Ingress'} = $object->getIngress(); + if ($data->isInitialized('iPAM') && null !== $data->getIPAM()) { + $dataArray['IPAM'] = $this->normalizer->normalize($data->getIPAM(), 'json', $context); } - if (null !== $object->getIPAM()) { - $data->{'IPAM'} = $this->normalizer->normalize($object->getIPAM(), 'json', $context); + if ($data->isInitialized('enableIPv6') && null !== $data->getEnableIPv6()) { + $dataArray['EnableIPv6'] = $data->getEnableIPv6(); } - if (null !== $object->getEnableIPv6()) { - $data->{'EnableIPv6'} = $object->getEnableIPv6(); + if ($data->isInitialized('options') && null !== $data->getOptions()) { + $values = []; + foreach ($data->getOptions() as $key => $value) { + $values[$key] = $value; + } + $dataArray['Options'] = $values; } - if (null !== $object->getOptions()) { - $values = new \stdClass(); - foreach ($object->getOptions() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values_1 = []; + foreach ($data->getLabels() as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; } - $data->{'Options'} = $values; + $dataArray['Labels'] = $values_1; } - if (null !== $object->getLabels()) { - $values_1 = new \stdClass(); - foreach ($object->getLabels() as $key_1 => $value_1) { - $values_1->{$key_1} = $value_1; + foreach ($data as $key_2 => $value_2) { + if (preg_match('/.*/', (string) $key_2)) { + $dataArray[$key_2] = $value_2; } - $data->{'Labels'} = $values_1; } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworksCreatePostBody::class => false]; } } diff --git a/src/Normalizer/NetworksCreatePostResponse201Normalizer.php b/src/Normalizer/NetworksCreatePostResponse201Normalizer.php index 2daf0463..9f8eb8ed 100644 --- a/src/Normalizer/NetworksCreatePostResponse201Normalizer.php +++ b/src/Normalizer/NetworksCreatePostResponse201Normalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class NetworksCreatePostResponse201Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\NetworksCreatePostResponse201'; + return \Docker\API\Model\NetworksCreatePostResponse201::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\NetworksCreatePostResponse201; + return \is_object($data) && \Docker\API\Model\NetworksCreatePostResponse201::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\NetworksCreatePostResponse201(); - if (property_exists($data, 'Id') && $data->{'Id'} !== null) { - $object->setId($data->{'Id'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Id', $data) && null !== $data['Id']) { + $object->setId($data['Id']); + unset($data['Id']); + } elseif (\array_key_exists('Id', $data) && null === $data['Id']) { + $object->setId(null); + } + if (\array_key_exists('Warning', $data) && null !== $data['Warning']) { + $object->setWarning($data['Warning']); + unset($data['Warning']); + } elseif (\array_key_exists('Warning', $data) && null === $data['Warning']) { + $object->setWarning(null); } - if (property_exists($data, 'Warning') && $data->{'Warning'} !== null) { - $object->setWarning($data->{'Warning'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); + $dataArray = []; + if ($data->isInitialized('id') && null !== $data->getId()) { + $dataArray['Id'] = $data->getId(); } - if (null !== $object->getWarning()) { - $data->{'Warning'} = $object->getWarning(); + if ($data->isInitialized('warning') && null !== $data->getWarning()) { + $dataArray['Warning'] = $data->getWarning(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworksCreatePostResponse201::class => false]; } } diff --git a/src/Normalizer/NetworksIdConnectPostBodyNormalizer.php b/src/Normalizer/NetworksIdConnectPostBodyNormalizer.php index 90362a2a..c3970bce 100644 --- a/src/Normalizer/NetworksIdConnectPostBodyNormalizer.php +++ b/src/Normalizer/NetworksIdConnectPostBodyNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class NetworksIdConnectPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\NetworksIdConnectPostBody'; + return \Docker\API\Model\NetworksIdConnectPostBody::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\NetworksIdConnectPostBody; + return \is_object($data) && \Docker\API\Model\NetworksIdConnectPostBody::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\NetworksIdConnectPostBody(); - if (property_exists($data, 'Container') && $data->{'Container'} !== null) { - $object->setContainer($data->{'Container'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Container', $data) && null !== $data['Container']) { + $object->setContainer($data['Container']); + unset($data['Container']); + } elseif (\array_key_exists('Container', $data) && null === $data['Container']) { + $object->setContainer(null); + } + if (\array_key_exists('EndpointConfig', $data) && null !== $data['EndpointConfig']) { + $object->setEndpointConfig($this->denormalizer->denormalize($data['EndpointConfig'], \Docker\API\Model\EndpointSettings::class, 'json', $context)); + unset($data['EndpointConfig']); + } elseif (\array_key_exists('EndpointConfig', $data) && null === $data['EndpointConfig']) { + $object->setEndpointConfig(null); } - if (property_exists($data, 'EndpointConfig') && $data->{'EndpointConfig'} !== null) { - $object->setEndpointConfig($this->denormalizer->denormalize($data->{'EndpointConfig'}, 'Docker\\API\\Model\\EndpointSettings', 'json', $context)); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getContainer()) { - $data->{'Container'} = $object->getContainer(); + $dataArray = []; + if ($data->isInitialized('container') && null !== $data->getContainer()) { + $dataArray['Container'] = $data->getContainer(); } - if (null !== $object->getEndpointConfig()) { - $data->{'EndpointConfig'} = $this->normalizer->normalize($object->getEndpointConfig(), 'json', $context); + if ($data->isInitialized('endpointConfig') && null !== $data->getEndpointConfig()) { + $dataArray['EndpointConfig'] = $this->normalizer->normalize($data->getEndpointConfig(), 'json', $context); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworksIdConnectPostBody::class => false]; } } diff --git a/src/Normalizer/NetworksIdDisconnectPostBodyNormalizer.php b/src/Normalizer/NetworksIdDisconnectPostBodyNormalizer.php index eb3ac16a..e379e8c7 100644 --- a/src/Normalizer/NetworksIdDisconnectPostBodyNormalizer.php +++ b/src/Normalizer/NetworksIdDisconnectPostBodyNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,77 @@ class NetworksIdDisconnectPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\NetworksIdDisconnectPostBody'; + return \Docker\API\Model\NetworksIdDisconnectPostBody::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\NetworksIdDisconnectPostBody; + return \is_object($data) && \Docker\API\Model\NetworksIdDisconnectPostBody::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\NetworksIdDisconnectPostBody(); - if (property_exists($data, 'Container') && $data->{'Container'} !== null) { - $object->setContainer($data->{'Container'}); + if (\array_key_exists('Force', $data) && \is_int($data['Force'])) { + $data['Force'] = (bool) $data['Force']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Container', $data) && null !== $data['Container']) { + $object->setContainer($data['Container']); + unset($data['Container']); + } elseif (\array_key_exists('Container', $data) && null === $data['Container']) { + $object->setContainer(null); + } + if (\array_key_exists('Force', $data) && null !== $data['Force']) { + $object->setForce($data['Force']); + unset($data['Force']); + } elseif (\array_key_exists('Force', $data) && null === $data['Force']) { + $object->setForce(null); } - if (property_exists($data, 'Force') && $data->{'Force'} !== null) { - $object->setForce($data->{'Force'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getContainer()) { - $data->{'Container'} = $object->getContainer(); + $dataArray = []; + if ($data->isInitialized('container') && null !== $data->getContainer()) { + $dataArray['Container'] = $data->getContainer(); } - if (null !== $object->getForce()) { - $data->{'Force'} = $object->getForce(); + if ($data->isInitialized('force') && null !== $data->getForce()) { + $dataArray['Force'] = $data->getForce(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworksIdDisconnectPostBody::class => false]; } } diff --git a/src/Normalizer/NetworksPrunePostResponse200Normalizer.php b/src/Normalizer/NetworksPrunePostResponse200Normalizer.php index e3b56751..c519142f 100644 --- a/src/Normalizer/NetworksPrunePostResponse200Normalizer.php +++ b/src/Normalizer/NetworksPrunePostResponse200Normalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,47 +16,73 @@ class NetworksPrunePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\NetworksPrunePostResponse200'; + return \Docker\API\Model\NetworksPrunePostResponse200::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\NetworksPrunePostResponse200; + return \is_object($data) && \Docker\API\Model\NetworksPrunePostResponse200::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\NetworksPrunePostResponse200(); - if (property_exists($data, 'NetworksDeleted') && $data->{'NetworksDeleted'} !== null) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NetworksDeleted', $data) && null !== $data['NetworksDeleted']) { $values = []; - foreach ($data->{'NetworksDeleted'} as $value) { + foreach ($data['NetworksDeleted'] as $value) { $values[] = $value; } $object->setNetworksDeleted($values); + unset($data['NetworksDeleted']); + } elseif (\array_key_exists('NetworksDeleted', $data) && null === $data['NetworksDeleted']) { + $object->setNetworksDeleted(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getNetworksDeleted()) { + $dataArray = []; + if ($data->isInitialized('networksDeleted') && null !== $data->getNetworksDeleted()) { $values = []; - foreach ($object->getNetworksDeleted() as $value) { + foreach ($data->getNetworksDeleted() as $value) { $values[] = $value; } - $data->{'NetworksDeleted'} = $values; + $dataArray['NetworksDeleted'] = $values; + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NetworksPrunePostResponse200::class => false]; } } diff --git a/src/Normalizer/NodeDescriptionNormalizer.php b/src/Normalizer/NodeDescriptionNormalizer.php index be714cde..6715dc09 100644 --- a/src/Normalizer/NodeDescriptionNormalizer.php +++ b/src/Normalizer/NodeDescriptionNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,63 +16,101 @@ class NodeDescriptionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\NodeDescription'; + return \Docker\API\Model\NodeDescription::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\NodeDescription; + return \is_object($data) && \Docker\API\Model\NodeDescription::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\NodeDescription(); - if (property_exists($data, 'Hostname') && $data->{'Hostname'} !== null) { - $object->setHostname($data->{'Hostname'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Hostname', $data) && null !== $data['Hostname']) { + $object->setHostname($data['Hostname']); + unset($data['Hostname']); + } elseif (\array_key_exists('Hostname', $data) && null === $data['Hostname']) { + $object->setHostname(null); + } + if (\array_key_exists('Platform', $data) && null !== $data['Platform']) { + $object->setPlatform($this->denormalizer->denormalize($data['Platform'], \Docker\API\Model\Platform::class, 'json', $context)); + unset($data['Platform']); + } elseif (\array_key_exists('Platform', $data) && null === $data['Platform']) { + $object->setPlatform(null); } - if (property_exists($data, 'Platform') && $data->{'Platform'} !== null) { - $object->setPlatform($this->denormalizer->denormalize($data->{'Platform'}, 'Docker\\API\\Model\\Platform', 'json', $context)); + if (\array_key_exists('Resources', $data) && null !== $data['Resources']) { + $object->setResources($this->denormalizer->denormalize($data['Resources'], \Docker\API\Model\ResourceObject::class, 'json', $context)); + unset($data['Resources']); + } elseif (\array_key_exists('Resources', $data) && null === $data['Resources']) { + $object->setResources(null); } - if (property_exists($data, 'Resources') && $data->{'Resources'} !== null) { - $object->setResources($this->denormalizer->denormalize($data->{'Resources'}, 'Docker\\API\\Model\\ResourceObject', 'json', $context)); + if (\array_key_exists('Engine', $data) && null !== $data['Engine']) { + $object->setEngine($this->denormalizer->denormalize($data['Engine'], \Docker\API\Model\EngineDescription::class, 'json', $context)); + unset($data['Engine']); + } elseif (\array_key_exists('Engine', $data) && null === $data['Engine']) { + $object->setEngine(null); } - if (property_exists($data, 'Engine') && $data->{'Engine'} !== null) { - $object->setEngine($this->denormalizer->denormalize($data->{'Engine'}, 'Docker\\API\\Model\\EngineDescription', 'json', $context)); + if (\array_key_exists('TLSInfo', $data) && null !== $data['TLSInfo']) { + $object->setTLSInfo($this->denormalizer->denormalize($data['TLSInfo'], \Docker\API\Model\TLSInfo::class, 'json', $context)); + unset($data['TLSInfo']); + } elseif (\array_key_exists('TLSInfo', $data) && null === $data['TLSInfo']) { + $object->setTLSInfo(null); } - if (property_exists($data, 'TLSInfo') && $data->{'TLSInfo'} !== null) { - $object->setTLSInfo($this->denormalizer->denormalize($data->{'TLSInfo'}, 'Docker\\API\\Model\\TLSInfo', 'json', $context)); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getHostname()) { - $data->{'Hostname'} = $object->getHostname(); + $dataArray = []; + if ($data->isInitialized('hostname') && null !== $data->getHostname()) { + $dataArray['Hostname'] = $data->getHostname(); } - if (null !== $object->getPlatform()) { - $data->{'Platform'} = $this->normalizer->normalize($object->getPlatform(), 'json', $context); + if ($data->isInitialized('platform') && null !== $data->getPlatform()) { + $dataArray['Platform'] = $this->normalizer->normalize($data->getPlatform(), 'json', $context); } - if (null !== $object->getResources()) { - $data->{'Resources'} = $this->normalizer->normalize($object->getResources(), 'json', $context); + if ($data->isInitialized('resources') && null !== $data->getResources()) { + $dataArray['Resources'] = $this->normalizer->normalize($data->getResources(), 'json', $context); } - if (null !== $object->getEngine()) { - $data->{'Engine'} = $this->normalizer->normalize($object->getEngine(), 'json', $context); + if ($data->isInitialized('engine') && null !== $data->getEngine()) { + $dataArray['Engine'] = $this->normalizer->normalize($data->getEngine(), 'json', $context); } - if (null !== $object->getTLSInfo()) { - $data->{'TLSInfo'} = $this->normalizer->normalize($object->getTLSInfo(), 'json', $context); + if ($data->isInitialized('tLSInfo') && null !== $data->getTLSInfo()) { + $dataArray['TLSInfo'] = $this->normalizer->normalize($data->getTLSInfo(), 'json', $context); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NodeDescription::class => false]; } } diff --git a/src/Normalizer/NodeNormalizer.php b/src/Normalizer/NodeNormalizer.php index 015a881e..0148ac13 100644 --- a/src/Normalizer/NodeNormalizer.php +++ b/src/Normalizer/NodeNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,81 +16,128 @@ class NodeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Node'; + return \Docker\API\Model\Node::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Node; + return \is_object($data) && \Docker\API\Model\Node::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\Node(); - if (property_exists($data, 'ID') && $data->{'ID'} !== null) { - $object->setID($data->{'ID'}); - } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($this->denormalizer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); - } - if (property_exists($data, 'CreatedAt') && $data->{'CreatedAt'} !== null) { - $object->setCreatedAt($data->{'CreatedAt'}); - } - if (property_exists($data, 'UpdatedAt') && $data->{'UpdatedAt'} !== null) { - $object->setUpdatedAt($data->{'UpdatedAt'}); - } - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\NodeSpec', 'json', $context)); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($this->denormalizer->denormalize($data->{'Description'}, 'Docker\\API\\Model\\NodeDescription', 'json', $context)); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'Status') && $data->{'Status'} !== null) { - $object->setStatus($this->denormalizer->denormalize($data->{'Status'}, 'Docker\\API\\Model\\NodeStatus', 'json', $context)); - } - if (property_exists($data, 'ManagerStatus') && $data->{'ManagerStatus'} !== null) { - $object->setManagerStatus($this->denormalizer->denormalize($data->{'ManagerStatus'}, 'Docker\\API\\Model\\ManagerStatus', 'json', $context)); + $object = new \Docker\API\Model\Node(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && null !== $data['ID']) { + $object->setID($data['ID']); + unset($data['ID']); + } elseif (\array_key_exists('ID', $data) && null === $data['ID']) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && null !== $data['Version']) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + unset($data['Version']); + } elseif (\array_key_exists('Version', $data) && null === $data['Version']) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && null !== $data['CreatedAt']) { + $object->setCreatedAt($data['CreatedAt']); + unset($data['CreatedAt']); + } elseif (\array_key_exists('CreatedAt', $data) && null === $data['CreatedAt']) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && null !== $data['UpdatedAt']) { + $object->setUpdatedAt($data['UpdatedAt']); + unset($data['UpdatedAt']); + } elseif (\array_key_exists('UpdatedAt', $data) && null === $data['UpdatedAt']) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && null !== $data['Spec']) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\NodeSpec::class, 'json', $context)); + unset($data['Spec']); + } elseif (\array_key_exists('Spec', $data) && null === $data['Spec']) { + $object->setSpec(null); + } + if (\array_key_exists('Description', $data) && null !== $data['Description']) { + $object->setDescription($this->denormalizer->denormalize($data['Description'], \Docker\API\Model\NodeDescription::class, 'json', $context)); + unset($data['Description']); + } elseif (\array_key_exists('Description', $data) && null === $data['Description']) { + $object->setDescription(null); + } + if (\array_key_exists('Status', $data) && null !== $data['Status']) { + $object->setStatus($this->denormalizer->denormalize($data['Status'], \Docker\API\Model\NodeStatus::class, 'json', $context)); + unset($data['Status']); + } elseif (\array_key_exists('Status', $data) && null === $data['Status']) { + $object->setStatus(null); + } + if (\array_key_exists('ManagerStatus', $data) && null !== $data['ManagerStatus']) { + $object->setManagerStatus($this->denormalizer->denormalize($data['ManagerStatus'], \Docker\API\Model\ManagerStatus::class, 'json', $context)); + unset($data['ManagerStatus']); + } elseif (\array_key_exists('ManagerStatus', $data) && null === $data['ManagerStatus']) { + $object->setManagerStatus(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $dataArray = []; + if ($data->isInitialized('iD') && null !== $data->getID()) { + $dataArray['ID'] = $data->getID(); + } + if ($data->isInitialized('version') && null !== $data->getVersion()) { + $dataArray['Version'] = $this->normalizer->normalize($data->getVersion(), 'json', $context); } - if (null !== $object->getVersion()) { - $data->{'Version'} = $this->normalizer->normalize($object->getVersion(), 'json', $context); + if ($data->isInitialized('createdAt') && null !== $data->getCreatedAt()) { + $dataArray['CreatedAt'] = $data->getCreatedAt(); } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt(); + if ($data->isInitialized('updatedAt') && null !== $data->getUpdatedAt()) { + $dataArray['UpdatedAt'] = $data->getUpdatedAt(); } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt(); + if ($data->isInitialized('spec') && null !== $data->getSpec()) { + $dataArray['Spec'] = $this->normalizer->normalize($data->getSpec(), 'json', $context); } - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + if ($data->isInitialized('description') && null !== $data->getDescription()) { + $dataArray['Description'] = $this->normalizer->normalize($data->getDescription(), 'json', $context); } - if (null !== $object->getDescription()) { - $data->{'Description'} = $this->normalizer->normalize($object->getDescription(), 'json', $context); + if ($data->isInitialized('status') && null !== $data->getStatus()) { + $dataArray['Status'] = $this->normalizer->normalize($data->getStatus(), 'json', $context); } - if (null !== $object->getStatus()) { - $data->{'Status'} = $this->normalizer->normalize($object->getStatus(), 'json', $context); + if ($data->isInitialized('managerStatus') && null !== $data->getManagerStatus()) { + $dataArray['ManagerStatus'] = $this->normalizer->normalize($data->getManagerStatus(), 'json', $context); } - if (null !== $object->getManagerStatus()) { - $data->{'ManagerStatus'} = $this->normalizer->normalize($object->getManagerStatus(), 'json', $context); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Node::class => false]; } } diff --git a/src/Normalizer/NodeSpecNormalizer.php b/src/Normalizer/NodeSpecNormalizer.php index 9a789ac0..863748d5 100644 --- a/src/Normalizer/NodeSpecNormalizer.php +++ b/src/Normalizer/NodeSpecNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,65 +16,100 @@ class NodeSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\NodeSpec'; + return \Docker\API\Model\NodeSpec::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\NodeSpec; + return \is_object($data) && \Docker\API\Model\NodeSpec::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\NodeSpec(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); } - if (property_exists($data, 'Role') && $data->{'Role'} !== null) { - $object->setRole($data->{'Role'}); + if (\array_key_exists('Role', $data) && null !== $data['Role']) { + $object->setRole($data['Role']); + unset($data['Role']); + } elseif (\array_key_exists('Role', $data) && null === $data['Role']) { + $object->setRole(null); } - if (property_exists($data, 'Availability') && $data->{'Availability'} !== null) { - $object->setAvailability($data->{'Availability'}); + if (\array_key_exists('Availability', $data) && null !== $data['Availability']) { + $object->setAvailability($data['Availability']); + unset($data['Availability']); + } elseif (\array_key_exists('Availability', $data) && null === $data['Availability']) { + $object->setAvailability(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values = []; + foreach ($data->getLabels() as $key => $value) { + $values[$key] = $value; } - $data->{'Labels'} = $values; + $dataArray['Labels'] = $values; } - if (null !== $object->getRole()) { - $data->{'Role'} = $object->getRole(); + if ($data->isInitialized('role') && null !== $data->getRole()) { + $dataArray['Role'] = $data->getRole(); } - if (null !== $object->getAvailability()) { - $data->{'Availability'} = $object->getAvailability(); + if ($data->isInitialized('availability') && null !== $data->getAvailability()) { + $dataArray['Availability'] = $data->getAvailability(); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NodeSpec::class => false]; } } diff --git a/src/Normalizer/NodeStatusNormalizer.php b/src/Normalizer/NodeStatusNormalizer.php index 01a9700a..df2c5c3f 100644 --- a/src/Normalizer/NodeStatusNormalizer.php +++ b/src/Normalizer/NodeStatusNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,51 +16,83 @@ class NodeStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\NodeStatus'; + return \Docker\API\Model\NodeStatus::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\NodeStatus; + return \is_object($data) && \Docker\API\Model\NodeStatus::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\NodeStatus(); - if (property_exists($data, 'State') && $data->{'State'} !== null) { - $object->setState($data->{'State'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('State', $data) && null !== $data['State']) { + $object->setState($data['State']); + unset($data['State']); + } elseif (\array_key_exists('State', $data) && null === $data['State']) { + $object->setState(null); + } + if (\array_key_exists('Message', $data) && null !== $data['Message']) { + $object->setMessage($data['Message']); + unset($data['Message']); + } elseif (\array_key_exists('Message', $data) && null === $data['Message']) { + $object->setMessage(null); } - if (property_exists($data, 'Message') && $data->{'Message'} !== null) { - $object->setMessage($data->{'Message'}); + if (\array_key_exists('Addr', $data) && null !== $data['Addr']) { + $object->setAddr($data['Addr']); + unset($data['Addr']); + } elseif (\array_key_exists('Addr', $data) && null === $data['Addr']) { + $object->setAddr(null); } - if (property_exists($data, 'Addr') && $data->{'Addr'} !== null) { - $object->setAddr($data->{'Addr'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getState()) { - $data->{'State'} = $object->getState(); + $dataArray = []; + if ($data->isInitialized('state') && null !== $data->getState()) { + $dataArray['State'] = $data->getState(); } - if (null !== $object->getMessage()) { - $data->{'Message'} = $object->getMessage(); + if ($data->isInitialized('message') && null !== $data->getMessage()) { + $dataArray['Message'] = $data->getMessage(); } - if (null !== $object->getAddr()) { - $data->{'Addr'} = $object->getAddr(); + if ($data->isInitialized('addr') && null !== $data->getAddr()) { + $dataArray['Addr'] = $data->getAddr(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\NodeStatus::class => false]; } } diff --git a/src/Normalizer/NormalizerFactory.php b/src/Normalizer/NormalizerFactory.php deleted file mode 100644 index f7c2dc70..00000000 --- a/src/Normalizer/NormalizerFactory.php +++ /dev/null @@ -1,206 +0,0 @@ -setMediaType($data['mediaType']); + unset($data['mediaType']); + } elseif (\array_key_exists('mediaType', $data) && null === $data['mediaType']) { + $object->setMediaType(null); + } + if (\array_key_exists('digest', $data) && null !== $data['digest']) { + $object->setDigest($data['digest']); + unset($data['digest']); + } elseif (\array_key_exists('digest', $data) && null === $data['digest']) { + $object->setDigest(null); + } + if (\array_key_exists('size', $data) && null !== $data['size']) { + $object->setSize($data['size']); + unset($data['size']); + } elseif (\array_key_exists('size', $data) && null === $data['size']) { + $object->setSize(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('mediaType') && null !== $data->getMediaType()) { + $dataArray['mediaType'] = $data->getMediaType(); + } + if ($data->isInitialized('digest') && null !== $data->getDigest()) { + $dataArray['digest'] = $data->getDigest(); + } + if ($data->isInitialized('size') && null !== $data->getSize()) { + $dataArray['size'] = $data->getSize(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\OCIDescriptor::class => false]; + } +} diff --git a/src/Normalizer/OCIPlatformNormalizer.php b/src/Normalizer/OCIPlatformNormalizer.php new file mode 100644 index 00000000..d3282178 --- /dev/null +++ b/src/Normalizer/OCIPlatformNormalizer.php @@ -0,0 +1,124 @@ +setArchitecture($data['architecture']); + unset($data['architecture']); + } elseif (\array_key_exists('architecture', $data) && null === $data['architecture']) { + $object->setArchitecture(null); + } + if (\array_key_exists('os', $data) && null !== $data['os']) { + $object->setOs($data['os']); + unset($data['os']); + } elseif (\array_key_exists('os', $data) && null === $data['os']) { + $object->setOs(null); + } + if (\array_key_exists('os.version', $data) && null !== $data['os.version']) { + $object->setOsVersion($data['os.version']); + unset($data['os.version']); + } elseif (\array_key_exists('os.version', $data) && null === $data['os.version']) { + $object->setOsVersion(null); + } + if (\array_key_exists('os.features', $data) && null !== $data['os.features']) { + $values = []; + foreach ($data['os.features'] as $value) { + $values[] = $value; + } + $object->setOsFeatures($values); + unset($data['os.features']); + } elseif (\array_key_exists('os.features', $data) && null === $data['os.features']) { + $object->setOsFeatures(null); + } + if (\array_key_exists('variant', $data) && null !== $data['variant']) { + $object->setVariant($data['variant']); + unset($data['variant']); + } elseif (\array_key_exists('variant', $data) && null === $data['variant']) { + $object->setVariant(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('architecture') && null !== $data->getArchitecture()) { + $dataArray['architecture'] = $data->getArchitecture(); + } + if ($data->isInitialized('os') && null !== $data->getOs()) { + $dataArray['os'] = $data->getOs(); + } + if ($data->isInitialized('osVersion') && null !== $data->getOsVersion()) { + $dataArray['os.version'] = $data->getOsVersion(); + } + if ($data->isInitialized('osFeatures') && null !== $data->getOsFeatures()) { + $values = []; + foreach ($data->getOsFeatures() as $value) { + $values[] = $value; + } + $dataArray['os.features'] = $values; + } + if ($data->isInitialized('variant') && null !== $data->getVariant()) { + $dataArray['variant'] = $data->getVariant(); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\OCIPlatform::class => false]; + } +} diff --git a/src/Normalizer/ObjectVersionNormalizer.php b/src/Normalizer/ObjectVersionNormalizer.php index db361da6..37b40c01 100644 --- a/src/Normalizer/ObjectVersionNormalizer.php +++ b/src/Normalizer/ObjectVersionNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,39 +16,65 @@ class ObjectVersionNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ObjectVersion'; + return \Docker\API\Model\ObjectVersion::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ObjectVersion; + return \is_object($data) && \Docker\API\Model\ObjectVersion::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ObjectVersion(); - if (property_exists($data, 'Index') && $data->{'Index'} !== null) { - $object->setIndex($data->{'Index'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Index', $data) && null !== $data['Index']) { + $object->setIndex($data['Index']); + unset($data['Index']); + } elseif (\array_key_exists('Index', $data) && null === $data['Index']) { + $object->setIndex(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getIndex()) { - $data->{'Index'} = $object->getIndex(); + $dataArray = []; + if ($data->isInitialized('index') && null !== $data->getIndex()) { + $dataArray['Index'] = $data->getIndex(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ObjectVersion::class => false]; } } diff --git a/src/Normalizer/PeerNodeNormalizer.php b/src/Normalizer/PeerNodeNormalizer.php index 985a93fb..6862f8e4 100644 --- a/src/Normalizer/PeerNodeNormalizer.php +++ b/src/Normalizer/PeerNodeNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class PeerNodeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\PeerNode'; + return \Docker\API\Model\PeerNode::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\PeerNode; + return \is_object($data) && \Docker\API\Model\PeerNode::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\PeerNode(); - if (property_exists($data, 'NodeID') && $data->{'NodeID'} !== null) { - $object->setNodeID($data->{'NodeID'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NodeID', $data) && null !== $data['NodeID']) { + $object->setNodeID($data['NodeID']); + unset($data['NodeID']); + } elseif (\array_key_exists('NodeID', $data) && null === $data['NodeID']) { + $object->setNodeID(null); + } + if (\array_key_exists('Addr', $data) && null !== $data['Addr']) { + $object->setAddr($data['Addr']); + unset($data['Addr']); + } elseif (\array_key_exists('Addr', $data) && null === $data['Addr']) { + $object->setAddr(null); } - if (property_exists($data, 'Addr') && $data->{'Addr'} !== null) { - $object->setAddr($data->{'Addr'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getNodeID()) { - $data->{'NodeID'} = $object->getNodeID(); + $dataArray = []; + if ($data->isInitialized('nodeID') && null !== $data->getNodeID()) { + $dataArray['NodeID'] = $data->getNodeID(); } - if (null !== $object->getAddr()) { - $data->{'Addr'} = $object->getAddr(); + if ($data->isInitialized('addr') && null !== $data->getAddr()) { + $dataArray['Addr'] = $data->getAddr(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PeerNode::class => false]; } } diff --git a/src/Normalizer/PlatformNormalizer.php b/src/Normalizer/PlatformNormalizer.php index 32492468..104dd090 100644 --- a/src/Normalizer/PlatformNormalizer.php +++ b/src/Normalizer/PlatformNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class PlatformNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Platform'; + return \Docker\API\Model\Platform::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Platform; + return \is_object($data) && \Docker\API\Model\Platform::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\Platform(); - if (property_exists($data, 'Architecture') && $data->{'Architecture'} !== null) { - $object->setArchitecture($data->{'Architecture'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Architecture', $data) && null !== $data['Architecture']) { + $object->setArchitecture($data['Architecture']); + unset($data['Architecture']); + } elseif (\array_key_exists('Architecture', $data) && null === $data['Architecture']) { + $object->setArchitecture(null); + } + if (\array_key_exists('OS', $data) && null !== $data['OS']) { + $object->setOS($data['OS']); + unset($data['OS']); + } elseif (\array_key_exists('OS', $data) && null === $data['OS']) { + $object->setOS(null); } - if (property_exists($data, 'OS') && $data->{'OS'} !== null) { - $object->setOS($data->{'OS'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getArchitecture()) { - $data->{'Architecture'} = $object->getArchitecture(); + $dataArray = []; + if ($data->isInitialized('architecture') && null !== $data->getArchitecture()) { + $dataArray['Architecture'] = $data->getArchitecture(); } - if (null !== $object->getOS()) { - $data->{'OS'} = $object->getOS(); + if ($data->isInitialized('oS') && null !== $data->getOS()) { + $dataArray['OS'] = $data->getOS(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Platform::class => false]; } } diff --git a/src/Normalizer/PluginConfigArgsNormalizer.php b/src/Normalizer/PluginConfigArgsNormalizer.php index a435ac5c..f2856cbf 100644 --- a/src/Normalizer/PluginConfigArgsNormalizer.php +++ b/src/Normalizer/PluginConfigArgsNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,73 +16,100 @@ class PluginConfigArgsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\PluginConfigArgs'; + return \Docker\API\Model\PluginConfigArgs::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\PluginConfigArgs; + return \is_object($data) && \Docker\API\Model\PluginConfigArgs::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\PluginConfigArgs(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); } - if (property_exists($data, 'Settable') && $data->{'Settable'} !== null) { + if (\array_key_exists('Description', $data) && null !== $data['Description']) { + $object->setDescription($data['Description']); + unset($data['Description']); + } elseif (\array_key_exists('Description', $data) && null === $data['Description']) { + $object->setDescription(null); + } + if (\array_key_exists('Settable', $data) && null !== $data['Settable']) { $values = []; - foreach ($data->{'Settable'} as $value) { + foreach ($data['Settable'] as $value) { $values[] = $value; } $object->setSettable($values); + unset($data['Settable']); + } elseif (\array_key_exists('Settable', $data) && null === $data['Settable']) { + $object->setSettable(null); } - if (property_exists($data, 'Value') && $data->{'Value'} !== null) { + if (\array_key_exists('Value', $data) && null !== $data['Value']) { $values_1 = []; - foreach ($data->{'Value'} as $value_1) { + foreach ($data['Value'] as $value_1) { $values_1[] = $value_1; } $object->setValue($values_1); + unset($data['Value']); + } elseif (\array_key_exists('Value', $data) && null === $data['Value']) { + $object->setValue(null); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getDescription()) { - $data->{'Description'} = $object->getDescription(); + $dataArray = []; + $dataArray['Name'] = $data->getName(); + $dataArray['Description'] = $data->getDescription(); + $values = []; + foreach ($data->getSettable() as $value) { + $values[] = $value; } - if (null !== $object->getSettable()) { - $values = []; - foreach ($object->getSettable() as $value) { - $values[] = $value; - } - $data->{'Settable'} = $values; + $dataArray['Settable'] = $values; + $values_1 = []; + foreach ($data->getValue() as $value_1) { + $values_1[] = $value_1; } - if (null !== $object->getValue()) { - $values_1 = []; - foreach ($object->getValue() as $value_1) { - $values_1[] = $value_1; + $dataArray['Value'] = $values_1; + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_2; } - $data->{'Value'} = $values_1; } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigArgs::class => false]; } } diff --git a/src/Normalizer/PluginConfigInterfaceNormalizer.php b/src/Normalizer/PluginConfigInterfaceNormalizer.php index 01fc0d06..5905eb34 100644 --- a/src/Normalizer/PluginConfigInterfaceNormalizer.php +++ b/src/Normalizer/PluginConfigInterfaceNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,53 +16,87 @@ class PluginConfigInterfaceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\PluginConfigInterface'; + return \Docker\API\Model\PluginConfigInterface::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\PluginConfigInterface; + return \is_object($data) && \Docker\API\Model\PluginConfigInterface::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\PluginConfigInterface(); - if (property_exists($data, 'Types') && $data->{'Types'} !== null) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Types', $data) && null !== $data['Types']) { $values = []; - foreach ($data->{'Types'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\PluginInterfaceType', 'json', $context); + foreach ($data['Types'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\PluginInterfaceType::class, 'json', $context); } $object->setTypes($values); + unset($data['Types']); + } elseif (\array_key_exists('Types', $data) && null === $data['Types']) { + $object->setTypes(null); + } + if (\array_key_exists('Socket', $data) && null !== $data['Socket']) { + $object->setSocket($data['Socket']); + unset($data['Socket']); + } elseif (\array_key_exists('Socket', $data) && null === $data['Socket']) { + $object->setSocket(null); } - if (property_exists($data, 'Socket') && $data->{'Socket'} !== null) { - $object->setSocket($data->{'Socket'}); + if (\array_key_exists('ProtocolScheme', $data) && null !== $data['ProtocolScheme']) { + $object->setProtocolScheme($data['ProtocolScheme']); + unset($data['ProtocolScheme']); + } elseif (\array_key_exists('ProtocolScheme', $data) && null === $data['ProtocolScheme']) { + $object->setProtocolScheme(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getTypes()) { - $values = []; - foreach ($object->getTypes() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data->{'Types'} = $values; + $dataArray = []; + $values = []; + foreach ($data->getTypes() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $dataArray['Types'] = $values; + $dataArray['Socket'] = $data->getSocket(); + if ($data->isInitialized('protocolScheme') && null !== $data->getProtocolScheme()) { + $dataArray['ProtocolScheme'] = $data->getProtocolScheme(); } - if (null !== $object->getSocket()) { - $data->{'Socket'} = $object->getSocket(); + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigInterface::class => false]; } } diff --git a/src/Normalizer/PluginConfigLinuxNormalizer.php b/src/Normalizer/PluginConfigLinuxNormalizer.php index 7fc450e5..a1525842 100644 --- a/src/Normalizer/PluginConfigLinuxNormalizer.php +++ b/src/Normalizer/PluginConfigLinuxNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,67 +16,96 @@ class PluginConfigLinuxNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\PluginConfigLinux'; + return \Docker\API\Model\PluginConfigLinux::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\PluginConfigLinux; + return \is_object($data) && \Docker\API\Model\PluginConfigLinux::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\PluginConfigLinux(); - if (property_exists($data, 'Capabilities') && $data->{'Capabilities'} !== null) { + if (\array_key_exists('AllowAllDevices', $data) && \is_int($data['AllowAllDevices'])) { + $data['AllowAllDevices'] = (bool) $data['AllowAllDevices']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Capabilities', $data) && null !== $data['Capabilities']) { $values = []; - foreach ($data->{'Capabilities'} as $value) { + foreach ($data['Capabilities'] as $value) { $values[] = $value; } $object->setCapabilities($values); + unset($data['Capabilities']); + } elseif (\array_key_exists('Capabilities', $data) && null === $data['Capabilities']) { + $object->setCapabilities(null); } - if (property_exists($data, 'AllowAllDevices') && $data->{'AllowAllDevices'} !== null) { - $object->setAllowAllDevices($data->{'AllowAllDevices'}); + if (\array_key_exists('AllowAllDevices', $data) && null !== $data['AllowAllDevices']) { + $object->setAllowAllDevices($data['AllowAllDevices']); + unset($data['AllowAllDevices']); + } elseif (\array_key_exists('AllowAllDevices', $data) && null === $data['AllowAllDevices']) { + $object->setAllowAllDevices(null); } - if (property_exists($data, 'Devices') && $data->{'Devices'} !== null) { + if (\array_key_exists('Devices', $data) && null !== $data['Devices']) { $values_1 = []; - foreach ($data->{'Devices'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PluginDevice', 'json', $context); + foreach ($data['Devices'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\PluginDevice::class, 'json', $context); } $object->setDevices($values_1); + unset($data['Devices']); + } elseif (\array_key_exists('Devices', $data) && null === $data['Devices']) { + $object->setDevices(null); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getCapabilities()) { - $values = []; - foreach ($object->getCapabilities() as $value) { - $values[] = $value; - } - $data->{'Capabilities'} = $values; + $dataArray = []; + $values = []; + foreach ($data->getCapabilities() as $value) { + $values[] = $value; } - if (null !== $object->getAllowAllDevices()) { - $data->{'AllowAllDevices'} = $object->getAllowAllDevices(); + $dataArray['Capabilities'] = $values; + $dataArray['AllowAllDevices'] = $data->getAllowAllDevices(); + $values_1 = []; + foreach ($data->getDevices() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - if (null !== $object->getDevices()) { - $values_1 = []; - foreach ($object->getDevices() as $value_1) { - $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + $dataArray['Devices'] = $values_1; + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_2; } - $data->{'Devices'} = $values_1; } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigLinux::class => false]; } } diff --git a/src/Normalizer/PluginConfigNetworkNormalizer.php b/src/Normalizer/PluginConfigNetworkNormalizer.php index f3942c2d..fb12ba4e 100644 --- a/src/Normalizer/PluginConfigNetworkNormalizer.php +++ b/src/Normalizer/PluginConfigNetworkNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,39 +16,63 @@ class PluginConfigNetworkNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\PluginConfigNetwork'; + return \Docker\API\Model\PluginConfigNetwork::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\PluginConfigNetwork; + return \is_object($data) && \Docker\API\Model\PluginConfigNetwork::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\PluginConfigNetwork(); - if (property_exists($data, 'Type') && $data->{'Type'} !== null) { - $object->setType($data->{'Type'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Type', $data) && null !== $data['Type']) { + $object->setType($data['Type']); + unset($data['Type']); + } elseif (\array_key_exists('Type', $data) && null === $data['Type']) { + $object->setType(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); + $dataArray = []; + $dataArray['Type'] = $data->getType(); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigNetwork::class => false]; } } diff --git a/src/Normalizer/PluginConfigNormalizer.php b/src/Normalizer/PluginConfigNormalizer.php index 055ed079..d858f516 100644 --- a/src/Normalizer/PluginConfigNormalizer.php +++ b/src/Normalizer/PluginConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,153 +16,204 @@ class PluginConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\PluginConfig'; + return \Docker\API\Model\PluginConfig::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\PluginConfig; + return \is_object($data) && \Docker\API\Model\PluginConfig::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\PluginConfig(); - if (property_exists($data, 'DockerVersion') && $data->{'DockerVersion'} !== null) { - $object->setDockerVersion($data->{'DockerVersion'}); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'Documentation') && $data->{'Documentation'} !== null) { - $object->setDocumentation($data->{'Documentation'}); - } - if (property_exists($data, 'Interface') && $data->{'Interface'} !== null) { - $object->setInterface($this->denormalizer->denormalize($data->{'Interface'}, 'Docker\\API\\Model\\PluginConfigInterface', 'json', $context)); - } - if (property_exists($data, 'Entrypoint') && $data->{'Entrypoint'} !== null) { + $object = new \Docker\API\Model\PluginConfig(); + if (\array_key_exists('IpcHost', $data) && \is_int($data['IpcHost'])) { + $data['IpcHost'] = (bool) $data['IpcHost']; + } + if (\array_key_exists('PidHost', $data) && \is_int($data['PidHost'])) { + $data['PidHost'] = (bool) $data['PidHost']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('DockerVersion', $data) && null !== $data['DockerVersion']) { + $object->setDockerVersion($data['DockerVersion']); + unset($data['DockerVersion']); + } elseif (\array_key_exists('DockerVersion', $data) && null === $data['DockerVersion']) { + $object->setDockerVersion(null); + } + if (\array_key_exists('Description', $data) && null !== $data['Description']) { + $object->setDescription($data['Description']); + unset($data['Description']); + } elseif (\array_key_exists('Description', $data) && null === $data['Description']) { + $object->setDescription(null); + } + if (\array_key_exists('Documentation', $data) && null !== $data['Documentation']) { + $object->setDocumentation($data['Documentation']); + unset($data['Documentation']); + } elseif (\array_key_exists('Documentation', $data) && null === $data['Documentation']) { + $object->setDocumentation(null); + } + if (\array_key_exists('Interface', $data) && null !== $data['Interface']) { + $object->setInterface($this->denormalizer->denormalize($data['Interface'], \Docker\API\Model\PluginConfigInterface::class, 'json', $context)); + unset($data['Interface']); + } elseif (\array_key_exists('Interface', $data) && null === $data['Interface']) { + $object->setInterface(null); + } + if (\array_key_exists('Entrypoint', $data) && null !== $data['Entrypoint']) { $values = []; - foreach ($data->{'Entrypoint'} as $value) { + foreach ($data['Entrypoint'] as $value) { $values[] = $value; } $object->setEntrypoint($values); - } - if (property_exists($data, 'WorkDir') && $data->{'WorkDir'} !== null) { - $object->setWorkDir($data->{'WorkDir'}); - } - if (property_exists($data, 'User') && $data->{'User'} !== null) { - $object->setUser($this->denormalizer->denormalize($data->{'User'}, 'Docker\\API\\Model\\PluginConfigUser', 'json', $context)); - } - if (property_exists($data, 'Network') && $data->{'Network'} !== null) { - $object->setNetwork($this->denormalizer->denormalize($data->{'Network'}, 'Docker\\API\\Model\\PluginConfigNetwork', 'json', $context)); - } - if (property_exists($data, 'Linux') && $data->{'Linux'} !== null) { - $object->setLinux($this->denormalizer->denormalize($data->{'Linux'}, 'Docker\\API\\Model\\PluginConfigLinux', 'json', $context)); - } - if (property_exists($data, 'PropagatedMount') && $data->{'PropagatedMount'} !== null) { - $object->setPropagatedMount($data->{'PropagatedMount'}); - } - if (property_exists($data, 'IpcHost') && $data->{'IpcHost'} !== null) { - $object->setIpcHost($data->{'IpcHost'}); - } - if (property_exists($data, 'PidHost') && $data->{'PidHost'} !== null) { - $object->setPidHost($data->{'PidHost'}); - } - if (property_exists($data, 'Mounts') && $data->{'Mounts'} !== null) { + unset($data['Entrypoint']); + } elseif (\array_key_exists('Entrypoint', $data) && null === $data['Entrypoint']) { + $object->setEntrypoint(null); + } + if (\array_key_exists('WorkDir', $data) && null !== $data['WorkDir']) { + $object->setWorkDir($data['WorkDir']); + unset($data['WorkDir']); + } elseif (\array_key_exists('WorkDir', $data) && null === $data['WorkDir']) { + $object->setWorkDir(null); + } + if (\array_key_exists('User', $data) && null !== $data['User']) { + $object->setUser($this->denormalizer->denormalize($data['User'], \Docker\API\Model\PluginConfigUser::class, 'json', $context)); + unset($data['User']); + } elseif (\array_key_exists('User', $data) && null === $data['User']) { + $object->setUser(null); + } + if (\array_key_exists('Network', $data) && null !== $data['Network']) { + $object->setNetwork($this->denormalizer->denormalize($data['Network'], \Docker\API\Model\PluginConfigNetwork::class, 'json', $context)); + unset($data['Network']); + } elseif (\array_key_exists('Network', $data) && null === $data['Network']) { + $object->setNetwork(null); + } + if (\array_key_exists('Linux', $data) && null !== $data['Linux']) { + $object->setLinux($this->denormalizer->denormalize($data['Linux'], \Docker\API\Model\PluginConfigLinux::class, 'json', $context)); + unset($data['Linux']); + } elseif (\array_key_exists('Linux', $data) && null === $data['Linux']) { + $object->setLinux(null); + } + if (\array_key_exists('PropagatedMount', $data) && null !== $data['PropagatedMount']) { + $object->setPropagatedMount($data['PropagatedMount']); + unset($data['PropagatedMount']); + } elseif (\array_key_exists('PropagatedMount', $data) && null === $data['PropagatedMount']) { + $object->setPropagatedMount(null); + } + if (\array_key_exists('IpcHost', $data) && null !== $data['IpcHost']) { + $object->setIpcHost($data['IpcHost']); + unset($data['IpcHost']); + } elseif (\array_key_exists('IpcHost', $data) && null === $data['IpcHost']) { + $object->setIpcHost(null); + } + if (\array_key_exists('PidHost', $data) && null !== $data['PidHost']) { + $object->setPidHost($data['PidHost']); + unset($data['PidHost']); + } elseif (\array_key_exists('PidHost', $data) && null === $data['PidHost']) { + $object->setPidHost(null); + } + if (\array_key_exists('Mounts', $data) && null !== $data['Mounts']) { $values_1 = []; - foreach ($data->{'Mounts'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PluginMount', 'json', $context); + foreach ($data['Mounts'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\PluginMount::class, 'json', $context); } $object->setMounts($values_1); + unset($data['Mounts']); + } elseif (\array_key_exists('Mounts', $data) && null === $data['Mounts']) { + $object->setMounts(null); } - if (property_exists($data, 'Env') && $data->{'Env'} !== null) { + if (\array_key_exists('Env', $data) && null !== $data['Env']) { $values_2 = []; - foreach ($data->{'Env'} as $value_2) { - $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\PluginEnv', 'json', $context); + foreach ($data['Env'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\PluginEnv::class, 'json', $context); } $object->setEnv($values_2); - } - if (property_exists($data, 'Args') && $data->{'Args'} !== null) { - $object->setArgs($this->denormalizer->denormalize($data->{'Args'}, 'Docker\\API\\Model\\PluginConfigArgs', 'json', $context)); - } - if (property_exists($data, 'rootfs') && $data->{'rootfs'} !== null) { - $object->setRootfs($this->denormalizer->denormalize($data->{'rootfs'}, 'Docker\\API\\Model\\PluginConfigRootfs', 'json', $context)); + unset($data['Env']); + } elseif (\array_key_exists('Env', $data) && null === $data['Env']) { + $object->setEnv(null); + } + if (\array_key_exists('Args', $data) && null !== $data['Args']) { + $object->setArgs($this->denormalizer->denormalize($data['Args'], \Docker\API\Model\PluginConfigArgs::class, 'json', $context)); + unset($data['Args']); + } elseif (\array_key_exists('Args', $data) && null === $data['Args']) { + $object->setArgs(null); + } + if (\array_key_exists('rootfs', $data) && null !== $data['rootfs']) { + $object->setRootfs($this->denormalizer->denormalize($data['rootfs'], \Docker\API\Model\PluginConfigRootfs::class, 'json', $context)); + unset($data['rootfs']); + } elseif (\array_key_exists('rootfs', $data) && null === $data['rootfs']) { + $object->setRootfs(null); + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_3; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getDockerVersion()) { - $data->{'DockerVersion'} = $object->getDockerVersion(); - } - if (null !== $object->getDescription()) { - $data->{'Description'} = $object->getDescription(); - } - if (null !== $object->getDocumentation()) { - $data->{'Documentation'} = $object->getDocumentation(); - } - if (null !== $object->getInterface()) { - $data->{'Interface'} = $this->normalizer->normalize($object->getInterface(), 'json', $context); - } - if (null !== $object->getEntrypoint()) { - $values = []; - foreach ($object->getEntrypoint() as $value) { - $values[] = $value; - } - $data->{'Entrypoint'} = $values; - } - if (null !== $object->getWorkDir()) { - $data->{'WorkDir'} = $object->getWorkDir(); - } - if (null !== $object->getUser()) { - $data->{'User'} = $this->normalizer->normalize($object->getUser(), 'json', $context); - } - if (null !== $object->getNetwork()) { - $data->{'Network'} = $this->normalizer->normalize($object->getNetwork(), 'json', $context); - } - if (null !== $object->getLinux()) { - $data->{'Linux'} = $this->normalizer->normalize($object->getLinux(), 'json', $context); - } - if (null !== $object->getPropagatedMount()) { - $data->{'PropagatedMount'} = $object->getPropagatedMount(); - } - if (null !== $object->getIpcHost()) { - $data->{'IpcHost'} = $object->getIpcHost(); - } - if (null !== $object->getPidHost()) { - $data->{'PidHost'} = $object->getPidHost(); - } - if (null !== $object->getMounts()) { - $values_1 = []; - foreach ($object->getMounts() as $value_1) { - $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); - } - $data->{'Mounts'} = $values_1; - } - if (null !== $object->getEnv()) { - $values_2 = []; - foreach ($object->getEnv() as $value_2) { - $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + $dataArray = []; + if ($data->isInitialized('dockerVersion') && null !== $data->getDockerVersion()) { + $dataArray['DockerVersion'] = $data->getDockerVersion(); + } + $dataArray['Description'] = $data->getDescription(); + $dataArray['Documentation'] = $data->getDocumentation(); + $dataArray['Interface'] = $this->normalizer->normalize($data->getInterface(), 'json', $context); + $values = []; + foreach ($data->getEntrypoint() as $value) { + $values[] = $value; + } + $dataArray['Entrypoint'] = $values; + $dataArray['WorkDir'] = $data->getWorkDir(); + if ($data->isInitialized('user') && null !== $data->getUser()) { + $dataArray['User'] = $this->normalizer->normalize($data->getUser(), 'json', $context); + } + $dataArray['Network'] = $this->normalizer->normalize($data->getNetwork(), 'json', $context); + $dataArray['Linux'] = $this->normalizer->normalize($data->getLinux(), 'json', $context); + $dataArray['PropagatedMount'] = $data->getPropagatedMount(); + $dataArray['IpcHost'] = $data->getIpcHost(); + $dataArray['PidHost'] = $data->getPidHost(); + $values_1 = []; + foreach ($data->getMounts() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $dataArray['Mounts'] = $values_1; + $values_2 = []; + foreach ($data->getEnv() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $dataArray['Env'] = $values_2; + $dataArray['Args'] = $this->normalizer->normalize($data->getArgs(), 'json', $context); + if ($data->isInitialized('rootfs') && null !== $data->getRootfs()) { + $dataArray['rootfs'] = $this->normalizer->normalize($data->getRootfs(), 'json', $context); + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_3; } - $data->{'Env'} = $values_2; - } - if (null !== $object->getArgs()) { - $data->{'Args'} = $this->normalizer->normalize($object->getArgs(), 'json', $context); - } - if (null !== $object->getRootfs()) { - $data->{'rootfs'} = $this->normalizer->normalize($object->getRootfs(), 'json', $context); } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfig::class => false]; } } diff --git a/src/Normalizer/PluginConfigRootfsNormalizer.php b/src/Normalizer/PluginConfigRootfsNormalizer.php index a2ab1f4c..ad9c6dfb 100644 --- a/src/Normalizer/PluginConfigRootfsNormalizer.php +++ b/src/Normalizer/PluginConfigRootfsNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,53 +16,82 @@ class PluginConfigRootfsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\PluginConfigRootfs'; + return \Docker\API\Model\PluginConfigRootfs::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\PluginConfigRootfs; + return \is_object($data) && \Docker\API\Model\PluginConfigRootfs::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\PluginConfigRootfs(); - if (property_exists($data, 'type') && $data->{'type'} !== null) { - $object->setType($data->{'type'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('type', $data) && null !== $data['type']) { + $object->setType($data['type']); + unset($data['type']); + } elseif (\array_key_exists('type', $data) && null === $data['type']) { + $object->setType(null); } - if (property_exists($data, 'diff_ids') && $data->{'diff_ids'} !== null) { + if (\array_key_exists('diff_ids', $data) && null !== $data['diff_ids']) { $values = []; - foreach ($data->{'diff_ids'} as $value) { + foreach ($data['diff_ids'] as $value) { $values[] = $value; } $object->setDiffIds($values); + unset($data['diff_ids']); + } elseif (\array_key_exists('diff_ids', $data) && null === $data['diff_ids']) { + $object->setDiffIds(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getType()) { - $data->{'type'} = $object->getType(); + $dataArray = []; + if ($data->isInitialized('type') && null !== $data->getType()) { + $dataArray['type'] = $data->getType(); } - if (null !== $object->getDiffIds()) { + if ($data->isInitialized('diffIds') && null !== $data->getDiffIds()) { $values = []; - foreach ($object->getDiffIds() as $value) { + foreach ($data->getDiffIds() as $value) { $values[] = $value; } - $data->{'diff_ids'} = $values; + $dataArray['diff_ids'] = $values; + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigRootfs::class => false]; } } diff --git a/src/Normalizer/PluginConfigUserNormalizer.php b/src/Normalizer/PluginConfigUserNormalizer.php index ea2ab039..60d26ece 100644 --- a/src/Normalizer/PluginConfigUserNormalizer.php +++ b/src/Normalizer/PluginConfigUserNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class PluginConfigUserNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\PluginConfigUser'; + return \Docker\API\Model\PluginConfigUser::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\PluginConfigUser; + return \is_object($data) && \Docker\API\Model\PluginConfigUser::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\PluginConfigUser(); - if (property_exists($data, 'UID') && $data->{'UID'} !== null) { - $object->setUID($data->{'UID'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('UID', $data) && null !== $data['UID']) { + $object->setUID($data['UID']); + unset($data['UID']); + } elseif (\array_key_exists('UID', $data) && null === $data['UID']) { + $object->setUID(null); + } + if (\array_key_exists('GID', $data) && null !== $data['GID']) { + $object->setGID($data['GID']); + unset($data['GID']); + } elseif (\array_key_exists('GID', $data) && null === $data['GID']) { + $object->setGID(null); } - if (property_exists($data, 'GID') && $data->{'GID'} !== null) { - $object->setGID($data->{'GID'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getUID()) { - $data->{'UID'} = $object->getUID(); + $dataArray = []; + if ($data->isInitialized('uID') && null !== $data->getUID()) { + $dataArray['UID'] = $data->getUID(); } - if (null !== $object->getGID()) { - $data->{'GID'} = $object->getGID(); + if ($data->isInitialized('gID') && null !== $data->getGID()) { + $dataArray['GID'] = $data->getGID(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginConfigUser::class => false]; } } diff --git a/src/Normalizer/PluginDeviceNormalizer.php b/src/Normalizer/PluginDeviceNormalizer.php index 8cdcd29e..abb7fd49 100644 --- a/src/Normalizer/PluginDeviceNormalizer.php +++ b/src/Normalizer/PluginDeviceNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,65 +16,92 @@ class PluginDeviceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\PluginDevice'; + return \Docker\API\Model\PluginDevice::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\PluginDevice; + return \is_object($data) && \Docker\API\Model\PluginDevice::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\PluginDevice(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); + if (\array_key_exists('Description', $data) && null !== $data['Description']) { + $object->setDescription($data['Description']); + unset($data['Description']); + } elseif (\array_key_exists('Description', $data) && null === $data['Description']) { + $object->setDescription(null); } - if (property_exists($data, 'Settable') && $data->{'Settable'} !== null) { + if (\array_key_exists('Settable', $data) && null !== $data['Settable']) { $values = []; - foreach ($data->{'Settable'} as $value) { + foreach ($data['Settable'] as $value) { $values[] = $value; } $object->setSettable($values); + unset($data['Settable']); + } elseif (\array_key_exists('Settable', $data) && null === $data['Settable']) { + $object->setSettable(null); } - if (property_exists($data, 'Path') && $data->{'Path'} !== null) { - $object->setPath($data->{'Path'}); + if (\array_key_exists('Path', $data) && null !== $data['Path']) { + $object->setPath($data['Path']); + unset($data['Path']); + } elseif (\array_key_exists('Path', $data) && null === $data['Path']) { + $object->setPath(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getDescription()) { - $data->{'Description'} = $object->getDescription(); + $dataArray = []; + $dataArray['Name'] = $data->getName(); + $dataArray['Description'] = $data->getDescription(); + $values = []; + foreach ($data->getSettable() as $value) { + $values[] = $value; } - if (null !== $object->getSettable()) { - $values = []; - foreach ($object->getSettable() as $value) { - $values[] = $value; + $dataArray['Settable'] = $values; + $dataArray['Path'] = $data->getPath(); + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; } - $data->{'Settable'} = $values; - } - if (null !== $object->getPath()) { - $data->{'Path'} = $object->getPath(); } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginDevice::class => false]; } } diff --git a/src/Normalizer/PluginEnvNormalizer.php b/src/Normalizer/PluginEnvNormalizer.php index adc6614c..9a7aa1b6 100644 --- a/src/Normalizer/PluginEnvNormalizer.php +++ b/src/Normalizer/PluginEnvNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,65 +16,92 @@ class PluginEnvNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\PluginEnv'; + return \Docker\API\Model\PluginEnv::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\PluginEnv; + return \is_object($data) && \Docker\API\Model\PluginEnv::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\PluginEnv(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); + if (\array_key_exists('Description', $data) && null !== $data['Description']) { + $object->setDescription($data['Description']); + unset($data['Description']); + } elseif (\array_key_exists('Description', $data) && null === $data['Description']) { + $object->setDescription(null); } - if (property_exists($data, 'Settable') && $data->{'Settable'} !== null) { + if (\array_key_exists('Settable', $data) && null !== $data['Settable']) { $values = []; - foreach ($data->{'Settable'} as $value) { + foreach ($data['Settable'] as $value) { $values[] = $value; } $object->setSettable($values); + unset($data['Settable']); + } elseif (\array_key_exists('Settable', $data) && null === $data['Settable']) { + $object->setSettable(null); } - if (property_exists($data, 'Value') && $data->{'Value'} !== null) { - $object->setValue($data->{'Value'}); + if (\array_key_exists('Value', $data) && null !== $data['Value']) { + $object->setValue($data['Value']); + unset($data['Value']); + } elseif (\array_key_exists('Value', $data) && null === $data['Value']) { + $object->setValue(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getDescription()) { - $data->{'Description'} = $object->getDescription(); + $dataArray = []; + $dataArray['Name'] = $data->getName(); + $dataArray['Description'] = $data->getDescription(); + $values = []; + foreach ($data->getSettable() as $value) { + $values[] = $value; } - if (null !== $object->getSettable()) { - $values = []; - foreach ($object->getSettable() as $value) { - $values[] = $value; + $dataArray['Settable'] = $values; + $dataArray['Value'] = $data->getValue(); + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; } - $data->{'Settable'} = $values; - } - if (null !== $object->getValue()) { - $data->{'Value'} = $object->getValue(); } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginEnv::class => false]; } } diff --git a/src/Normalizer/PluginInterfaceTypeNormalizer.php b/src/Normalizer/PluginInterfaceTypeNormalizer.php index db789e61..f22e0eeb 100644 --- a/src/Normalizer/PluginInterfaceTypeNormalizer.php +++ b/src/Normalizer/PluginInterfaceTypeNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,51 +16,77 @@ class PluginInterfaceTypeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\PluginInterfaceType'; + return \Docker\API\Model\PluginInterfaceType::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\PluginInterfaceType; + return \is_object($data) && \Docker\API\Model\PluginInterfaceType::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\PluginInterfaceType(); - if (property_exists($data, 'Prefix') && $data->{'Prefix'} !== null) { - $object->setPrefix($data->{'Prefix'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Prefix', $data) && null !== $data['Prefix']) { + $object->setPrefix($data['Prefix']); + unset($data['Prefix']); + } elseif (\array_key_exists('Prefix', $data) && null === $data['Prefix']) { + $object->setPrefix(null); } - if (property_exists($data, 'Capability') && $data->{'Capability'} !== null) { - $object->setCapability($data->{'Capability'}); + if (\array_key_exists('Capability', $data) && null !== $data['Capability']) { + $object->setCapability($data['Capability']); + unset($data['Capability']); + } elseif (\array_key_exists('Capability', $data) && null === $data['Capability']) { + $object->setCapability(null); } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($data->{'Version'}); + if (\array_key_exists('Version', $data) && null !== $data['Version']) { + $object->setVersion($data['Version']); + unset($data['Version']); + } elseif (\array_key_exists('Version', $data) && null === $data['Version']) { + $object->setVersion(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getPrefix()) { - $data->{'Prefix'} = $object->getPrefix(); - } - if (null !== $object->getCapability()) { - $data->{'Capability'} = $object->getCapability(); - } - if (null !== $object->getVersion()) { - $data->{'Version'} = $object->getVersion(); + $dataArray = []; + $dataArray['Prefix'] = $data->getPrefix(); + $dataArray['Capability'] = $data->getCapability(); + $dataArray['Version'] = $data->getVersion(); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginInterfaceType::class => false]; } } diff --git a/src/Normalizer/PluginMountNormalizer.php b/src/Normalizer/PluginMountNormalizer.php index c6d1fef8..5f8246e1 100644 --- a/src/Normalizer/PluginMountNormalizer.php +++ b/src/Normalizer/PluginMountNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,91 +16,121 @@ class PluginMountNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\PluginMount'; + return \Docker\API\Model\PluginMount::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\PluginMount; + return \is_object($data) && \Docker\API\Model\PluginMount::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\PluginMount(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); + if (\array_key_exists('Description', $data) && null !== $data['Description']) { + $object->setDescription($data['Description']); + unset($data['Description']); + } elseif (\array_key_exists('Description', $data) && null === $data['Description']) { + $object->setDescription(null); } - if (property_exists($data, 'Settable') && $data->{'Settable'} !== null) { + if (\array_key_exists('Settable', $data) && null !== $data['Settable']) { $values = []; - foreach ($data->{'Settable'} as $value) { + foreach ($data['Settable'] as $value) { $values[] = $value; } $object->setSettable($values); + unset($data['Settable']); + } elseif (\array_key_exists('Settable', $data) && null === $data['Settable']) { + $object->setSettable(null); } - if (property_exists($data, 'Source') && $data->{'Source'} !== null) { - $object->setSource($data->{'Source'}); + if (\array_key_exists('Source', $data) && null !== $data['Source']) { + $object->setSource($data['Source']); + unset($data['Source']); + } elseif (\array_key_exists('Source', $data) && null === $data['Source']) { + $object->setSource(null); } - if (property_exists($data, 'Destination') && $data->{'Destination'} !== null) { - $object->setDestination($data->{'Destination'}); + if (\array_key_exists('Destination', $data) && null !== $data['Destination']) { + $object->setDestination($data['Destination']); + unset($data['Destination']); + } elseif (\array_key_exists('Destination', $data) && null === $data['Destination']) { + $object->setDestination(null); } - if (property_exists($data, 'Type') && $data->{'Type'} !== null) { - $object->setType($data->{'Type'}); + if (\array_key_exists('Type', $data) && null !== $data['Type']) { + $object->setType($data['Type']); + unset($data['Type']); + } elseif (\array_key_exists('Type', $data) && null === $data['Type']) { + $object->setType(null); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { + if (\array_key_exists('Options', $data) && null !== $data['Options']) { $values_1 = []; - foreach ($data->{'Options'} as $value_1) { + foreach ($data['Options'] as $value_1) { $values_1[] = $value_1; } $object->setOptions($values_1); + unset($data['Options']); + } elseif (\array_key_exists('Options', $data) && null === $data['Options']) { + $object->setOptions(null); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + $dataArray['Name'] = $data->getName(); + $dataArray['Description'] = $data->getDescription(); + $values = []; + foreach ($data->getSettable() as $value) { + $values[] = $value; } - if (null !== $object->getDescription()) { - $data->{'Description'} = $object->getDescription(); + $dataArray['Settable'] = $values; + $dataArray['Source'] = $data->getSource(); + $dataArray['Destination'] = $data->getDestination(); + $dataArray['Type'] = $data->getType(); + $values_1 = []; + foreach ($data->getOptions() as $value_1) { + $values_1[] = $value_1; } - if (null !== $object->getSettable()) { - $values = []; - foreach ($object->getSettable() as $value) { - $values[] = $value; + $dataArray['Options'] = $values_1; + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_2; } - $data->{'Settable'} = $values; - } - if (null !== $object->getSource()) { - $data->{'Source'} = $object->getSource(); - } - if (null !== $object->getDestination()) { - $data->{'Destination'} = $object->getDestination(); - } - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); - } - if (null !== $object->getOptions()) { - $values_1 = []; - foreach ($object->getOptions() as $value_1) { - $values_1[] = $value_1; - } - $data->{'Options'} = $values_1; } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginMount::class => false]; } } diff --git a/src/Normalizer/PluginNormalizer.php b/src/Normalizer/PluginNormalizer.php index f24ad2fd..ce410dcc 100644 --- a/src/Normalizer/PluginNormalizer.php +++ b/src/Normalizer/PluginNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,69 +16,105 @@ class PluginNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Plugin'; + return \Docker\API\Model\Plugin::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Plugin; + return \is_object($data) && \Docker\API\Model\Plugin::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\Plugin(); - if (property_exists($data, 'Id') && $data->{'Id'} !== null) { - $object->setId($data->{'Id'}); + if (\array_key_exists('Enabled', $data) && \is_int($data['Enabled'])) { + $data['Enabled'] = (bool) $data['Enabled']; + } + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (\array_key_exists('Id', $data) && null !== $data['Id']) { + $object->setId($data['Id']); + unset($data['Id']); + } elseif (\array_key_exists('Id', $data) && null === $data['Id']) { + $object->setId(null); } - if (property_exists($data, 'Enabled') && $data->{'Enabled'} !== null) { - $object->setEnabled($data->{'Enabled'}); + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); } - if (property_exists($data, 'Settings') && $data->{'Settings'} !== null) { - $object->setSettings($this->denormalizer->denormalize($data->{'Settings'}, 'Docker\\API\\Model\\PluginSettings', 'json', $context)); + if (\array_key_exists('Enabled', $data) && null !== $data['Enabled']) { + $object->setEnabled($data['Enabled']); + unset($data['Enabled']); + } elseif (\array_key_exists('Enabled', $data) && null === $data['Enabled']) { + $object->setEnabled(null); } - if (property_exists($data, 'PluginReference') && $data->{'PluginReference'} !== null) { - $object->setPluginReference($data->{'PluginReference'}); + if (\array_key_exists('Settings', $data) && null !== $data['Settings']) { + $object->setSettings($this->denormalizer->denormalize($data['Settings'], \Docker\API\Model\PluginSettings::class, 'json', $context)); + unset($data['Settings']); + } elseif (\array_key_exists('Settings', $data) && null === $data['Settings']) { + $object->setSettings(null); } - if (property_exists($data, 'Config') && $data->{'Config'} !== null) { - $object->setConfig($this->denormalizer->denormalize($data->{'Config'}, 'Docker\\API\\Model\\PluginConfig', 'json', $context)); + if (\array_key_exists('PluginReference', $data) && null !== $data['PluginReference']) { + $object->setPluginReference($data['PluginReference']); + unset($data['PluginReference']); + } elseif (\array_key_exists('PluginReference', $data) && null === $data['PluginReference']) { + $object->setPluginReference(null); + } + if (\array_key_exists('Config', $data) && null !== $data['Config']) { + $object->setConfig($this->denormalizer->denormalize($data['Config'], \Docker\API\Model\PluginConfig::class, 'json', $context)); + unset($data['Config']); + } elseif (\array_key_exists('Config', $data) && null === $data['Config']) { + $object->setConfig(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getId()) { - $data->{'Id'} = $object->getId(); - } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('id') && null !== $data->getId()) { + $dataArray['Id'] = $data->getId(); } - if (null !== $object->getEnabled()) { - $data->{'Enabled'} = $object->getEnabled(); + $dataArray['Name'] = $data->getName(); + $dataArray['Enabled'] = $data->getEnabled(); + $dataArray['Settings'] = $this->normalizer->normalize($data->getSettings(), 'json', $context); + if ($data->isInitialized('pluginReference') && null !== $data->getPluginReference()) { + $dataArray['PluginReference'] = $data->getPluginReference(); } - if (null !== $object->getSettings()) { - $data->{'Settings'} = $this->normalizer->normalize($object->getSettings(), 'json', $context); - } - if (null !== $object->getPluginReference()) { - $data->{'PluginReference'} = $object->getPluginReference(); - } - if (null !== $object->getConfig()) { - $data->{'Config'} = $this->normalizer->normalize($object->getConfig(), 'json', $context); + $dataArray['Config'] = $this->normalizer->normalize($data->getConfig(), 'json', $context); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Plugin::class => false]; } } diff --git a/src/Normalizer/PluginPrivilegeNormalizer.php b/src/Normalizer/PluginPrivilegeNormalizer.php new file mode 100644 index 00000000..8fb05441 --- /dev/null +++ b/src/Normalizer/PluginPrivilegeNormalizer.php @@ -0,0 +1,106 @@ +setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Description', $data) && null !== $data['Description']) { + $object->setDescription($data['Description']); + unset($data['Description']); + } elseif (\array_key_exists('Description', $data) && null === $data['Description']) { + $object->setDescription(null); + } + if (\array_key_exists('Value', $data) && null !== $data['Value']) { + $values = []; + foreach ($data['Value'] as $value) { + $values[] = $value; + } + $object->setValue($values); + unset($data['Value']); + } elseif (\array_key_exists('Value', $data) && null === $data['Value']) { + $object->setValue(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); + } + if ($data->isInitialized('description') && null !== $data->getDescription()) { + $dataArray['Description'] = $data->getDescription(); + } + if ($data->isInitialized('value') && null !== $data->getValue()) { + $values = []; + foreach ($data->getValue() as $value) { + $values[] = $value; + } + $dataArray['Value'] = $values; + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginPrivilege::class => false]; + } +} diff --git a/src/Normalizer/PluginSettingsNormalizer.php b/src/Normalizer/PluginSettingsNormalizer.php index 5c1f47ff..31a60a51 100644 --- a/src/Normalizer/PluginSettingsNormalizer.php +++ b/src/Normalizer/PluginSettingsNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,89 +16,116 @@ class PluginSettingsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\PluginSettings'; + return \Docker\API\Model\PluginSettings::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\PluginSettings; + return \is_object($data) && \Docker\API\Model\PluginSettings::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\PluginSettings(); - if (property_exists($data, 'Mounts') && $data->{'Mounts'} !== null) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Mounts', $data) && null !== $data['Mounts']) { $values = []; - foreach ($data->{'Mounts'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\PluginMount', 'json', $context); + foreach ($data['Mounts'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\PluginMount::class, 'json', $context); } $object->setMounts($values); + unset($data['Mounts']); + } elseif (\array_key_exists('Mounts', $data) && null === $data['Mounts']) { + $object->setMounts(null); } - if (property_exists($data, 'Env') && $data->{'Env'} !== null) { + if (\array_key_exists('Env', $data) && null !== $data['Env']) { $values_1 = []; - foreach ($data->{'Env'} as $value_1) { + foreach ($data['Env'] as $value_1) { $values_1[] = $value_1; } $object->setEnv($values_1); + unset($data['Env']); + } elseif (\array_key_exists('Env', $data) && null === $data['Env']) { + $object->setEnv(null); } - if (property_exists($data, 'Args') && $data->{'Args'} !== null) { + if (\array_key_exists('Args', $data) && null !== $data['Args']) { $values_2 = []; - foreach ($data->{'Args'} as $value_2) { + foreach ($data['Args'] as $value_2) { $values_2[] = $value_2; } $object->setArgs($values_2); + unset($data['Args']); + } elseif (\array_key_exists('Args', $data) && null === $data['Args']) { + $object->setArgs(null); } - if (property_exists($data, 'Devices') && $data->{'Devices'} !== null) { + if (\array_key_exists('Devices', $data) && null !== $data['Devices']) { $values_3 = []; - foreach ($data->{'Devices'} as $value_3) { - $values_3[] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\PluginDevice', 'json', $context); + foreach ($data['Devices'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\PluginDevice::class, 'json', $context); } $object->setDevices($values_3); + unset($data['Devices']); + } elseif (\array_key_exists('Devices', $data) && null === $data['Devices']) { + $object->setDevices(null); + } + foreach ($data as $key => $value_4) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_4; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getMounts()) { - $values = []; - foreach ($object->getMounts() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data->{'Mounts'} = $values; + $dataArray = []; + $values = []; + foreach ($data->getMounts() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); } - if (null !== $object->getEnv()) { - $values_1 = []; - foreach ($object->getEnv() as $value_1) { - $values_1[] = $value_1; - } - $data->{'Env'} = $values_1; + $dataArray['Mounts'] = $values; + $values_1 = []; + foreach ($data->getEnv() as $value_1) { + $values_1[] = $value_1; } - if (null !== $object->getArgs()) { - $values_2 = []; - foreach ($object->getArgs() as $value_2) { - $values_2[] = $value_2; - } - $data->{'Args'} = $values_2; + $dataArray['Env'] = $values_1; + $values_2 = []; + foreach ($data->getArgs() as $value_2) { + $values_2[] = $value_2; } - if (null !== $object->getDevices()) { - $values_3 = []; - foreach ($object->getDevices() as $value_3) { - $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + $dataArray['Args'] = $values_2; + $values_3 = []; + foreach ($data->getDevices() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $dataArray['Devices'] = $values_3; + foreach ($data as $key => $value_4) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_4; } - $data->{'Devices'} = $values_3; } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginSettings::class => false]; } } diff --git a/src/Normalizer/PluginsInfoNormalizer.php b/src/Normalizer/PluginsInfoNormalizer.php index 748ac1aa..1e70509d 100644 --- a/src/Normalizer/PluginsInfoNormalizer.php +++ b/src/Normalizer/PluginsInfoNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,89 +16,124 @@ class PluginsInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\PluginsInfo'; + return \Docker\API\Model\PluginsInfo::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\PluginsInfo; + return \is_object($data) && \Docker\API\Model\PluginsInfo::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\PluginsInfo(); - if (property_exists($data, 'Volume') && $data->{'Volume'} !== null) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Volume', $data) && null !== $data['Volume']) { $values = []; - foreach ($data->{'Volume'} as $value) { + foreach ($data['Volume'] as $value) { $values[] = $value; } $object->setVolume($values); + unset($data['Volume']); + } elseif (\array_key_exists('Volume', $data) && null === $data['Volume']) { + $object->setVolume(null); } - if (property_exists($data, 'Network') && $data->{'Network'} !== null) { + if (\array_key_exists('Network', $data) && null !== $data['Network']) { $values_1 = []; - foreach ($data->{'Network'} as $value_1) { + foreach ($data['Network'] as $value_1) { $values_1[] = $value_1; } $object->setNetwork($values_1); + unset($data['Network']); + } elseif (\array_key_exists('Network', $data) && null === $data['Network']) { + $object->setNetwork(null); } - if (property_exists($data, 'Authorization') && $data->{'Authorization'} !== null) { + if (\array_key_exists('Authorization', $data) && null !== $data['Authorization']) { $values_2 = []; - foreach ($data->{'Authorization'} as $value_2) { + foreach ($data['Authorization'] as $value_2) { $values_2[] = $value_2; } $object->setAuthorization($values_2); + unset($data['Authorization']); + } elseif (\array_key_exists('Authorization', $data) && null === $data['Authorization']) { + $object->setAuthorization(null); } - if (property_exists($data, 'Log') && $data->{'Log'} !== null) { + if (\array_key_exists('Log', $data) && null !== $data['Log']) { $values_3 = []; - foreach ($data->{'Log'} as $value_3) { + foreach ($data['Log'] as $value_3) { $values_3[] = $value_3; } $object->setLog($values_3); + unset($data['Log']); + } elseif (\array_key_exists('Log', $data) && null === $data['Log']) { + $object->setLog(null); + } + foreach ($data as $key => $value_4) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_4; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getVolume()) { + $dataArray = []; + if ($data->isInitialized('volume') && null !== $data->getVolume()) { $values = []; - foreach ($object->getVolume() as $value) { + foreach ($data->getVolume() as $value) { $values[] = $value; } - $data->{'Volume'} = $values; + $dataArray['Volume'] = $values; } - if (null !== $object->getNetwork()) { + if ($data->isInitialized('network') && null !== $data->getNetwork()) { $values_1 = []; - foreach ($object->getNetwork() as $value_1) { + foreach ($data->getNetwork() as $value_1) { $values_1[] = $value_1; } - $data->{'Network'} = $values_1; + $dataArray['Network'] = $values_1; } - if (null !== $object->getAuthorization()) { + if ($data->isInitialized('authorization') && null !== $data->getAuthorization()) { $values_2 = []; - foreach ($object->getAuthorization() as $value_2) { + foreach ($data->getAuthorization() as $value_2) { $values_2[] = $value_2; } - $data->{'Authorization'} = $values_2; + $dataArray['Authorization'] = $values_2; } - if (null !== $object->getLog()) { + if ($data->isInitialized('log') && null !== $data->getLog()) { $values_3 = []; - foreach ($object->getLog() as $value_3) { + foreach ($data->getLog() as $value_3) { $values_3[] = $value_3; } - $data->{'Log'} = $values_3; + $dataArray['Log'] = $values_3; + } + foreach ($data as $key => $value_4) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_4; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PluginsInfo::class => false]; } } diff --git a/src/Normalizer/PluginsNameUpgradePostBodyItemNormalizer.php b/src/Normalizer/PluginsNameUpgradePostBodyItemNormalizer.php deleted file mode 100644 index 324b8ebf..00000000 --- a/src/Normalizer/PluginsNameUpgradePostBodyItemNormalizer.php +++ /dev/null @@ -1,77 +0,0 @@ -{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); - } - if (property_exists($data, 'Value') && $data->{'Value'} !== null) { - $values = []; - foreach ($data->{'Value'} as $value) { - $values[] = $value; - } - $object->setValue($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getDescription()) { - $data->{'Description'} = $object->getDescription(); - } - if (null !== $object->getValue()) { - $values = []; - foreach ($object->getValue() as $value) { - $values[] = $value; - } - $data->{'Value'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/PluginsPrivilegesGetResponse200ItemNormalizer.php b/src/Normalizer/PluginsPrivilegesGetResponse200ItemNormalizer.php deleted file mode 100644 index 5c361ccb..00000000 --- a/src/Normalizer/PluginsPrivilegesGetResponse200ItemNormalizer.php +++ /dev/null @@ -1,77 +0,0 @@ -{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); - } - if (property_exists($data, 'Value') && $data->{'Value'} !== null) { - $values = []; - foreach ($data->{'Value'} as $value) { - $values[] = $value; - } - $object->setValue($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getDescription()) { - $data->{'Description'} = $object->getDescription(); - } - if (null !== $object->getValue()) { - $values = []; - foreach ($object->getValue() as $value) { - $values[] = $value; - } - $data->{'Value'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/PluginsPullPostBodyItemNormalizer.php b/src/Normalizer/PluginsPullPostBodyItemNormalizer.php deleted file mode 100644 index ca126dd9..00000000 --- a/src/Normalizer/PluginsPullPostBodyItemNormalizer.php +++ /dev/null @@ -1,77 +0,0 @@ -{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); - } - if (property_exists($data, 'Value') && $data->{'Value'} !== null) { - $values = []; - foreach ($data->{'Value'} as $value) { - $values[] = $value; - } - $object->setValue($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getDescription()) { - $data->{'Description'} = $object->getDescription(); - } - if (null !== $object->getValue()) { - $values = []; - foreach ($object->getValue() as $value) { - $values[] = $value; - } - $data->{'Value'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/PortBindingNormalizer.php b/src/Normalizer/PortBindingNormalizer.php index b10dedf5..6ae9291d 100644 --- a/src/Normalizer/PortBindingNormalizer.php +++ b/src/Normalizer/PortBindingNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class PortBindingNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\PortBinding'; + return \Docker\API\Model\PortBinding::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\PortBinding; + return \is_object($data) && \Docker\API\Model\PortBinding::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\PortBinding(); - if (property_exists($data, 'HostIp') && $data->{'HostIp'} !== null) { - $object->setHostIp($data->{'HostIp'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('HostIp', $data) && null !== $data['HostIp']) { + $object->setHostIp($data['HostIp']); + unset($data['HostIp']); + } elseif (\array_key_exists('HostIp', $data) && null === $data['HostIp']) { + $object->setHostIp(null); + } + if (\array_key_exists('HostPort', $data) && null !== $data['HostPort']) { + $object->setHostPort($data['HostPort']); + unset($data['HostPort']); + } elseif (\array_key_exists('HostPort', $data) && null === $data['HostPort']) { + $object->setHostPort(null); } - if (property_exists($data, 'HostPort') && $data->{'HostPort'} !== null) { - $object->setHostPort($data->{'HostPort'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getHostIp()) { - $data->{'HostIp'} = $object->getHostIp(); + $dataArray = []; + if ($data->isInitialized('hostIp') && null !== $data->getHostIp()) { + $dataArray['HostIp'] = $data->getHostIp(); } - if (null !== $object->getHostPort()) { - $data->{'HostPort'} = $object->getHostPort(); + if ($data->isInitialized('hostPort') && null !== $data->getHostPort()) { + $dataArray['HostPort'] = $data->getHostPort(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PortBinding::class => false]; } } diff --git a/src/Normalizer/PortNormalizer.php b/src/Normalizer/PortNormalizer.php index 4f6a07fd..d2a15e6c 100644 --- a/src/Normalizer/PortNormalizer.php +++ b/src/Normalizer/PortNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,57 +16,88 @@ class PortNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Port'; + return \Docker\API\Model\Port::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Port; + return \is_object($data) && \Docker\API\Model\Port::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\Port(); - if (property_exists($data, 'IP') && $data->{'IP'} !== null) { - $object->setIP($data->{'IP'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('IP', $data) && null !== $data['IP']) { + $object->setIP($data['IP']); + unset($data['IP']); + } elseif (\array_key_exists('IP', $data) && null === $data['IP']) { + $object->setIP(null); + } + if (\array_key_exists('PrivatePort', $data) && null !== $data['PrivatePort']) { + $object->setPrivatePort($data['PrivatePort']); + unset($data['PrivatePort']); + } elseif (\array_key_exists('PrivatePort', $data) && null === $data['PrivatePort']) { + $object->setPrivatePort(null); } - if (property_exists($data, 'PrivatePort') && $data->{'PrivatePort'} !== null) { - $object->setPrivatePort($data->{'PrivatePort'}); + if (\array_key_exists('PublicPort', $data) && null !== $data['PublicPort']) { + $object->setPublicPort($data['PublicPort']); + unset($data['PublicPort']); + } elseif (\array_key_exists('PublicPort', $data) && null === $data['PublicPort']) { + $object->setPublicPort(null); } - if (property_exists($data, 'PublicPort') && $data->{'PublicPort'} !== null) { - $object->setPublicPort($data->{'PublicPort'}); + if (\array_key_exists('Type', $data) && null !== $data['Type']) { + $object->setType($data['Type']); + unset($data['Type']); + } elseif (\array_key_exists('Type', $data) && null === $data['Type']) { + $object->setType(null); } - if (property_exists($data, 'Type') && $data->{'Type'} !== null) { - $object->setType($data->{'Type'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getIP()) { - $data->{'IP'} = $object->getIP(); + $dataArray = []; + if ($data->isInitialized('iP') && null !== $data->getIP()) { + $dataArray['IP'] = $data->getIP(); } - if (null !== $object->getPrivatePort()) { - $data->{'PrivatePort'} = $object->getPrivatePort(); + $dataArray['PrivatePort'] = $data->getPrivatePort(); + if ($data->isInitialized('publicPort') && null !== $data->getPublicPort()) { + $dataArray['PublicPort'] = $data->getPublicPort(); } - if (null !== $object->getPublicPort()) { - $data->{'PublicPort'} = $object->getPublicPort(); - } - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); + $dataArray['Type'] = $data->getType(); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Port::class => false]; } } diff --git a/src/Normalizer/PortStatusNormalizer.php b/src/Normalizer/PortStatusNormalizer.php new file mode 100644 index 00000000..6a59c4cd --- /dev/null +++ b/src/Normalizer/PortStatusNormalizer.php @@ -0,0 +1,88 @@ +denormalizer->denormalize($value, \Docker\API\Model\EndpointPortConfig::class, 'json', $context); + } + $object->setPorts($values); + unset($data['Ports']); + } elseif (\array_key_exists('Ports', $data) && null === $data['Ports']) { + $object->setPorts(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('ports') && null !== $data->getPorts()) { + $values = []; + foreach ($data->getPorts() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $dataArray['Ports'] = $values; + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PortStatus::class => false]; + } +} diff --git a/src/Normalizer/ProcessConfigNormalizer.php b/src/Normalizer/ProcessConfigNormalizer.php index d545c545..caac37dd 100644 --- a/src/Normalizer/ProcessConfigNormalizer.php +++ b/src/Normalizer/ProcessConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,71 +16,115 @@ class ProcessConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ProcessConfig'; + return \Docker\API\Model\ProcessConfig::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ProcessConfig; + return \is_object($data) && \Docker\API\Model\ProcessConfig::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ProcessConfig(); - if (property_exists($data, 'privileged') && $data->{'privileged'} !== null) { - $object->setPrivileged($data->{'privileged'}); + if (\array_key_exists('privileged', $data) && \is_int($data['privileged'])) { + $data['privileged'] = (bool) $data['privileged']; + } + if (\array_key_exists('tty', $data) && \is_int($data['tty'])) { + $data['tty'] = (bool) $data['tty']; } - if (property_exists($data, 'user') && $data->{'user'} !== null) { - $object->setUser($data->{'user'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'tty') && $data->{'tty'} !== null) { - $object->setTty($data->{'tty'}); + if (\array_key_exists('privileged', $data) && null !== $data['privileged']) { + $object->setPrivileged($data['privileged']); + unset($data['privileged']); + } elseif (\array_key_exists('privileged', $data) && null === $data['privileged']) { + $object->setPrivileged(null); } - if (property_exists($data, 'entrypoint') && $data->{'entrypoint'} !== null) { - $object->setEntrypoint($data->{'entrypoint'}); + if (\array_key_exists('user', $data) && null !== $data['user']) { + $object->setUser($data['user']); + unset($data['user']); + } elseif (\array_key_exists('user', $data) && null === $data['user']) { + $object->setUser(null); } - if (property_exists($data, 'arguments') && $data->{'arguments'} !== null) { + if (\array_key_exists('tty', $data) && null !== $data['tty']) { + $object->setTty($data['tty']); + unset($data['tty']); + } elseif (\array_key_exists('tty', $data) && null === $data['tty']) { + $object->setTty(null); + } + if (\array_key_exists('entrypoint', $data) && null !== $data['entrypoint']) { + $object->setEntrypoint($data['entrypoint']); + unset($data['entrypoint']); + } elseif (\array_key_exists('entrypoint', $data) && null === $data['entrypoint']) { + $object->setEntrypoint(null); + } + if (\array_key_exists('arguments', $data) && null !== $data['arguments']) { $values = []; - foreach ($data->{'arguments'} as $value) { + foreach ($data['arguments'] as $value) { $values[] = $value; } $object->setArguments($values); + unset($data['arguments']); + } elseif (\array_key_exists('arguments', $data) && null === $data['arguments']) { + $object->setArguments(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getPrivileged()) { - $data->{'privileged'} = $object->getPrivileged(); + $dataArray = []; + if ($data->isInitialized('privileged') && null !== $data->getPrivileged()) { + $dataArray['privileged'] = $data->getPrivileged(); } - if (null !== $object->getUser()) { - $data->{'user'} = $object->getUser(); + if ($data->isInitialized('user') && null !== $data->getUser()) { + $dataArray['user'] = $data->getUser(); } - if (null !== $object->getTty()) { - $data->{'tty'} = $object->getTty(); + if ($data->isInitialized('tty') && null !== $data->getTty()) { + $dataArray['tty'] = $data->getTty(); } - if (null !== $object->getEntrypoint()) { - $data->{'entrypoint'} = $object->getEntrypoint(); + if ($data->isInitialized('entrypoint') && null !== $data->getEntrypoint()) { + $dataArray['entrypoint'] = $data->getEntrypoint(); } - if (null !== $object->getArguments()) { + if ($data->isInitialized('arguments') && null !== $data->getArguments()) { $values = []; - foreach ($object->getArguments() as $value) { + foreach ($data->getArguments() as $value) { $values[] = $value; } - $data->{'arguments'} = $values; + $dataArray['arguments'] = $values; + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ProcessConfig::class => false]; } } diff --git a/src/Normalizer/ProgressDetailNormalizer.php b/src/Normalizer/ProgressDetailNormalizer.php index e96a0441..65f378fc 100644 --- a/src/Normalizer/ProgressDetailNormalizer.php +++ b/src/Normalizer/ProgressDetailNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class ProgressDetailNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ProgressDetail'; + return \Docker\API\Model\ProgressDetail::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ProgressDetail; + return \is_object($data) && \Docker\API\Model\ProgressDetail::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ProgressDetail(); - if (property_exists($data, 'current') && $data->{'current'} !== null) { - $object->setCurrent($data->{'current'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('current', $data) && null !== $data['current']) { + $object->setCurrent($data['current']); + unset($data['current']); + } elseif (\array_key_exists('current', $data) && null === $data['current']) { + $object->setCurrent(null); + } + if (\array_key_exists('total', $data) && null !== $data['total']) { + $object->setTotal($data['total']); + unset($data['total']); + } elseif (\array_key_exists('total', $data) && null === $data['total']) { + $object->setTotal(null); } - if (property_exists($data, 'total') && $data->{'total'} !== null) { - $object->setTotal($data->{'total'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getCurrent()) { - $data->{'current'} = $object->getCurrent(); + $dataArray = []; + if ($data->isInitialized('current') && null !== $data->getCurrent()) { + $dataArray['current'] = $data->getCurrent(); } - if (null !== $object->getTotal()) { - $data->{'total'} = $object->getTotal(); + if ($data->isInitialized('total') && null !== $data->getTotal()) { + $dataArray['total'] = $data->getTotal(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ProgressDetail::class => false]; } } diff --git a/src/Normalizer/PushImageInfoNormalizer.php b/src/Normalizer/PushImageInfoNormalizer.php index 91891730..94cb1491 100644 --- a/src/Normalizer/PushImageInfoNormalizer.php +++ b/src/Normalizer/PushImageInfoNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,57 +16,92 @@ class PushImageInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\PushImageInfo'; + return \Docker\API\Model\PushImageInfo::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\PushImageInfo; + return \is_object($data) && \Docker\API\Model\PushImageInfo::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\PushImageInfo(); - if (property_exists($data, 'error') && $data->{'error'} !== null) { - $object->setError($data->{'error'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('error', $data) && null !== $data['error']) { + $object->setError($data['error']); + unset($data['error']); + } elseif (\array_key_exists('error', $data) && null === $data['error']) { + $object->setError(null); + } + if (\array_key_exists('status', $data) && null !== $data['status']) { + $object->setStatus($data['status']); + unset($data['status']); + } elseif (\array_key_exists('status', $data) && null === $data['status']) { + $object->setStatus(null); } - if (property_exists($data, 'status') && $data->{'status'} !== null) { - $object->setStatus($data->{'status'}); + if (\array_key_exists('progress', $data) && null !== $data['progress']) { + $object->setProgress($data['progress']); + unset($data['progress']); + } elseif (\array_key_exists('progress', $data) && null === $data['progress']) { + $object->setProgress(null); } - if (property_exists($data, 'progress') && $data->{'progress'} !== null) { - $object->setProgress($data->{'progress'}); + if (\array_key_exists('progressDetail', $data) && null !== $data['progressDetail']) { + $object->setProgressDetail($this->denormalizer->denormalize($data['progressDetail'], \Docker\API\Model\ProgressDetail::class, 'json', $context)); + unset($data['progressDetail']); + } elseif (\array_key_exists('progressDetail', $data) && null === $data['progressDetail']) { + $object->setProgressDetail(null); } - if (property_exists($data, 'progressDetail') && $data->{'progressDetail'} !== null) { - $object->setProgressDetail($this->denormalizer->denormalize($data->{'progressDetail'}, 'Docker\\API\\Model\\ProgressDetail', 'json', $context)); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getError()) { - $data->{'error'} = $object->getError(); + $dataArray = []; + if ($data->isInitialized('error') && null !== $data->getError()) { + $dataArray['error'] = $data->getError(); } - if (null !== $object->getStatus()) { - $data->{'status'} = $object->getStatus(); + if ($data->isInitialized('status') && null !== $data->getStatus()) { + $dataArray['status'] = $data->getStatus(); } - if (null !== $object->getProgress()) { - $data->{'progress'} = $object->getProgress(); + if ($data->isInitialized('progress') && null !== $data->getProgress()) { + $dataArray['progress'] = $data->getProgress(); } - if (null !== $object->getProgressDetail()) { - $data->{'progressDetail'} = $this->normalizer->normalize($object->getProgressDetail(), 'json', $context); + if ($data->isInitialized('progressDetail') && null !== $data->getProgressDetail()) { + $dataArray['progressDetail'] = $this->normalizer->normalize($data->getProgressDetail(), 'json', $context); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\PushImageInfo::class => false]; } } diff --git a/src/Normalizer/RegistryServiceConfigNormalizer.php b/src/Normalizer/RegistryServiceConfigNormalizer.php index c4b2bf06..d275b03e 100644 --- a/src/Normalizer/RegistryServiceConfigNormalizer.php +++ b/src/Normalizer/RegistryServiceConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,103 +16,141 @@ class RegistryServiceConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\RegistryServiceConfig'; + return \Docker\API\Model\RegistryServiceConfig::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\RegistryServiceConfig; + return \is_object($data) && \Docker\API\Model\RegistryServiceConfig::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\RegistryServiceConfig(); - if (property_exists($data, 'AllowNondistributableArtifactsCIDRs') && $data->{'AllowNondistributableArtifactsCIDRs'} !== null) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AllowNondistributableArtifactsCIDRs', $data) && null !== $data['AllowNondistributableArtifactsCIDRs']) { $values = []; - foreach ($data->{'AllowNondistributableArtifactsCIDRs'} as $value) { + foreach ($data['AllowNondistributableArtifactsCIDRs'] as $value) { $values[] = $value; } $object->setAllowNondistributableArtifactsCIDRs($values); + unset($data['AllowNondistributableArtifactsCIDRs']); + } elseif (\array_key_exists('AllowNondistributableArtifactsCIDRs', $data) && null === $data['AllowNondistributableArtifactsCIDRs']) { + $object->setAllowNondistributableArtifactsCIDRs(null); } - if (property_exists($data, 'AllowNondistributableArtifactsHostnames') && $data->{'AllowNondistributableArtifactsHostnames'} !== null) { + if (\array_key_exists('AllowNondistributableArtifactsHostnames', $data) && null !== $data['AllowNondistributableArtifactsHostnames']) { $values_1 = []; - foreach ($data->{'AllowNondistributableArtifactsHostnames'} as $value_1) { + foreach ($data['AllowNondistributableArtifactsHostnames'] as $value_1) { $values_1[] = $value_1; } $object->setAllowNondistributableArtifactsHostnames($values_1); + unset($data['AllowNondistributableArtifactsHostnames']); + } elseif (\array_key_exists('AllowNondistributableArtifactsHostnames', $data) && null === $data['AllowNondistributableArtifactsHostnames']) { + $object->setAllowNondistributableArtifactsHostnames(null); } - if (property_exists($data, 'InsecureRegistryCIDRs') && $data->{'InsecureRegistryCIDRs'} !== null) { + if (\array_key_exists('InsecureRegistryCIDRs', $data) && null !== $data['InsecureRegistryCIDRs']) { $values_2 = []; - foreach ($data->{'InsecureRegistryCIDRs'} as $value_2) { + foreach ($data['InsecureRegistryCIDRs'] as $value_2) { $values_2[] = $value_2; } $object->setInsecureRegistryCIDRs($values_2); + unset($data['InsecureRegistryCIDRs']); + } elseif (\array_key_exists('InsecureRegistryCIDRs', $data) && null === $data['InsecureRegistryCIDRs']) { + $object->setInsecureRegistryCIDRs(null); } - if (property_exists($data, 'IndexConfigs') && $data->{'IndexConfigs'} !== null) { + if (\array_key_exists('IndexConfigs', $data) && null !== $data['IndexConfigs']) { $values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'IndexConfigs'} as $key => $value_3) { - $values_3[$key] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\IndexInfo', 'json', $context); + foreach ($data['IndexConfigs'] as $key => $value_3) { + $values_3[$key] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\IndexInfo::class, 'json', $context); } $object->setIndexConfigs($values_3); + unset($data['IndexConfigs']); + } elseif (\array_key_exists('IndexConfigs', $data) && null === $data['IndexConfigs']) { + $object->setIndexConfigs(null); } - if (property_exists($data, 'Mirrors') && $data->{'Mirrors'} !== null) { + if (\array_key_exists('Mirrors', $data) && null !== $data['Mirrors']) { $values_4 = []; - foreach ($data->{'Mirrors'} as $value_4) { + foreach ($data['Mirrors'] as $value_4) { $values_4[] = $value_4; } $object->setMirrors($values_4); + unset($data['Mirrors']); + } elseif (\array_key_exists('Mirrors', $data) && null === $data['Mirrors']) { + $object->setMirrors(null); + } + foreach ($data as $key_1 => $value_5) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_5; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getAllowNondistributableArtifactsCIDRs()) { + $dataArray = []; + if ($data->isInitialized('allowNondistributableArtifactsCIDRs') && null !== $data->getAllowNondistributableArtifactsCIDRs()) { $values = []; - foreach ($object->getAllowNondistributableArtifactsCIDRs() as $value) { + foreach ($data->getAllowNondistributableArtifactsCIDRs() as $value) { $values[] = $value; } - $data->{'AllowNondistributableArtifactsCIDRs'} = $values; + $dataArray['AllowNondistributableArtifactsCIDRs'] = $values; } - if (null !== $object->getAllowNondistributableArtifactsHostnames()) { + if ($data->isInitialized('allowNondistributableArtifactsHostnames') && null !== $data->getAllowNondistributableArtifactsHostnames()) { $values_1 = []; - foreach ($object->getAllowNondistributableArtifactsHostnames() as $value_1) { + foreach ($data->getAllowNondistributableArtifactsHostnames() as $value_1) { $values_1[] = $value_1; } - $data->{'AllowNondistributableArtifactsHostnames'} = $values_1; + $dataArray['AllowNondistributableArtifactsHostnames'] = $values_1; } - if (null !== $object->getInsecureRegistryCIDRs()) { + if ($data->isInitialized('insecureRegistryCIDRs') && null !== $data->getInsecureRegistryCIDRs()) { $values_2 = []; - foreach ($object->getInsecureRegistryCIDRs() as $value_2) { + foreach ($data->getInsecureRegistryCIDRs() as $value_2) { $values_2[] = $value_2; } - $data->{'InsecureRegistryCIDRs'} = $values_2; + $dataArray['InsecureRegistryCIDRs'] = $values_2; } - if (null !== $object->getIndexConfigs()) { - $values_3 = new \stdClass(); - foreach ($object->getIndexConfigs() as $key => $value_3) { - $values_3->{$key} = $this->normalizer->normalize($value_3, 'json', $context); + if ($data->isInitialized('indexConfigs') && null !== $data->getIndexConfigs()) { + $values_3 = []; + foreach ($data->getIndexConfigs() as $key => $value_3) { + $values_3[$key] = $this->normalizer->normalize($value_3, 'json', $context); } - $data->{'IndexConfigs'} = $values_3; + $dataArray['IndexConfigs'] = $values_3; } - if (null !== $object->getMirrors()) { + if ($data->isInitialized('mirrors') && null !== $data->getMirrors()) { $values_4 = []; - foreach ($object->getMirrors() as $value_4) { + foreach ($data->getMirrors() as $value_4) { $values_4[] = $value_4; } - $data->{'Mirrors'} = $values_4; + $dataArray['Mirrors'] = $values_4; + } + foreach ($data as $key_1 => $value_5) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_5; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\RegistryServiceConfig::class => false]; } } diff --git a/src/Normalizer/ResourceObjectNormalizer.php b/src/Normalizer/ResourceObjectNormalizer.php index f9149445..a39ec8ee 100644 --- a/src/Normalizer/ResourceObjectNormalizer.php +++ b/src/Normalizer/ResourceObjectNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,59 +16,91 @@ class ResourceObjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ResourceObject'; + return \Docker\API\Model\ResourceObject::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ResourceObject; + return \is_object($data) && \Docker\API\Model\ResourceObject::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ResourceObject(); - if (property_exists($data, 'NanoCPUs') && $data->{'NanoCPUs'} !== null) { - $object->setNanoCPUs($data->{'NanoCPUs'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NanoCPUs', $data) && null !== $data['NanoCPUs']) { + $object->setNanoCPUs($data['NanoCPUs']); + unset($data['NanoCPUs']); + } elseif (\array_key_exists('NanoCPUs', $data) && null === $data['NanoCPUs']) { + $object->setNanoCPUs(null); } - if (property_exists($data, 'MemoryBytes') && $data->{'MemoryBytes'} !== null) { - $object->setMemoryBytes($data->{'MemoryBytes'}); + if (\array_key_exists('MemoryBytes', $data) && null !== $data['MemoryBytes']) { + $object->setMemoryBytes($data['MemoryBytes']); + unset($data['MemoryBytes']); + } elseif (\array_key_exists('MemoryBytes', $data) && null === $data['MemoryBytes']) { + $object->setMemoryBytes(null); } - if (property_exists($data, 'GenericResources') && $data->{'GenericResources'} !== null) { + if (\array_key_exists('GenericResources', $data) && null !== $data['GenericResources']) { $values = []; - foreach ($data->{'GenericResources'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\GenericResourcesItem', 'json', $context); + foreach ($data['GenericResources'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\GenericResourcesItem::class, 'json', $context); } $object->setGenericResources($values); + unset($data['GenericResources']); + } elseif (\array_key_exists('GenericResources', $data) && null === $data['GenericResources']) { + $object->setGenericResources(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getNanoCPUs()) { - $data->{'NanoCPUs'} = $object->getNanoCPUs(); + $dataArray = []; + if ($data->isInitialized('nanoCPUs') && null !== $data->getNanoCPUs()) { + $dataArray['NanoCPUs'] = $data->getNanoCPUs(); } - if (null !== $object->getMemoryBytes()) { - $data->{'MemoryBytes'} = $object->getMemoryBytes(); + if ($data->isInitialized('memoryBytes') && null !== $data->getMemoryBytes()) { + $dataArray['MemoryBytes'] = $data->getMemoryBytes(); } - if (null !== $object->getGenericResources()) { + if ($data->isInitialized('genericResources') && null !== $data->getGenericResources()) { $values = []; - foreach ($object->getGenericResources() as $value) { + foreach ($data->getGenericResources() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'GenericResources'} = $values; + $dataArray['GenericResources'] = $values; + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ResourceObject::class => false]; } } diff --git a/src/Normalizer/ResourcesBlkioWeightDeviceItemNormalizer.php b/src/Normalizer/ResourcesBlkioWeightDeviceItemNormalizer.php index 73570f9c..837f83bc 100644 --- a/src/Normalizer/ResourcesBlkioWeightDeviceItemNormalizer.php +++ b/src/Normalizer/ResourcesBlkioWeightDeviceItemNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class ResourcesBlkioWeightDeviceItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ResourcesBlkioWeightDeviceItem'; + return \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ResourcesBlkioWeightDeviceItem; + return \is_object($data) && \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ResourcesBlkioWeightDeviceItem(); - if (property_exists($data, 'Path') && $data->{'Path'} !== null) { - $object->setPath($data->{'Path'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Path', $data) && null !== $data['Path']) { + $object->setPath($data['Path']); + unset($data['Path']); + } elseif (\array_key_exists('Path', $data) && null === $data['Path']) { + $object->setPath(null); + } + if (\array_key_exists('Weight', $data) && null !== $data['Weight']) { + $object->setWeight($data['Weight']); + unset($data['Weight']); + } elseif (\array_key_exists('Weight', $data) && null === $data['Weight']) { + $object->setWeight(null); } - if (property_exists($data, 'Weight') && $data->{'Weight'} !== null) { - $object->setWeight($data->{'Weight'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getPath()) { - $data->{'Path'} = $object->getPath(); + $dataArray = []; + if ($data->isInitialized('path') && null !== $data->getPath()) { + $dataArray['Path'] = $data->getPath(); } - if (null !== $object->getWeight()) { - $data->{'Weight'} = $object->getWeight(); + if ($data->isInitialized('weight') && null !== $data->getWeight()) { + $dataArray['Weight'] = $data->getWeight(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ResourcesBlkioWeightDeviceItem::class => false]; } } diff --git a/src/Normalizer/ResourcesNormalizer.php b/src/Normalizer/ResourcesNormalizer.php index 5d706503..6f46c84e 100644 --- a/src/Normalizer/ResourcesNormalizer.php +++ b/src/Normalizer/ResourcesNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,277 +16,413 @@ class ResourcesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Resources'; + return \Docker\API\Model\Resources::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Resources; + return \is_object($data) && \Docker\API\Model\Resources::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\Resources(); - if (property_exists($data, 'CpuShares') && $data->{'CpuShares'} !== null) { - $object->setCpuShares($data->{'CpuShares'}); - } - if (property_exists($data, 'Memory') && $data->{'Memory'} !== null) { - $object->setMemory($data->{'Memory'}); - } - if (property_exists($data, 'CgroupParent') && $data->{'CgroupParent'} !== null) { - $object->setCgroupParent($data->{'CgroupParent'}); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'BlkioWeight') && $data->{'BlkioWeight'} !== null) { - $object->setBlkioWeight($data->{'BlkioWeight'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'BlkioWeightDevice') && $data->{'BlkioWeightDevice'} !== null) { + $object = new \Docker\API\Model\Resources(); + if (\array_key_exists('OomKillDisable', $data) && \is_int($data['OomKillDisable'])) { + $data['OomKillDisable'] = (bool) $data['OomKillDisable']; + } + if (\array_key_exists('Init', $data) && \is_int($data['Init'])) { + $data['Init'] = (bool) $data['Init']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CpuShares', $data) && null !== $data['CpuShares']) { + $object->setCpuShares($data['CpuShares']); + unset($data['CpuShares']); + } elseif (\array_key_exists('CpuShares', $data) && null === $data['CpuShares']) { + $object->setCpuShares(null); + } + if (\array_key_exists('Memory', $data) && null !== $data['Memory']) { + $object->setMemory($data['Memory']); + unset($data['Memory']); + } elseif (\array_key_exists('Memory', $data) && null === $data['Memory']) { + $object->setMemory(null); + } + if (\array_key_exists('CgroupParent', $data) && null !== $data['CgroupParent']) { + $object->setCgroupParent($data['CgroupParent']); + unset($data['CgroupParent']); + } elseif (\array_key_exists('CgroupParent', $data) && null === $data['CgroupParent']) { + $object->setCgroupParent(null); + } + if (\array_key_exists('BlkioWeight', $data) && null !== $data['BlkioWeight']) { + $object->setBlkioWeight($data['BlkioWeight']); + unset($data['BlkioWeight']); + } elseif (\array_key_exists('BlkioWeight', $data) && null === $data['BlkioWeight']) { + $object->setBlkioWeight(null); + } + if (\array_key_exists('BlkioWeightDevice', $data) && null !== $data['BlkioWeightDevice']) { $values = []; - foreach ($data->{'BlkioWeightDevice'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\ResourcesBlkioWeightDeviceItem', 'json', $context); + foreach ($data['BlkioWeightDevice'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ResourcesBlkioWeightDeviceItem::class, 'json', $context); } $object->setBlkioWeightDevice($values); + unset($data['BlkioWeightDevice']); + } elseif (\array_key_exists('BlkioWeightDevice', $data) && null === $data['BlkioWeightDevice']) { + $object->setBlkioWeightDevice(null); } - if (property_exists($data, 'BlkioDeviceReadBps') && $data->{'BlkioDeviceReadBps'} !== null) { + if (\array_key_exists('BlkioDeviceReadBps', $data) && null !== $data['BlkioDeviceReadBps']) { $values_1 = []; - foreach ($data->{'BlkioDeviceReadBps'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); + foreach ($data['BlkioDeviceReadBps'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\ThrottleDevice::class, 'json', $context); } $object->setBlkioDeviceReadBps($values_1); + unset($data['BlkioDeviceReadBps']); + } elseif (\array_key_exists('BlkioDeviceReadBps', $data) && null === $data['BlkioDeviceReadBps']) { + $object->setBlkioDeviceReadBps(null); } - if (property_exists($data, 'BlkioDeviceWriteBps') && $data->{'BlkioDeviceWriteBps'} !== null) { + if (\array_key_exists('BlkioDeviceWriteBps', $data) && null !== $data['BlkioDeviceWriteBps']) { $values_2 = []; - foreach ($data->{'BlkioDeviceWriteBps'} as $value_2) { - $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); + foreach ($data['BlkioDeviceWriteBps'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\ThrottleDevice::class, 'json', $context); } $object->setBlkioDeviceWriteBps($values_2); + unset($data['BlkioDeviceWriteBps']); + } elseif (\array_key_exists('BlkioDeviceWriteBps', $data) && null === $data['BlkioDeviceWriteBps']) { + $object->setBlkioDeviceWriteBps(null); } - if (property_exists($data, 'BlkioDeviceReadIOps') && $data->{'BlkioDeviceReadIOps'} !== null) { + if (\array_key_exists('BlkioDeviceReadIOps', $data) && null !== $data['BlkioDeviceReadIOps']) { $values_3 = []; - foreach ($data->{'BlkioDeviceReadIOps'} as $value_3) { - $values_3[] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); + foreach ($data['BlkioDeviceReadIOps'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\ThrottleDevice::class, 'json', $context); } $object->setBlkioDeviceReadIOps($values_3); + unset($data['BlkioDeviceReadIOps']); + } elseif (\array_key_exists('BlkioDeviceReadIOps', $data) && null === $data['BlkioDeviceReadIOps']) { + $object->setBlkioDeviceReadIOps(null); } - if (property_exists($data, 'BlkioDeviceWriteIOps') && $data->{'BlkioDeviceWriteIOps'} !== null) { + if (\array_key_exists('BlkioDeviceWriteIOps', $data) && null !== $data['BlkioDeviceWriteIOps']) { $values_4 = []; - foreach ($data->{'BlkioDeviceWriteIOps'} as $value_4) { - $values_4[] = $this->denormalizer->denormalize($value_4, 'Docker\\API\\Model\\ThrottleDevice', 'json', $context); + foreach ($data['BlkioDeviceWriteIOps'] as $value_4) { + $values_4[] = $this->denormalizer->denormalize($value_4, \Docker\API\Model\ThrottleDevice::class, 'json', $context); } $object->setBlkioDeviceWriteIOps($values_4); - } - if (property_exists($data, 'CpuPeriod') && $data->{'CpuPeriod'} !== null) { - $object->setCpuPeriod($data->{'CpuPeriod'}); - } - if (property_exists($data, 'CpuQuota') && $data->{'CpuQuota'} !== null) { - $object->setCpuQuota($data->{'CpuQuota'}); - } - if (property_exists($data, 'CpuRealtimePeriod') && $data->{'CpuRealtimePeriod'} !== null) { - $object->setCpuRealtimePeriod($data->{'CpuRealtimePeriod'}); - } - if (property_exists($data, 'CpuRealtimeRuntime') && $data->{'CpuRealtimeRuntime'} !== null) { - $object->setCpuRealtimeRuntime($data->{'CpuRealtimeRuntime'}); - } - if (property_exists($data, 'CpusetCpus') && $data->{'CpusetCpus'} !== null) { - $object->setCpusetCpus($data->{'CpusetCpus'}); - } - if (property_exists($data, 'CpusetMems') && $data->{'CpusetMems'} !== null) { - $object->setCpusetMems($data->{'CpusetMems'}); - } - if (property_exists($data, 'Devices') && $data->{'Devices'} !== null) { + unset($data['BlkioDeviceWriteIOps']); + } elseif (\array_key_exists('BlkioDeviceWriteIOps', $data) && null === $data['BlkioDeviceWriteIOps']) { + $object->setBlkioDeviceWriteIOps(null); + } + if (\array_key_exists('CpuPeriod', $data) && null !== $data['CpuPeriod']) { + $object->setCpuPeriod($data['CpuPeriod']); + unset($data['CpuPeriod']); + } elseif (\array_key_exists('CpuPeriod', $data) && null === $data['CpuPeriod']) { + $object->setCpuPeriod(null); + } + if (\array_key_exists('CpuQuota', $data) && null !== $data['CpuQuota']) { + $object->setCpuQuota($data['CpuQuota']); + unset($data['CpuQuota']); + } elseif (\array_key_exists('CpuQuota', $data) && null === $data['CpuQuota']) { + $object->setCpuQuota(null); + } + if (\array_key_exists('CpuRealtimePeriod', $data) && null !== $data['CpuRealtimePeriod']) { + $object->setCpuRealtimePeriod($data['CpuRealtimePeriod']); + unset($data['CpuRealtimePeriod']); + } elseif (\array_key_exists('CpuRealtimePeriod', $data) && null === $data['CpuRealtimePeriod']) { + $object->setCpuRealtimePeriod(null); + } + if (\array_key_exists('CpuRealtimeRuntime', $data) && null !== $data['CpuRealtimeRuntime']) { + $object->setCpuRealtimeRuntime($data['CpuRealtimeRuntime']); + unset($data['CpuRealtimeRuntime']); + } elseif (\array_key_exists('CpuRealtimeRuntime', $data) && null === $data['CpuRealtimeRuntime']) { + $object->setCpuRealtimeRuntime(null); + } + if (\array_key_exists('CpusetCpus', $data) && null !== $data['CpusetCpus']) { + $object->setCpusetCpus($data['CpusetCpus']); + unset($data['CpusetCpus']); + } elseif (\array_key_exists('CpusetCpus', $data) && null === $data['CpusetCpus']) { + $object->setCpusetCpus(null); + } + if (\array_key_exists('CpusetMems', $data) && null !== $data['CpusetMems']) { + $object->setCpusetMems($data['CpusetMems']); + unset($data['CpusetMems']); + } elseif (\array_key_exists('CpusetMems', $data) && null === $data['CpusetMems']) { + $object->setCpusetMems(null); + } + if (\array_key_exists('Devices', $data) && null !== $data['Devices']) { $values_5 = []; - foreach ($data->{'Devices'} as $value_5) { - $values_5[] = $this->denormalizer->denormalize($value_5, 'Docker\\API\\Model\\DeviceMapping', 'json', $context); + foreach ($data['Devices'] as $value_5) { + $values_5[] = $this->denormalizer->denormalize($value_5, \Docker\API\Model\DeviceMapping::class, 'json', $context); } $object->setDevices($values_5); + unset($data['Devices']); + } elseif (\array_key_exists('Devices', $data) && null === $data['Devices']) { + $object->setDevices(null); } - if (property_exists($data, 'DeviceCgroupRules') && $data->{'DeviceCgroupRules'} !== null) { + if (\array_key_exists('DeviceCgroupRules', $data) && null !== $data['DeviceCgroupRules']) { $values_6 = []; - foreach ($data->{'DeviceCgroupRules'} as $value_6) { + foreach ($data['DeviceCgroupRules'] as $value_6) { $values_6[] = $value_6; } $object->setDeviceCgroupRules($values_6); + unset($data['DeviceCgroupRules']); + } elseif (\array_key_exists('DeviceCgroupRules', $data) && null === $data['DeviceCgroupRules']) { + $object->setDeviceCgroupRules(null); } - if (property_exists($data, 'DiskQuota') && $data->{'DiskQuota'} !== null) { - $object->setDiskQuota($data->{'DiskQuota'}); - } - if (property_exists($data, 'KernelMemory') && $data->{'KernelMemory'} !== null) { - $object->setKernelMemory($data->{'KernelMemory'}); - } - if (property_exists($data, 'MemoryReservation') && $data->{'MemoryReservation'} !== null) { - $object->setMemoryReservation($data->{'MemoryReservation'}); - } - if (property_exists($data, 'MemorySwap') && $data->{'MemorySwap'} !== null) { - $object->setMemorySwap($data->{'MemorySwap'}); - } - if (property_exists($data, 'MemorySwappiness') && $data->{'MemorySwappiness'} !== null) { - $object->setMemorySwappiness($data->{'MemorySwappiness'}); - } - if (property_exists($data, 'NanoCPUs') && $data->{'NanoCPUs'} !== null) { - $object->setNanoCPUs($data->{'NanoCPUs'}); - } - if (property_exists($data, 'OomKillDisable') && $data->{'OomKillDisable'} !== null) { - $object->setOomKillDisable($data->{'OomKillDisable'}); - } - if (property_exists($data, 'PidsLimit') && $data->{'PidsLimit'} !== null) { - $object->setPidsLimit($data->{'PidsLimit'}); - } - if (property_exists($data, 'Ulimits') && $data->{'Ulimits'} !== null) { + if (\array_key_exists('DeviceRequests', $data) && null !== $data['DeviceRequests']) { $values_7 = []; - foreach ($data->{'Ulimits'} as $value_7) { - $values_7[] = $this->denormalizer->denormalize($value_7, 'Docker\\API\\Model\\ResourcesUlimitsItem', 'json', $context); + foreach ($data['DeviceRequests'] as $value_7) { + $values_7[] = $this->denormalizer->denormalize($value_7, \Docker\API\Model\DeviceRequest::class, 'json', $context); + } + $object->setDeviceRequests($values_7); + unset($data['DeviceRequests']); + } elseif (\array_key_exists('DeviceRequests', $data) && null === $data['DeviceRequests']) { + $object->setDeviceRequests(null); + } + if (\array_key_exists('KernelMemoryTCP', $data) && null !== $data['KernelMemoryTCP']) { + $object->setKernelMemoryTCP($data['KernelMemoryTCP']); + unset($data['KernelMemoryTCP']); + } elseif (\array_key_exists('KernelMemoryTCP', $data) && null === $data['KernelMemoryTCP']) { + $object->setKernelMemoryTCP(null); + } + if (\array_key_exists('MemoryReservation', $data) && null !== $data['MemoryReservation']) { + $object->setMemoryReservation($data['MemoryReservation']); + unset($data['MemoryReservation']); + } elseif (\array_key_exists('MemoryReservation', $data) && null === $data['MemoryReservation']) { + $object->setMemoryReservation(null); + } + if (\array_key_exists('MemorySwap', $data) && null !== $data['MemorySwap']) { + $object->setMemorySwap($data['MemorySwap']); + unset($data['MemorySwap']); + } elseif (\array_key_exists('MemorySwap', $data) && null === $data['MemorySwap']) { + $object->setMemorySwap(null); + } + if (\array_key_exists('MemorySwappiness', $data) && null !== $data['MemorySwappiness']) { + $object->setMemorySwappiness($data['MemorySwappiness']); + unset($data['MemorySwappiness']); + } elseif (\array_key_exists('MemorySwappiness', $data) && null === $data['MemorySwappiness']) { + $object->setMemorySwappiness(null); + } + if (\array_key_exists('NanoCpus', $data) && null !== $data['NanoCpus']) { + $object->setNanoCpus($data['NanoCpus']); + unset($data['NanoCpus']); + } elseif (\array_key_exists('NanoCpus', $data) && null === $data['NanoCpus']) { + $object->setNanoCpus(null); + } + if (\array_key_exists('OomKillDisable', $data) && null !== $data['OomKillDisable']) { + $object->setOomKillDisable($data['OomKillDisable']); + unset($data['OomKillDisable']); + } elseif (\array_key_exists('OomKillDisable', $data) && null === $data['OomKillDisable']) { + $object->setOomKillDisable(null); + } + if (\array_key_exists('Init', $data) && null !== $data['Init']) { + $object->setInit($data['Init']); + unset($data['Init']); + } elseif (\array_key_exists('Init', $data) && null === $data['Init']) { + $object->setInit(null); + } + if (\array_key_exists('PidsLimit', $data) && null !== $data['PidsLimit']) { + $object->setPidsLimit($data['PidsLimit']); + unset($data['PidsLimit']); + } elseif (\array_key_exists('PidsLimit', $data) && null === $data['PidsLimit']) { + $object->setPidsLimit(null); + } + if (\array_key_exists('Ulimits', $data) && null !== $data['Ulimits']) { + $values_8 = []; + foreach ($data['Ulimits'] as $value_8) { + $values_8[] = $this->denormalizer->denormalize($value_8, \Docker\API\Model\ResourcesUlimitsItem::class, 'json', $context); + } + $object->setUlimits($values_8); + unset($data['Ulimits']); + } elseif (\array_key_exists('Ulimits', $data) && null === $data['Ulimits']) { + $object->setUlimits(null); + } + if (\array_key_exists('CpuCount', $data) && null !== $data['CpuCount']) { + $object->setCpuCount($data['CpuCount']); + unset($data['CpuCount']); + } elseif (\array_key_exists('CpuCount', $data) && null === $data['CpuCount']) { + $object->setCpuCount(null); + } + if (\array_key_exists('CpuPercent', $data) && null !== $data['CpuPercent']) { + $object->setCpuPercent($data['CpuPercent']); + unset($data['CpuPercent']); + } elseif (\array_key_exists('CpuPercent', $data) && null === $data['CpuPercent']) { + $object->setCpuPercent(null); + } + if (\array_key_exists('IOMaximumIOps', $data) && null !== $data['IOMaximumIOps']) { + $object->setIOMaximumIOps($data['IOMaximumIOps']); + unset($data['IOMaximumIOps']); + } elseif (\array_key_exists('IOMaximumIOps', $data) && null === $data['IOMaximumIOps']) { + $object->setIOMaximumIOps(null); + } + if (\array_key_exists('IOMaximumBandwidth', $data) && null !== $data['IOMaximumBandwidth']) { + $object->setIOMaximumBandwidth($data['IOMaximumBandwidth']); + unset($data['IOMaximumBandwidth']); + } elseif (\array_key_exists('IOMaximumBandwidth', $data) && null === $data['IOMaximumBandwidth']) { + $object->setIOMaximumBandwidth(null); + } + foreach ($data as $key => $value_9) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_9; } - $object->setUlimits($values_7); - } - if (property_exists($data, 'CpuCount') && $data->{'CpuCount'} !== null) { - $object->setCpuCount($data->{'CpuCount'}); - } - if (property_exists($data, 'CpuPercent') && $data->{'CpuPercent'} !== null) { - $object->setCpuPercent($data->{'CpuPercent'}); - } - if (property_exists($data, 'IOMaximumIOps') && $data->{'IOMaximumIOps'} !== null) { - $object->setIOMaximumIOps($data->{'IOMaximumIOps'}); - } - if (property_exists($data, 'IOMaximumBandwidth') && $data->{'IOMaximumBandwidth'} !== null) { - $object->setIOMaximumBandwidth($data->{'IOMaximumBandwidth'}); } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getCpuShares()) { - $data->{'CpuShares'} = $object->getCpuShares(); + $dataArray = []; + if ($data->isInitialized('cpuShares') && null !== $data->getCpuShares()) { + $dataArray['CpuShares'] = $data->getCpuShares(); } - if (null !== $object->getMemory()) { - $data->{'Memory'} = $object->getMemory(); + if ($data->isInitialized('memory') && null !== $data->getMemory()) { + $dataArray['Memory'] = $data->getMemory(); } - if (null !== $object->getCgroupParent()) { - $data->{'CgroupParent'} = $object->getCgroupParent(); + if ($data->isInitialized('cgroupParent') && null !== $data->getCgroupParent()) { + $dataArray['CgroupParent'] = $data->getCgroupParent(); } - if (null !== $object->getBlkioWeight()) { - $data->{'BlkioWeight'} = $object->getBlkioWeight(); + if ($data->isInitialized('blkioWeight') && null !== $data->getBlkioWeight()) { + $dataArray['BlkioWeight'] = $data->getBlkioWeight(); } - if (null !== $object->getBlkioWeightDevice()) { + if ($data->isInitialized('blkioWeightDevice') && null !== $data->getBlkioWeightDevice()) { $values = []; - foreach ($object->getBlkioWeightDevice() as $value) { + foreach ($data->getBlkioWeightDevice() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'BlkioWeightDevice'} = $values; + $dataArray['BlkioWeightDevice'] = $values; } - if (null !== $object->getBlkioDeviceReadBps()) { + if ($data->isInitialized('blkioDeviceReadBps') && null !== $data->getBlkioDeviceReadBps()) { $values_1 = []; - foreach ($object->getBlkioDeviceReadBps() as $value_1) { + foreach ($data->getBlkioDeviceReadBps() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'BlkioDeviceReadBps'} = $values_1; + $dataArray['BlkioDeviceReadBps'] = $values_1; } - if (null !== $object->getBlkioDeviceWriteBps()) { + if ($data->isInitialized('blkioDeviceWriteBps') && null !== $data->getBlkioDeviceWriteBps()) { $values_2 = []; - foreach ($object->getBlkioDeviceWriteBps() as $value_2) { + foreach ($data->getBlkioDeviceWriteBps() as $value_2) { $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); } - $data->{'BlkioDeviceWriteBps'} = $values_2; + $dataArray['BlkioDeviceWriteBps'] = $values_2; } - if (null !== $object->getBlkioDeviceReadIOps()) { + if ($data->isInitialized('blkioDeviceReadIOps') && null !== $data->getBlkioDeviceReadIOps()) { $values_3 = []; - foreach ($object->getBlkioDeviceReadIOps() as $value_3) { + foreach ($data->getBlkioDeviceReadIOps() as $value_3) { $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); } - $data->{'BlkioDeviceReadIOps'} = $values_3; + $dataArray['BlkioDeviceReadIOps'] = $values_3; } - if (null !== $object->getBlkioDeviceWriteIOps()) { + if ($data->isInitialized('blkioDeviceWriteIOps') && null !== $data->getBlkioDeviceWriteIOps()) { $values_4 = []; - foreach ($object->getBlkioDeviceWriteIOps() as $value_4) { + foreach ($data->getBlkioDeviceWriteIOps() as $value_4) { $values_4[] = $this->normalizer->normalize($value_4, 'json', $context); } - $data->{'BlkioDeviceWriteIOps'} = $values_4; + $dataArray['BlkioDeviceWriteIOps'] = $values_4; } - if (null !== $object->getCpuPeriod()) { - $data->{'CpuPeriod'} = $object->getCpuPeriod(); + if ($data->isInitialized('cpuPeriod') && null !== $data->getCpuPeriod()) { + $dataArray['CpuPeriod'] = $data->getCpuPeriod(); } - if (null !== $object->getCpuQuota()) { - $data->{'CpuQuota'} = $object->getCpuQuota(); + if ($data->isInitialized('cpuQuota') && null !== $data->getCpuQuota()) { + $dataArray['CpuQuota'] = $data->getCpuQuota(); } - if (null !== $object->getCpuRealtimePeriod()) { - $data->{'CpuRealtimePeriod'} = $object->getCpuRealtimePeriod(); + if ($data->isInitialized('cpuRealtimePeriod') && null !== $data->getCpuRealtimePeriod()) { + $dataArray['CpuRealtimePeriod'] = $data->getCpuRealtimePeriod(); } - if (null !== $object->getCpuRealtimeRuntime()) { - $data->{'CpuRealtimeRuntime'} = $object->getCpuRealtimeRuntime(); + if ($data->isInitialized('cpuRealtimeRuntime') && null !== $data->getCpuRealtimeRuntime()) { + $dataArray['CpuRealtimeRuntime'] = $data->getCpuRealtimeRuntime(); } - if (null !== $object->getCpusetCpus()) { - $data->{'CpusetCpus'} = $object->getCpusetCpus(); + if ($data->isInitialized('cpusetCpus') && null !== $data->getCpusetCpus()) { + $dataArray['CpusetCpus'] = $data->getCpusetCpus(); } - if (null !== $object->getCpusetMems()) { - $data->{'CpusetMems'} = $object->getCpusetMems(); + if ($data->isInitialized('cpusetMems') && null !== $data->getCpusetMems()) { + $dataArray['CpusetMems'] = $data->getCpusetMems(); } - if (null !== $object->getDevices()) { + if ($data->isInitialized('devices') && null !== $data->getDevices()) { $values_5 = []; - foreach ($object->getDevices() as $value_5) { + foreach ($data->getDevices() as $value_5) { $values_5[] = $this->normalizer->normalize($value_5, 'json', $context); } - $data->{'Devices'} = $values_5; + $dataArray['Devices'] = $values_5; } - if (null !== $object->getDeviceCgroupRules()) { + if ($data->isInitialized('deviceCgroupRules') && null !== $data->getDeviceCgroupRules()) { $values_6 = []; - foreach ($object->getDeviceCgroupRules() as $value_6) { + foreach ($data->getDeviceCgroupRules() as $value_6) { $values_6[] = $value_6; } - $data->{'DeviceCgroupRules'} = $values_6; + $dataArray['DeviceCgroupRules'] = $values_6; } - if (null !== $object->getDiskQuota()) { - $data->{'DiskQuota'} = $object->getDiskQuota(); + if ($data->isInitialized('deviceRequests') && null !== $data->getDeviceRequests()) { + $values_7 = []; + foreach ($data->getDeviceRequests() as $value_7) { + $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + } + $dataArray['DeviceRequests'] = $values_7; } - if (null !== $object->getKernelMemory()) { - $data->{'KernelMemory'} = $object->getKernelMemory(); + if ($data->isInitialized('kernelMemoryTCP') && null !== $data->getKernelMemoryTCP()) { + $dataArray['KernelMemoryTCP'] = $data->getKernelMemoryTCP(); } - if (null !== $object->getMemoryReservation()) { - $data->{'MemoryReservation'} = $object->getMemoryReservation(); + if ($data->isInitialized('memoryReservation') && null !== $data->getMemoryReservation()) { + $dataArray['MemoryReservation'] = $data->getMemoryReservation(); } - if (null !== $object->getMemorySwap()) { - $data->{'MemorySwap'} = $object->getMemorySwap(); + if ($data->isInitialized('memorySwap') && null !== $data->getMemorySwap()) { + $dataArray['MemorySwap'] = $data->getMemorySwap(); } - if (null !== $object->getMemorySwappiness()) { - $data->{'MemorySwappiness'} = $object->getMemorySwappiness(); + if ($data->isInitialized('memorySwappiness') && null !== $data->getMemorySwappiness()) { + $dataArray['MemorySwappiness'] = $data->getMemorySwappiness(); } - if (null !== $object->getNanoCPUs()) { - $data->{'NanoCPUs'} = $object->getNanoCPUs(); + if ($data->isInitialized('nanoCpus') && null !== $data->getNanoCpus()) { + $dataArray['NanoCpus'] = $data->getNanoCpus(); } - if (null !== $object->getOomKillDisable()) { - $data->{'OomKillDisable'} = $object->getOomKillDisable(); + if ($data->isInitialized('oomKillDisable') && null !== $data->getOomKillDisable()) { + $dataArray['OomKillDisable'] = $data->getOomKillDisable(); } - if (null !== $object->getPidsLimit()) { - $data->{'PidsLimit'} = $object->getPidsLimit(); + if ($data->isInitialized('init') && null !== $data->getInit()) { + $dataArray['Init'] = $data->getInit(); } - if (null !== $object->getUlimits()) { - $values_7 = []; - foreach ($object->getUlimits() as $value_7) { - $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); + if ($data->isInitialized('pidsLimit') && null !== $data->getPidsLimit()) { + $dataArray['PidsLimit'] = $data->getPidsLimit(); + } + if ($data->isInitialized('ulimits') && null !== $data->getUlimits()) { + $values_8 = []; + foreach ($data->getUlimits() as $value_8) { + $values_8[] = $this->normalizer->normalize($value_8, 'json', $context); } - $data->{'Ulimits'} = $values_7; + $dataArray['Ulimits'] = $values_8; } - if (null !== $object->getCpuCount()) { - $data->{'CpuCount'} = $object->getCpuCount(); + if ($data->isInitialized('cpuCount') && null !== $data->getCpuCount()) { + $dataArray['CpuCount'] = $data->getCpuCount(); } - if (null !== $object->getCpuPercent()) { - $data->{'CpuPercent'} = $object->getCpuPercent(); + if ($data->isInitialized('cpuPercent') && null !== $data->getCpuPercent()) { + $dataArray['CpuPercent'] = $data->getCpuPercent(); } - if (null !== $object->getIOMaximumIOps()) { - $data->{'IOMaximumIOps'} = $object->getIOMaximumIOps(); + if ($data->isInitialized('iOMaximumIOps') && null !== $data->getIOMaximumIOps()) { + $dataArray['IOMaximumIOps'] = $data->getIOMaximumIOps(); } - if (null !== $object->getIOMaximumBandwidth()) { - $data->{'IOMaximumBandwidth'} = $object->getIOMaximumBandwidth(); + if ($data->isInitialized('iOMaximumBandwidth') && null !== $data->getIOMaximumBandwidth()) { + $dataArray['IOMaximumBandwidth'] = $data->getIOMaximumBandwidth(); } + foreach ($data as $key => $value_9) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_9; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Resources::class => false]; } } diff --git a/src/Normalizer/ResourcesUlimitsItemNormalizer.php b/src/Normalizer/ResourcesUlimitsItemNormalizer.php index 00b29f68..643048f6 100644 --- a/src/Normalizer/ResourcesUlimitsItemNormalizer.php +++ b/src/Normalizer/ResourcesUlimitsItemNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,51 +16,83 @@ class ResourcesUlimitsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ResourcesUlimitsItem'; + return \Docker\API\Model\ResourcesUlimitsItem::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ResourcesUlimitsItem; + return \is_object($data) && \Docker\API\Model\ResourcesUlimitsItem::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ResourcesUlimitsItem(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Soft', $data) && null !== $data['Soft']) { + $object->setSoft($data['Soft']); + unset($data['Soft']); + } elseif (\array_key_exists('Soft', $data) && null === $data['Soft']) { + $object->setSoft(null); } - if (property_exists($data, 'Soft') && $data->{'Soft'} !== null) { - $object->setSoft($data->{'Soft'}); + if (\array_key_exists('Hard', $data) && null !== $data['Hard']) { + $object->setHard($data['Hard']); + unset($data['Hard']); + } elseif (\array_key_exists('Hard', $data) && null === $data['Hard']) { + $object->setHard(null); } - if (property_exists($data, 'Hard') && $data->{'Hard'} !== null) { - $object->setHard($data->{'Hard'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getSoft()) { - $data->{'Soft'} = $object->getSoft(); + if ($data->isInitialized('soft') && null !== $data->getSoft()) { + $dataArray['Soft'] = $data->getSoft(); } - if (null !== $object->getHard()) { - $data->{'Hard'} = $object->getHard(); + if ($data->isInitialized('hard') && null !== $data->getHard()) { + $dataArray['Hard'] = $data->getHard(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ResourcesUlimitsItem::class => false]; } } diff --git a/src/Normalizer/RestartPolicyNormalizer.php b/src/Normalizer/RestartPolicyNormalizer.php index 2942678a..cda11024 100644 --- a/src/Normalizer/RestartPolicyNormalizer.php +++ b/src/Normalizer/RestartPolicyNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class RestartPolicyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\RestartPolicy'; + return \Docker\API\Model\RestartPolicy::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\RestartPolicy; + return \is_object($data) && \Docker\API\Model\RestartPolicy::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\RestartPolicy(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('MaximumRetryCount', $data) && null !== $data['MaximumRetryCount']) { + $object->setMaximumRetryCount($data['MaximumRetryCount']); + unset($data['MaximumRetryCount']); + } elseif (\array_key_exists('MaximumRetryCount', $data) && null === $data['MaximumRetryCount']) { + $object->setMaximumRetryCount(null); } - if (property_exists($data, 'MaximumRetryCount') && $data->{'MaximumRetryCount'} !== null) { - $object->setMaximumRetryCount($data->{'MaximumRetryCount'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getMaximumRetryCount()) { - $data->{'MaximumRetryCount'} = $object->getMaximumRetryCount(); + if ($data->isInitialized('maximumRetryCount') && null !== $data->getMaximumRetryCount()) { + $dataArray['MaximumRetryCount'] = $data->getMaximumRetryCount(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\RestartPolicy::class => false]; } } diff --git a/src/Normalizer/RuntimeNormalizer.php b/src/Normalizer/RuntimeNormalizer.php index 361aa353..b24531aa 100644 --- a/src/Normalizer/RuntimeNormalizer.php +++ b/src/Normalizer/RuntimeNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,53 +16,99 @@ class RuntimeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Runtime'; + return \Docker\API\Model\Runtime::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Runtime; + return \is_object($data) && \Docker\API\Model\Runtime::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\Runtime(); - if (property_exists($data, 'path') && $data->{'path'} !== null) { - $object->setPath($data->{'path'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'runtimeArgs') && $data->{'runtimeArgs'} !== null) { + if (\array_key_exists('path', $data) && null !== $data['path']) { + $object->setPath($data['path']); + unset($data['path']); + } elseif (\array_key_exists('path', $data) && null === $data['path']) { + $object->setPath(null); + } + if (\array_key_exists('runtimeArgs', $data) && null !== $data['runtimeArgs']) { $values = []; - foreach ($data->{'runtimeArgs'} as $value) { + foreach ($data['runtimeArgs'] as $value) { $values[] = $value; } $object->setRuntimeArgs($values); + unset($data['runtimeArgs']); + } elseif (\array_key_exists('runtimeArgs', $data) && null === $data['runtimeArgs']) { + $object->setRuntimeArgs(null); + } + if (\array_key_exists('status', $data) && null !== $data['status']) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['status'] as $key => $value_1) { + $values_1[$key] = $value_1; + } + $object->setStatus($values_1); + unset($data['status']); + } elseif (\array_key_exists('status', $data) && null === $data['status']) { + $object->setStatus(null); + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getPath()) { - $data->{'path'} = $object->getPath(); + $dataArray = []; + if ($data->isInitialized('path') && null !== $data->getPath()) { + $dataArray['path'] = $data->getPath(); } - if (null !== $object->getRuntimeArgs()) { + if ($data->isInitialized('runtimeArgs') && null !== $data->getRuntimeArgs()) { $values = []; - foreach ($object->getRuntimeArgs() as $value) { + foreach ($data->getRuntimeArgs() as $value) { $values[] = $value; } - $data->{'runtimeArgs'} = $values; + $dataArray['runtimeArgs'] = $values; + } + if ($data->isInitialized('status') && null !== $data->getStatus()) { + $values_1 = []; + foreach ($data->getStatus() as $key => $value_1) { + $values_1[$key] = $value_1; + } + $dataArray['status'] = $values_1; + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_2; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Runtime::class => false]; } } diff --git a/src/Normalizer/SecretNormalizer.php b/src/Normalizer/SecretNormalizer.php index 83224bac..71c95fe0 100644 --- a/src/Normalizer/SecretNormalizer.php +++ b/src/Normalizer/SecretNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,63 +16,101 @@ class SecretNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Secret'; + return \Docker\API\Model\Secret::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Secret; + return \is_object($data) && \Docker\API\Model\Secret::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\Secret(); - if (property_exists($data, 'ID') && $data->{'ID'} !== null) { - $object->setID($data->{'ID'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && null !== $data['ID']) { + $object->setID($data['ID']); + unset($data['ID']); + } elseif (\array_key_exists('ID', $data) && null === $data['ID']) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && null !== $data['Version']) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + unset($data['Version']); + } elseif (\array_key_exists('Version', $data) && null === $data['Version']) { + $object->setVersion(null); } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($this->denormalizer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); + if (\array_key_exists('CreatedAt', $data) && null !== $data['CreatedAt']) { + $object->setCreatedAt($data['CreatedAt']); + unset($data['CreatedAt']); + } elseif (\array_key_exists('CreatedAt', $data) && null === $data['CreatedAt']) { + $object->setCreatedAt(null); } - if (property_exists($data, 'CreatedAt') && $data->{'CreatedAt'} !== null) { - $object->setCreatedAt($data->{'CreatedAt'}); + if (\array_key_exists('UpdatedAt', $data) && null !== $data['UpdatedAt']) { + $object->setUpdatedAt($data['UpdatedAt']); + unset($data['UpdatedAt']); + } elseif (\array_key_exists('UpdatedAt', $data) && null === $data['UpdatedAt']) { + $object->setUpdatedAt(null); } - if (property_exists($data, 'UpdatedAt') && $data->{'UpdatedAt'} !== null) { - $object->setUpdatedAt($data->{'UpdatedAt'}); + if (\array_key_exists('Spec', $data) && null !== $data['Spec']) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\SecretSpec::class, 'json', $context)); + unset($data['Spec']); + } elseif (\array_key_exists('Spec', $data) && null === $data['Spec']) { + $object->setSpec(null); } - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\SecretSpec', 'json', $context)); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $dataArray = []; + if ($data->isInitialized('iD') && null !== $data->getID()) { + $dataArray['ID'] = $data->getID(); } - if (null !== $object->getVersion()) { - $data->{'Version'} = $this->normalizer->normalize($object->getVersion(), 'json', $context); + if ($data->isInitialized('version') && null !== $data->getVersion()) { + $dataArray['Version'] = $this->normalizer->normalize($data->getVersion(), 'json', $context); } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt(); + if ($data->isInitialized('createdAt') && null !== $data->getCreatedAt()) { + $dataArray['CreatedAt'] = $data->getCreatedAt(); } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt(); + if ($data->isInitialized('updatedAt') && null !== $data->getUpdatedAt()) { + $dataArray['UpdatedAt'] = $data->getUpdatedAt(); } - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + if ($data->isInitialized('spec') && null !== $data->getSpec()) { + $dataArray['Spec'] = $this->normalizer->normalize($data->getSpec(), 'json', $context); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Secret::class => false]; } } diff --git a/src/Normalizer/SecretSpecNormalizer.php b/src/Normalizer/SecretSpecNormalizer.php index 4cae5434..24364e6d 100644 --- a/src/Normalizer/SecretSpecNormalizer.php +++ b/src/Normalizer/SecretSpecNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,65 +16,109 @@ class SecretSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\SecretSpec'; + return \Docker\API\Model\SecretSpec::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\SecretSpec; + return \is_object($data) && \Docker\API\Model\SecretSpec::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\SecretSpec(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + if (\array_key_exists('Data', $data) && null !== $data['Data']) { + $object->setData($data['Data']); + unset($data['Data']); + } elseif (\array_key_exists('Data', $data) && null === $data['Data']) { + $object->setData(null); } - if (property_exists($data, 'Data') && $data->{'Data'} !== null) { - $object->setData($data->{'Data'}); + if (\array_key_exists('Driver', $data) && null !== $data['Driver']) { + $object->setDriver($this->denormalizer->denormalize($data['Driver'], \Docker\API\Model\Driver::class, 'json', $context)); + unset($data['Driver']); + } elseif (\array_key_exists('Driver', $data) && null === $data['Driver']) { + $object->setDriver(null); } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($this->denormalizer->denormalize($data->{'Driver'}, 'Docker\\API\\Model\\Driver', 'json', $context)); + if (\array_key_exists('Templating', $data) && null !== $data['Templating']) { + $object->setTemplating($this->denormalizer->denormalize($data['Templating'], \Docker\API\Model\Driver::class, 'json', $context)); + unset($data['Templating']); + } elseif (\array_key_exists('Templating', $data) && null === $data['Templating']) { + $object->setTemplating(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values = []; + foreach ($data->getLabels() as $key => $value) { + $values[$key] = $value; } - $data->{'Labels'} = $values; + $dataArray['Labels'] = $values; } - if (null !== $object->getData()) { - $data->{'Data'} = $object->getData(); + if ($data->isInitialized('data') && null !== $data->getData()) { + $dataArray['Data'] = $data->getData(); } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $this->normalizer->normalize($object->getDriver(), 'json', $context); + if ($data->isInitialized('driver') && null !== $data->getDriver()) { + $dataArray['Driver'] = $this->normalizer->normalize($data->getDriver(), 'json', $context); + } + if ($data->isInitialized('templating') && null !== $data->getTemplating()) { + $dataArray['Templating'] = $this->normalizer->normalize($data->getTemplating(), 'json', $context); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SecretSpec::class => false]; } } diff --git a/src/Normalizer/SecretsCreatePostBodyNormalizer.php b/src/Normalizer/SecretsCreatePostBodyNormalizer.php index 6b0a853f..f29ab9a8 100644 --- a/src/Normalizer/SecretsCreatePostBodyNormalizer.php +++ b/src/Normalizer/SecretsCreatePostBodyNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,65 +16,109 @@ class SecretsCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\SecretsCreatePostBody'; + return \Docker\API\Model\SecretsCreatePostBody::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\SecretsCreatePostBody; + return \is_object($data) && \Docker\API\Model\SecretsCreatePostBody::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\SecretsCreatePostBody(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + if (\array_key_exists('Data', $data) && null !== $data['Data']) { + $object->setData($data['Data']); + unset($data['Data']); + } elseif (\array_key_exists('Data', $data) && null === $data['Data']) { + $object->setData(null); } - if (property_exists($data, 'Data') && $data->{'Data'} !== null) { - $object->setData($data->{'Data'}); + if (\array_key_exists('Driver', $data) && null !== $data['Driver']) { + $object->setDriver($this->denormalizer->denormalize($data['Driver'], \Docker\API\Model\Driver::class, 'json', $context)); + unset($data['Driver']); + } elseif (\array_key_exists('Driver', $data) && null === $data['Driver']) { + $object->setDriver(null); } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($this->denormalizer->denormalize($data->{'Driver'}, 'Docker\\API\\Model\\Driver', 'json', $context)); + if (\array_key_exists('Templating', $data) && null !== $data['Templating']) { + $object->setTemplating($this->denormalizer->denormalize($data['Templating'], \Docker\API\Model\Driver::class, 'json', $context)); + unset($data['Templating']); + } elseif (\array_key_exists('Templating', $data) && null === $data['Templating']) { + $object->setTemplating(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values = []; + foreach ($data->getLabels() as $key => $value) { + $values[$key] = $value; } - $data->{'Labels'} = $values; + $dataArray['Labels'] = $values; } - if (null !== $object->getData()) { - $data->{'Data'} = $object->getData(); + if ($data->isInitialized('data') && null !== $data->getData()) { + $dataArray['Data'] = $data->getData(); } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $this->normalizer->normalize($object->getDriver(), 'json', $context); + if ($data->isInitialized('driver') && null !== $data->getDriver()) { + $dataArray['Driver'] = $this->normalizer->normalize($data->getDriver(), 'json', $context); + } + if ($data->isInitialized('templating') && null !== $data->getTemplating()) { + $dataArray['Templating'] = $this->normalizer->normalize($data->getTemplating(), 'json', $context); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SecretsCreatePostBody::class => false]; } } diff --git a/src/Normalizer/ServiceCreateResponseNormalizer.php b/src/Normalizer/ServiceCreateResponseNormalizer.php new file mode 100644 index 00000000..800ac13e --- /dev/null +++ b/src/Normalizer/ServiceCreateResponseNormalizer.php @@ -0,0 +1,97 @@ +setID($data['ID']); + unset($data['ID']); + } elseif (\array_key_exists('ID', $data) && null === $data['ID']) { + $object->setID(null); + } + if (\array_key_exists('Warnings', $data) && null !== $data['Warnings']) { + $values = []; + foreach ($data['Warnings'] as $value) { + $values[] = $value; + } + $object->setWarnings($values); + unset($data['Warnings']); + } elseif (\array_key_exists('Warnings', $data) && null === $data['Warnings']) { + $object->setWarnings(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('iD') && null !== $data->getID()) { + $dataArray['ID'] = $data->getID(); + } + if ($data->isInitialized('warnings') && null !== $data->getWarnings()) { + $values = []; + foreach ($data->getWarnings() as $value) { + $values[] = $value; + } + $dataArray['Warnings'] = $values; + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceCreateResponse::class => false]; + } +} diff --git a/src/Normalizer/ServiceEndpointNormalizer.php b/src/Normalizer/ServiceEndpointNormalizer.php index 62f90e76..73df8b97 100644 --- a/src/Normalizer/ServiceEndpointNormalizer.php +++ b/src/Normalizer/ServiceEndpointNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,67 +16,99 @@ class ServiceEndpointNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ServiceEndpoint'; + return \Docker\API\Model\ServiceEndpoint::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ServiceEndpoint; + return \is_object($data) && \Docker\API\Model\ServiceEndpoint::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ServiceEndpoint(); - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\EndpointSpec', 'json', $context)); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Spec', $data) && null !== $data['Spec']) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\EndpointSpec::class, 'json', $context)); + unset($data['Spec']); + } elseif (\array_key_exists('Spec', $data) && null === $data['Spec']) { + $object->setSpec(null); } - if (property_exists($data, 'Ports') && $data->{'Ports'} !== null) { + if (\array_key_exists('Ports', $data) && null !== $data['Ports']) { $values = []; - foreach ($data->{'Ports'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\EndpointPortConfig', 'json', $context); + foreach ($data['Ports'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\EndpointPortConfig::class, 'json', $context); } $object->setPorts($values); + unset($data['Ports']); + } elseif (\array_key_exists('Ports', $data) && null === $data['Ports']) { + $object->setPorts(null); } - if (property_exists($data, 'VirtualIPs') && $data->{'VirtualIPs'} !== null) { + if (\array_key_exists('VirtualIPs', $data) && null !== $data['VirtualIPs']) { $values_1 = []; - foreach ($data->{'VirtualIPs'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\ServiceEndpointVirtualIPsItem', 'json', $context); + foreach ($data['VirtualIPs'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\ServiceEndpointVirtualIPsItem::class, 'json', $context); } $object->setVirtualIPs($values_1); + unset($data['VirtualIPs']); + } elseif (\array_key_exists('VirtualIPs', $data) && null === $data['VirtualIPs']) { + $object->setVirtualIPs(null); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + $dataArray = []; + if ($data->isInitialized('spec') && null !== $data->getSpec()) { + $dataArray['Spec'] = $this->normalizer->normalize($data->getSpec(), 'json', $context); } - if (null !== $object->getPorts()) { + if ($data->isInitialized('ports') && null !== $data->getPorts()) { $values = []; - foreach ($object->getPorts() as $value) { + foreach ($data->getPorts() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'Ports'} = $values; + $dataArray['Ports'] = $values; } - if (null !== $object->getVirtualIPs()) { + if ($data->isInitialized('virtualIPs') && null !== $data->getVirtualIPs()) { $values_1 = []; - foreach ($object->getVirtualIPs() as $value_1) { + foreach ($data->getVirtualIPs() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'VirtualIPs'} = $values_1; + $dataArray['VirtualIPs'] = $values_1; + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_2; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceEndpoint::class => false]; } } diff --git a/src/Normalizer/ServiceEndpointVirtualIPsItemNormalizer.php b/src/Normalizer/ServiceEndpointVirtualIPsItemNormalizer.php index 03776a58..d6815bbb 100644 --- a/src/Normalizer/ServiceEndpointVirtualIPsItemNormalizer.php +++ b/src/Normalizer/ServiceEndpointVirtualIPsItemNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class ServiceEndpointVirtualIPsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ServiceEndpointVirtualIPsItem'; + return \Docker\API\Model\ServiceEndpointVirtualIPsItem::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ServiceEndpointVirtualIPsItem; + return \is_object($data) && \Docker\API\Model\ServiceEndpointVirtualIPsItem::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ServiceEndpointVirtualIPsItem(); - if (property_exists($data, 'NetworkID') && $data->{'NetworkID'} !== null) { - $object->setNetworkID($data->{'NetworkID'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NetworkID', $data) && null !== $data['NetworkID']) { + $object->setNetworkID($data['NetworkID']); + unset($data['NetworkID']); + } elseif (\array_key_exists('NetworkID', $data) && null === $data['NetworkID']) { + $object->setNetworkID(null); + } + if (\array_key_exists('Addr', $data) && null !== $data['Addr']) { + $object->setAddr($data['Addr']); + unset($data['Addr']); + } elseif (\array_key_exists('Addr', $data) && null === $data['Addr']) { + $object->setAddr(null); } - if (property_exists($data, 'Addr') && $data->{'Addr'} !== null) { - $object->setAddr($data->{'Addr'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getNetworkID()) { - $data->{'NetworkID'} = $object->getNetworkID(); + $dataArray = []; + if ($data->isInitialized('networkID') && null !== $data->getNetworkID()) { + $dataArray['NetworkID'] = $data->getNetworkID(); } - if (null !== $object->getAddr()) { - $data->{'Addr'} = $object->getAddr(); + if ($data->isInitialized('addr') && null !== $data->getAddr()) { + $dataArray['Addr'] = $data->getAddr(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceEndpointVirtualIPsItem::class => false]; } } diff --git a/src/Normalizer/ServiceJobStatusNormalizer.php b/src/Normalizer/ServiceJobStatusNormalizer.php new file mode 100644 index 00000000..41376853 --- /dev/null +++ b/src/Normalizer/ServiceJobStatusNormalizer.php @@ -0,0 +1,89 @@ +setJobIteration($this->denormalizer->denormalize($data['JobIteration'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + unset($data['JobIteration']); + } elseif (\array_key_exists('JobIteration', $data) && null === $data['JobIteration']) { + $object->setJobIteration(null); + } + if (\array_key_exists('LastExecution', $data) && null !== $data['LastExecution']) { + $object->setLastExecution($data['LastExecution']); + unset($data['LastExecution']); + } elseif (\array_key_exists('LastExecution', $data) && null === $data['LastExecution']) { + $object->setLastExecution(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('jobIteration') && null !== $data->getJobIteration()) { + $dataArray['JobIteration'] = $this->normalizer->normalize($data->getJobIteration(), 'json', $context); + } + if ($data->isInitialized('lastExecution') && null !== $data->getLastExecution()) { + $dataArray['LastExecution'] = $data->getLastExecution(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceJobStatus::class => false]; + } +} diff --git a/src/Normalizer/ServiceNormalizer.php b/src/Normalizer/ServiceNormalizer.php index cec8f790..460f1a86 100644 --- a/src/Normalizer/ServiceNormalizer.php +++ b/src/Normalizer/ServiceNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,75 +16,137 @@ class ServiceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Service'; + return \Docker\API\Model\Service::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Service; + return \is_object($data) && \Docker\API\Model\Service::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\Service(); - if (property_exists($data, 'ID') && $data->{'ID'} !== null) { - $object->setID($data->{'ID'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && null !== $data['ID']) { + $object->setID($data['ID']); + unset($data['ID']); + } elseif (\array_key_exists('ID', $data) && null === $data['ID']) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && null !== $data['Version']) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + unset($data['Version']); + } elseif (\array_key_exists('Version', $data) && null === $data['Version']) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && null !== $data['CreatedAt']) { + $object->setCreatedAt($data['CreatedAt']); + unset($data['CreatedAt']); + } elseif (\array_key_exists('CreatedAt', $data) && null === $data['CreatedAt']) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && null !== $data['UpdatedAt']) { + $object->setUpdatedAt($data['UpdatedAt']); + unset($data['UpdatedAt']); + } elseif (\array_key_exists('UpdatedAt', $data) && null === $data['UpdatedAt']) { + $object->setUpdatedAt(null); } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($this->denormalizer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); + if (\array_key_exists('Spec', $data) && null !== $data['Spec']) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\ServiceSpec::class, 'json', $context)); + unset($data['Spec']); + } elseif (\array_key_exists('Spec', $data) && null === $data['Spec']) { + $object->setSpec(null); } - if (property_exists($data, 'CreatedAt') && $data->{'CreatedAt'} !== null) { - $object->setCreatedAt($data->{'CreatedAt'}); + if (\array_key_exists('Endpoint', $data) && null !== $data['Endpoint']) { + $object->setEndpoint($this->denormalizer->denormalize($data['Endpoint'], \Docker\API\Model\ServiceEndpoint::class, 'json', $context)); + unset($data['Endpoint']); + } elseif (\array_key_exists('Endpoint', $data) && null === $data['Endpoint']) { + $object->setEndpoint(null); } - if (property_exists($data, 'UpdatedAt') && $data->{'UpdatedAt'} !== null) { - $object->setUpdatedAt($data->{'UpdatedAt'}); + if (\array_key_exists('UpdateStatus', $data) && null !== $data['UpdateStatus']) { + $object->setUpdateStatus($this->denormalizer->denormalize($data['UpdateStatus'], \Docker\API\Model\ServiceUpdateStatus::class, 'json', $context)); + unset($data['UpdateStatus']); + } elseif (\array_key_exists('UpdateStatus', $data) && null === $data['UpdateStatus']) { + $object->setUpdateStatus(null); } - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\ServiceSpec', 'json', $context)); + if (\array_key_exists('ServiceStatus', $data) && null !== $data['ServiceStatus']) { + $object->setServiceStatus($this->denormalizer->denormalize($data['ServiceStatus'], \Docker\API\Model\ServiceServiceStatus::class, 'json', $context)); + unset($data['ServiceStatus']); + } elseif (\array_key_exists('ServiceStatus', $data) && null === $data['ServiceStatus']) { + $object->setServiceStatus(null); } - if (property_exists($data, 'Endpoint') && $data->{'Endpoint'} !== null) { - $object->setEndpoint($this->denormalizer->denormalize($data->{'Endpoint'}, 'Docker\\API\\Model\\ServiceEndpoint', 'json', $context)); + if (\array_key_exists('JobStatus', $data) && null !== $data['JobStatus']) { + $object->setJobStatus($this->denormalizer->denormalize($data['JobStatus'], \Docker\API\Model\ServiceJobStatus::class, 'json', $context)); + unset($data['JobStatus']); + } elseif (\array_key_exists('JobStatus', $data) && null === $data['JobStatus']) { + $object->setJobStatus(null); } - if (property_exists($data, 'UpdateStatus') && $data->{'UpdateStatus'} !== null) { - $object->setUpdateStatus($this->denormalizer->denormalize($data->{'UpdateStatus'}, 'Docker\\API\\Model\\ServiceUpdateStatus', 'json', $context)); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $dataArray = []; + if ($data->isInitialized('iD') && null !== $data->getID()) { + $dataArray['ID'] = $data->getID(); } - if (null !== $object->getVersion()) { - $data->{'Version'} = $this->normalizer->normalize($object->getVersion(), 'json', $context); + if ($data->isInitialized('version') && null !== $data->getVersion()) { + $dataArray['Version'] = $this->normalizer->normalize($data->getVersion(), 'json', $context); } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt(); + if ($data->isInitialized('createdAt') && null !== $data->getCreatedAt()) { + $dataArray['CreatedAt'] = $data->getCreatedAt(); } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt(); + if ($data->isInitialized('updatedAt') && null !== $data->getUpdatedAt()) { + $dataArray['UpdatedAt'] = $data->getUpdatedAt(); } - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + if ($data->isInitialized('spec') && null !== $data->getSpec()) { + $dataArray['Spec'] = $this->normalizer->normalize($data->getSpec(), 'json', $context); } - if (null !== $object->getEndpoint()) { - $data->{'Endpoint'} = $this->normalizer->normalize($object->getEndpoint(), 'json', $context); + if ($data->isInitialized('endpoint') && null !== $data->getEndpoint()) { + $dataArray['Endpoint'] = $this->normalizer->normalize($data->getEndpoint(), 'json', $context); } - if (null !== $object->getUpdateStatus()) { - $data->{'UpdateStatus'} = $this->normalizer->normalize($object->getUpdateStatus(), 'json', $context); + if ($data->isInitialized('updateStatus') && null !== $data->getUpdateStatus()) { + $dataArray['UpdateStatus'] = $this->normalizer->normalize($data->getUpdateStatus(), 'json', $context); + } + if ($data->isInitialized('serviceStatus') && null !== $data->getServiceStatus()) { + $dataArray['ServiceStatus'] = $this->normalizer->normalize($data->getServiceStatus(), 'json', $context); + } + if ($data->isInitialized('jobStatus') && null !== $data->getJobStatus()) { + $dataArray['JobStatus'] = $this->normalizer->normalize($data->getJobStatus(), 'json', $context); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Service::class => false]; } } diff --git a/src/Normalizer/ServiceServiceStatusNormalizer.php b/src/Normalizer/ServiceServiceStatusNormalizer.php new file mode 100644 index 00000000..e1a96bd7 --- /dev/null +++ b/src/Normalizer/ServiceServiceStatusNormalizer.php @@ -0,0 +1,98 @@ +setRunningTasks($data['RunningTasks']); + unset($data['RunningTasks']); + } elseif (\array_key_exists('RunningTasks', $data) && null === $data['RunningTasks']) { + $object->setRunningTasks(null); + } + if (\array_key_exists('DesiredTasks', $data) && null !== $data['DesiredTasks']) { + $object->setDesiredTasks($data['DesiredTasks']); + unset($data['DesiredTasks']); + } elseif (\array_key_exists('DesiredTasks', $data) && null === $data['DesiredTasks']) { + $object->setDesiredTasks(null); + } + if (\array_key_exists('CompletedTasks', $data) && null !== $data['CompletedTasks']) { + $object->setCompletedTasks($data['CompletedTasks']); + unset($data['CompletedTasks']); + } elseif (\array_key_exists('CompletedTasks', $data) && null === $data['CompletedTasks']) { + $object->setCompletedTasks(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('runningTasks') && null !== $data->getRunningTasks()) { + $dataArray['RunningTasks'] = $data->getRunningTasks(); + } + if ($data->isInitialized('desiredTasks') && null !== $data->getDesiredTasks()) { + $dataArray['DesiredTasks'] = $data->getDesiredTasks(); + } + if ($data->isInitialized('completedTasks') && null !== $data->getCompletedTasks()) { + $dataArray['CompletedTasks'] = $data->getCompletedTasks(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceServiceStatus::class => false]; + } +} diff --git a/src/Normalizer/ServiceSpecModeGlobalJobNormalizer.php b/src/Normalizer/ServiceSpecModeGlobalJobNormalizer.php new file mode 100644 index 00000000..d9cdc1be --- /dev/null +++ b/src/Normalizer/ServiceSpecModeGlobalJobNormalizer.php @@ -0,0 +1,71 @@ + $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecModeGlobalJob::class => false]; + } +} diff --git a/src/Normalizer/ServiceSpecModeGlobalNormalizer.php b/src/Normalizer/ServiceSpecModeGlobalNormalizer.php new file mode 100644 index 00000000..b0946271 --- /dev/null +++ b/src/Normalizer/ServiceSpecModeGlobalNormalizer.php @@ -0,0 +1,71 @@ + $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecModeGlobal::class => false]; + } +} diff --git a/src/Normalizer/ServiceSpecModeNormalizer.php b/src/Normalizer/ServiceSpecModeNormalizer.php index 4fbd3a17..357ab5d6 100644 --- a/src/Normalizer/ServiceSpecModeNormalizer.php +++ b/src/Normalizer/ServiceSpecModeNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,92 @@ class ServiceSpecModeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ServiceSpecMode'; + return \Docker\API\Model\ServiceSpecMode::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ServiceSpecMode; + return \is_object($data) && \Docker\API\Model\ServiceSpecMode::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ServiceSpecMode(); - if (property_exists($data, 'Replicated') && $data->{'Replicated'} !== null) { - $object->setReplicated($this->denormalizer->denormalize($data->{'Replicated'}, 'Docker\\API\\Model\\ServiceSpecModeReplicated', 'json', $context)); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Replicated', $data) && null !== $data['Replicated']) { + $object->setReplicated($this->denormalizer->denormalize($data['Replicated'], \Docker\API\Model\ServiceSpecModeReplicated::class, 'json', $context)); + unset($data['Replicated']); + } elseif (\array_key_exists('Replicated', $data) && null === $data['Replicated']) { + $object->setReplicated(null); + } + if (\array_key_exists('Global', $data) && null !== $data['Global']) { + $object->setGlobal($this->denormalizer->denormalize($data['Global'], \Docker\API\Model\ServiceSpecModeGlobal::class, 'json', $context)); + unset($data['Global']); + } elseif (\array_key_exists('Global', $data) && null === $data['Global']) { + $object->setGlobal(null); + } + if (\array_key_exists('ReplicatedJob', $data) && null !== $data['ReplicatedJob']) { + $object->setReplicatedJob($this->denormalizer->denormalize($data['ReplicatedJob'], \Docker\API\Model\ServiceSpecModeReplicatedJob::class, 'json', $context)); + unset($data['ReplicatedJob']); + } elseif (\array_key_exists('ReplicatedJob', $data) && null === $data['ReplicatedJob']) { + $object->setReplicatedJob(null); + } + if (\array_key_exists('GlobalJob', $data) && null !== $data['GlobalJob']) { + $object->setGlobalJob($this->denormalizer->denormalize($data['GlobalJob'], \Docker\API\Model\ServiceSpecModeGlobalJob::class, 'json', $context)); + unset($data['GlobalJob']); + } elseif (\array_key_exists('GlobalJob', $data) && null === $data['GlobalJob']) { + $object->setGlobalJob(null); } - if (property_exists($data, 'Global') && $data->{'Global'} !== null) { - $object->setGlobal($data->{'Global'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getReplicated()) { - $data->{'Replicated'} = $this->normalizer->normalize($object->getReplicated(), 'json', $context); + $dataArray = []; + if ($data->isInitialized('replicated') && null !== $data->getReplicated()) { + $dataArray['Replicated'] = $this->normalizer->normalize($data->getReplicated(), 'json', $context); } - if (null !== $object->getGlobal()) { - $data->{'Global'} = $object->getGlobal(); + if ($data->isInitialized('global') && null !== $data->getGlobal()) { + $dataArray['Global'] = $this->normalizer->normalize($data->getGlobal(), 'json', $context); + } + if ($data->isInitialized('replicatedJob') && null !== $data->getReplicatedJob()) { + $dataArray['ReplicatedJob'] = $this->normalizer->normalize($data->getReplicatedJob(), 'json', $context); + } + if ($data->isInitialized('globalJob') && null !== $data->getGlobalJob()) { + $dataArray['GlobalJob'] = $this->normalizer->normalize($data->getGlobalJob(), 'json', $context); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecMode::class => false]; } } diff --git a/src/Normalizer/ServiceSpecModeReplicatedJobNormalizer.php b/src/Normalizer/ServiceSpecModeReplicatedJobNormalizer.php new file mode 100644 index 00000000..b1bc41fc --- /dev/null +++ b/src/Normalizer/ServiceSpecModeReplicatedJobNormalizer.php @@ -0,0 +1,89 @@ +setMaxConcurrent($data['MaxConcurrent']); + unset($data['MaxConcurrent']); + } elseif (\array_key_exists('MaxConcurrent', $data) && null === $data['MaxConcurrent']) { + $object->setMaxConcurrent(null); + } + if (\array_key_exists('TotalCompletions', $data) && null !== $data['TotalCompletions']) { + $object->setTotalCompletions($data['TotalCompletions']); + unset($data['TotalCompletions']); + } elseif (\array_key_exists('TotalCompletions', $data) && null === $data['TotalCompletions']) { + $object->setTotalCompletions(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('maxConcurrent') && null !== $data->getMaxConcurrent()) { + $dataArray['MaxConcurrent'] = $data->getMaxConcurrent(); + } + if ($data->isInitialized('totalCompletions') && null !== $data->getTotalCompletions()) { + $dataArray['TotalCompletions'] = $data->getTotalCompletions(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecModeReplicatedJob::class => false]; + } +} diff --git a/src/Normalizer/ServiceSpecModeReplicatedNormalizer.php b/src/Normalizer/ServiceSpecModeReplicatedNormalizer.php index 63f96be0..cec449a8 100644 --- a/src/Normalizer/ServiceSpecModeReplicatedNormalizer.php +++ b/src/Normalizer/ServiceSpecModeReplicatedNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,39 +16,65 @@ class ServiceSpecModeReplicatedNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ServiceSpecModeReplicated'; + return \Docker\API\Model\ServiceSpecModeReplicated::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ServiceSpecModeReplicated; + return \is_object($data) && \Docker\API\Model\ServiceSpecModeReplicated::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ServiceSpecModeReplicated(); - if (property_exists($data, 'Replicas') && $data->{'Replicas'} !== null) { - $object->setReplicas($data->{'Replicas'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Replicas', $data) && null !== $data['Replicas']) { + $object->setReplicas($data['Replicas']); + unset($data['Replicas']); + } elseif (\array_key_exists('Replicas', $data) && null === $data['Replicas']) { + $object->setReplicas(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getReplicas()) { - $data->{'Replicas'} = $object->getReplicas(); + $dataArray = []; + if ($data->isInitialized('replicas') && null !== $data->getReplicas()) { + $dataArray['Replicas'] = $data->getReplicas(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecModeReplicated::class => false]; } } diff --git a/src/Normalizer/ServiceSpecNetworksItemNormalizer.php b/src/Normalizer/ServiceSpecNetworksItemNormalizer.php deleted file mode 100644 index 38cafacf..00000000 --- a/src/Normalizer/ServiceSpecNetworksItemNormalizer.php +++ /dev/null @@ -1,71 +0,0 @@ -{'Target'} !== null) { - $object->setTarget($data->{'Target'}); - } - if (property_exists($data, 'Aliases') && $data->{'Aliases'} !== null) { - $values = []; - foreach ($data->{'Aliases'} as $value) { - $values[] = $value; - } - $object->setAliases($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getTarget()) { - $data->{'Target'} = $object->getTarget(); - } - if (null !== $object->getAliases()) { - $values = []; - foreach ($object->getAliases() as $value) { - $values[] = $value; - } - $data->{'Aliases'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/ServiceSpecNormalizer.php b/src/Normalizer/ServiceSpecNormalizer.php index 25ea0a81..4c220804 100644 --- a/src/Normalizer/ServiceSpecNormalizer.php +++ b/src/Normalizer/ServiceSpecNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,97 +16,144 @@ class ServiceSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ServiceSpec'; + return \Docker\API\Model\ServiceSpec::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ServiceSpec; + return \is_object($data) && \Docker\API\Model\ServiceSpec::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ServiceSpec(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); - } - if (property_exists($data, 'TaskTemplate') && $data->{'TaskTemplate'} !== null) { - $object->setTaskTemplate($this->denormalizer->denormalize($data->{'TaskTemplate'}, 'Docker\\API\\Model\\TaskSpec', 'json', $context)); - } - if (property_exists($data, 'Mode') && $data->{'Mode'} !== null) { - $object->setMode($this->denormalizer->denormalize($data->{'Mode'}, 'Docker\\API\\Model\\ServiceSpecMode', 'json', $context)); - } - if (property_exists($data, 'UpdateConfig') && $data->{'UpdateConfig'} !== null) { - $object->setUpdateConfig($this->denormalizer->denormalize($data->{'UpdateConfig'}, 'Docker\\API\\Model\\ServiceSpecUpdateConfig', 'json', $context)); - } - if (property_exists($data, 'RollbackConfig') && $data->{'RollbackConfig'} !== null) { - $object->setRollbackConfig($this->denormalizer->denormalize($data->{'RollbackConfig'}, 'Docker\\API\\Model\\ServiceSpecRollbackConfig', 'json', $context)); - } - if (property_exists($data, 'Networks') && $data->{'Networks'} !== null) { + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + if (\array_key_exists('TaskTemplate', $data) && null !== $data['TaskTemplate']) { + $object->setTaskTemplate($this->denormalizer->denormalize($data['TaskTemplate'], \Docker\API\Model\TaskSpec::class, 'json', $context)); + unset($data['TaskTemplate']); + } elseif (\array_key_exists('TaskTemplate', $data) && null === $data['TaskTemplate']) { + $object->setTaskTemplate(null); + } + if (\array_key_exists('Mode', $data) && null !== $data['Mode']) { + $object->setMode($this->denormalizer->denormalize($data['Mode'], \Docker\API\Model\ServiceSpecMode::class, 'json', $context)); + unset($data['Mode']); + } elseif (\array_key_exists('Mode', $data) && null === $data['Mode']) { + $object->setMode(null); + } + if (\array_key_exists('UpdateConfig', $data) && null !== $data['UpdateConfig']) { + $object->setUpdateConfig($this->denormalizer->denormalize($data['UpdateConfig'], \Docker\API\Model\ServiceSpecUpdateConfig::class, 'json', $context)); + unset($data['UpdateConfig']); + } elseif (\array_key_exists('UpdateConfig', $data) && null === $data['UpdateConfig']) { + $object->setUpdateConfig(null); + } + if (\array_key_exists('RollbackConfig', $data) && null !== $data['RollbackConfig']) { + $object->setRollbackConfig($this->denormalizer->denormalize($data['RollbackConfig'], \Docker\API\Model\ServiceSpecRollbackConfig::class, 'json', $context)); + unset($data['RollbackConfig']); + } elseif (\array_key_exists('RollbackConfig', $data) && null === $data['RollbackConfig']) { + $object->setRollbackConfig(null); + } + if (\array_key_exists('Networks', $data) && null !== $data['Networks']) { $values_1 = []; - foreach ($data->{'Networks'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\ServiceSpecNetworksItem', 'json', $context); + foreach ($data['Networks'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\NetworkAttachmentConfig::class, 'json', $context); } $object->setNetworks($values_1); - } - if (property_exists($data, 'EndpointSpec') && $data->{'EndpointSpec'} !== null) { - $object->setEndpointSpec($this->denormalizer->denormalize($data->{'EndpointSpec'}, 'Docker\\API\\Model\\EndpointSpec', 'json', $context)); + unset($data['Networks']); + } elseif (\array_key_exists('Networks', $data) && null === $data['Networks']) { + $object->setNetworks(null); + } + if (\array_key_exists('EndpointSpec', $data) && null !== $data['EndpointSpec']) { + $object->setEndpointSpec($this->denormalizer->denormalize($data['EndpointSpec'], \Docker\API\Model\EndpointSpec::class, 'json', $context)); + unset($data['EndpointSpec']); + } elseif (\array_key_exists('EndpointSpec', $data) && null === $data['EndpointSpec']) { + $object->setEndpointSpec(null); + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getLabels()) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); + } + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values = []; + foreach ($data->getLabels() as $key => $value) { + $values[$key] = $value; } - $data->{'Labels'} = $values; + $dataArray['Labels'] = $values; } - if (null !== $object->getTaskTemplate()) { - $data->{'TaskTemplate'} = $this->normalizer->normalize($object->getTaskTemplate(), 'json', $context); + if ($data->isInitialized('taskTemplate') && null !== $data->getTaskTemplate()) { + $dataArray['TaskTemplate'] = $this->normalizer->normalize($data->getTaskTemplate(), 'json', $context); } - if (null !== $object->getMode()) { - $data->{'Mode'} = $this->normalizer->normalize($object->getMode(), 'json', $context); + if ($data->isInitialized('mode') && null !== $data->getMode()) { + $dataArray['Mode'] = $this->normalizer->normalize($data->getMode(), 'json', $context); } - if (null !== $object->getUpdateConfig()) { - $data->{'UpdateConfig'} = $this->normalizer->normalize($object->getUpdateConfig(), 'json', $context); + if ($data->isInitialized('updateConfig') && null !== $data->getUpdateConfig()) { + $dataArray['UpdateConfig'] = $this->normalizer->normalize($data->getUpdateConfig(), 'json', $context); } - if (null !== $object->getRollbackConfig()) { - $data->{'RollbackConfig'} = $this->normalizer->normalize($object->getRollbackConfig(), 'json', $context); + if ($data->isInitialized('rollbackConfig') && null !== $data->getRollbackConfig()) { + $dataArray['RollbackConfig'] = $this->normalizer->normalize($data->getRollbackConfig(), 'json', $context); } - if (null !== $object->getNetworks()) { + if ($data->isInitialized('networks') && null !== $data->getNetworks()) { $values_1 = []; - foreach ($object->getNetworks() as $value_1) { + foreach ($data->getNetworks() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'Networks'} = $values_1; + $dataArray['Networks'] = $values_1; + } + if ($data->isInitialized('endpointSpec') && null !== $data->getEndpointSpec()) { + $dataArray['EndpointSpec'] = $this->normalizer->normalize($data->getEndpointSpec(), 'json', $context); } - if (null !== $object->getEndpointSpec()) { - $data->{'EndpointSpec'} = $this->normalizer->normalize($object->getEndpointSpec(), 'json', $context); + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_2; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpec::class => false]; } } diff --git a/src/Normalizer/ServiceSpecRollbackConfigNormalizer.php b/src/Normalizer/ServiceSpecRollbackConfigNormalizer.php index 4b8a7510..3d666766 100644 --- a/src/Normalizer/ServiceSpecRollbackConfigNormalizer.php +++ b/src/Normalizer/ServiceSpecRollbackConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,69 +16,113 @@ class ServiceSpecRollbackConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ServiceSpecRollbackConfig'; + return \Docker\API\Model\ServiceSpecRollbackConfig::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ServiceSpecRollbackConfig; + return \is_object($data) && \Docker\API\Model\ServiceSpecRollbackConfig::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ServiceSpecRollbackConfig(); - if (property_exists($data, 'Parallelism') && $data->{'Parallelism'} !== null) { - $object->setParallelism($data->{'Parallelism'}); + if (\array_key_exists('MaxFailureRatio', $data) && \is_int($data['MaxFailureRatio'])) { + $data['MaxFailureRatio'] = (float) $data['MaxFailureRatio']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Parallelism', $data) && null !== $data['Parallelism']) { + $object->setParallelism($data['Parallelism']); + unset($data['Parallelism']); + } elseif (\array_key_exists('Parallelism', $data) && null === $data['Parallelism']) { + $object->setParallelism(null); + } + if (\array_key_exists('Delay', $data) && null !== $data['Delay']) { + $object->setDelay($data['Delay']); + unset($data['Delay']); + } elseif (\array_key_exists('Delay', $data) && null === $data['Delay']) { + $object->setDelay(null); } - if (property_exists($data, 'Delay') && $data->{'Delay'} !== null) { - $object->setDelay($data->{'Delay'}); + if (\array_key_exists('FailureAction', $data) && null !== $data['FailureAction']) { + $object->setFailureAction($data['FailureAction']); + unset($data['FailureAction']); + } elseif (\array_key_exists('FailureAction', $data) && null === $data['FailureAction']) { + $object->setFailureAction(null); } - if (property_exists($data, 'FailureAction') && $data->{'FailureAction'} !== null) { - $object->setFailureAction($data->{'FailureAction'}); + if (\array_key_exists('Monitor', $data) && null !== $data['Monitor']) { + $object->setMonitor($data['Monitor']); + unset($data['Monitor']); + } elseif (\array_key_exists('Monitor', $data) && null === $data['Monitor']) { + $object->setMonitor(null); } - if (property_exists($data, 'Monitor') && $data->{'Monitor'} !== null) { - $object->setMonitor($data->{'Monitor'}); + if (\array_key_exists('MaxFailureRatio', $data) && null !== $data['MaxFailureRatio']) { + $object->setMaxFailureRatio($data['MaxFailureRatio']); + unset($data['MaxFailureRatio']); + } elseif (\array_key_exists('MaxFailureRatio', $data) && null === $data['MaxFailureRatio']) { + $object->setMaxFailureRatio(null); } - if (property_exists($data, 'MaxFailureRatio') && $data->{'MaxFailureRatio'} !== null) { - $object->setMaxFailureRatio($data->{'MaxFailureRatio'}); + if (\array_key_exists('Order', $data) && null !== $data['Order']) { + $object->setOrder($data['Order']); + unset($data['Order']); + } elseif (\array_key_exists('Order', $data) && null === $data['Order']) { + $object->setOrder(null); } - if (property_exists($data, 'Order') && $data->{'Order'} !== null) { - $object->setOrder($data->{'Order'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getParallelism()) { - $data->{'Parallelism'} = $object->getParallelism(); + $dataArray = []; + if ($data->isInitialized('parallelism') && null !== $data->getParallelism()) { + $dataArray['Parallelism'] = $data->getParallelism(); } - if (null !== $object->getDelay()) { - $data->{'Delay'} = $object->getDelay(); + if ($data->isInitialized('delay') && null !== $data->getDelay()) { + $dataArray['Delay'] = $data->getDelay(); } - if (null !== $object->getFailureAction()) { - $data->{'FailureAction'} = $object->getFailureAction(); + if ($data->isInitialized('failureAction') && null !== $data->getFailureAction()) { + $dataArray['FailureAction'] = $data->getFailureAction(); } - if (null !== $object->getMonitor()) { - $data->{'Monitor'} = $object->getMonitor(); + if ($data->isInitialized('monitor') && null !== $data->getMonitor()) { + $dataArray['Monitor'] = $data->getMonitor(); } - if (null !== $object->getMaxFailureRatio()) { - $data->{'MaxFailureRatio'} = $object->getMaxFailureRatio(); + if ($data->isInitialized('maxFailureRatio') && null !== $data->getMaxFailureRatio()) { + $dataArray['MaxFailureRatio'] = $data->getMaxFailureRatio(); } - if (null !== $object->getOrder()) { - $data->{'Order'} = $object->getOrder(); + if ($data->isInitialized('order') && null !== $data->getOrder()) { + $dataArray['Order'] = $data->getOrder(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecRollbackConfig::class => false]; } } diff --git a/src/Normalizer/ServiceSpecUpdateConfigNormalizer.php b/src/Normalizer/ServiceSpecUpdateConfigNormalizer.php index 32671dfa..58dc8338 100644 --- a/src/Normalizer/ServiceSpecUpdateConfigNormalizer.php +++ b/src/Normalizer/ServiceSpecUpdateConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,69 +16,113 @@ class ServiceSpecUpdateConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ServiceSpecUpdateConfig'; + return \Docker\API\Model\ServiceSpecUpdateConfig::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ServiceSpecUpdateConfig; + return \is_object($data) && \Docker\API\Model\ServiceSpecUpdateConfig::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ServiceSpecUpdateConfig(); - if (property_exists($data, 'Parallelism') && $data->{'Parallelism'} !== null) { - $object->setParallelism($data->{'Parallelism'}); + if (\array_key_exists('MaxFailureRatio', $data) && \is_int($data['MaxFailureRatio'])) { + $data['MaxFailureRatio'] = (float) $data['MaxFailureRatio']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Parallelism', $data) && null !== $data['Parallelism']) { + $object->setParallelism($data['Parallelism']); + unset($data['Parallelism']); + } elseif (\array_key_exists('Parallelism', $data) && null === $data['Parallelism']) { + $object->setParallelism(null); + } + if (\array_key_exists('Delay', $data) && null !== $data['Delay']) { + $object->setDelay($data['Delay']); + unset($data['Delay']); + } elseif (\array_key_exists('Delay', $data) && null === $data['Delay']) { + $object->setDelay(null); } - if (property_exists($data, 'Delay') && $data->{'Delay'} !== null) { - $object->setDelay($data->{'Delay'}); + if (\array_key_exists('FailureAction', $data) && null !== $data['FailureAction']) { + $object->setFailureAction($data['FailureAction']); + unset($data['FailureAction']); + } elseif (\array_key_exists('FailureAction', $data) && null === $data['FailureAction']) { + $object->setFailureAction(null); } - if (property_exists($data, 'FailureAction') && $data->{'FailureAction'} !== null) { - $object->setFailureAction($data->{'FailureAction'}); + if (\array_key_exists('Monitor', $data) && null !== $data['Monitor']) { + $object->setMonitor($data['Monitor']); + unset($data['Monitor']); + } elseif (\array_key_exists('Monitor', $data) && null === $data['Monitor']) { + $object->setMonitor(null); } - if (property_exists($data, 'Monitor') && $data->{'Monitor'} !== null) { - $object->setMonitor($data->{'Monitor'}); + if (\array_key_exists('MaxFailureRatio', $data) && null !== $data['MaxFailureRatio']) { + $object->setMaxFailureRatio($data['MaxFailureRatio']); + unset($data['MaxFailureRatio']); + } elseif (\array_key_exists('MaxFailureRatio', $data) && null === $data['MaxFailureRatio']) { + $object->setMaxFailureRatio(null); } - if (property_exists($data, 'MaxFailureRatio') && $data->{'MaxFailureRatio'} !== null) { - $object->setMaxFailureRatio($data->{'MaxFailureRatio'}); + if (\array_key_exists('Order', $data) && null !== $data['Order']) { + $object->setOrder($data['Order']); + unset($data['Order']); + } elseif (\array_key_exists('Order', $data) && null === $data['Order']) { + $object->setOrder(null); } - if (property_exists($data, 'Order') && $data->{'Order'} !== null) { - $object->setOrder($data->{'Order'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getParallelism()) { - $data->{'Parallelism'} = $object->getParallelism(); + $dataArray = []; + if ($data->isInitialized('parallelism') && null !== $data->getParallelism()) { + $dataArray['Parallelism'] = $data->getParallelism(); } - if (null !== $object->getDelay()) { - $data->{'Delay'} = $object->getDelay(); + if ($data->isInitialized('delay') && null !== $data->getDelay()) { + $dataArray['Delay'] = $data->getDelay(); } - if (null !== $object->getFailureAction()) { - $data->{'FailureAction'} = $object->getFailureAction(); + if ($data->isInitialized('failureAction') && null !== $data->getFailureAction()) { + $dataArray['FailureAction'] = $data->getFailureAction(); } - if (null !== $object->getMonitor()) { - $data->{'Monitor'} = $object->getMonitor(); + if ($data->isInitialized('monitor') && null !== $data->getMonitor()) { + $dataArray['Monitor'] = $data->getMonitor(); } - if (null !== $object->getMaxFailureRatio()) { - $data->{'MaxFailureRatio'} = $object->getMaxFailureRatio(); + if ($data->isInitialized('maxFailureRatio') && null !== $data->getMaxFailureRatio()) { + $dataArray['MaxFailureRatio'] = $data->getMaxFailureRatio(); } - if (null !== $object->getOrder()) { - $data->{'Order'} = $object->getOrder(); + if ($data->isInitialized('order') && null !== $data->getOrder()) { + $dataArray['Order'] = $data->getOrder(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceSpecUpdateConfig::class => false]; } } diff --git a/src/Normalizer/ServiceUpdateResponseNormalizer.php b/src/Normalizer/ServiceUpdateResponseNormalizer.php index 86d7d059..878ee6b0 100644 --- a/src/Normalizer/ServiceUpdateResponseNormalizer.php +++ b/src/Normalizer/ServiceUpdateResponseNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,47 +16,73 @@ class ServiceUpdateResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ServiceUpdateResponse'; + return \Docker\API\Model\ServiceUpdateResponse::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ServiceUpdateResponse; + return \is_object($data) && \Docker\API\Model\ServiceUpdateResponse::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ServiceUpdateResponse(); - if (property_exists($data, 'Warnings') && $data->{'Warnings'} !== null) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Warnings', $data) && null !== $data['Warnings']) { $values = []; - foreach ($data->{'Warnings'} as $value) { + foreach ($data['Warnings'] as $value) { $values[] = $value; } $object->setWarnings($values); + unset($data['Warnings']); + } elseif (\array_key_exists('Warnings', $data) && null === $data['Warnings']) { + $object->setWarnings(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getWarnings()) { + $dataArray = []; + if ($data->isInitialized('warnings') && null !== $data->getWarnings()) { $values = []; - foreach ($object->getWarnings() as $value) { + foreach ($data->getWarnings() as $value) { $values[] = $value; } - $data->{'Warnings'} = $values; + $dataArray['Warnings'] = $values; + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceUpdateResponse::class => false]; } } diff --git a/src/Normalizer/ServiceUpdateStatusNormalizer.php b/src/Normalizer/ServiceUpdateStatusNormalizer.php index fa146a30..4750d413 100644 --- a/src/Normalizer/ServiceUpdateStatusNormalizer.php +++ b/src/Normalizer/ServiceUpdateStatusNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,57 +16,92 @@ class ServiceUpdateStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ServiceUpdateStatus'; + return \Docker\API\Model\ServiceUpdateStatus::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ServiceUpdateStatus; + return \is_object($data) && \Docker\API\Model\ServiceUpdateStatus::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ServiceUpdateStatus(); - if (property_exists($data, 'State') && $data->{'State'} !== null) { - $object->setState($data->{'State'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('State', $data) && null !== $data['State']) { + $object->setState($data['State']); + unset($data['State']); + } elseif (\array_key_exists('State', $data) && null === $data['State']) { + $object->setState(null); + } + if (\array_key_exists('StartedAt', $data) && null !== $data['StartedAt']) { + $object->setStartedAt($data['StartedAt']); + unset($data['StartedAt']); + } elseif (\array_key_exists('StartedAt', $data) && null === $data['StartedAt']) { + $object->setStartedAt(null); } - if (property_exists($data, 'StartedAt') && $data->{'StartedAt'} !== null) { - $object->setStartedAt($data->{'StartedAt'}); + if (\array_key_exists('CompletedAt', $data) && null !== $data['CompletedAt']) { + $object->setCompletedAt($data['CompletedAt']); + unset($data['CompletedAt']); + } elseif (\array_key_exists('CompletedAt', $data) && null === $data['CompletedAt']) { + $object->setCompletedAt(null); } - if (property_exists($data, 'CompletedAt') && $data->{'CompletedAt'} !== null) { - $object->setCompletedAt($data->{'CompletedAt'}); + if (\array_key_exists('Message', $data) && null !== $data['Message']) { + $object->setMessage($data['Message']); + unset($data['Message']); + } elseif (\array_key_exists('Message', $data) && null === $data['Message']) { + $object->setMessage(null); } - if (property_exists($data, 'Message') && $data->{'Message'} !== null) { - $object->setMessage($data->{'Message'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getState()) { - $data->{'State'} = $object->getState(); + $dataArray = []; + if ($data->isInitialized('state') && null !== $data->getState()) { + $dataArray['State'] = $data->getState(); } - if (null !== $object->getStartedAt()) { - $data->{'StartedAt'} = $object->getStartedAt(); + if ($data->isInitialized('startedAt') && null !== $data->getStartedAt()) { + $dataArray['StartedAt'] = $data->getStartedAt(); } - if (null !== $object->getCompletedAt()) { - $data->{'CompletedAt'} = $object->getCompletedAt(); + if ($data->isInitialized('completedAt') && null !== $data->getCompletedAt()) { + $dataArray['CompletedAt'] = $data->getCompletedAt(); } - if (null !== $object->getMessage()) { - $data->{'Message'} = $object->getMessage(); + if ($data->isInitialized('message') && null !== $data->getMessage()) { + $dataArray['Message'] = $data->getMessage(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServiceUpdateStatus::class => false]; } } diff --git a/src/Normalizer/ServicesCreatePostBodyNormalizer.php b/src/Normalizer/ServicesCreatePostBodyNormalizer.php index f28b49a6..fa98cb6f 100644 --- a/src/Normalizer/ServicesCreatePostBodyNormalizer.php +++ b/src/Normalizer/ServicesCreatePostBodyNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,97 +16,144 @@ class ServicesCreatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ServicesCreatePostBody'; + return \Docker\API\Model\ServicesCreatePostBody::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ServicesCreatePostBody; + return \is_object($data) && \Docker\API\Model\ServicesCreatePostBody::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ServicesCreatePostBody(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); - } - if (property_exists($data, 'TaskTemplate') && $data->{'TaskTemplate'} !== null) { - $object->setTaskTemplate($this->denormalizer->denormalize($data->{'TaskTemplate'}, 'Docker\\API\\Model\\TaskSpec', 'json', $context)); - } - if (property_exists($data, 'Mode') && $data->{'Mode'} !== null) { - $object->setMode($this->denormalizer->denormalize($data->{'Mode'}, 'Docker\\API\\Model\\ServiceSpecMode', 'json', $context)); - } - if (property_exists($data, 'UpdateConfig') && $data->{'UpdateConfig'} !== null) { - $object->setUpdateConfig($this->denormalizer->denormalize($data->{'UpdateConfig'}, 'Docker\\API\\Model\\ServiceSpecUpdateConfig', 'json', $context)); - } - if (property_exists($data, 'RollbackConfig') && $data->{'RollbackConfig'} !== null) { - $object->setRollbackConfig($this->denormalizer->denormalize($data->{'RollbackConfig'}, 'Docker\\API\\Model\\ServiceSpecRollbackConfig', 'json', $context)); - } - if (property_exists($data, 'Networks') && $data->{'Networks'} !== null) { + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + if (\array_key_exists('TaskTemplate', $data) && null !== $data['TaskTemplate']) { + $object->setTaskTemplate($this->denormalizer->denormalize($data['TaskTemplate'], \Docker\API\Model\TaskSpec::class, 'json', $context)); + unset($data['TaskTemplate']); + } elseif (\array_key_exists('TaskTemplate', $data) && null === $data['TaskTemplate']) { + $object->setTaskTemplate(null); + } + if (\array_key_exists('Mode', $data) && null !== $data['Mode']) { + $object->setMode($this->denormalizer->denormalize($data['Mode'], \Docker\API\Model\ServiceSpecMode::class, 'json', $context)); + unset($data['Mode']); + } elseif (\array_key_exists('Mode', $data) && null === $data['Mode']) { + $object->setMode(null); + } + if (\array_key_exists('UpdateConfig', $data) && null !== $data['UpdateConfig']) { + $object->setUpdateConfig($this->denormalizer->denormalize($data['UpdateConfig'], \Docker\API\Model\ServiceSpecUpdateConfig::class, 'json', $context)); + unset($data['UpdateConfig']); + } elseif (\array_key_exists('UpdateConfig', $data) && null === $data['UpdateConfig']) { + $object->setUpdateConfig(null); + } + if (\array_key_exists('RollbackConfig', $data) && null !== $data['RollbackConfig']) { + $object->setRollbackConfig($this->denormalizer->denormalize($data['RollbackConfig'], \Docker\API\Model\ServiceSpecRollbackConfig::class, 'json', $context)); + unset($data['RollbackConfig']); + } elseif (\array_key_exists('RollbackConfig', $data) && null === $data['RollbackConfig']) { + $object->setRollbackConfig(null); + } + if (\array_key_exists('Networks', $data) && null !== $data['Networks']) { $values_1 = []; - foreach ($data->{'Networks'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\ServiceSpecNetworksItem', 'json', $context); + foreach ($data['Networks'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\NetworkAttachmentConfig::class, 'json', $context); } $object->setNetworks($values_1); - } - if (property_exists($data, 'EndpointSpec') && $data->{'EndpointSpec'} !== null) { - $object->setEndpointSpec($this->denormalizer->denormalize($data->{'EndpointSpec'}, 'Docker\\API\\Model\\EndpointSpec', 'json', $context)); + unset($data['Networks']); + } elseif (\array_key_exists('Networks', $data) && null === $data['Networks']) { + $object->setNetworks(null); + } + if (\array_key_exists('EndpointSpec', $data) && null !== $data['EndpointSpec']) { + $object->setEndpointSpec($this->denormalizer->denormalize($data['EndpointSpec'], \Docker\API\Model\EndpointSpec::class, 'json', $context)); + unset($data['EndpointSpec']); + } elseif (\array_key_exists('EndpointSpec', $data) && null === $data['EndpointSpec']) { + $object->setEndpointSpec(null); + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getLabels()) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); + } + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values = []; + foreach ($data->getLabels() as $key => $value) { + $values[$key] = $value; } - $data->{'Labels'} = $values; + $dataArray['Labels'] = $values; } - if (null !== $object->getTaskTemplate()) { - $data->{'TaskTemplate'} = $this->normalizer->normalize($object->getTaskTemplate(), 'json', $context); + if ($data->isInitialized('taskTemplate') && null !== $data->getTaskTemplate()) { + $dataArray['TaskTemplate'] = $this->normalizer->normalize($data->getTaskTemplate(), 'json', $context); } - if (null !== $object->getMode()) { - $data->{'Mode'} = $this->normalizer->normalize($object->getMode(), 'json', $context); + if ($data->isInitialized('mode') && null !== $data->getMode()) { + $dataArray['Mode'] = $this->normalizer->normalize($data->getMode(), 'json', $context); } - if (null !== $object->getUpdateConfig()) { - $data->{'UpdateConfig'} = $this->normalizer->normalize($object->getUpdateConfig(), 'json', $context); + if ($data->isInitialized('updateConfig') && null !== $data->getUpdateConfig()) { + $dataArray['UpdateConfig'] = $this->normalizer->normalize($data->getUpdateConfig(), 'json', $context); } - if (null !== $object->getRollbackConfig()) { - $data->{'RollbackConfig'} = $this->normalizer->normalize($object->getRollbackConfig(), 'json', $context); + if ($data->isInitialized('rollbackConfig') && null !== $data->getRollbackConfig()) { + $dataArray['RollbackConfig'] = $this->normalizer->normalize($data->getRollbackConfig(), 'json', $context); } - if (null !== $object->getNetworks()) { + if ($data->isInitialized('networks') && null !== $data->getNetworks()) { $values_1 = []; - foreach ($object->getNetworks() as $value_1) { + foreach ($data->getNetworks() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'Networks'} = $values_1; + $dataArray['Networks'] = $values_1; + } + if ($data->isInitialized('endpointSpec') && null !== $data->getEndpointSpec()) { + $dataArray['EndpointSpec'] = $this->normalizer->normalize($data->getEndpointSpec(), 'json', $context); } - if (null !== $object->getEndpointSpec()) { - $data->{'EndpointSpec'} = $this->normalizer->normalize($object->getEndpointSpec(), 'json', $context); + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_2; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServicesCreatePostBody::class => false]; } } diff --git a/src/Normalizer/ServicesCreatePostResponse201Normalizer.php b/src/Normalizer/ServicesCreatePostResponse201Normalizer.php deleted file mode 100644 index d76a68ed..00000000 --- a/src/Normalizer/ServicesCreatePostResponse201Normalizer.php +++ /dev/null @@ -1,63 +0,0 @@ -{'ID'} !== null) { - $object->setID($data->{'ID'}); - } - if (property_exists($data, 'Warning') && $data->{'Warning'} !== null) { - $object->setWarning($data->{'Warning'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); - } - if (null !== $object->getWarning()) { - $data->{'Warning'} = $object->getWarning(); - } - - return $data; - } -} diff --git a/src/Normalizer/ServicesIdUpdatePostBodyNormalizer.php b/src/Normalizer/ServicesIdUpdatePostBodyNormalizer.php index 312f8f0f..46a677dd 100644 --- a/src/Normalizer/ServicesIdUpdatePostBodyNormalizer.php +++ b/src/Normalizer/ServicesIdUpdatePostBodyNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,97 +16,144 @@ class ServicesIdUpdatePostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ServicesIdUpdatePostBody'; + return \Docker\API\Model\ServicesIdUpdatePostBody::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ServicesIdUpdatePostBody; + return \is_object($data) && \Docker\API\Model\ServicesIdUpdatePostBody::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ServicesIdUpdatePostBody(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); - } - if (property_exists($data, 'TaskTemplate') && $data->{'TaskTemplate'} !== null) { - $object->setTaskTemplate($this->denormalizer->denormalize($data->{'TaskTemplate'}, 'Docker\\API\\Model\\TaskSpec', 'json', $context)); - } - if (property_exists($data, 'Mode') && $data->{'Mode'} !== null) { - $object->setMode($this->denormalizer->denormalize($data->{'Mode'}, 'Docker\\API\\Model\\ServiceSpecMode', 'json', $context)); - } - if (property_exists($data, 'UpdateConfig') && $data->{'UpdateConfig'} !== null) { - $object->setUpdateConfig($this->denormalizer->denormalize($data->{'UpdateConfig'}, 'Docker\\API\\Model\\ServiceSpecUpdateConfig', 'json', $context)); - } - if (property_exists($data, 'RollbackConfig') && $data->{'RollbackConfig'} !== null) { - $object->setRollbackConfig($this->denormalizer->denormalize($data->{'RollbackConfig'}, 'Docker\\API\\Model\\ServiceSpecRollbackConfig', 'json', $context)); - } - if (property_exists($data, 'Networks') && $data->{'Networks'} !== null) { + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + if (\array_key_exists('TaskTemplate', $data) && null !== $data['TaskTemplate']) { + $object->setTaskTemplate($this->denormalizer->denormalize($data['TaskTemplate'], \Docker\API\Model\TaskSpec::class, 'json', $context)); + unset($data['TaskTemplate']); + } elseif (\array_key_exists('TaskTemplate', $data) && null === $data['TaskTemplate']) { + $object->setTaskTemplate(null); + } + if (\array_key_exists('Mode', $data) && null !== $data['Mode']) { + $object->setMode($this->denormalizer->denormalize($data['Mode'], \Docker\API\Model\ServiceSpecMode::class, 'json', $context)); + unset($data['Mode']); + } elseif (\array_key_exists('Mode', $data) && null === $data['Mode']) { + $object->setMode(null); + } + if (\array_key_exists('UpdateConfig', $data) && null !== $data['UpdateConfig']) { + $object->setUpdateConfig($this->denormalizer->denormalize($data['UpdateConfig'], \Docker\API\Model\ServiceSpecUpdateConfig::class, 'json', $context)); + unset($data['UpdateConfig']); + } elseif (\array_key_exists('UpdateConfig', $data) && null === $data['UpdateConfig']) { + $object->setUpdateConfig(null); + } + if (\array_key_exists('RollbackConfig', $data) && null !== $data['RollbackConfig']) { + $object->setRollbackConfig($this->denormalizer->denormalize($data['RollbackConfig'], \Docker\API\Model\ServiceSpecRollbackConfig::class, 'json', $context)); + unset($data['RollbackConfig']); + } elseif (\array_key_exists('RollbackConfig', $data) && null === $data['RollbackConfig']) { + $object->setRollbackConfig(null); + } + if (\array_key_exists('Networks', $data) && null !== $data['Networks']) { $values_1 = []; - foreach ($data->{'Networks'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\ServiceSpecNetworksItem', 'json', $context); + foreach ($data['Networks'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\NetworkAttachmentConfig::class, 'json', $context); } $object->setNetworks($values_1); - } - if (property_exists($data, 'EndpointSpec') && $data->{'EndpointSpec'} !== null) { - $object->setEndpointSpec($this->denormalizer->denormalize($data->{'EndpointSpec'}, 'Docker\\API\\Model\\EndpointSpec', 'json', $context)); + unset($data['Networks']); + } elseif (\array_key_exists('Networks', $data) && null === $data['Networks']) { + $object->setNetworks(null); + } + if (\array_key_exists('EndpointSpec', $data) && null !== $data['EndpointSpec']) { + $object->setEndpointSpec($this->denormalizer->denormalize($data['EndpointSpec'], \Docker\API\Model\EndpointSpec::class, 'json', $context)); + unset($data['EndpointSpec']); + } elseif (\array_key_exists('EndpointSpec', $data) && null === $data['EndpointSpec']) { + $object->setEndpointSpec(null); + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getLabels()) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); + } + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values = []; + foreach ($data->getLabels() as $key => $value) { + $values[$key] = $value; } - $data->{'Labels'} = $values; + $dataArray['Labels'] = $values; } - if (null !== $object->getTaskTemplate()) { - $data->{'TaskTemplate'} = $this->normalizer->normalize($object->getTaskTemplate(), 'json', $context); + if ($data->isInitialized('taskTemplate') && null !== $data->getTaskTemplate()) { + $dataArray['TaskTemplate'] = $this->normalizer->normalize($data->getTaskTemplate(), 'json', $context); } - if (null !== $object->getMode()) { - $data->{'Mode'} = $this->normalizer->normalize($object->getMode(), 'json', $context); + if ($data->isInitialized('mode') && null !== $data->getMode()) { + $dataArray['Mode'] = $this->normalizer->normalize($data->getMode(), 'json', $context); } - if (null !== $object->getUpdateConfig()) { - $data->{'UpdateConfig'} = $this->normalizer->normalize($object->getUpdateConfig(), 'json', $context); + if ($data->isInitialized('updateConfig') && null !== $data->getUpdateConfig()) { + $dataArray['UpdateConfig'] = $this->normalizer->normalize($data->getUpdateConfig(), 'json', $context); } - if (null !== $object->getRollbackConfig()) { - $data->{'RollbackConfig'} = $this->normalizer->normalize($object->getRollbackConfig(), 'json', $context); + if ($data->isInitialized('rollbackConfig') && null !== $data->getRollbackConfig()) { + $dataArray['RollbackConfig'] = $this->normalizer->normalize($data->getRollbackConfig(), 'json', $context); } - if (null !== $object->getNetworks()) { + if ($data->isInitialized('networks') && null !== $data->getNetworks()) { $values_1 = []; - foreach ($object->getNetworks() as $value_1) { + foreach ($data->getNetworks() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'Networks'} = $values_1; + $dataArray['Networks'] = $values_1; + } + if ($data->isInitialized('endpointSpec') && null !== $data->getEndpointSpec()) { + $dataArray['EndpointSpec'] = $this->normalizer->normalize($data->getEndpointSpec(), 'json', $context); } - if (null !== $object->getEndpointSpec()) { - $data->{'EndpointSpec'} = $this->normalizer->normalize($object->getEndpointSpec(), 'json', $context); + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_2; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ServicesIdUpdatePostBody::class => false]; } } diff --git a/src/Normalizer/SwarmInfoNormalizer.php b/src/Normalizer/SwarmInfoNormalizer.php index bfe4799d..b91bb223 100644 --- a/src/Normalizer/SwarmInfoNormalizer.php +++ b/src/Normalizer/SwarmInfoNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,95 +16,148 @@ class SwarmInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\SwarmInfo'; + return \Docker\API\Model\SwarmInfo::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\SwarmInfo; + return \is_object($data) && \Docker\API\Model\SwarmInfo::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\SwarmInfo(); - if (property_exists($data, 'NodeID') && $data->{'NodeID'} !== null) { - $object->setNodeID($data->{'NodeID'}); - } - if (property_exists($data, 'NodeAddr') && $data->{'NodeAddr'} !== null) { - $object->setNodeAddr($data->{'NodeAddr'}); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'LocalNodeState') && $data->{'LocalNodeState'} !== null) { - $object->setLocalNodeState($data->{'LocalNodeState'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'ControlAvailable') && $data->{'ControlAvailable'} !== null) { - $object->setControlAvailable($data->{'ControlAvailable'}); - } - if (property_exists($data, 'Error') && $data->{'Error'} !== null) { - $object->setError($data->{'Error'}); - } - if (property_exists($data, 'RemoteManagers') && $data->{'RemoteManagers'} !== null) { + $object = new \Docker\API\Model\SwarmInfo(); + if (\array_key_exists('ControlAvailable', $data) && \is_int($data['ControlAvailable'])) { + $data['ControlAvailable'] = (bool) $data['ControlAvailable']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NodeID', $data) && null !== $data['NodeID']) { + $object->setNodeID($data['NodeID']); + unset($data['NodeID']); + } elseif (\array_key_exists('NodeID', $data) && null === $data['NodeID']) { + $object->setNodeID(null); + } + if (\array_key_exists('NodeAddr', $data) && null !== $data['NodeAddr']) { + $object->setNodeAddr($data['NodeAddr']); + unset($data['NodeAddr']); + } elseif (\array_key_exists('NodeAddr', $data) && null === $data['NodeAddr']) { + $object->setNodeAddr(null); + } + if (\array_key_exists('LocalNodeState', $data) && null !== $data['LocalNodeState']) { + $object->setLocalNodeState($data['LocalNodeState']); + unset($data['LocalNodeState']); + } elseif (\array_key_exists('LocalNodeState', $data) && null === $data['LocalNodeState']) { + $object->setLocalNodeState(null); + } + if (\array_key_exists('ControlAvailable', $data) && null !== $data['ControlAvailable']) { + $object->setControlAvailable($data['ControlAvailable']); + unset($data['ControlAvailable']); + } elseif (\array_key_exists('ControlAvailable', $data) && null === $data['ControlAvailable']) { + $object->setControlAvailable(null); + } + if (\array_key_exists('Error', $data) && null !== $data['Error']) { + $object->setError($data['Error']); + unset($data['Error']); + } elseif (\array_key_exists('Error', $data) && null === $data['Error']) { + $object->setError(null); + } + if (\array_key_exists('RemoteManagers', $data) && null !== $data['RemoteManagers']) { $values = []; - foreach ($data->{'RemoteManagers'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\PeerNode', 'json', $context); + foreach ($data['RemoteManagers'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\PeerNode::class, 'json', $context); } $object->setRemoteManagers($values); - } - if (property_exists($data, 'Nodes') && $data->{'Nodes'} !== null) { - $object->setNodes($data->{'Nodes'}); - } - if (property_exists($data, 'Managers') && $data->{'Managers'} !== null) { - $object->setManagers($data->{'Managers'}); - } - if (property_exists($data, 'Cluster') && $data->{'Cluster'} !== null) { - $object->setCluster($this->denormalizer->denormalize($data->{'Cluster'}, 'Docker\\API\\Model\\ClusterInfo', 'json', $context)); + unset($data['RemoteManagers']); + } elseif (\array_key_exists('RemoteManagers', $data) && null === $data['RemoteManagers']) { + $object->setRemoteManagers(null); + } + if (\array_key_exists('Nodes', $data) && null !== $data['Nodes']) { + $object->setNodes($data['Nodes']); + unset($data['Nodes']); + } elseif (\array_key_exists('Nodes', $data) && null === $data['Nodes']) { + $object->setNodes(null); + } + if (\array_key_exists('Managers', $data) && null !== $data['Managers']) { + $object->setManagers($data['Managers']); + unset($data['Managers']); + } elseif (\array_key_exists('Managers', $data) && null === $data['Managers']) { + $object->setManagers(null); + } + if (\array_key_exists('Cluster', $data) && null !== $data['Cluster']) { + $object->setCluster($this->denormalizer->denormalize($data['Cluster'], \Docker\API\Model\ClusterInfo::class, 'json', $context)); + unset($data['Cluster']); + } elseif (\array_key_exists('Cluster', $data) && null === $data['Cluster']) { + $object->setCluster(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getNodeID()) { - $data->{'NodeID'} = $object->getNodeID(); + $dataArray = []; + if ($data->isInitialized('nodeID') && null !== $data->getNodeID()) { + $dataArray['NodeID'] = $data->getNodeID(); } - if (null !== $object->getNodeAddr()) { - $data->{'NodeAddr'} = $object->getNodeAddr(); + if ($data->isInitialized('nodeAddr') && null !== $data->getNodeAddr()) { + $dataArray['NodeAddr'] = $data->getNodeAddr(); } - if (null !== $object->getLocalNodeState()) { - $data->{'LocalNodeState'} = $object->getLocalNodeState(); + if ($data->isInitialized('localNodeState') && null !== $data->getLocalNodeState()) { + $dataArray['LocalNodeState'] = $data->getLocalNodeState(); } - if (null !== $object->getControlAvailable()) { - $data->{'ControlAvailable'} = $object->getControlAvailable(); + if ($data->isInitialized('controlAvailable') && null !== $data->getControlAvailable()) { + $dataArray['ControlAvailable'] = $data->getControlAvailable(); } - if (null !== $object->getError()) { - $data->{'Error'} = $object->getError(); + if ($data->isInitialized('error') && null !== $data->getError()) { + $dataArray['Error'] = $data->getError(); } - if (null !== $object->getRemoteManagers()) { + if ($data->isInitialized('remoteManagers') && null !== $data->getRemoteManagers()) { $values = []; - foreach ($object->getRemoteManagers() as $value) { + foreach ($data->getRemoteManagers() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'RemoteManagers'} = $values; + $dataArray['RemoteManagers'] = $values; + } + if ($data->isInitialized('nodes') && null !== $data->getNodes()) { + $dataArray['Nodes'] = $data->getNodes(); } - if (null !== $object->getNodes()) { - $data->{'Nodes'} = $object->getNodes(); + if ($data->isInitialized('managers') && null !== $data->getManagers()) { + $dataArray['Managers'] = $data->getManagers(); } - if (null !== $object->getManagers()) { - $data->{'Managers'} = $object->getManagers(); + if ($data->isInitialized('cluster') && null !== $data->getCluster()) { + $dataArray['Cluster'] = $this->normalizer->normalize($data->getCluster(), 'json', $context); } - if (null !== $object->getCluster()) { - $data->{'Cluster'} = $this->normalizer->normalize($object->getCluster(), 'json', $context); + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmInfo::class => false]; } } diff --git a/src/Normalizer/SwarmInitPostBodyNormalizer.php b/src/Normalizer/SwarmInitPostBodyNormalizer.php index 5505a2fc..e98b5b72 100644 --- a/src/Normalizer/SwarmInitPostBodyNormalizer.php +++ b/src/Normalizer/SwarmInitPostBodyNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,63 +16,139 @@ class SwarmInitPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\SwarmInitPostBody'; + return \Docker\API\Model\SwarmInitPostBody::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\SwarmInitPostBody; + return \is_object($data) && \Docker\API\Model\SwarmInitPostBody::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\SwarmInitPostBody(); - if (property_exists($data, 'ListenAddr') && $data->{'ListenAddr'} !== null) { - $object->setListenAddr($data->{'ListenAddr'}); + if (\array_key_exists('ForceNewCluster', $data) && \is_int($data['ForceNewCluster'])) { + $data['ForceNewCluster'] = (bool) $data['ForceNewCluster']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ListenAddr', $data) && null !== $data['ListenAddr']) { + $object->setListenAddr($data['ListenAddr']); + unset($data['ListenAddr']); + } elseif (\array_key_exists('ListenAddr', $data) && null === $data['ListenAddr']) { + $object->setListenAddr(null); + } + if (\array_key_exists('AdvertiseAddr', $data) && null !== $data['AdvertiseAddr']) { + $object->setAdvertiseAddr($data['AdvertiseAddr']); + unset($data['AdvertiseAddr']); + } elseif (\array_key_exists('AdvertiseAddr', $data) && null === $data['AdvertiseAddr']) { + $object->setAdvertiseAddr(null); + } + if (\array_key_exists('DataPathAddr', $data) && null !== $data['DataPathAddr']) { + $object->setDataPathAddr($data['DataPathAddr']); + unset($data['DataPathAddr']); + } elseif (\array_key_exists('DataPathAddr', $data) && null === $data['DataPathAddr']) { + $object->setDataPathAddr(null); + } + if (\array_key_exists('DataPathPort', $data) && null !== $data['DataPathPort']) { + $object->setDataPathPort($data['DataPathPort']); + unset($data['DataPathPort']); + } elseif (\array_key_exists('DataPathPort', $data) && null === $data['DataPathPort']) { + $object->setDataPathPort(null); + } + if (\array_key_exists('DefaultAddrPool', $data) && null !== $data['DefaultAddrPool']) { + $values = []; + foreach ($data['DefaultAddrPool'] as $value) { + $values[] = $value; + } + $object->setDefaultAddrPool($values); + unset($data['DefaultAddrPool']); + } elseif (\array_key_exists('DefaultAddrPool', $data) && null === $data['DefaultAddrPool']) { + $object->setDefaultAddrPool(null); } - if (property_exists($data, 'AdvertiseAddr') && $data->{'AdvertiseAddr'} !== null) { - $object->setAdvertiseAddr($data->{'AdvertiseAddr'}); + if (\array_key_exists('ForceNewCluster', $data) && null !== $data['ForceNewCluster']) { + $object->setForceNewCluster($data['ForceNewCluster']); + unset($data['ForceNewCluster']); + } elseif (\array_key_exists('ForceNewCluster', $data) && null === $data['ForceNewCluster']) { + $object->setForceNewCluster(null); } - if (property_exists($data, 'DataPathAddr') && $data->{'DataPathAddr'} !== null) { - $object->setDataPathAddr($data->{'DataPathAddr'}); + if (\array_key_exists('SubnetSize', $data) && null !== $data['SubnetSize']) { + $object->setSubnetSize($data['SubnetSize']); + unset($data['SubnetSize']); + } elseif (\array_key_exists('SubnetSize', $data) && null === $data['SubnetSize']) { + $object->setSubnetSize(null); } - if (property_exists($data, 'ForceNewCluster') && $data->{'ForceNewCluster'} !== null) { - $object->setForceNewCluster($data->{'ForceNewCluster'}); + if (\array_key_exists('Spec', $data) && null !== $data['Spec']) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\SwarmSpec::class, 'json', $context)); + unset($data['Spec']); + } elseif (\array_key_exists('Spec', $data) && null === $data['Spec']) { + $object->setSpec(null); } - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\SwarmSpec', 'json', $context)); + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getListenAddr()) { - $data->{'ListenAddr'} = $object->getListenAddr(); + $dataArray = []; + if ($data->isInitialized('listenAddr') && null !== $data->getListenAddr()) { + $dataArray['ListenAddr'] = $data->getListenAddr(); } - if (null !== $object->getAdvertiseAddr()) { - $data->{'AdvertiseAddr'} = $object->getAdvertiseAddr(); + if ($data->isInitialized('advertiseAddr') && null !== $data->getAdvertiseAddr()) { + $dataArray['AdvertiseAddr'] = $data->getAdvertiseAddr(); } - if (null !== $object->getDataPathAddr()) { - $data->{'DataPathAddr'} = $object->getDataPathAddr(); + if ($data->isInitialized('dataPathAddr') && null !== $data->getDataPathAddr()) { + $dataArray['DataPathAddr'] = $data->getDataPathAddr(); } - if (null !== $object->getForceNewCluster()) { - $data->{'ForceNewCluster'} = $object->getForceNewCluster(); + if ($data->isInitialized('dataPathPort') && null !== $data->getDataPathPort()) { + $dataArray['DataPathPort'] = $data->getDataPathPort(); } - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + if ($data->isInitialized('defaultAddrPool') && null !== $data->getDefaultAddrPool()) { + $values = []; + foreach ($data->getDefaultAddrPool() as $value) { + $values[] = $value; + } + $dataArray['DefaultAddrPool'] = $values; + } + if ($data->isInitialized('forceNewCluster') && null !== $data->getForceNewCluster()) { + $dataArray['ForceNewCluster'] = $data->getForceNewCluster(); + } + if ($data->isInitialized('subnetSize') && null !== $data->getSubnetSize()) { + $dataArray['SubnetSize'] = $data->getSubnetSize(); + } + if ($data->isInitialized('spec') && null !== $data->getSpec()) { + $dataArray['Spec'] = $this->normalizer->normalize($data->getSpec(), 'json', $context); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmInitPostBody::class => false]; } } diff --git a/src/Normalizer/SwarmJoinPostBodyNormalizer.php b/src/Normalizer/SwarmJoinPostBodyNormalizer.php index 10230b0f..f41f5b08 100644 --- a/src/Normalizer/SwarmJoinPostBodyNormalizer.php +++ b/src/Normalizer/SwarmJoinPostBodyNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,63 +16,109 @@ class SwarmJoinPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\SwarmJoinPostBody'; + return \Docker\API\Model\SwarmJoinPostBody::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\SwarmJoinPostBody; + return \is_object($data) && \Docker\API\Model\SwarmJoinPostBody::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\SwarmJoinPostBody(); - if (property_exists($data, 'ListenAddr') && $data->{'ListenAddr'} !== null) { - $object->setListenAddr($data->{'ListenAddr'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ListenAddr', $data) && null !== $data['ListenAddr']) { + $object->setListenAddr($data['ListenAddr']); + unset($data['ListenAddr']); + } elseif (\array_key_exists('ListenAddr', $data) && null === $data['ListenAddr']) { + $object->setListenAddr(null); + } + if (\array_key_exists('AdvertiseAddr', $data) && null !== $data['AdvertiseAddr']) { + $object->setAdvertiseAddr($data['AdvertiseAddr']); + unset($data['AdvertiseAddr']); + } elseif (\array_key_exists('AdvertiseAddr', $data) && null === $data['AdvertiseAddr']) { + $object->setAdvertiseAddr(null); } - if (property_exists($data, 'AdvertiseAddr') && $data->{'AdvertiseAddr'} !== null) { - $object->setAdvertiseAddr($data->{'AdvertiseAddr'}); + if (\array_key_exists('DataPathAddr', $data) && null !== $data['DataPathAddr']) { + $object->setDataPathAddr($data['DataPathAddr']); + unset($data['DataPathAddr']); + } elseif (\array_key_exists('DataPathAddr', $data) && null === $data['DataPathAddr']) { + $object->setDataPathAddr(null); } - if (property_exists($data, 'DataPathAddr') && $data->{'DataPathAddr'} !== null) { - $object->setDataPathAddr($data->{'DataPathAddr'}); + if (\array_key_exists('RemoteAddrs', $data) && null !== $data['RemoteAddrs']) { + $values = []; + foreach ($data['RemoteAddrs'] as $value) { + $values[] = $value; + } + $object->setRemoteAddrs($values); + unset($data['RemoteAddrs']); + } elseif (\array_key_exists('RemoteAddrs', $data) && null === $data['RemoteAddrs']) { + $object->setRemoteAddrs(null); } - if (property_exists($data, 'RemoteAddrs') && $data->{'RemoteAddrs'} !== null) { - $object->setRemoteAddrs($data->{'RemoteAddrs'}); + if (\array_key_exists('JoinToken', $data) && null !== $data['JoinToken']) { + $object->setJoinToken($data['JoinToken']); + unset($data['JoinToken']); + } elseif (\array_key_exists('JoinToken', $data) && null === $data['JoinToken']) { + $object->setJoinToken(null); } - if (property_exists($data, 'JoinToken') && $data->{'JoinToken'} !== null) { - $object->setJoinToken($data->{'JoinToken'}); + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getListenAddr()) { - $data->{'ListenAddr'} = $object->getListenAddr(); + $dataArray = []; + if ($data->isInitialized('listenAddr') && null !== $data->getListenAddr()) { + $dataArray['ListenAddr'] = $data->getListenAddr(); } - if (null !== $object->getAdvertiseAddr()) { - $data->{'AdvertiseAddr'} = $object->getAdvertiseAddr(); + if ($data->isInitialized('advertiseAddr') && null !== $data->getAdvertiseAddr()) { + $dataArray['AdvertiseAddr'] = $data->getAdvertiseAddr(); } - if (null !== $object->getDataPathAddr()) { - $data->{'DataPathAddr'} = $object->getDataPathAddr(); + if ($data->isInitialized('dataPathAddr') && null !== $data->getDataPathAddr()) { + $dataArray['DataPathAddr'] = $data->getDataPathAddr(); } - if (null !== $object->getRemoteAddrs()) { - $data->{'RemoteAddrs'} = $object->getRemoteAddrs(); + if ($data->isInitialized('remoteAddrs') && null !== $data->getRemoteAddrs()) { + $values = []; + foreach ($data->getRemoteAddrs() as $value) { + $values[] = $value; + } + $dataArray['RemoteAddrs'] = $values; } - if (null !== $object->getJoinToken()) { - $data->{'JoinToken'} = $object->getJoinToken(); + if ($data->isInitialized('joinToken') && null !== $data->getJoinToken()) { + $dataArray['JoinToken'] = $data->getJoinToken(); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmJoinPostBody::class => false]; } } diff --git a/src/Normalizer/SwarmNormalizer.php b/src/Normalizer/SwarmNormalizer.php index eae64ffa..1c4f71d4 100644 --- a/src/Normalizer/SwarmNormalizer.php +++ b/src/Normalizer/SwarmNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,81 +16,166 @@ class SwarmNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Swarm'; + return \Docker\API\Model\Swarm::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Swarm; + return \is_object($data) && \Docker\API\Model\Swarm::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\Swarm(); - if (property_exists($data, 'ID') && $data->{'ID'} !== null) { - $object->setID($data->{'ID'}); - } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($this->denormalizer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); - } - if (property_exists($data, 'CreatedAt') && $data->{'CreatedAt'} !== null) { - $object->setCreatedAt($data->{'CreatedAt'}); - } - if (property_exists($data, 'UpdatedAt') && $data->{'UpdatedAt'} !== null) { - $object->setUpdatedAt($data->{'UpdatedAt'}); - } - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\SwarmSpec', 'json', $context)); - } - if (property_exists($data, 'TLSInfo') && $data->{'TLSInfo'} !== null) { - $object->setTLSInfo($this->denormalizer->denormalize($data->{'TLSInfo'}, 'Docker\\API\\Model\\TLSInfo', 'json', $context)); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'RootRotationInProgress') && $data->{'RootRotationInProgress'} !== null) { - $object->setRootRotationInProgress($data->{'RootRotationInProgress'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'JoinTokens') && $data->{'JoinTokens'} !== null) { - $object->setJoinTokens($this->denormalizer->denormalize($data->{'JoinTokens'}, 'Docker\\API\\Model\\JoinTokens', 'json', $context)); + $object = new \Docker\API\Model\Swarm(); + if (\array_key_exists('RootRotationInProgress', $data) && \is_int($data['RootRotationInProgress'])) { + $data['RootRotationInProgress'] = (bool) $data['RootRotationInProgress']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && null !== $data['ID']) { + $object->setID($data['ID']); + unset($data['ID']); + } elseif (\array_key_exists('ID', $data) && null === $data['ID']) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && null !== $data['Version']) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + unset($data['Version']); + } elseif (\array_key_exists('Version', $data) && null === $data['Version']) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && null !== $data['CreatedAt']) { + $object->setCreatedAt($data['CreatedAt']); + unset($data['CreatedAt']); + } elseif (\array_key_exists('CreatedAt', $data) && null === $data['CreatedAt']) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && null !== $data['UpdatedAt']) { + $object->setUpdatedAt($data['UpdatedAt']); + unset($data['UpdatedAt']); + } elseif (\array_key_exists('UpdatedAt', $data) && null === $data['UpdatedAt']) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Spec', $data) && null !== $data['Spec']) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\SwarmSpec::class, 'json', $context)); + unset($data['Spec']); + } elseif (\array_key_exists('Spec', $data) && null === $data['Spec']) { + $object->setSpec(null); + } + if (\array_key_exists('TLSInfo', $data) && null !== $data['TLSInfo']) { + $object->setTLSInfo($this->denormalizer->denormalize($data['TLSInfo'], \Docker\API\Model\TLSInfo::class, 'json', $context)); + unset($data['TLSInfo']); + } elseif (\array_key_exists('TLSInfo', $data) && null === $data['TLSInfo']) { + $object->setTLSInfo(null); + } + if (\array_key_exists('RootRotationInProgress', $data) && null !== $data['RootRotationInProgress']) { + $object->setRootRotationInProgress($data['RootRotationInProgress']); + unset($data['RootRotationInProgress']); + } elseif (\array_key_exists('RootRotationInProgress', $data) && null === $data['RootRotationInProgress']) { + $object->setRootRotationInProgress(null); + } + if (\array_key_exists('DataPathPort', $data) && null !== $data['DataPathPort']) { + $object->setDataPathPort($data['DataPathPort']); + unset($data['DataPathPort']); + } elseif (\array_key_exists('DataPathPort', $data) && null === $data['DataPathPort']) { + $object->setDataPathPort(null); + } + if (\array_key_exists('DefaultAddrPool', $data) && null !== $data['DefaultAddrPool']) { + $values = []; + foreach ($data['DefaultAddrPool'] as $value) { + $values[] = $value; + } + $object->setDefaultAddrPool($values); + unset($data['DefaultAddrPool']); + } elseif (\array_key_exists('DefaultAddrPool', $data) && null === $data['DefaultAddrPool']) { + $object->setDefaultAddrPool(null); + } + if (\array_key_exists('SubnetSize', $data) && null !== $data['SubnetSize']) { + $object->setSubnetSize($data['SubnetSize']); + unset($data['SubnetSize']); + } elseif (\array_key_exists('SubnetSize', $data) && null === $data['SubnetSize']) { + $object->setSubnetSize(null); + } + if (\array_key_exists('JoinTokens', $data) && null !== $data['JoinTokens']) { + $object->setJoinTokens($this->denormalizer->denormalize($data['JoinTokens'], \Docker\API\Model\JoinTokens::class, 'json', $context)); + unset($data['JoinTokens']); + } elseif (\array_key_exists('JoinTokens', $data) && null === $data['JoinTokens']) { + $object->setJoinTokens(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $dataArray = []; + if ($data->isInitialized('iD') && null !== $data->getID()) { + $dataArray['ID'] = $data->getID(); + } + if ($data->isInitialized('version') && null !== $data->getVersion()) { + $dataArray['Version'] = $this->normalizer->normalize($data->getVersion(), 'json', $context); + } + if ($data->isInitialized('createdAt') && null !== $data->getCreatedAt()) { + $dataArray['CreatedAt'] = $data->getCreatedAt(); + } + if ($data->isInitialized('updatedAt') && null !== $data->getUpdatedAt()) { + $dataArray['UpdatedAt'] = $data->getUpdatedAt(); } - if (null !== $object->getVersion()) { - $data->{'Version'} = $this->normalizer->normalize($object->getVersion(), 'json', $context); + if ($data->isInitialized('spec') && null !== $data->getSpec()) { + $dataArray['Spec'] = $this->normalizer->normalize($data->getSpec(), 'json', $context); } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt(); + if ($data->isInitialized('tLSInfo') && null !== $data->getTLSInfo()) { + $dataArray['TLSInfo'] = $this->normalizer->normalize($data->getTLSInfo(), 'json', $context); } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt(); + if ($data->isInitialized('rootRotationInProgress') && null !== $data->getRootRotationInProgress()) { + $dataArray['RootRotationInProgress'] = $data->getRootRotationInProgress(); } - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + if ($data->isInitialized('dataPathPort') && null !== $data->getDataPathPort()) { + $dataArray['DataPathPort'] = $data->getDataPathPort(); } - if (null !== $object->getTLSInfo()) { - $data->{'TLSInfo'} = $this->normalizer->normalize($object->getTLSInfo(), 'json', $context); + if ($data->isInitialized('defaultAddrPool') && null !== $data->getDefaultAddrPool()) { + $values = []; + foreach ($data->getDefaultAddrPool() as $value) { + $values[] = $value; + } + $dataArray['DefaultAddrPool'] = $values; } - if (null !== $object->getRootRotationInProgress()) { - $data->{'RootRotationInProgress'} = $object->getRootRotationInProgress(); + if ($data->isInitialized('subnetSize') && null !== $data->getSubnetSize()) { + $dataArray['SubnetSize'] = $data->getSubnetSize(); } - if (null !== $object->getJoinTokens()) { - $data->{'JoinTokens'} = $this->normalizer->normalize($object->getJoinTokens(), 'json', $context); + if ($data->isInitialized('joinTokens') && null !== $data->getJoinTokens()) { + $dataArray['JoinTokens'] = $this->normalizer->normalize($data->getJoinTokens(), 'json', $context); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Swarm::class => false]; } } diff --git a/src/Normalizer/SwarmSpecCAConfigExternalCAsItemNormalizer.php b/src/Normalizer/SwarmSpecCAConfigExternalCAsItemNormalizer.php index dc14013d..16962faa 100644 --- a/src/Normalizer/SwarmSpecCAConfigExternalCAsItemNormalizer.php +++ b/src/Normalizer/SwarmSpecCAConfigExternalCAsItemNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,65 +16,100 @@ class SwarmSpecCAConfigExternalCAsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\SwarmSpecCAConfigExternalCAsItem'; + return \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem; + return \is_object($data) && \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem(); - if (property_exists($data, 'Protocol') && $data->{'Protocol'} !== null) { - $object->setProtocol($data->{'Protocol'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Protocol', $data) && null !== $data['Protocol']) { + $object->setProtocol($data['Protocol']); + unset($data['Protocol']); + } elseif (\array_key_exists('Protocol', $data) && null === $data['Protocol']) { + $object->setProtocol(null); } - if (property_exists($data, 'URL') && $data->{'URL'} !== null) { - $object->setURL($data->{'URL'}); + if (\array_key_exists('URL', $data) && null !== $data['URL']) { + $object->setURL($data['URL']); + unset($data['URL']); + } elseif (\array_key_exists('URL', $data) && null === $data['URL']) { + $object->setURL(null); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { + if (\array_key_exists('Options', $data) && null !== $data['Options']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key => $value) { + foreach ($data['Options'] as $key => $value) { $values[$key] = $value; } $object->setOptions($values); + unset($data['Options']); + } elseif (\array_key_exists('Options', $data) && null === $data['Options']) { + $object->setOptions(null); } - if (property_exists($data, 'CACert') && $data->{'CACert'} !== null) { - $object->setCACert($data->{'CACert'}); + if (\array_key_exists('CACert', $data) && null !== $data['CACert']) { + $object->setCACert($data['CACert']); + unset($data['CACert']); + } elseif (\array_key_exists('CACert', $data) && null === $data['CACert']) { + $object->setCACert(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getProtocol()) { - $data->{'Protocol'} = $object->getProtocol(); + $dataArray = []; + if ($data->isInitialized('protocol') && null !== $data->getProtocol()) { + $dataArray['Protocol'] = $data->getProtocol(); } - if (null !== $object->getURL()) { - $data->{'URL'} = $object->getURL(); + if ($data->isInitialized('uRL') && null !== $data->getURL()) { + $dataArray['URL'] = $data->getURL(); } - if (null !== $object->getOptions()) { - $values = new \stdClass(); - foreach ($object->getOptions() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('options') && null !== $data->getOptions()) { + $values = []; + foreach ($data->getOptions() as $key => $value) { + $values[$key] = $value; } - $data->{'Options'} = $values; + $dataArray['Options'] = $values; } - if (null !== $object->getCACert()) { - $data->{'CACert'} = $object->getCACert(); + if ($data->isInitialized('cACert') && null !== $data->getCACert()) { + $dataArray['CACert'] = $data->getCACert(); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class => false]; } } diff --git a/src/Normalizer/SwarmSpecCAConfigNormalizer.php b/src/Normalizer/SwarmSpecCAConfigNormalizer.php index ade294b1..6e3d1c61 100644 --- a/src/Normalizer/SwarmSpecCAConfigNormalizer.php +++ b/src/Normalizer/SwarmSpecCAConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,71 +16,109 @@ class SwarmSpecCAConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\SwarmSpecCAConfig'; + return \Docker\API\Model\SwarmSpecCAConfig::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\SwarmSpecCAConfig; + return \is_object($data) && \Docker\API\Model\SwarmSpecCAConfig::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\SwarmSpecCAConfig(); - if (property_exists($data, 'NodeCertExpiry') && $data->{'NodeCertExpiry'} !== null) { - $object->setNodeCertExpiry($data->{'NodeCertExpiry'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('NodeCertExpiry', $data) && null !== $data['NodeCertExpiry']) { + $object->setNodeCertExpiry($data['NodeCertExpiry']); + unset($data['NodeCertExpiry']); + } elseif (\array_key_exists('NodeCertExpiry', $data) && null === $data['NodeCertExpiry']) { + $object->setNodeCertExpiry(null); } - if (property_exists($data, 'ExternalCAs') && $data->{'ExternalCAs'} !== null) { + if (\array_key_exists('ExternalCAs', $data) && null !== $data['ExternalCAs']) { $values = []; - foreach ($data->{'ExternalCAs'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\SwarmSpecCAConfigExternalCAsItem', 'json', $context); + foreach ($data['ExternalCAs'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\SwarmSpecCAConfigExternalCAsItem::class, 'json', $context); } $object->setExternalCAs($values); + unset($data['ExternalCAs']); + } elseif (\array_key_exists('ExternalCAs', $data) && null === $data['ExternalCAs']) { + $object->setExternalCAs(null); } - if (property_exists($data, 'SigningCACert') && $data->{'SigningCACert'} !== null) { - $object->setSigningCACert($data->{'SigningCACert'}); + if (\array_key_exists('SigningCACert', $data) && null !== $data['SigningCACert']) { + $object->setSigningCACert($data['SigningCACert']); + unset($data['SigningCACert']); + } elseif (\array_key_exists('SigningCACert', $data) && null === $data['SigningCACert']) { + $object->setSigningCACert(null); } - if (property_exists($data, 'SigningCAKey') && $data->{'SigningCAKey'} !== null) { - $object->setSigningCAKey($data->{'SigningCAKey'}); + if (\array_key_exists('SigningCAKey', $data) && null !== $data['SigningCAKey']) { + $object->setSigningCAKey($data['SigningCAKey']); + unset($data['SigningCAKey']); + } elseif (\array_key_exists('SigningCAKey', $data) && null === $data['SigningCAKey']) { + $object->setSigningCAKey(null); } - if (property_exists($data, 'ForceRotate') && $data->{'ForceRotate'} !== null) { - $object->setForceRotate($data->{'ForceRotate'}); + if (\array_key_exists('ForceRotate', $data) && null !== $data['ForceRotate']) { + $object->setForceRotate($data['ForceRotate']); + unset($data['ForceRotate']); + } elseif (\array_key_exists('ForceRotate', $data) && null === $data['ForceRotate']) { + $object->setForceRotate(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getNodeCertExpiry()) { - $data->{'NodeCertExpiry'} = $object->getNodeCertExpiry(); + $dataArray = []; + if ($data->isInitialized('nodeCertExpiry') && null !== $data->getNodeCertExpiry()) { + $dataArray['NodeCertExpiry'] = $data->getNodeCertExpiry(); } - if (null !== $object->getExternalCAs()) { + if ($data->isInitialized('externalCAs') && null !== $data->getExternalCAs()) { $values = []; - foreach ($object->getExternalCAs() as $value) { + foreach ($data->getExternalCAs() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'ExternalCAs'} = $values; + $dataArray['ExternalCAs'] = $values; } - if (null !== $object->getSigningCACert()) { - $data->{'SigningCACert'} = $object->getSigningCACert(); + if ($data->isInitialized('signingCACert') && null !== $data->getSigningCACert()) { + $dataArray['SigningCACert'] = $data->getSigningCACert(); } - if (null !== $object->getSigningCAKey()) { - $data->{'SigningCAKey'} = $object->getSigningCAKey(); + if ($data->isInitialized('signingCAKey') && null !== $data->getSigningCAKey()) { + $dataArray['SigningCAKey'] = $data->getSigningCAKey(); } - if (null !== $object->getForceRotate()) { - $data->{'ForceRotate'} = $object->getForceRotate(); + if ($data->isInitialized('forceRotate') && null !== $data->getForceRotate()) { + $dataArray['ForceRotate'] = $data->getForceRotate(); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecCAConfig::class => false]; } } diff --git a/src/Normalizer/SwarmSpecDispatcherNormalizer.php b/src/Normalizer/SwarmSpecDispatcherNormalizer.php index dd3d325d..4f86d371 100644 --- a/src/Normalizer/SwarmSpecDispatcherNormalizer.php +++ b/src/Normalizer/SwarmSpecDispatcherNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,39 +16,65 @@ class SwarmSpecDispatcherNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\SwarmSpecDispatcher'; + return \Docker\API\Model\SwarmSpecDispatcher::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\SwarmSpecDispatcher; + return \is_object($data) && \Docker\API\Model\SwarmSpecDispatcher::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\SwarmSpecDispatcher(); - if (property_exists($data, 'HeartbeatPeriod') && $data->{'HeartbeatPeriod'} !== null) { - $object->setHeartbeatPeriod($data->{'HeartbeatPeriod'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('HeartbeatPeriod', $data) && null !== $data['HeartbeatPeriod']) { + $object->setHeartbeatPeriod($data['HeartbeatPeriod']); + unset($data['HeartbeatPeriod']); + } elseif (\array_key_exists('HeartbeatPeriod', $data) && null === $data['HeartbeatPeriod']) { + $object->setHeartbeatPeriod(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getHeartbeatPeriod()) { - $data->{'HeartbeatPeriod'} = $object->getHeartbeatPeriod(); + $dataArray = []; + if ($data->isInitialized('heartbeatPeriod') && null !== $data->getHeartbeatPeriod()) { + $dataArray['HeartbeatPeriod'] = $data->getHeartbeatPeriod(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecDispatcher::class => false]; } } diff --git a/src/Normalizer/SwarmSpecEncryptionConfigNormalizer.php b/src/Normalizer/SwarmSpecEncryptionConfigNormalizer.php index f5139cf6..fa328d35 100644 --- a/src/Normalizer/SwarmSpecEncryptionConfigNormalizer.php +++ b/src/Normalizer/SwarmSpecEncryptionConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,39 +16,68 @@ class SwarmSpecEncryptionConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\SwarmSpecEncryptionConfig'; + return \Docker\API\Model\SwarmSpecEncryptionConfig::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\SwarmSpecEncryptionConfig; + return \is_object($data) && \Docker\API\Model\SwarmSpecEncryptionConfig::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\SwarmSpecEncryptionConfig(); - if (property_exists($data, 'AutoLockManagers') && $data->{'AutoLockManagers'} !== null) { - $object->setAutoLockManagers($data->{'AutoLockManagers'}); + if (\array_key_exists('AutoLockManagers', $data) && \is_int($data['AutoLockManagers'])) { + $data['AutoLockManagers'] = (bool) $data['AutoLockManagers']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('AutoLockManagers', $data) && null !== $data['AutoLockManagers']) { + $object->setAutoLockManagers($data['AutoLockManagers']); + unset($data['AutoLockManagers']); + } elseif (\array_key_exists('AutoLockManagers', $data) && null === $data['AutoLockManagers']) { + $object->setAutoLockManagers(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getAutoLockManagers()) { - $data->{'AutoLockManagers'} = $object->getAutoLockManagers(); + $dataArray = []; + if ($data->isInitialized('autoLockManagers') && null !== $data->getAutoLockManagers()) { + $dataArray['AutoLockManagers'] = $data->getAutoLockManagers(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecEncryptionConfig::class => false]; } } diff --git a/src/Normalizer/SwarmSpecNormalizer.php b/src/Normalizer/SwarmSpecNormalizer.php index 351c967d..ed2fa973 100644 --- a/src/Normalizer/SwarmSpecNormalizer.php +++ b/src/Normalizer/SwarmSpecNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,89 +16,136 @@ class SwarmSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\SwarmSpec'; + return \Docker\API\Model\SwarmSpec::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\SwarmSpec; + return \is_object($data) && \Docker\API\Model\SwarmSpec::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\SwarmSpec(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); - } - if (property_exists($data, 'Orchestration') && $data->{'Orchestration'} !== null) { - $object->setOrchestration($this->denormalizer->denormalize($data->{'Orchestration'}, 'Docker\\API\\Model\\SwarmSpecOrchestration', 'json', $context)); - } - if (property_exists($data, 'Raft') && $data->{'Raft'} !== null) { - $object->setRaft($this->denormalizer->denormalize($data->{'Raft'}, 'Docker\\API\\Model\\SwarmSpecRaft', 'json', $context)); - } - if (property_exists($data, 'Dispatcher') && $data->{'Dispatcher'} !== null) { - $object->setDispatcher($this->denormalizer->denormalize($data->{'Dispatcher'}, 'Docker\\API\\Model\\SwarmSpecDispatcher', 'json', $context)); - } - if (property_exists($data, 'CAConfig') && $data->{'CAConfig'} !== null) { - $object->setCAConfig($this->denormalizer->denormalize($data->{'CAConfig'}, 'Docker\\API\\Model\\SwarmSpecCAConfig', 'json', $context)); - } - if (property_exists($data, 'EncryptionConfig') && $data->{'EncryptionConfig'} !== null) { - $object->setEncryptionConfig($this->denormalizer->denormalize($data->{'EncryptionConfig'}, 'Docker\\API\\Model\\SwarmSpecEncryptionConfig', 'json', $context)); - } - if (property_exists($data, 'TaskDefaults') && $data->{'TaskDefaults'} !== null) { - $object->setTaskDefaults($this->denormalizer->denormalize($data->{'TaskDefaults'}, 'Docker\\API\\Model\\SwarmSpecTaskDefaults', 'json', $context)); + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + if (\array_key_exists('Orchestration', $data) && null !== $data['Orchestration']) { + $object->setOrchestration($this->denormalizer->denormalize($data['Orchestration'], \Docker\API\Model\SwarmSpecOrchestration::class, 'json', $context)); + unset($data['Orchestration']); + } elseif (\array_key_exists('Orchestration', $data) && null === $data['Orchestration']) { + $object->setOrchestration(null); + } + if (\array_key_exists('Raft', $data) && null !== $data['Raft']) { + $object->setRaft($this->denormalizer->denormalize($data['Raft'], \Docker\API\Model\SwarmSpecRaft::class, 'json', $context)); + unset($data['Raft']); + } elseif (\array_key_exists('Raft', $data) && null === $data['Raft']) { + $object->setRaft(null); + } + if (\array_key_exists('Dispatcher', $data) && null !== $data['Dispatcher']) { + $object->setDispatcher($this->denormalizer->denormalize($data['Dispatcher'], \Docker\API\Model\SwarmSpecDispatcher::class, 'json', $context)); + unset($data['Dispatcher']); + } elseif (\array_key_exists('Dispatcher', $data) && null === $data['Dispatcher']) { + $object->setDispatcher(null); + } + if (\array_key_exists('CAConfig', $data) && null !== $data['CAConfig']) { + $object->setCAConfig($this->denormalizer->denormalize($data['CAConfig'], \Docker\API\Model\SwarmSpecCAConfig::class, 'json', $context)); + unset($data['CAConfig']); + } elseif (\array_key_exists('CAConfig', $data) && null === $data['CAConfig']) { + $object->setCAConfig(null); + } + if (\array_key_exists('EncryptionConfig', $data) && null !== $data['EncryptionConfig']) { + $object->setEncryptionConfig($this->denormalizer->denormalize($data['EncryptionConfig'], \Docker\API\Model\SwarmSpecEncryptionConfig::class, 'json', $context)); + unset($data['EncryptionConfig']); + } elseif (\array_key_exists('EncryptionConfig', $data) && null === $data['EncryptionConfig']) { + $object->setEncryptionConfig(null); + } + if (\array_key_exists('TaskDefaults', $data) && null !== $data['TaskDefaults']) { + $object->setTaskDefaults($this->denormalizer->denormalize($data['TaskDefaults'], \Docker\API\Model\SwarmSpecTaskDefaults::class, 'json', $context)); + unset($data['TaskDefaults']); + } elseif (\array_key_exists('TaskDefaults', $data) && null === $data['TaskDefaults']) { + $object->setTaskDefaults(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getLabels()) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); + } + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values = []; + foreach ($data->getLabels() as $key => $value) { + $values[$key] = $value; } - $data->{'Labels'} = $values; + $dataArray['Labels'] = $values; + } + if ($data->isInitialized('orchestration') && null !== $data->getOrchestration()) { + $dataArray['Orchestration'] = $this->normalizer->normalize($data->getOrchestration(), 'json', $context); } - if (null !== $object->getOrchestration()) { - $data->{'Orchestration'} = $this->normalizer->normalize($object->getOrchestration(), 'json', $context); + if ($data->isInitialized('raft') && null !== $data->getRaft()) { + $dataArray['Raft'] = $this->normalizer->normalize($data->getRaft(), 'json', $context); } - if (null !== $object->getRaft()) { - $data->{'Raft'} = $this->normalizer->normalize($object->getRaft(), 'json', $context); + if ($data->isInitialized('dispatcher') && null !== $data->getDispatcher()) { + $dataArray['Dispatcher'] = $this->normalizer->normalize($data->getDispatcher(), 'json', $context); } - if (null !== $object->getDispatcher()) { - $data->{'Dispatcher'} = $this->normalizer->normalize($object->getDispatcher(), 'json', $context); + if ($data->isInitialized('cAConfig') && null !== $data->getCAConfig()) { + $dataArray['CAConfig'] = $this->normalizer->normalize($data->getCAConfig(), 'json', $context); } - if (null !== $object->getCAConfig()) { - $data->{'CAConfig'} = $this->normalizer->normalize($object->getCAConfig(), 'json', $context); + if ($data->isInitialized('encryptionConfig') && null !== $data->getEncryptionConfig()) { + $dataArray['EncryptionConfig'] = $this->normalizer->normalize($data->getEncryptionConfig(), 'json', $context); } - if (null !== $object->getEncryptionConfig()) { - $data->{'EncryptionConfig'} = $this->normalizer->normalize($object->getEncryptionConfig(), 'json', $context); + if ($data->isInitialized('taskDefaults') && null !== $data->getTaskDefaults()) { + $dataArray['TaskDefaults'] = $this->normalizer->normalize($data->getTaskDefaults(), 'json', $context); } - if (null !== $object->getTaskDefaults()) { - $data->{'TaskDefaults'} = $this->normalizer->normalize($object->getTaskDefaults(), 'json', $context); + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpec::class => false]; } } diff --git a/src/Normalizer/SwarmSpecOrchestrationNormalizer.php b/src/Normalizer/SwarmSpecOrchestrationNormalizer.php index eefca1fa..b5ed9a55 100644 --- a/src/Normalizer/SwarmSpecOrchestrationNormalizer.php +++ b/src/Normalizer/SwarmSpecOrchestrationNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,39 +16,65 @@ class SwarmSpecOrchestrationNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\SwarmSpecOrchestration'; + return \Docker\API\Model\SwarmSpecOrchestration::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\SwarmSpecOrchestration; + return \is_object($data) && \Docker\API\Model\SwarmSpecOrchestration::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\SwarmSpecOrchestration(); - if (property_exists($data, 'TaskHistoryRetentionLimit') && $data->{'TaskHistoryRetentionLimit'} !== null) { - $object->setTaskHistoryRetentionLimit($data->{'TaskHistoryRetentionLimit'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('TaskHistoryRetentionLimit', $data) && null !== $data['TaskHistoryRetentionLimit']) { + $object->setTaskHistoryRetentionLimit($data['TaskHistoryRetentionLimit']); + unset($data['TaskHistoryRetentionLimit']); + } elseif (\array_key_exists('TaskHistoryRetentionLimit', $data) && null === $data['TaskHistoryRetentionLimit']) { + $object->setTaskHistoryRetentionLimit(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getTaskHistoryRetentionLimit()) { - $data->{'TaskHistoryRetentionLimit'} = $object->getTaskHistoryRetentionLimit(); + $dataArray = []; + if ($data->isInitialized('taskHistoryRetentionLimit') && null !== $data->getTaskHistoryRetentionLimit()) { + $dataArray['TaskHistoryRetentionLimit'] = $data->getTaskHistoryRetentionLimit(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecOrchestration::class => false]; } } diff --git a/src/Normalizer/SwarmSpecRaftNormalizer.php b/src/Normalizer/SwarmSpecRaftNormalizer.php index 7c0ed118..1767569e 100644 --- a/src/Normalizer/SwarmSpecRaftNormalizer.php +++ b/src/Normalizer/SwarmSpecRaftNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,63 +16,101 @@ class SwarmSpecRaftNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\SwarmSpecRaft'; + return \Docker\API\Model\SwarmSpecRaft::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\SwarmSpecRaft; + return \is_object($data) && \Docker\API\Model\SwarmSpecRaft::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\SwarmSpecRaft(); - if (property_exists($data, 'SnapshotInterval') && $data->{'SnapshotInterval'} !== null) { - $object->setSnapshotInterval($data->{'SnapshotInterval'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('SnapshotInterval', $data) && null !== $data['SnapshotInterval']) { + $object->setSnapshotInterval($data['SnapshotInterval']); + unset($data['SnapshotInterval']); + } elseif (\array_key_exists('SnapshotInterval', $data) && null === $data['SnapshotInterval']) { + $object->setSnapshotInterval(null); + } + if (\array_key_exists('KeepOldSnapshots', $data) && null !== $data['KeepOldSnapshots']) { + $object->setKeepOldSnapshots($data['KeepOldSnapshots']); + unset($data['KeepOldSnapshots']); + } elseif (\array_key_exists('KeepOldSnapshots', $data) && null === $data['KeepOldSnapshots']) { + $object->setKeepOldSnapshots(null); } - if (property_exists($data, 'KeepOldSnapshots') && $data->{'KeepOldSnapshots'} !== null) { - $object->setKeepOldSnapshots($data->{'KeepOldSnapshots'}); + if (\array_key_exists('LogEntriesForSlowFollowers', $data) && null !== $data['LogEntriesForSlowFollowers']) { + $object->setLogEntriesForSlowFollowers($data['LogEntriesForSlowFollowers']); + unset($data['LogEntriesForSlowFollowers']); + } elseif (\array_key_exists('LogEntriesForSlowFollowers', $data) && null === $data['LogEntriesForSlowFollowers']) { + $object->setLogEntriesForSlowFollowers(null); } - if (property_exists($data, 'LogEntriesForSlowFollowers') && $data->{'LogEntriesForSlowFollowers'} !== null) { - $object->setLogEntriesForSlowFollowers($data->{'LogEntriesForSlowFollowers'}); + if (\array_key_exists('ElectionTick', $data) && null !== $data['ElectionTick']) { + $object->setElectionTick($data['ElectionTick']); + unset($data['ElectionTick']); + } elseif (\array_key_exists('ElectionTick', $data) && null === $data['ElectionTick']) { + $object->setElectionTick(null); } - if (property_exists($data, 'ElectionTick') && $data->{'ElectionTick'} !== null) { - $object->setElectionTick($data->{'ElectionTick'}); + if (\array_key_exists('HeartbeatTick', $data) && null !== $data['HeartbeatTick']) { + $object->setHeartbeatTick($data['HeartbeatTick']); + unset($data['HeartbeatTick']); + } elseif (\array_key_exists('HeartbeatTick', $data) && null === $data['HeartbeatTick']) { + $object->setHeartbeatTick(null); } - if (property_exists($data, 'HeartbeatTick') && $data->{'HeartbeatTick'} !== null) { - $object->setHeartbeatTick($data->{'HeartbeatTick'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getSnapshotInterval()) { - $data->{'SnapshotInterval'} = $object->getSnapshotInterval(); + $dataArray = []; + if ($data->isInitialized('snapshotInterval') && null !== $data->getSnapshotInterval()) { + $dataArray['SnapshotInterval'] = $data->getSnapshotInterval(); } - if (null !== $object->getKeepOldSnapshots()) { - $data->{'KeepOldSnapshots'} = $object->getKeepOldSnapshots(); + if ($data->isInitialized('keepOldSnapshots') && null !== $data->getKeepOldSnapshots()) { + $dataArray['KeepOldSnapshots'] = $data->getKeepOldSnapshots(); } - if (null !== $object->getLogEntriesForSlowFollowers()) { - $data->{'LogEntriesForSlowFollowers'} = $object->getLogEntriesForSlowFollowers(); + if ($data->isInitialized('logEntriesForSlowFollowers') && null !== $data->getLogEntriesForSlowFollowers()) { + $dataArray['LogEntriesForSlowFollowers'] = $data->getLogEntriesForSlowFollowers(); } - if (null !== $object->getElectionTick()) { - $data->{'ElectionTick'} = $object->getElectionTick(); + if ($data->isInitialized('electionTick') && null !== $data->getElectionTick()) { + $dataArray['ElectionTick'] = $data->getElectionTick(); } - if (null !== $object->getHeartbeatTick()) { - $data->{'HeartbeatTick'} = $object->getHeartbeatTick(); + if ($data->isInitialized('heartbeatTick') && null !== $data->getHeartbeatTick()) { + $dataArray['HeartbeatTick'] = $data->getHeartbeatTick(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecRaft::class => false]; } } diff --git a/src/Normalizer/SwarmSpecTaskDefaultsLogDriverNormalizer.php b/src/Normalizer/SwarmSpecTaskDefaultsLogDriverNormalizer.php index 28a75995..b14d6df3 100644 --- a/src/Normalizer/SwarmSpecTaskDefaultsLogDriverNormalizer.php +++ b/src/Normalizer/SwarmSpecTaskDefaultsLogDriverNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,53 +16,82 @@ class SwarmSpecTaskDefaultsLogDriverNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\SwarmSpecTaskDefaultsLogDriver'; + return \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver; + return \is_object($data) && \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { + if (\array_key_exists('Options', $data) && null !== $data['Options']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key => $value) { + foreach ($data['Options'] as $key => $value) { $values[$key] = $value; } $object->setOptions($values); + unset($data['Options']); + } elseif (\array_key_exists('Options', $data) && null === $data['Options']) { + $object->setOptions(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getOptions()) { - $values = new \stdClass(); - foreach ($object->getOptions() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('options') && null !== $data->getOptions()) { + $values = []; + foreach ($data->getOptions() as $key => $value) { + $values[$key] = $value; + } + $dataArray['Options'] = $values; + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; } - $data->{'Options'} = $values; } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class => false]; } } diff --git a/src/Normalizer/SwarmSpecTaskDefaultsNormalizer.php b/src/Normalizer/SwarmSpecTaskDefaultsNormalizer.php index f34e389a..248c85c7 100644 --- a/src/Normalizer/SwarmSpecTaskDefaultsNormalizer.php +++ b/src/Normalizer/SwarmSpecTaskDefaultsNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,39 +16,65 @@ class SwarmSpecTaskDefaultsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\SwarmSpecTaskDefaults'; + return \Docker\API\Model\SwarmSpecTaskDefaults::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\SwarmSpecTaskDefaults; + return \is_object($data) && \Docker\API\Model\SwarmSpecTaskDefaults::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\SwarmSpecTaskDefaults(); - if (property_exists($data, 'LogDriver') && $data->{'LogDriver'} !== null) { - $object->setLogDriver($this->denormalizer->denormalize($data->{'LogDriver'}, 'Docker\\API\\Model\\SwarmSpecTaskDefaultsLogDriver', 'json', $context)); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('LogDriver', $data) && null !== $data['LogDriver']) { + $object->setLogDriver($this->denormalizer->denormalize($data['LogDriver'], \Docker\API\Model\SwarmSpecTaskDefaultsLogDriver::class, 'json', $context)); + unset($data['LogDriver']); + } elseif (\array_key_exists('LogDriver', $data) && null === $data['LogDriver']) { + $object->setLogDriver(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getLogDriver()) { - $data->{'LogDriver'} = $this->normalizer->normalize($object->getLogDriver(), 'json', $context); + $dataArray = []; + if ($data->isInitialized('logDriver') && null !== $data->getLogDriver()) { + $dataArray['LogDriver'] = $this->normalizer->normalize($data->getLogDriver(), 'json', $context); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmSpecTaskDefaults::class => false]; } } diff --git a/src/Normalizer/SwarmUnlockPostBodyNormalizer.php b/src/Normalizer/SwarmUnlockPostBodyNormalizer.php index edf6159f..2b5eb2ad 100644 --- a/src/Normalizer/SwarmUnlockPostBodyNormalizer.php +++ b/src/Normalizer/SwarmUnlockPostBodyNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,39 +16,65 @@ class SwarmUnlockPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\SwarmUnlockPostBody'; + return \Docker\API\Model\SwarmUnlockPostBody::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\SwarmUnlockPostBody; + return \is_object($data) && \Docker\API\Model\SwarmUnlockPostBody::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\SwarmUnlockPostBody(); - if (property_exists($data, 'UnlockKey') && $data->{'UnlockKey'} !== null) { - $object->setUnlockKey($data->{'UnlockKey'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('UnlockKey', $data) && null !== $data['UnlockKey']) { + $object->setUnlockKey($data['UnlockKey']); + unset($data['UnlockKey']); + } elseif (\array_key_exists('UnlockKey', $data) && null === $data['UnlockKey']) { + $object->setUnlockKey(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getUnlockKey()) { - $data->{'UnlockKey'} = $object->getUnlockKey(); + $dataArray = []; + if ($data->isInitialized('unlockKey') && null !== $data->getUnlockKey()) { + $dataArray['UnlockKey'] = $data->getUnlockKey(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmUnlockPostBody::class => false]; } } diff --git a/src/Normalizer/SwarmUnlockkeyGetJsonResponse200Normalizer.php b/src/Normalizer/SwarmUnlockkeyGetJsonResponse200Normalizer.php new file mode 100644 index 00000000..fad9f2c8 --- /dev/null +++ b/src/Normalizer/SwarmUnlockkeyGetJsonResponse200Normalizer.php @@ -0,0 +1,80 @@ +setUnlockKey($data['UnlockKey']); + unset($data['UnlockKey']); + } elseif (\array_key_exists('UnlockKey', $data) && null === $data['UnlockKey']) { + $object->setUnlockKey(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('unlockKey') && null !== $data->getUnlockKey()) { + $dataArray['UnlockKey'] = $data->getUnlockKey(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmUnlockkeyGetJsonResponse200::class => false]; + } +} diff --git a/src/Normalizer/SwarmUnlockkeyGetResponse200Normalizer.php b/src/Normalizer/SwarmUnlockkeyGetResponse200Normalizer.php deleted file mode 100644 index 1c6c027d..00000000 --- a/src/Normalizer/SwarmUnlockkeyGetResponse200Normalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -{'UnlockKey'} !== null) { - $object->setUnlockKey($data->{'UnlockKey'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getUnlockKey()) { - $data->{'UnlockKey'} = $object->getUnlockKey(); - } - - return $data; - } -} diff --git a/src/Normalizer/SwarmUnlockkeyGetTextplainResponse200Normalizer.php b/src/Normalizer/SwarmUnlockkeyGetTextplainResponse200Normalizer.php new file mode 100644 index 00000000..6b2efb51 --- /dev/null +++ b/src/Normalizer/SwarmUnlockkeyGetTextplainResponse200Normalizer.php @@ -0,0 +1,80 @@ +setUnlockKey($data['UnlockKey']); + unset($data['UnlockKey']); + } elseif (\array_key_exists('UnlockKey', $data) && null === $data['UnlockKey']) { + $object->setUnlockKey(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('unlockKey') && null !== $data->getUnlockKey()) { + $dataArray['UnlockKey'] = $data->getUnlockKey(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SwarmUnlockkeyGetTextplainResponse200::class => false]; + } +} diff --git a/src/Normalizer/SystemDfGetJsonResponse200Normalizer.php b/src/Normalizer/SystemDfGetJsonResponse200Normalizer.php new file mode 100644 index 00000000..2830ac41 --- /dev/null +++ b/src/Normalizer/SystemDfGetJsonResponse200Normalizer.php @@ -0,0 +1,148 @@ +setLayersSize($data['LayersSize']); + unset($data['LayersSize']); + } elseif (\array_key_exists('LayersSize', $data) && null === $data['LayersSize']) { + $object->setLayersSize(null); + } + if (\array_key_exists('Images', $data) && null !== $data['Images']) { + $values = []; + foreach ($data['Images'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ImageSummary::class, 'json', $context); + } + $object->setImages($values); + unset($data['Images']); + } elseif (\array_key_exists('Images', $data) && null === $data['Images']) { + $object->setImages(null); + } + if (\array_key_exists('Containers', $data) && null !== $data['Containers']) { + $values_1 = []; + foreach ($data['Containers'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\ContainerSummary::class, 'json', $context); + } + $object->setContainers($values_1); + unset($data['Containers']); + } elseif (\array_key_exists('Containers', $data) && null === $data['Containers']) { + $object->setContainers(null); + } + if (\array_key_exists('Volumes', $data) && null !== $data['Volumes']) { + $values_2 = []; + foreach ($data['Volumes'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\Volume::class, 'json', $context); + } + $object->setVolumes($values_2); + unset($data['Volumes']); + } elseif (\array_key_exists('Volumes', $data) && null === $data['Volumes']) { + $object->setVolumes(null); + } + if (\array_key_exists('BuildCache', $data) && null !== $data['BuildCache']) { + $values_3 = []; + foreach ($data['BuildCache'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\BuildCache::class, 'json', $context); + } + $object->setBuildCache($values_3); + unset($data['BuildCache']); + } elseif (\array_key_exists('BuildCache', $data) && null === $data['BuildCache']) { + $object->setBuildCache(null); + } + foreach ($data as $key => $value_4) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_4; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('layersSize') && null !== $data->getLayersSize()) { + $dataArray['LayersSize'] = $data->getLayersSize(); + } + if ($data->isInitialized('images') && null !== $data->getImages()) { + $values = []; + foreach ($data->getImages() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $dataArray['Images'] = $values; + } + if ($data->isInitialized('containers') && null !== $data->getContainers()) { + $values_1 = []; + foreach ($data->getContainers() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $dataArray['Containers'] = $values_1; + } + if ($data->isInitialized('volumes') && null !== $data->getVolumes()) { + $values_2 = []; + foreach ($data->getVolumes() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $dataArray['Volumes'] = $values_2; + } + if ($data->isInitialized('buildCache') && null !== $data->getBuildCache()) { + $values_3 = []; + foreach ($data->getBuildCache() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $dataArray['BuildCache'] = $values_3; + } + foreach ($data as $key => $value_4) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_4; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemDfGetJsonResponse200::class => false]; + } +} diff --git a/src/Normalizer/SystemDfGetResponse200Normalizer.php b/src/Normalizer/SystemDfGetResponse200Normalizer.php deleted file mode 100644 index a29b07d1..00000000 --- a/src/Normalizer/SystemDfGetResponse200Normalizer.php +++ /dev/null @@ -1,107 +0,0 @@ -{'LayersSize'} !== null) { - $object->setLayersSize($data->{'LayersSize'}); - } - if (property_exists($data, 'Images') && $data->{'Images'} !== null) { - $values = []; - foreach ($data->{'Images'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\ImageSummary', 'json', $context); - } - $object->setImages($values); - } - if (property_exists($data, 'Containers') && $data->{'Containers'} !== null) { - $values_1 = []; - foreach ($data->{'Containers'} as $value_1) { - $values_2 = []; - foreach ($value_1 as $value_2) { - $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\ContainerSummaryItem', 'json', $context); - } - $values_1[] = $values_2; - } - $object->setContainers($values_1); - } - if (property_exists($data, 'Volumes') && $data->{'Volumes'} !== null) { - $values_3 = []; - foreach ($data->{'Volumes'} as $value_3) { - $values_3[] = $this->denormalizer->denormalize($value_3, 'Docker\\API\\Model\\Volume', 'json', $context); - } - $object->setVolumes($values_3); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getLayersSize()) { - $data->{'LayersSize'} = $object->getLayersSize(); - } - if (null !== $object->getImages()) { - $values = []; - foreach ($object->getImages() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data->{'Images'} = $values; - } - if (null !== $object->getContainers()) { - $values_1 = []; - foreach ($object->getContainers() as $value_1) { - $values_2 = []; - foreach ($value_1 as $value_2) { - $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); - } - $values_1[] = $values_2; - } - $data->{'Containers'} = $values_1; - } - if (null !== $object->getVolumes()) { - $values_3 = []; - foreach ($object->getVolumes() as $value_3) { - $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); - } - $data->{'Volumes'} = $values_3; - } - - return $data; - } -} diff --git a/src/Normalizer/SystemDfGetTextplainResponse200Normalizer.php b/src/Normalizer/SystemDfGetTextplainResponse200Normalizer.php new file mode 100644 index 00000000..2de13395 --- /dev/null +++ b/src/Normalizer/SystemDfGetTextplainResponse200Normalizer.php @@ -0,0 +1,148 @@ +setLayersSize($data['LayersSize']); + unset($data['LayersSize']); + } elseif (\array_key_exists('LayersSize', $data) && null === $data['LayersSize']) { + $object->setLayersSize(null); + } + if (\array_key_exists('Images', $data) && null !== $data['Images']) { + $values = []; + foreach ($data['Images'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\ImageSummary::class, 'json', $context); + } + $object->setImages($values); + unset($data['Images']); + } elseif (\array_key_exists('Images', $data) && null === $data['Images']) { + $object->setImages(null); + } + if (\array_key_exists('Containers', $data) && null !== $data['Containers']) { + $values_1 = []; + foreach ($data['Containers'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\ContainerSummary::class, 'json', $context); + } + $object->setContainers($values_1); + unset($data['Containers']); + } elseif (\array_key_exists('Containers', $data) && null === $data['Containers']) { + $object->setContainers(null); + } + if (\array_key_exists('Volumes', $data) && null !== $data['Volumes']) { + $values_2 = []; + foreach ($data['Volumes'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\Volume::class, 'json', $context); + } + $object->setVolumes($values_2); + unset($data['Volumes']); + } elseif (\array_key_exists('Volumes', $data) && null === $data['Volumes']) { + $object->setVolumes(null); + } + if (\array_key_exists('BuildCache', $data) && null !== $data['BuildCache']) { + $values_3 = []; + foreach ($data['BuildCache'] as $value_3) { + $values_3[] = $this->denormalizer->denormalize($value_3, \Docker\API\Model\BuildCache::class, 'json', $context); + } + $object->setBuildCache($values_3); + unset($data['BuildCache']); + } elseif (\array_key_exists('BuildCache', $data) && null === $data['BuildCache']) { + $object->setBuildCache(null); + } + foreach ($data as $key => $value_4) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_4; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('layersSize') && null !== $data->getLayersSize()) { + $dataArray['LayersSize'] = $data->getLayersSize(); + } + if ($data->isInitialized('images') && null !== $data->getImages()) { + $values = []; + foreach ($data->getImages() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $dataArray['Images'] = $values; + } + if ($data->isInitialized('containers') && null !== $data->getContainers()) { + $values_1 = []; + foreach ($data->getContainers() as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); + } + $dataArray['Containers'] = $values_1; + } + if ($data->isInitialized('volumes') && null !== $data->getVolumes()) { + $values_2 = []; + foreach ($data->getVolumes() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); + } + $dataArray['Volumes'] = $values_2; + } + if ($data->isInitialized('buildCache') && null !== $data->getBuildCache()) { + $values_3 = []; + foreach ($data->getBuildCache() as $value_3) { + $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); + } + $dataArray['BuildCache'] = $values_3; + } + foreach ($data as $key => $value_4) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_4; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemDfGetTextplainResponse200::class => false]; + } +} diff --git a/src/Normalizer/SystemInfoDefaultAddressPoolsItemNormalizer.php b/src/Normalizer/SystemInfoDefaultAddressPoolsItemNormalizer.php new file mode 100644 index 00000000..becee776 --- /dev/null +++ b/src/Normalizer/SystemInfoDefaultAddressPoolsItemNormalizer.php @@ -0,0 +1,89 @@ +setBase($data['Base']); + unset($data['Base']); + } elseif (\array_key_exists('Base', $data) && null === $data['Base']) { + $object->setBase(null); + } + if (\array_key_exists('Size', $data) && null !== $data['Size']) { + $object->setSize($data['Size']); + unset($data['Size']); + } elseif (\array_key_exists('Size', $data) && null === $data['Size']) { + $object->setSize(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('base') && null !== $data->getBase()) { + $dataArray['Base'] = $data->getBase(); + } + if ($data->isInitialized('size') && null !== $data->getSize()) { + $dataArray['Size'] = $data->getSize(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemInfoDefaultAddressPoolsItem::class => false]; + } +} diff --git a/src/Normalizer/SystemInfoNormalizer.php b/src/Normalizer/SystemInfoNormalizer.php index 24a766ce..b863d86c 100644 --- a/src/Normalizer/SystemInfoNormalizer.php +++ b/src/Normalizer/SystemInfoNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,439 +16,722 @@ class SystemInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\SystemInfo'; + return \Docker\API\Model\SystemInfo::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\SystemInfo; + return \is_object($data) && \Docker\API\Model\SystemInfo::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\SystemInfo(); - if (property_exists($data, 'ID') && $data->{'ID'} !== null) { - $object->setID($data->{'ID'}); - } - if (property_exists($data, 'Containers') && $data->{'Containers'} !== null) { - $object->setContainers($data->{'Containers'}); - } - if (property_exists($data, 'ContainersRunning') && $data->{'ContainersRunning'} !== null) { - $object->setContainersRunning($data->{'ContainersRunning'}); - } - if (property_exists($data, 'ContainersPaused') && $data->{'ContainersPaused'} !== null) { - $object->setContainersPaused($data->{'ContainersPaused'}); - } - if (property_exists($data, 'ContainersStopped') && $data->{'ContainersStopped'} !== null) { - $object->setContainersStopped($data->{'ContainersStopped'}); - } - if (property_exists($data, 'Images') && $data->{'Images'} !== null) { - $object->setImages($data->{'Images'}); - } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($data->{'Driver'}); - } - if (property_exists($data, 'DriverStatus') && $data->{'DriverStatus'} !== null) { - $values = []; - foreach ($data->{'DriverStatus'} as $value) { - $values_1 = []; - foreach ($value as $value_1) { - $values_1[] = $value_1; - } - $values[] = $values_1; - } - $object->setDriverStatus($values); - } - if (property_exists($data, 'DockerRootDir') && $data->{'DockerRootDir'} !== null) { - $object->setDockerRootDir($data->{'DockerRootDir'}); - } - if (property_exists($data, 'SystemStatus') && $data->{'SystemStatus'} !== null) { - $values_2 = []; - foreach ($data->{'SystemStatus'} as $value_2) { - $values_3 = []; - foreach ($value_2 as $value_3) { - $values_3[] = $value_3; - } - $values_2[] = $values_3; - } - $object->setSystemStatus($values_2); - } - if (property_exists($data, 'Plugins') && $data->{'Plugins'} !== null) { - $object->setPlugins($this->denormalizer->denormalize($data->{'Plugins'}, 'Docker\\API\\Model\\PluginsInfo', 'json', $context)); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'MemoryLimit') && $data->{'MemoryLimit'} !== null) { - $object->setMemoryLimit($data->{'MemoryLimit'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'SwapLimit') && $data->{'SwapLimit'} !== null) { - $object->setSwapLimit($data->{'SwapLimit'}); - } - if (property_exists($data, 'KernelMemory') && $data->{'KernelMemory'} !== null) { - $object->setKernelMemory($data->{'KernelMemory'}); - } - if (property_exists($data, 'CpuCfsPeriod') && $data->{'CpuCfsPeriod'} !== null) { - $object->setCpuCfsPeriod($data->{'CpuCfsPeriod'}); + $object = new \Docker\API\Model\SystemInfo(); + if (\array_key_exists('MemoryLimit', $data) && \is_int($data['MemoryLimit'])) { + $data['MemoryLimit'] = (bool) $data['MemoryLimit']; } - if (property_exists($data, 'CpuCfsQuota') && $data->{'CpuCfsQuota'} !== null) { - $object->setCpuCfsQuota($data->{'CpuCfsQuota'}); + if (\array_key_exists('SwapLimit', $data) && \is_int($data['SwapLimit'])) { + $data['SwapLimit'] = (bool) $data['SwapLimit']; } - if (property_exists($data, 'CPUShares') && $data->{'CPUShares'} !== null) { - $object->setCPUShares($data->{'CPUShares'}); + if (\array_key_exists('KernelMemoryTCP', $data) && \is_int($data['KernelMemoryTCP'])) { + $data['KernelMemoryTCP'] = (bool) $data['KernelMemoryTCP']; } - if (property_exists($data, 'CPUSet') && $data->{'CPUSet'} !== null) { - $object->setCPUSet($data->{'CPUSet'}); + if (\array_key_exists('CpuCfsPeriod', $data) && \is_int($data['CpuCfsPeriod'])) { + $data['CpuCfsPeriod'] = (bool) $data['CpuCfsPeriod']; } - if (property_exists($data, 'OomKillDisable') && $data->{'OomKillDisable'} !== null) { - $object->setOomKillDisable($data->{'OomKillDisable'}); + if (\array_key_exists('CpuCfsQuota', $data) && \is_int($data['CpuCfsQuota'])) { + $data['CpuCfsQuota'] = (bool) $data['CpuCfsQuota']; } - if (property_exists($data, 'IPv4Forwarding') && $data->{'IPv4Forwarding'} !== null) { - $object->setIPv4Forwarding($data->{'IPv4Forwarding'}); + if (\array_key_exists('CPUShares', $data) && \is_int($data['CPUShares'])) { + $data['CPUShares'] = (bool) $data['CPUShares']; } - if (property_exists($data, 'BridgeNfIptables') && $data->{'BridgeNfIptables'} !== null) { - $object->setBridgeNfIptables($data->{'BridgeNfIptables'}); + if (\array_key_exists('CPUSet', $data) && \is_int($data['CPUSet'])) { + $data['CPUSet'] = (bool) $data['CPUSet']; } - if (property_exists($data, 'BridgeNfIp6tables') && $data->{'BridgeNfIp6tables'} !== null) { - $object->setBridgeNfIp6tables($data->{'BridgeNfIp6tables'}); + if (\array_key_exists('PidsLimit', $data) && \is_int($data['PidsLimit'])) { + $data['PidsLimit'] = (bool) $data['PidsLimit']; } - if (property_exists($data, 'Debug') && $data->{'Debug'} !== null) { - $object->setDebug($data->{'Debug'}); + if (\array_key_exists('OomKillDisable', $data) && \is_int($data['OomKillDisable'])) { + $data['OomKillDisable'] = (bool) $data['OomKillDisable']; } - if (property_exists($data, 'NFd') && $data->{'NFd'} !== null) { - $object->setNFd($data->{'NFd'}); + if (\array_key_exists('IPv4Forwarding', $data) && \is_int($data['IPv4Forwarding'])) { + $data['IPv4Forwarding'] = (bool) $data['IPv4Forwarding']; } - if (property_exists($data, 'NGoroutines') && $data->{'NGoroutines'} !== null) { - $object->setNGoroutines($data->{'NGoroutines'}); + if (\array_key_exists('BridgeNfIptables', $data) && \is_int($data['BridgeNfIptables'])) { + $data['BridgeNfIptables'] = (bool) $data['BridgeNfIptables']; } - if (property_exists($data, 'SystemTime') && $data->{'SystemTime'} !== null) { - $object->setSystemTime($data->{'SystemTime'}); + if (\array_key_exists('BridgeNfIp6tables', $data) && \is_int($data['BridgeNfIp6tables'])) { + $data['BridgeNfIp6tables'] = (bool) $data['BridgeNfIp6tables']; } - if (property_exists($data, 'LoggingDriver') && $data->{'LoggingDriver'} !== null) { - $object->setLoggingDriver($data->{'LoggingDriver'}); + if (\array_key_exists('Debug', $data) && \is_int($data['Debug'])) { + $data['Debug'] = (bool) $data['Debug']; } - if (property_exists($data, 'CgroupDriver') && $data->{'CgroupDriver'} !== null) { - $object->setCgroupDriver($data->{'CgroupDriver'}); + if (\array_key_exists('ExperimentalBuild', $data) && \is_int($data['ExperimentalBuild'])) { + $data['ExperimentalBuild'] = (bool) $data['ExperimentalBuild']; } - if (property_exists($data, 'NEventsListener') && $data->{'NEventsListener'} !== null) { - $object->setNEventsListener($data->{'NEventsListener'}); + if (\array_key_exists('LiveRestoreEnabled', $data) && \is_int($data['LiveRestoreEnabled'])) { + $data['LiveRestoreEnabled'] = (bool) $data['LiveRestoreEnabled']; } - if (property_exists($data, 'KernelVersion') && $data->{'KernelVersion'} !== null) { - $object->setKernelVersion($data->{'KernelVersion'}); + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'OperatingSystem') && $data->{'OperatingSystem'} !== null) { - $object->setOperatingSystem($data->{'OperatingSystem'}); + if (\array_key_exists('ID', $data) && null !== $data['ID']) { + $object->setID($data['ID']); + unset($data['ID']); + } elseif (\array_key_exists('ID', $data) && null === $data['ID']) { + $object->setID(null); } - if (property_exists($data, 'OSType') && $data->{'OSType'} !== null) { - $object->setOSType($data->{'OSType'}); + if (\array_key_exists('Containers', $data) && null !== $data['Containers']) { + $object->setContainers($data['Containers']); + unset($data['Containers']); + } elseif (\array_key_exists('Containers', $data) && null === $data['Containers']) { + $object->setContainers(null); } - if (property_exists($data, 'Architecture') && $data->{'Architecture'} !== null) { - $object->setArchitecture($data->{'Architecture'}); + if (\array_key_exists('ContainersRunning', $data) && null !== $data['ContainersRunning']) { + $object->setContainersRunning($data['ContainersRunning']); + unset($data['ContainersRunning']); + } elseif (\array_key_exists('ContainersRunning', $data) && null === $data['ContainersRunning']) { + $object->setContainersRunning(null); } - if (property_exists($data, 'NCPU') && $data->{'NCPU'} !== null) { - $object->setNCPU($data->{'NCPU'}); + if (\array_key_exists('ContainersPaused', $data) && null !== $data['ContainersPaused']) { + $object->setContainersPaused($data['ContainersPaused']); + unset($data['ContainersPaused']); + } elseif (\array_key_exists('ContainersPaused', $data) && null === $data['ContainersPaused']) { + $object->setContainersPaused(null); } - if (property_exists($data, 'MemTotal') && $data->{'MemTotal'} !== null) { - $object->setMemTotal($data->{'MemTotal'}); + if (\array_key_exists('ContainersStopped', $data) && null !== $data['ContainersStopped']) { + $object->setContainersStopped($data['ContainersStopped']); + unset($data['ContainersStopped']); + } elseif (\array_key_exists('ContainersStopped', $data) && null === $data['ContainersStopped']) { + $object->setContainersStopped(null); } - if (property_exists($data, 'IndexServerAddress') && $data->{'IndexServerAddress'} !== null) { - $object->setIndexServerAddress($data->{'IndexServerAddress'}); + if (\array_key_exists('Images', $data) && null !== $data['Images']) { + $object->setImages($data['Images']); + unset($data['Images']); + } elseif (\array_key_exists('Images', $data) && null === $data['Images']) { + $object->setImages(null); } - if (property_exists($data, 'RegistryConfig') && $data->{'RegistryConfig'} !== null) { - $object->setRegistryConfig($this->denormalizer->denormalize($data->{'RegistryConfig'}, 'Docker\\API\\Model\\RegistryServiceConfig', 'json', $context)); + if (\array_key_exists('Driver', $data) && null !== $data['Driver']) { + $object->setDriver($data['Driver']); + unset($data['Driver']); + } elseif (\array_key_exists('Driver', $data) && null === $data['Driver']) { + $object->setDriver(null); } - if (property_exists($data, 'GenericResources') && $data->{'GenericResources'} !== null) { - $values_4 = []; - foreach ($data->{'GenericResources'} as $value_4) { - $values_4[] = $this->denormalizer->denormalize($value_4, 'Docker\\API\\Model\\GenericResourcesItem', 'json', $context); + if (\array_key_exists('DriverStatus', $data) && null !== $data['DriverStatus']) { + $values = []; + foreach ($data['DriverStatus'] as $value) { + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $value_1; + } + $values[] = $values_1; } - $object->setGenericResources($values_4); - } - if (property_exists($data, 'HttpProxy') && $data->{'HttpProxy'} !== null) { - $object->setHttpProxy($data->{'HttpProxy'}); - } - if (property_exists($data, 'HttpsProxy') && $data->{'HttpsProxy'} !== null) { - $object->setHttpsProxy($data->{'HttpsProxy'}); - } - if (property_exists($data, 'NoProxy') && $data->{'NoProxy'} !== null) { - $object->setNoProxy($data->{'NoProxy'}); - } - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + $object->setDriverStatus($values); + unset($data['DriverStatus']); + } elseif (\array_key_exists('DriverStatus', $data) && null === $data['DriverStatus']) { + $object->setDriverStatus(null); + } + if (\array_key_exists('DockerRootDir', $data) && null !== $data['DockerRootDir']) { + $object->setDockerRootDir($data['DockerRootDir']); + unset($data['DockerRootDir']); + } elseif (\array_key_exists('DockerRootDir', $data) && null === $data['DockerRootDir']) { + $object->setDockerRootDir(null); + } + if (\array_key_exists('Plugins', $data) && null !== $data['Plugins']) { + $object->setPlugins($this->denormalizer->denormalize($data['Plugins'], \Docker\API\Model\PluginsInfo::class, 'json', $context)); + unset($data['Plugins']); + } elseif (\array_key_exists('Plugins', $data) && null === $data['Plugins']) { + $object->setPlugins(null); + } + if (\array_key_exists('MemoryLimit', $data) && null !== $data['MemoryLimit']) { + $object->setMemoryLimit($data['MemoryLimit']); + unset($data['MemoryLimit']); + } elseif (\array_key_exists('MemoryLimit', $data) && null === $data['MemoryLimit']) { + $object->setMemoryLimit(null); + } + if (\array_key_exists('SwapLimit', $data) && null !== $data['SwapLimit']) { + $object->setSwapLimit($data['SwapLimit']); + unset($data['SwapLimit']); + } elseif (\array_key_exists('SwapLimit', $data) && null === $data['SwapLimit']) { + $object->setSwapLimit(null); + } + if (\array_key_exists('KernelMemoryTCP', $data) && null !== $data['KernelMemoryTCP']) { + $object->setKernelMemoryTCP($data['KernelMemoryTCP']); + unset($data['KernelMemoryTCP']); + } elseif (\array_key_exists('KernelMemoryTCP', $data) && null === $data['KernelMemoryTCP']) { + $object->setKernelMemoryTCP(null); + } + if (\array_key_exists('CpuCfsPeriod', $data) && null !== $data['CpuCfsPeriod']) { + $object->setCpuCfsPeriod($data['CpuCfsPeriod']); + unset($data['CpuCfsPeriod']); + } elseif (\array_key_exists('CpuCfsPeriod', $data) && null === $data['CpuCfsPeriod']) { + $object->setCpuCfsPeriod(null); + } + if (\array_key_exists('CpuCfsQuota', $data) && null !== $data['CpuCfsQuota']) { + $object->setCpuCfsQuota($data['CpuCfsQuota']); + unset($data['CpuCfsQuota']); + } elseif (\array_key_exists('CpuCfsQuota', $data) && null === $data['CpuCfsQuota']) { + $object->setCpuCfsQuota(null); + } + if (\array_key_exists('CPUShares', $data) && null !== $data['CPUShares']) { + $object->setCPUShares($data['CPUShares']); + unset($data['CPUShares']); + } elseif (\array_key_exists('CPUShares', $data) && null === $data['CPUShares']) { + $object->setCPUShares(null); + } + if (\array_key_exists('CPUSet', $data) && null !== $data['CPUSet']) { + $object->setCPUSet($data['CPUSet']); + unset($data['CPUSet']); + } elseif (\array_key_exists('CPUSet', $data) && null === $data['CPUSet']) { + $object->setCPUSet(null); + } + if (\array_key_exists('PidsLimit', $data) && null !== $data['PidsLimit']) { + $object->setPidsLimit($data['PidsLimit']); + unset($data['PidsLimit']); + } elseif (\array_key_exists('PidsLimit', $data) && null === $data['PidsLimit']) { + $object->setPidsLimit(null); + } + if (\array_key_exists('OomKillDisable', $data) && null !== $data['OomKillDisable']) { + $object->setOomKillDisable($data['OomKillDisable']); + unset($data['OomKillDisable']); + } elseif (\array_key_exists('OomKillDisable', $data) && null === $data['OomKillDisable']) { + $object->setOomKillDisable(null); + } + if (\array_key_exists('IPv4Forwarding', $data) && null !== $data['IPv4Forwarding']) { + $object->setIPv4Forwarding($data['IPv4Forwarding']); + unset($data['IPv4Forwarding']); + } elseif (\array_key_exists('IPv4Forwarding', $data) && null === $data['IPv4Forwarding']) { + $object->setIPv4Forwarding(null); + } + if (\array_key_exists('BridgeNfIptables', $data) && null !== $data['BridgeNfIptables']) { + $object->setBridgeNfIptables($data['BridgeNfIptables']); + unset($data['BridgeNfIptables']); + } elseif (\array_key_exists('BridgeNfIptables', $data) && null === $data['BridgeNfIptables']) { + $object->setBridgeNfIptables(null); + } + if (\array_key_exists('BridgeNfIp6tables', $data) && null !== $data['BridgeNfIp6tables']) { + $object->setBridgeNfIp6tables($data['BridgeNfIp6tables']); + unset($data['BridgeNfIp6tables']); + } elseif (\array_key_exists('BridgeNfIp6tables', $data) && null === $data['BridgeNfIp6tables']) { + $object->setBridgeNfIp6tables(null); + } + if (\array_key_exists('Debug', $data) && null !== $data['Debug']) { + $object->setDebug($data['Debug']); + unset($data['Debug']); + } elseif (\array_key_exists('Debug', $data) && null === $data['Debug']) { + $object->setDebug(null); + } + if (\array_key_exists('NFd', $data) && null !== $data['NFd']) { + $object->setNFd($data['NFd']); + unset($data['NFd']); + } elseif (\array_key_exists('NFd', $data) && null === $data['NFd']) { + $object->setNFd(null); + } + if (\array_key_exists('NGoroutines', $data) && null !== $data['NGoroutines']) { + $object->setNGoroutines($data['NGoroutines']); + unset($data['NGoroutines']); + } elseif (\array_key_exists('NGoroutines', $data) && null === $data['NGoroutines']) { + $object->setNGoroutines(null); + } + if (\array_key_exists('SystemTime', $data) && null !== $data['SystemTime']) { + $object->setSystemTime($data['SystemTime']); + unset($data['SystemTime']); + } elseif (\array_key_exists('SystemTime', $data) && null === $data['SystemTime']) { + $object->setSystemTime(null); + } + if (\array_key_exists('LoggingDriver', $data) && null !== $data['LoggingDriver']) { + $object->setLoggingDriver($data['LoggingDriver']); + unset($data['LoggingDriver']); + } elseif (\array_key_exists('LoggingDriver', $data) && null === $data['LoggingDriver']) { + $object->setLoggingDriver(null); + } + if (\array_key_exists('CgroupDriver', $data) && null !== $data['CgroupDriver']) { + $object->setCgroupDriver($data['CgroupDriver']); + unset($data['CgroupDriver']); + } elseif (\array_key_exists('CgroupDriver', $data) && null === $data['CgroupDriver']) { + $object->setCgroupDriver(null); + } + if (\array_key_exists('CgroupVersion', $data) && null !== $data['CgroupVersion']) { + $object->setCgroupVersion($data['CgroupVersion']); + unset($data['CgroupVersion']); + } elseif (\array_key_exists('CgroupVersion', $data) && null === $data['CgroupVersion']) { + $object->setCgroupVersion(null); + } + if (\array_key_exists('NEventsListener', $data) && null !== $data['NEventsListener']) { + $object->setNEventsListener($data['NEventsListener']); + unset($data['NEventsListener']); + } elseif (\array_key_exists('NEventsListener', $data) && null === $data['NEventsListener']) { + $object->setNEventsListener(null); + } + if (\array_key_exists('KernelVersion', $data) && null !== $data['KernelVersion']) { + $object->setKernelVersion($data['KernelVersion']); + unset($data['KernelVersion']); + } elseif (\array_key_exists('KernelVersion', $data) && null === $data['KernelVersion']) { + $object->setKernelVersion(null); + } + if (\array_key_exists('OperatingSystem', $data) && null !== $data['OperatingSystem']) { + $object->setOperatingSystem($data['OperatingSystem']); + unset($data['OperatingSystem']); + } elseif (\array_key_exists('OperatingSystem', $data) && null === $data['OperatingSystem']) { + $object->setOperatingSystem(null); + } + if (\array_key_exists('OSVersion', $data) && null !== $data['OSVersion']) { + $object->setOSVersion($data['OSVersion']); + unset($data['OSVersion']); + } elseif (\array_key_exists('OSVersion', $data) && null === $data['OSVersion']) { + $object->setOSVersion(null); + } + if (\array_key_exists('OSType', $data) && null !== $data['OSType']) { + $object->setOSType($data['OSType']); + unset($data['OSType']); + } elseif (\array_key_exists('OSType', $data) && null === $data['OSType']) { + $object->setOSType(null); + } + if (\array_key_exists('Architecture', $data) && null !== $data['Architecture']) { + $object->setArchitecture($data['Architecture']); + unset($data['Architecture']); + } elseif (\array_key_exists('Architecture', $data) && null === $data['Architecture']) { + $object->setArchitecture(null); + } + if (\array_key_exists('NCPU', $data) && null !== $data['NCPU']) { + $object->setNCPU($data['NCPU']); + unset($data['NCPU']); + } elseif (\array_key_exists('NCPU', $data) && null === $data['NCPU']) { + $object->setNCPU(null); + } + if (\array_key_exists('MemTotal', $data) && null !== $data['MemTotal']) { + $object->setMemTotal($data['MemTotal']); + unset($data['MemTotal']); + } elseif (\array_key_exists('MemTotal', $data) && null === $data['MemTotal']) { + $object->setMemTotal(null); + } + if (\array_key_exists('IndexServerAddress', $data) && null !== $data['IndexServerAddress']) { + $object->setIndexServerAddress($data['IndexServerAddress']); + unset($data['IndexServerAddress']); + } elseif (\array_key_exists('IndexServerAddress', $data) && null === $data['IndexServerAddress']) { + $object->setIndexServerAddress(null); + } + if (\array_key_exists('RegistryConfig', $data) && null !== $data['RegistryConfig']) { + $object->setRegistryConfig($this->denormalizer->denormalize($data['RegistryConfig'], \Docker\API\Model\RegistryServiceConfig::class, 'json', $context)); + unset($data['RegistryConfig']); + } elseif (\array_key_exists('RegistryConfig', $data) && null === $data['RegistryConfig']) { + $object->setRegistryConfig(null); + } + if (\array_key_exists('GenericResources', $data) && null !== $data['GenericResources']) { + $values_2 = []; + foreach ($data['GenericResources'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\GenericResourcesItem::class, 'json', $context); + } + $object->setGenericResources($values_2); + unset($data['GenericResources']); + } elseif (\array_key_exists('GenericResources', $data) && null === $data['GenericResources']) { + $object->setGenericResources(null); + } + if (\array_key_exists('HttpProxy', $data) && null !== $data['HttpProxy']) { + $object->setHttpProxy($data['HttpProxy']); + unset($data['HttpProxy']); + } elseif (\array_key_exists('HttpProxy', $data) && null === $data['HttpProxy']) { + $object->setHttpProxy(null); + } + if (\array_key_exists('HttpsProxy', $data) && null !== $data['HttpsProxy']) { + $object->setHttpsProxy($data['HttpsProxy']); + unset($data['HttpsProxy']); + } elseif (\array_key_exists('HttpsProxy', $data) && null === $data['HttpsProxy']) { + $object->setHttpsProxy(null); + } + if (\array_key_exists('NoProxy', $data) && null !== $data['NoProxy']) { + $object->setNoProxy($data['NoProxy']); + unset($data['NoProxy']); + } elseif (\array_key_exists('NoProxy', $data) && null === $data['NoProxy']) { + $object->setNoProxy(null); + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { + $values_3 = []; + foreach ($data['Labels'] as $value_3) { + $values_3[] = $value_3; + } + $object->setLabels($values_3); + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + if (\array_key_exists('ExperimentalBuild', $data) && null !== $data['ExperimentalBuild']) { + $object->setExperimentalBuild($data['ExperimentalBuild']); + unset($data['ExperimentalBuild']); + } elseif (\array_key_exists('ExperimentalBuild', $data) && null === $data['ExperimentalBuild']) { + $object->setExperimentalBuild(null); + } + if (\array_key_exists('ServerVersion', $data) && null !== $data['ServerVersion']) { + $object->setServerVersion($data['ServerVersion']); + unset($data['ServerVersion']); + } elseif (\array_key_exists('ServerVersion', $data) && null === $data['ServerVersion']) { + $object->setServerVersion(null); + } + if (\array_key_exists('Runtimes', $data) && null !== $data['Runtimes']) { + $values_4 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Runtimes'] as $key => $value_4) { + $values_4[$key] = $this->denormalizer->denormalize($value_4, \Docker\API\Model\Runtime::class, 'json', $context); + } + $object->setRuntimes($values_4); + unset($data['Runtimes']); + } elseif (\array_key_exists('Runtimes', $data) && null === $data['Runtimes']) { + $object->setRuntimes(null); + } + if (\array_key_exists('DefaultRuntime', $data) && null !== $data['DefaultRuntime']) { + $object->setDefaultRuntime($data['DefaultRuntime']); + unset($data['DefaultRuntime']); + } elseif (\array_key_exists('DefaultRuntime', $data) && null === $data['DefaultRuntime']) { + $object->setDefaultRuntime(null); + } + if (\array_key_exists('Swarm', $data) && null !== $data['Swarm']) { + $object->setSwarm($this->denormalizer->denormalize($data['Swarm'], \Docker\API\Model\SwarmInfo::class, 'json', $context)); + unset($data['Swarm']); + } elseif (\array_key_exists('Swarm', $data) && null === $data['Swarm']) { + $object->setSwarm(null); + } + if (\array_key_exists('LiveRestoreEnabled', $data) && null !== $data['LiveRestoreEnabled']) { + $object->setLiveRestoreEnabled($data['LiveRestoreEnabled']); + unset($data['LiveRestoreEnabled']); + } elseif (\array_key_exists('LiveRestoreEnabled', $data) && null === $data['LiveRestoreEnabled']) { + $object->setLiveRestoreEnabled(null); + } + if (\array_key_exists('Isolation', $data) && null !== $data['Isolation']) { + $object->setIsolation($data['Isolation']); + unset($data['Isolation']); + } elseif (\array_key_exists('Isolation', $data) && null === $data['Isolation']) { + $object->setIsolation(null); + } + if (\array_key_exists('InitBinary', $data) && null !== $data['InitBinary']) { + $object->setInitBinary($data['InitBinary']); + unset($data['InitBinary']); + } elseif (\array_key_exists('InitBinary', $data) && null === $data['InitBinary']) { + $object->setInitBinary(null); + } + if (\array_key_exists('ContainerdCommit', $data) && null !== $data['ContainerdCommit']) { + $object->setContainerdCommit($this->denormalizer->denormalize($data['ContainerdCommit'], \Docker\API\Model\Commit::class, 'json', $context)); + unset($data['ContainerdCommit']); + } elseif (\array_key_exists('ContainerdCommit', $data) && null === $data['ContainerdCommit']) { + $object->setContainerdCommit(null); + } + if (\array_key_exists('RuncCommit', $data) && null !== $data['RuncCommit']) { + $object->setRuncCommit($this->denormalizer->denormalize($data['RuncCommit'], \Docker\API\Model\Commit::class, 'json', $context)); + unset($data['RuncCommit']); + } elseif (\array_key_exists('RuncCommit', $data) && null === $data['RuncCommit']) { + $object->setRuncCommit(null); + } + if (\array_key_exists('InitCommit', $data) && null !== $data['InitCommit']) { + $object->setInitCommit($this->denormalizer->denormalize($data['InitCommit'], \Docker\API\Model\Commit::class, 'json', $context)); + unset($data['InitCommit']); + } elseif (\array_key_exists('InitCommit', $data) && null === $data['InitCommit']) { + $object->setInitCommit(null); + } + if (\array_key_exists('SecurityOptions', $data) && null !== $data['SecurityOptions']) { $values_5 = []; - foreach ($data->{'Labels'} as $value_5) { + foreach ($data['SecurityOptions'] as $value_5) { $values_5[] = $value_5; } - $object->setLabels($values_5); - } - if (property_exists($data, 'ExperimentalBuild') && $data->{'ExperimentalBuild'} !== null) { - $object->setExperimentalBuild($data->{'ExperimentalBuild'}); - } - if (property_exists($data, 'ServerVersion') && $data->{'ServerVersion'} !== null) { - $object->setServerVersion($data->{'ServerVersion'}); - } - if (property_exists($data, 'ClusterStore') && $data->{'ClusterStore'} !== null) { - $object->setClusterStore($data->{'ClusterStore'}); - } - if (property_exists($data, 'ClusterAdvertise') && $data->{'ClusterAdvertise'} !== null) { - $object->setClusterAdvertise($data->{'ClusterAdvertise'}); - } - if (property_exists($data, 'Runtimes') && $data->{'Runtimes'} !== null) { - $values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Runtimes'} as $key => $value_6) { - $values_6[$key] = $this->denormalizer->denormalize($value_6, 'Docker\\API\\Model\\Runtime', 'json', $context); + $object->setSecurityOptions($values_5); + unset($data['SecurityOptions']); + } elseif (\array_key_exists('SecurityOptions', $data) && null === $data['SecurityOptions']) { + $object->setSecurityOptions(null); + } + if (\array_key_exists('ProductLicense', $data) && null !== $data['ProductLicense']) { + $object->setProductLicense($data['ProductLicense']); + unset($data['ProductLicense']); + } elseif (\array_key_exists('ProductLicense', $data) && null === $data['ProductLicense']) { + $object->setProductLicense(null); + } + if (\array_key_exists('DefaultAddressPools', $data) && null !== $data['DefaultAddressPools']) { + $values_6 = []; + foreach ($data['DefaultAddressPools'] as $value_6) { + $values_6[] = $this->denormalizer->denormalize($value_6, \Docker\API\Model\SystemInfoDefaultAddressPoolsItem::class, 'json', $context); } - $object->setRuntimes($values_6); - } - if (property_exists($data, 'DefaultRuntime') && $data->{'DefaultRuntime'} !== null) { - $object->setDefaultRuntime($data->{'DefaultRuntime'}); - } - if (property_exists($data, 'Swarm') && $data->{'Swarm'} !== null) { - $object->setSwarm($this->denormalizer->denormalize($data->{'Swarm'}, 'Docker\\API\\Model\\SwarmInfo', 'json', $context)); - } - if (property_exists($data, 'LiveRestoreEnabled') && $data->{'LiveRestoreEnabled'} !== null) { - $object->setLiveRestoreEnabled($data->{'LiveRestoreEnabled'}); - } - if (property_exists($data, 'Isolation') && $data->{'Isolation'} !== null) { - $object->setIsolation($data->{'Isolation'}); + $object->setDefaultAddressPools($values_6); + unset($data['DefaultAddressPools']); + } elseif (\array_key_exists('DefaultAddressPools', $data) && null === $data['DefaultAddressPools']) { + $object->setDefaultAddressPools(null); } - if (property_exists($data, 'InitBinary') && $data->{'InitBinary'} !== null) { - $object->setInitBinary($data->{'InitBinary'}); - } - if (property_exists($data, 'ContainerdCommit') && $data->{'ContainerdCommit'} !== null) { - $object->setContainerdCommit($this->denormalizer->denormalize($data->{'ContainerdCommit'}, 'Docker\\API\\Model\\Commit', 'json', $context)); - } - if (property_exists($data, 'RuncCommit') && $data->{'RuncCommit'} !== null) { - $object->setRuncCommit($this->denormalizer->denormalize($data->{'RuncCommit'}, 'Docker\\API\\Model\\Commit', 'json', $context)); - } - if (property_exists($data, 'InitCommit') && $data->{'InitCommit'} !== null) { - $object->setInitCommit($this->denormalizer->denormalize($data->{'InitCommit'}, 'Docker\\API\\Model\\Commit', 'json', $context)); - } - if (property_exists($data, 'SecurityOptions') && $data->{'SecurityOptions'} !== null) { + if (\array_key_exists('Warnings', $data) && null !== $data['Warnings']) { $values_7 = []; - foreach ($data->{'SecurityOptions'} as $value_7) { + foreach ($data['Warnings'] as $value_7) { $values_7[] = $value_7; } - $object->setSecurityOptions($values_7); + $object->setWarnings($values_7); + unset($data['Warnings']); + } elseif (\array_key_exists('Warnings', $data) && null === $data['Warnings']) { + $object->setWarnings(null); + } + if (\array_key_exists('CDISpecDirs', $data) && null !== $data['CDISpecDirs']) { + $values_8 = []; + foreach ($data['CDISpecDirs'] as $value_8) { + $values_8[] = $value_8; + } + $object->setCDISpecDirs($values_8); + unset($data['CDISpecDirs']); + } elseif (\array_key_exists('CDISpecDirs', $data) && null === $data['CDISpecDirs']) { + $object->setCDISpecDirs(null); + } + foreach ($data as $key_1 => $value_9) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_9; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $dataArray = []; + if ($data->isInitialized('iD') && null !== $data->getID()) { + $dataArray['ID'] = $data->getID(); } - if (null !== $object->getContainers()) { - $data->{'Containers'} = $object->getContainers(); + if ($data->isInitialized('containers') && null !== $data->getContainers()) { + $dataArray['Containers'] = $data->getContainers(); } - if (null !== $object->getContainersRunning()) { - $data->{'ContainersRunning'} = $object->getContainersRunning(); + if ($data->isInitialized('containersRunning') && null !== $data->getContainersRunning()) { + $dataArray['ContainersRunning'] = $data->getContainersRunning(); } - if (null !== $object->getContainersPaused()) { - $data->{'ContainersPaused'} = $object->getContainersPaused(); + if ($data->isInitialized('containersPaused') && null !== $data->getContainersPaused()) { + $dataArray['ContainersPaused'] = $data->getContainersPaused(); } - if (null !== $object->getContainersStopped()) { - $data->{'ContainersStopped'} = $object->getContainersStopped(); + if ($data->isInitialized('containersStopped') && null !== $data->getContainersStopped()) { + $dataArray['ContainersStopped'] = $data->getContainersStopped(); } - if (null !== $object->getImages()) { - $data->{'Images'} = $object->getImages(); + if ($data->isInitialized('images') && null !== $data->getImages()) { + $dataArray['Images'] = $data->getImages(); } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); + if ($data->isInitialized('driver') && null !== $data->getDriver()) { + $dataArray['Driver'] = $data->getDriver(); } - if (null !== $object->getDriverStatus()) { + if ($data->isInitialized('driverStatus') && null !== $data->getDriverStatus()) { $values = []; - foreach ($object->getDriverStatus() as $value) { + foreach ($data->getDriverStatus() as $value) { $values_1 = []; foreach ($value as $value_1) { $values_1[] = $value_1; } $values[] = $values_1; } - $data->{'DriverStatus'} = $values; + $dataArray['DriverStatus'] = $values; } - if (null !== $object->getDockerRootDir()) { - $data->{'DockerRootDir'} = $object->getDockerRootDir(); + if ($data->isInitialized('dockerRootDir') && null !== $data->getDockerRootDir()) { + $dataArray['DockerRootDir'] = $data->getDockerRootDir(); } - if (null !== $object->getSystemStatus()) { - $values_2 = []; - foreach ($object->getSystemStatus() as $value_2) { - $values_3 = []; - foreach ($value_2 as $value_3) { - $values_3[] = $value_3; - } - $values_2[] = $values_3; - } - $data->{'SystemStatus'} = $values_2; + if ($data->isInitialized('plugins') && null !== $data->getPlugins()) { + $dataArray['Plugins'] = $this->normalizer->normalize($data->getPlugins(), 'json', $context); } - if (null !== $object->getPlugins()) { - $data->{'Plugins'} = $this->normalizer->normalize($object->getPlugins(), 'json', $context); + if ($data->isInitialized('memoryLimit') && null !== $data->getMemoryLimit()) { + $dataArray['MemoryLimit'] = $data->getMemoryLimit(); } - if (null !== $object->getMemoryLimit()) { - $data->{'MemoryLimit'} = $object->getMemoryLimit(); + if ($data->isInitialized('swapLimit') && null !== $data->getSwapLimit()) { + $dataArray['SwapLimit'] = $data->getSwapLimit(); } - if (null !== $object->getSwapLimit()) { - $data->{'SwapLimit'} = $object->getSwapLimit(); + if ($data->isInitialized('kernelMemoryTCP') && null !== $data->getKernelMemoryTCP()) { + $dataArray['KernelMemoryTCP'] = $data->getKernelMemoryTCP(); } - if (null !== $object->getKernelMemory()) { - $data->{'KernelMemory'} = $object->getKernelMemory(); + if ($data->isInitialized('cpuCfsPeriod') && null !== $data->getCpuCfsPeriod()) { + $dataArray['CpuCfsPeriod'] = $data->getCpuCfsPeriod(); } - if (null !== $object->getCpuCfsPeriod()) { - $data->{'CpuCfsPeriod'} = $object->getCpuCfsPeriod(); + if ($data->isInitialized('cpuCfsQuota') && null !== $data->getCpuCfsQuota()) { + $dataArray['CpuCfsQuota'] = $data->getCpuCfsQuota(); } - if (null !== $object->getCpuCfsQuota()) { - $data->{'CpuCfsQuota'} = $object->getCpuCfsQuota(); + if ($data->isInitialized('cPUShares') && null !== $data->getCPUShares()) { + $dataArray['CPUShares'] = $data->getCPUShares(); } - if (null !== $object->getCPUShares()) { - $data->{'CPUShares'} = $object->getCPUShares(); + if ($data->isInitialized('cPUSet') && null !== $data->getCPUSet()) { + $dataArray['CPUSet'] = $data->getCPUSet(); } - if (null !== $object->getCPUSet()) { - $data->{'CPUSet'} = $object->getCPUSet(); + if ($data->isInitialized('pidsLimit') && null !== $data->getPidsLimit()) { + $dataArray['PidsLimit'] = $data->getPidsLimit(); } - if (null !== $object->getOomKillDisable()) { - $data->{'OomKillDisable'} = $object->getOomKillDisable(); + if ($data->isInitialized('oomKillDisable') && null !== $data->getOomKillDisable()) { + $dataArray['OomKillDisable'] = $data->getOomKillDisable(); } - if (null !== $object->getIPv4Forwarding()) { - $data->{'IPv4Forwarding'} = $object->getIPv4Forwarding(); + if ($data->isInitialized('iPv4Forwarding') && null !== $data->getIPv4Forwarding()) { + $dataArray['IPv4Forwarding'] = $data->getIPv4Forwarding(); } - if (null !== $object->getBridgeNfIptables()) { - $data->{'BridgeNfIptables'} = $object->getBridgeNfIptables(); + if ($data->isInitialized('bridgeNfIptables') && null !== $data->getBridgeNfIptables()) { + $dataArray['BridgeNfIptables'] = $data->getBridgeNfIptables(); } - if (null !== $object->getBridgeNfIp6tables()) { - $data->{'BridgeNfIp6tables'} = $object->getBridgeNfIp6tables(); + if ($data->isInitialized('bridgeNfIp6tables') && null !== $data->getBridgeNfIp6tables()) { + $dataArray['BridgeNfIp6tables'] = $data->getBridgeNfIp6tables(); } - if (null !== $object->getDebug()) { - $data->{'Debug'} = $object->getDebug(); + if ($data->isInitialized('debug') && null !== $data->getDebug()) { + $dataArray['Debug'] = $data->getDebug(); } - if (null !== $object->getNFd()) { - $data->{'NFd'} = $object->getNFd(); + if ($data->isInitialized('nFd') && null !== $data->getNFd()) { + $dataArray['NFd'] = $data->getNFd(); } - if (null !== $object->getNGoroutines()) { - $data->{'NGoroutines'} = $object->getNGoroutines(); + if ($data->isInitialized('nGoroutines') && null !== $data->getNGoroutines()) { + $dataArray['NGoroutines'] = $data->getNGoroutines(); } - if (null !== $object->getSystemTime()) { - $data->{'SystemTime'} = $object->getSystemTime(); + if ($data->isInitialized('systemTime') && null !== $data->getSystemTime()) { + $dataArray['SystemTime'] = $data->getSystemTime(); } - if (null !== $object->getLoggingDriver()) { - $data->{'LoggingDriver'} = $object->getLoggingDriver(); + if ($data->isInitialized('loggingDriver') && null !== $data->getLoggingDriver()) { + $dataArray['LoggingDriver'] = $data->getLoggingDriver(); } - if (null !== $object->getCgroupDriver()) { - $data->{'CgroupDriver'} = $object->getCgroupDriver(); + if ($data->isInitialized('cgroupDriver') && null !== $data->getCgroupDriver()) { + $dataArray['CgroupDriver'] = $data->getCgroupDriver(); } - if (null !== $object->getNEventsListener()) { - $data->{'NEventsListener'} = $object->getNEventsListener(); + if ($data->isInitialized('cgroupVersion') && null !== $data->getCgroupVersion()) { + $dataArray['CgroupVersion'] = $data->getCgroupVersion(); } - if (null !== $object->getKernelVersion()) { - $data->{'KernelVersion'} = $object->getKernelVersion(); + if ($data->isInitialized('nEventsListener') && null !== $data->getNEventsListener()) { + $dataArray['NEventsListener'] = $data->getNEventsListener(); } - if (null !== $object->getOperatingSystem()) { - $data->{'OperatingSystem'} = $object->getOperatingSystem(); + if ($data->isInitialized('kernelVersion') && null !== $data->getKernelVersion()) { + $dataArray['KernelVersion'] = $data->getKernelVersion(); } - if (null !== $object->getOSType()) { - $data->{'OSType'} = $object->getOSType(); + if ($data->isInitialized('operatingSystem') && null !== $data->getOperatingSystem()) { + $dataArray['OperatingSystem'] = $data->getOperatingSystem(); } - if (null !== $object->getArchitecture()) { - $data->{'Architecture'} = $object->getArchitecture(); + if ($data->isInitialized('oSVersion') && null !== $data->getOSVersion()) { + $dataArray['OSVersion'] = $data->getOSVersion(); } - if (null !== $object->getNCPU()) { - $data->{'NCPU'} = $object->getNCPU(); + if ($data->isInitialized('oSType') && null !== $data->getOSType()) { + $dataArray['OSType'] = $data->getOSType(); } - if (null !== $object->getMemTotal()) { - $data->{'MemTotal'} = $object->getMemTotal(); + if ($data->isInitialized('architecture') && null !== $data->getArchitecture()) { + $dataArray['Architecture'] = $data->getArchitecture(); } - if (null !== $object->getIndexServerAddress()) { - $data->{'IndexServerAddress'} = $object->getIndexServerAddress(); + if ($data->isInitialized('nCPU') && null !== $data->getNCPU()) { + $dataArray['NCPU'] = $data->getNCPU(); } - if (null !== $object->getRegistryConfig()) { - $data->{'RegistryConfig'} = $this->normalizer->normalize($object->getRegistryConfig(), 'json', $context); + if ($data->isInitialized('memTotal') && null !== $data->getMemTotal()) { + $dataArray['MemTotal'] = $data->getMemTotal(); } - if (null !== $object->getGenericResources()) { - $values_4 = []; - foreach ($object->getGenericResources() as $value_4) { - $values_4[] = $this->normalizer->normalize($value_4, 'json', $context); + if ($data->isInitialized('indexServerAddress') && null !== $data->getIndexServerAddress()) { + $dataArray['IndexServerAddress'] = $data->getIndexServerAddress(); + } + if ($data->isInitialized('registryConfig') && null !== $data->getRegistryConfig()) { + $dataArray['RegistryConfig'] = $this->normalizer->normalize($data->getRegistryConfig(), 'json', $context); + } + if ($data->isInitialized('genericResources') && null !== $data->getGenericResources()) { + $values_2 = []; + foreach ($data->getGenericResources() as $value_2) { + $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); } - $data->{'GenericResources'} = $values_4; + $dataArray['GenericResources'] = $values_2; } - if (null !== $object->getHttpProxy()) { - $data->{'HttpProxy'} = $object->getHttpProxy(); + if ($data->isInitialized('httpProxy') && null !== $data->getHttpProxy()) { + $dataArray['HttpProxy'] = $data->getHttpProxy(); } - if (null !== $object->getHttpsProxy()) { - $data->{'HttpsProxy'} = $object->getHttpsProxy(); + if ($data->isInitialized('httpsProxy') && null !== $data->getHttpsProxy()) { + $dataArray['HttpsProxy'] = $data->getHttpsProxy(); } - if (null !== $object->getNoProxy()) { - $data->{'NoProxy'} = $object->getNoProxy(); + if ($data->isInitialized('noProxy') && null !== $data->getNoProxy()) { + $dataArray['NoProxy'] = $data->getNoProxy(); } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getLabels()) { - $values_5 = []; - foreach ($object->getLabels() as $value_5) { - $values_5[] = $value_5; + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values_3 = []; + foreach ($data->getLabels() as $value_3) { + $values_3[] = $value_3; } - $data->{'Labels'} = $values_5; + $dataArray['Labels'] = $values_3; } - if (null !== $object->getExperimentalBuild()) { - $data->{'ExperimentalBuild'} = $object->getExperimentalBuild(); + if ($data->isInitialized('experimentalBuild') && null !== $data->getExperimentalBuild()) { + $dataArray['ExperimentalBuild'] = $data->getExperimentalBuild(); } - if (null !== $object->getServerVersion()) { - $data->{'ServerVersion'} = $object->getServerVersion(); + if ($data->isInitialized('serverVersion') && null !== $data->getServerVersion()) { + $dataArray['ServerVersion'] = $data->getServerVersion(); } - if (null !== $object->getClusterStore()) { - $data->{'ClusterStore'} = $object->getClusterStore(); + if ($data->isInitialized('runtimes') && null !== $data->getRuntimes()) { + $values_4 = []; + foreach ($data->getRuntimes() as $key => $value_4) { + $values_4[$key] = $this->normalizer->normalize($value_4, 'json', $context); + } + $dataArray['Runtimes'] = $values_4; } - if (null !== $object->getClusterAdvertise()) { - $data->{'ClusterAdvertise'} = $object->getClusterAdvertise(); + if ($data->isInitialized('defaultRuntime') && null !== $data->getDefaultRuntime()) { + $dataArray['DefaultRuntime'] = $data->getDefaultRuntime(); } - if (null !== $object->getRuntimes()) { - $values_6 = new \stdClass(); - foreach ($object->getRuntimes() as $key => $value_6) { - $values_6->{$key} = $this->normalizer->normalize($value_6, 'json', $context); - } - $data->{'Runtimes'} = $values_6; + if ($data->isInitialized('swarm') && null !== $data->getSwarm()) { + $dataArray['Swarm'] = $this->normalizer->normalize($data->getSwarm(), 'json', $context); } - if (null !== $object->getDefaultRuntime()) { - $data->{'DefaultRuntime'} = $object->getDefaultRuntime(); + if ($data->isInitialized('liveRestoreEnabled') && null !== $data->getLiveRestoreEnabled()) { + $dataArray['LiveRestoreEnabled'] = $data->getLiveRestoreEnabled(); } - if (null !== $object->getSwarm()) { - $data->{'Swarm'} = $this->normalizer->normalize($object->getSwarm(), 'json', $context); + if ($data->isInitialized('isolation') && null !== $data->getIsolation()) { + $dataArray['Isolation'] = $data->getIsolation(); } - if (null !== $object->getLiveRestoreEnabled()) { - $data->{'LiveRestoreEnabled'} = $object->getLiveRestoreEnabled(); + if ($data->isInitialized('initBinary') && null !== $data->getInitBinary()) { + $dataArray['InitBinary'] = $data->getInitBinary(); } - if (null !== $object->getIsolation()) { - $data->{'Isolation'} = $object->getIsolation(); + if ($data->isInitialized('containerdCommit') && null !== $data->getContainerdCommit()) { + $dataArray['ContainerdCommit'] = $this->normalizer->normalize($data->getContainerdCommit(), 'json', $context); } - if (null !== $object->getInitBinary()) { - $data->{'InitBinary'} = $object->getInitBinary(); + if ($data->isInitialized('runcCommit') && null !== $data->getRuncCommit()) { + $dataArray['RuncCommit'] = $this->normalizer->normalize($data->getRuncCommit(), 'json', $context); } - if (null !== $object->getContainerdCommit()) { - $data->{'ContainerdCommit'} = $this->normalizer->normalize($object->getContainerdCommit(), 'json', $context); + if ($data->isInitialized('initCommit') && null !== $data->getInitCommit()) { + $dataArray['InitCommit'] = $this->normalizer->normalize($data->getInitCommit(), 'json', $context); + } + if ($data->isInitialized('securityOptions') && null !== $data->getSecurityOptions()) { + $values_5 = []; + foreach ($data->getSecurityOptions() as $value_5) { + $values_5[] = $value_5; + } + $dataArray['SecurityOptions'] = $values_5; } - if (null !== $object->getRuncCommit()) { - $data->{'RuncCommit'} = $this->normalizer->normalize($object->getRuncCommit(), 'json', $context); + if ($data->isInitialized('productLicense') && null !== $data->getProductLicense()) { + $dataArray['ProductLicense'] = $data->getProductLicense(); } - if (null !== $object->getInitCommit()) { - $data->{'InitCommit'} = $this->normalizer->normalize($object->getInitCommit(), 'json', $context); + if ($data->isInitialized('defaultAddressPools') && null !== $data->getDefaultAddressPools()) { + $values_6 = []; + foreach ($data->getDefaultAddressPools() as $value_6) { + $values_6[] = $this->normalizer->normalize($value_6, 'json', $context); + } + $dataArray['DefaultAddressPools'] = $values_6; } - if (null !== $object->getSecurityOptions()) { + if ($data->isInitialized('warnings') && null !== $data->getWarnings()) { $values_7 = []; - foreach ($object->getSecurityOptions() as $value_7) { + foreach ($data->getWarnings() as $value_7) { $values_7[] = $value_7; } - $data->{'SecurityOptions'} = $values_7; + $dataArray['Warnings'] = $values_7; + } + if ($data->isInitialized('cDISpecDirs') && null !== $data->getCDISpecDirs()) { + $values_8 = []; + foreach ($data->getCDISpecDirs() as $value_8) { + $values_8[] = $value_8; + } + $dataArray['CDISpecDirs'] = $values_8; + } + foreach ($data as $key_1 => $value_9) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_9; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemInfo::class => false]; } } diff --git a/src/Normalizer/SystemVersionComponentsItemDetailsNormalizer.php b/src/Normalizer/SystemVersionComponentsItemDetailsNormalizer.php new file mode 100644 index 00000000..98c1e4e9 --- /dev/null +++ b/src/Normalizer/SystemVersionComponentsItemDetailsNormalizer.php @@ -0,0 +1,71 @@ + $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemVersionComponentsItemDetails::class => false]; + } +} diff --git a/src/Normalizer/SystemVersionComponentsItemNormalizer.php b/src/Normalizer/SystemVersionComponentsItemNormalizer.php new file mode 100644 index 00000000..b0c4c432 --- /dev/null +++ b/src/Normalizer/SystemVersionComponentsItemNormalizer.php @@ -0,0 +1,94 @@ +setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Version', $data) && null !== $data['Version']) { + $object->setVersion($data['Version']); + unset($data['Version']); + } elseif (\array_key_exists('Version', $data) && null === $data['Version']) { + $object->setVersion(null); + } + if (\array_key_exists('Details', $data) && null !== $data['Details']) { + $object->setDetails($this->denormalizer->denormalize($data['Details'], \Docker\API\Model\SystemVersionComponentsItemDetails::class, 'json', $context)); + unset($data['Details']); + } elseif (\array_key_exists('Details', $data) && null === $data['Details']) { + $object->setDetails(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + $dataArray['Name'] = $data->getName(); + $dataArray['Version'] = $data->getVersion(); + if ($data->isInitialized('details') && null !== $data->getDetails()) { + $dataArray['Details'] = $this->normalizer->normalize($data->getDetails(), 'json', $context); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemVersionComponentsItem::class => false]; + } +} diff --git a/src/Normalizer/SystemVersionNormalizer.php b/src/Normalizer/SystemVersionNormalizer.php new file mode 100644 index 00000000..1d203a26 --- /dev/null +++ b/src/Normalizer/SystemVersionNormalizer.php @@ -0,0 +1,190 @@ +setPlatform($this->denormalizer->denormalize($data['Platform'], \Docker\API\Model\SystemVersionPlatform::class, 'json', $context)); + unset($data['Platform']); + } elseif (\array_key_exists('Platform', $data) && null === $data['Platform']) { + $object->setPlatform(null); + } + if (\array_key_exists('Components', $data) && null !== $data['Components']) { + $values = []; + foreach ($data['Components'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\SystemVersionComponentsItem::class, 'json', $context); + } + $object->setComponents($values); + unset($data['Components']); + } elseif (\array_key_exists('Components', $data) && null === $data['Components']) { + $object->setComponents(null); + } + if (\array_key_exists('Version', $data) && null !== $data['Version']) { + $object->setVersion($data['Version']); + unset($data['Version']); + } elseif (\array_key_exists('Version', $data) && null === $data['Version']) { + $object->setVersion(null); + } + if (\array_key_exists('ApiVersion', $data) && null !== $data['ApiVersion']) { + $object->setApiVersion($data['ApiVersion']); + unset($data['ApiVersion']); + } elseif (\array_key_exists('ApiVersion', $data) && null === $data['ApiVersion']) { + $object->setApiVersion(null); + } + if (\array_key_exists('MinAPIVersion', $data) && null !== $data['MinAPIVersion']) { + $object->setMinAPIVersion($data['MinAPIVersion']); + unset($data['MinAPIVersion']); + } elseif (\array_key_exists('MinAPIVersion', $data) && null === $data['MinAPIVersion']) { + $object->setMinAPIVersion(null); + } + if (\array_key_exists('GitCommit', $data) && null !== $data['GitCommit']) { + $object->setGitCommit($data['GitCommit']); + unset($data['GitCommit']); + } elseif (\array_key_exists('GitCommit', $data) && null === $data['GitCommit']) { + $object->setGitCommit(null); + } + if (\array_key_exists('GoVersion', $data) && null !== $data['GoVersion']) { + $object->setGoVersion($data['GoVersion']); + unset($data['GoVersion']); + } elseif (\array_key_exists('GoVersion', $data) && null === $data['GoVersion']) { + $object->setGoVersion(null); + } + if (\array_key_exists('Os', $data) && null !== $data['Os']) { + $object->setOs($data['Os']); + unset($data['Os']); + } elseif (\array_key_exists('Os', $data) && null === $data['Os']) { + $object->setOs(null); + } + if (\array_key_exists('Arch', $data) && null !== $data['Arch']) { + $object->setArch($data['Arch']); + unset($data['Arch']); + } elseif (\array_key_exists('Arch', $data) && null === $data['Arch']) { + $object->setArch(null); + } + if (\array_key_exists('KernelVersion', $data) && null !== $data['KernelVersion']) { + $object->setKernelVersion($data['KernelVersion']); + unset($data['KernelVersion']); + } elseif (\array_key_exists('KernelVersion', $data) && null === $data['KernelVersion']) { + $object->setKernelVersion(null); + } + if (\array_key_exists('Experimental', $data) && null !== $data['Experimental']) { + $object->setExperimental($data['Experimental']); + unset($data['Experimental']); + } elseif (\array_key_exists('Experimental', $data) && null === $data['Experimental']) { + $object->setExperimental(null); + } + if (\array_key_exists('BuildTime', $data) && null !== $data['BuildTime']) { + $object->setBuildTime($data['BuildTime']); + unset($data['BuildTime']); + } elseif (\array_key_exists('BuildTime', $data) && null === $data['BuildTime']) { + $object->setBuildTime(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('platform') && null !== $data->getPlatform()) { + $dataArray['Platform'] = $this->normalizer->normalize($data->getPlatform(), 'json', $context); + } + if ($data->isInitialized('components') && null !== $data->getComponents()) { + $values = []; + foreach ($data->getComponents() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $dataArray['Components'] = $values; + } + if ($data->isInitialized('version') && null !== $data->getVersion()) { + $dataArray['Version'] = $data->getVersion(); + } + if ($data->isInitialized('apiVersion') && null !== $data->getApiVersion()) { + $dataArray['ApiVersion'] = $data->getApiVersion(); + } + if ($data->isInitialized('minAPIVersion') && null !== $data->getMinAPIVersion()) { + $dataArray['MinAPIVersion'] = $data->getMinAPIVersion(); + } + if ($data->isInitialized('gitCommit') && null !== $data->getGitCommit()) { + $dataArray['GitCommit'] = $data->getGitCommit(); + } + if ($data->isInitialized('goVersion') && null !== $data->getGoVersion()) { + $dataArray['GoVersion'] = $data->getGoVersion(); + } + if ($data->isInitialized('os') && null !== $data->getOs()) { + $dataArray['Os'] = $data->getOs(); + } + if ($data->isInitialized('arch') && null !== $data->getArch()) { + $dataArray['Arch'] = $data->getArch(); + } + if ($data->isInitialized('kernelVersion') && null !== $data->getKernelVersion()) { + $dataArray['KernelVersion'] = $data->getKernelVersion(); + } + if ($data->isInitialized('experimental') && null !== $data->getExperimental()) { + $dataArray['Experimental'] = $data->getExperimental(); + } + if ($data->isInitialized('buildTime') && null !== $data->getBuildTime()) { + $dataArray['BuildTime'] = $data->getBuildTime(); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemVersion::class => false]; + } +} diff --git a/src/Normalizer/SystemVersionPlatformNormalizer.php b/src/Normalizer/SystemVersionPlatformNormalizer.php new file mode 100644 index 00000000..bc9789c8 --- /dev/null +++ b/src/Normalizer/SystemVersionPlatformNormalizer.php @@ -0,0 +1,78 @@ +setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + $dataArray['Name'] = $data->getName(); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\SystemVersionPlatform::class => false]; + } +} diff --git a/src/Normalizer/TLSInfoNormalizer.php b/src/Normalizer/TLSInfoNormalizer.php index 4e07df45..6824356a 100644 --- a/src/Normalizer/TLSInfoNormalizer.php +++ b/src/Normalizer/TLSInfoNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,51 +16,83 @@ class TLSInfoNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TLSInfo'; + return \Docker\API\Model\TLSInfo::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TLSInfo; + return \is_object($data) && \Docker\API\Model\TLSInfo::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TLSInfo(); - if (property_exists($data, 'TrustRoot') && $data->{'TrustRoot'} !== null) { - $object->setTrustRoot($data->{'TrustRoot'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('TrustRoot', $data) && null !== $data['TrustRoot']) { + $object->setTrustRoot($data['TrustRoot']); + unset($data['TrustRoot']); + } elseif (\array_key_exists('TrustRoot', $data) && null === $data['TrustRoot']) { + $object->setTrustRoot(null); + } + if (\array_key_exists('CertIssuerSubject', $data) && null !== $data['CertIssuerSubject']) { + $object->setCertIssuerSubject($data['CertIssuerSubject']); + unset($data['CertIssuerSubject']); + } elseif (\array_key_exists('CertIssuerSubject', $data) && null === $data['CertIssuerSubject']) { + $object->setCertIssuerSubject(null); } - if (property_exists($data, 'CertIssuerSubject') && $data->{'CertIssuerSubject'} !== null) { - $object->setCertIssuerSubject($data->{'CertIssuerSubject'}); + if (\array_key_exists('CertIssuerPublicKey', $data) && null !== $data['CertIssuerPublicKey']) { + $object->setCertIssuerPublicKey($data['CertIssuerPublicKey']); + unset($data['CertIssuerPublicKey']); + } elseif (\array_key_exists('CertIssuerPublicKey', $data) && null === $data['CertIssuerPublicKey']) { + $object->setCertIssuerPublicKey(null); } - if (property_exists($data, 'CertIssuerPublicKey') && $data->{'CertIssuerPublicKey'} !== null) { - $object->setCertIssuerPublicKey($data->{'CertIssuerPublicKey'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getTrustRoot()) { - $data->{'TrustRoot'} = $object->getTrustRoot(); + $dataArray = []; + if ($data->isInitialized('trustRoot') && null !== $data->getTrustRoot()) { + $dataArray['TrustRoot'] = $data->getTrustRoot(); } - if (null !== $object->getCertIssuerSubject()) { - $data->{'CertIssuerSubject'} = $object->getCertIssuerSubject(); + if ($data->isInitialized('certIssuerSubject') && null !== $data->getCertIssuerSubject()) { + $dataArray['CertIssuerSubject'] = $data->getCertIssuerSubject(); } - if (null !== $object->getCertIssuerPublicKey()) { - $data->{'CertIssuerPublicKey'} = $object->getCertIssuerPublicKey(); + if ($data->isInitialized('certIssuerPublicKey') && null !== $data->getCertIssuerPublicKey()) { + $dataArray['CertIssuerPublicKey'] = $data->getCertIssuerPublicKey(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TLSInfo::class => false]; } } diff --git a/src/Normalizer/TaskNormalizer.php b/src/Normalizer/TaskNormalizer.php index d35888a9..c920f31e 100644 --- a/src/Normalizer/TaskNormalizer.php +++ b/src/Normalizer/TaskNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,127 +16,198 @@ class TaskNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Task'; + return \Docker\API\Model\Task::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Task; + return \is_object($data) && \Docker\API\Model\Task::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\Task(); - if (property_exists($data, 'ID') && $data->{'ID'} !== null) { - $object->setID($data->{'ID'}); - } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($this->denormalizer->denormalize($data->{'Version'}, 'Docker\\API\\Model\\ObjectVersion', 'json', $context)); - } - if (property_exists($data, 'CreatedAt') && $data->{'CreatedAt'} !== null) { - $object->setCreatedAt($data->{'CreatedAt'}); - } - if (property_exists($data, 'UpdatedAt') && $data->{'UpdatedAt'} !== null) { - $object->setUpdatedAt($data->{'UpdatedAt'}); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + $object = new \Docker\API\Model\Task(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('ID', $data) && null !== $data['ID']) { + $object->setID($data['ID']); + unset($data['ID']); + } elseif (\array_key_exists('ID', $data) && null === $data['ID']) { + $object->setID(null); + } + if (\array_key_exists('Version', $data) && null !== $data['Version']) { + $object->setVersion($this->denormalizer->denormalize($data['Version'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + unset($data['Version']); + } elseif (\array_key_exists('Version', $data) && null === $data['Version']) { + $object->setVersion(null); + } + if (\array_key_exists('CreatedAt', $data) && null !== $data['CreatedAt']) { + $object->setCreatedAt($data['CreatedAt']); + unset($data['CreatedAt']); + } elseif (\array_key_exists('CreatedAt', $data) && null === $data['CreatedAt']) { + $object->setCreatedAt(null); + } + if (\array_key_exists('UpdatedAt', $data) && null !== $data['UpdatedAt']) { + $object->setUpdatedAt($data['UpdatedAt']); + unset($data['UpdatedAt']); + } elseif (\array_key_exists('UpdatedAt', $data) && null === $data['UpdatedAt']) { + $object->setUpdatedAt(null); + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); - } - if (property_exists($data, 'Spec') && $data->{'Spec'} !== null) { - $object->setSpec($this->denormalizer->denormalize($data->{'Spec'}, 'Docker\\API\\Model\\TaskSpec', 'json', $context)); - } - if (property_exists($data, 'ServiceID') && $data->{'ServiceID'} !== null) { - $object->setServiceID($data->{'ServiceID'}); - } - if (property_exists($data, 'Slot') && $data->{'Slot'} !== null) { - $object->setSlot($data->{'Slot'}); - } - if (property_exists($data, 'NodeID') && $data->{'NodeID'} !== null) { - $object->setNodeID($data->{'NodeID'}); - } - if (property_exists($data, 'AssignedGenericResources') && $data->{'AssignedGenericResources'} !== null) { + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + if (\array_key_exists('Spec', $data) && null !== $data['Spec']) { + $object->setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\TaskSpec::class, 'json', $context)); + unset($data['Spec']); + } elseif (\array_key_exists('Spec', $data) && null === $data['Spec']) { + $object->setSpec(null); + } + if (\array_key_exists('ServiceID', $data) && null !== $data['ServiceID']) { + $object->setServiceID($data['ServiceID']); + unset($data['ServiceID']); + } elseif (\array_key_exists('ServiceID', $data) && null === $data['ServiceID']) { + $object->setServiceID(null); + } + if (\array_key_exists('Slot', $data) && null !== $data['Slot']) { + $object->setSlot($data['Slot']); + unset($data['Slot']); + } elseif (\array_key_exists('Slot', $data) && null === $data['Slot']) { + $object->setSlot(null); + } + if (\array_key_exists('NodeID', $data) && null !== $data['NodeID']) { + $object->setNodeID($data['NodeID']); + unset($data['NodeID']); + } elseif (\array_key_exists('NodeID', $data) && null === $data['NodeID']) { + $object->setNodeID(null); + } + if (\array_key_exists('AssignedGenericResources', $data) && null !== $data['AssignedGenericResources']) { $values_1 = []; - foreach ($data->{'AssignedGenericResources'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\GenericResourcesItem', 'json', $context); + foreach ($data['AssignedGenericResources'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\GenericResourcesItem::class, 'json', $context); } $object->setAssignedGenericResources($values_1); - } - if (property_exists($data, 'Status') && $data->{'Status'} !== null) { - $object->setStatus($this->denormalizer->denormalize($data->{'Status'}, 'Docker\\API\\Model\\TaskStatus', 'json', $context)); - } - if (property_exists($data, 'DesiredState') && $data->{'DesiredState'} !== null) { - $object->setDesiredState($data->{'DesiredState'}); + unset($data['AssignedGenericResources']); + } elseif (\array_key_exists('AssignedGenericResources', $data) && null === $data['AssignedGenericResources']) { + $object->setAssignedGenericResources(null); + } + if (\array_key_exists('Status', $data) && null !== $data['Status']) { + $object->setStatus($this->denormalizer->denormalize($data['Status'], \Docker\API\Model\TaskStatus::class, 'json', $context)); + unset($data['Status']); + } elseif (\array_key_exists('Status', $data) && null === $data['Status']) { + $object->setStatus(null); + } + if (\array_key_exists('DesiredState', $data) && null !== $data['DesiredState']) { + $object->setDesiredState($data['DesiredState']); + unset($data['DesiredState']); + } elseif (\array_key_exists('DesiredState', $data) && null === $data['DesiredState']) { + $object->setDesiredState(null); + } + if (\array_key_exists('JobIteration', $data) && null !== $data['JobIteration']) { + $object->setJobIteration($this->denormalizer->denormalize($data['JobIteration'], \Docker\API\Model\ObjectVersion::class, 'json', $context)); + unset($data['JobIteration']); + } elseif (\array_key_exists('JobIteration', $data) && null === $data['JobIteration']) { + $object->setJobIteration(null); + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_2; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getID()) { - $data->{'ID'} = $object->getID(); + $dataArray = []; + if ($data->isInitialized('iD') && null !== $data->getID()) { + $dataArray['ID'] = $data->getID(); } - if (null !== $object->getVersion()) { - $data->{'Version'} = $this->normalizer->normalize($object->getVersion(), 'json', $context); + if ($data->isInitialized('version') && null !== $data->getVersion()) { + $dataArray['Version'] = $this->normalizer->normalize($data->getVersion(), 'json', $context); } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt(); + if ($data->isInitialized('createdAt') && null !== $data->getCreatedAt()) { + $dataArray['CreatedAt'] = $data->getCreatedAt(); } - if (null !== $object->getUpdatedAt()) { - $data->{'UpdatedAt'} = $object->getUpdatedAt(); + if ($data->isInitialized('updatedAt') && null !== $data->getUpdatedAt()) { + $dataArray['UpdatedAt'] = $data->getUpdatedAt(); } - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values = []; + foreach ($data->getLabels() as $key => $value) { + $values[$key] = $value; } - $data->{'Labels'} = $values; + $dataArray['Labels'] = $values; } - if (null !== $object->getSpec()) { - $data->{'Spec'} = $this->normalizer->normalize($object->getSpec(), 'json', $context); + if ($data->isInitialized('spec') && null !== $data->getSpec()) { + $dataArray['Spec'] = $this->normalizer->normalize($data->getSpec(), 'json', $context); } - if (null !== $object->getServiceID()) { - $data->{'ServiceID'} = $object->getServiceID(); + if ($data->isInitialized('serviceID') && null !== $data->getServiceID()) { + $dataArray['ServiceID'] = $data->getServiceID(); } - if (null !== $object->getSlot()) { - $data->{'Slot'} = $object->getSlot(); + if ($data->isInitialized('slot') && null !== $data->getSlot()) { + $dataArray['Slot'] = $data->getSlot(); } - if (null !== $object->getNodeID()) { - $data->{'NodeID'} = $object->getNodeID(); + if ($data->isInitialized('nodeID') && null !== $data->getNodeID()) { + $dataArray['NodeID'] = $data->getNodeID(); } - if (null !== $object->getAssignedGenericResources()) { + if ($data->isInitialized('assignedGenericResources') && null !== $data->getAssignedGenericResources()) { $values_1 = []; - foreach ($object->getAssignedGenericResources() as $value_1) { + foreach ($data->getAssignedGenericResources() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'AssignedGenericResources'} = $values_1; + $dataArray['AssignedGenericResources'] = $values_1; + } + if ($data->isInitialized('status') && null !== $data->getStatus()) { + $dataArray['Status'] = $this->normalizer->normalize($data->getStatus(), 'json', $context); } - if (null !== $object->getStatus()) { - $data->{'Status'} = $this->normalizer->normalize($object->getStatus(), 'json', $context); + if ($data->isInitialized('desiredState') && null !== $data->getDesiredState()) { + $dataArray['DesiredState'] = $data->getDesiredState(); } - if (null !== $object->getDesiredState()) { - $data->{'DesiredState'} = $object->getDesiredState(); + if ($data->isInitialized('jobIteration') && null !== $data->getJobIteration()) { + $dataArray['JobIteration'] = $this->normalizer->normalize($data->getJobIteration(), 'json', $context); + } + foreach ($data as $key_1 => $value_2) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_2; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Task::class => false]; } } diff --git a/src/Normalizer/TaskSpecContainerSpecConfigsItemFileNormalizer.php b/src/Normalizer/TaskSpecContainerSpecConfigsItemFileNormalizer.php index d7fba318..2d8b4c3d 100644 --- a/src/Normalizer/TaskSpecContainerSpecConfigsItemFileNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecConfigsItemFileNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,57 +16,92 @@ class TaskSpecContainerSpecConfigsItemFileNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpecContainerSpecConfigsItemFile'; + return \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile; + return \is_object($data) && \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('UID', $data) && null !== $data['UID']) { + $object->setUID($data['UID']); + unset($data['UID']); + } elseif (\array_key_exists('UID', $data) && null === $data['UID']) { + $object->setUID(null); } - if (property_exists($data, 'UID') && $data->{'UID'} !== null) { - $object->setUID($data->{'UID'}); + if (\array_key_exists('GID', $data) && null !== $data['GID']) { + $object->setGID($data['GID']); + unset($data['GID']); + } elseif (\array_key_exists('GID', $data) && null === $data['GID']) { + $object->setGID(null); } - if (property_exists($data, 'GID') && $data->{'GID'} !== null) { - $object->setGID($data->{'GID'}); + if (\array_key_exists('Mode', $data) && null !== $data['Mode']) { + $object->setMode($data['Mode']); + unset($data['Mode']); + } elseif (\array_key_exists('Mode', $data) && null === $data['Mode']) { + $object->setMode(null); } - if (property_exists($data, 'Mode') && $data->{'Mode'} !== null) { - $object->setMode($data->{'Mode'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getUID()) { - $data->{'UID'} = $object->getUID(); + if ($data->isInitialized('uID') && null !== $data->getUID()) { + $dataArray['UID'] = $data->getUID(); } - if (null !== $object->getGID()) { - $data->{'GID'} = $object->getGID(); + if ($data->isInitialized('gID') && null !== $data->getGID()) { + $dataArray['GID'] = $data->getGID(); } - if (null !== $object->getMode()) { - $data->{'Mode'} = $object->getMode(); + if ($data->isInitialized('mode') && null !== $data->getMode()) { + $dataArray['Mode'] = $data->getMode(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class => false]; } } diff --git a/src/Normalizer/TaskSpecContainerSpecConfigsItemNormalizer.php b/src/Normalizer/TaskSpecContainerSpecConfigsItemNormalizer.php index aeba937f..6813ae32 100644 --- a/src/Normalizer/TaskSpecContainerSpecConfigsItemNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecConfigsItemNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,51 +16,92 @@ class TaskSpecContainerSpecConfigsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpecContainerSpecConfigsItem'; + return \Docker\API\Model\TaskSpecContainerSpecConfigsItem::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpecContainerSpecConfigsItem; + return \is_object($data) && \Docker\API\Model\TaskSpecContainerSpecConfigsItem::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskSpecContainerSpecConfigsItem(); - if (property_exists($data, 'File') && $data->{'File'} !== null) { - $object->setFile($this->denormalizer->denormalize($data->{'File'}, 'Docker\\API\\Model\\TaskSpecContainerSpecConfigsItemFile', 'json', $context)); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('File', $data) && null !== $data['File']) { + $object->setFile($this->denormalizer->denormalize($data['File'], \Docker\API\Model\TaskSpecContainerSpecConfigsItemFile::class, 'json', $context)); + unset($data['File']); + } elseif (\array_key_exists('File', $data) && null === $data['File']) { + $object->setFile(null); + } + if (\array_key_exists('Runtime', $data) && null !== $data['Runtime']) { + $object->setRuntime($this->denormalizer->denormalize($data['Runtime'], \Docker\API\Model\TaskSpecContainerSpecConfigsItemRuntime::class, 'json', $context)); + unset($data['Runtime']); + } elseif (\array_key_exists('Runtime', $data) && null === $data['Runtime']) { + $object->setRuntime(null); + } + if (\array_key_exists('ConfigID', $data) && null !== $data['ConfigID']) { + $object->setConfigID($data['ConfigID']); + unset($data['ConfigID']); + } elseif (\array_key_exists('ConfigID', $data) && null === $data['ConfigID']) { + $object->setConfigID(null); } - if (property_exists($data, 'ConfigID') && $data->{'ConfigID'} !== null) { - $object->setConfigID($data->{'ConfigID'}); + if (\array_key_exists('ConfigName', $data) && null !== $data['ConfigName']) { + $object->setConfigName($data['ConfigName']); + unset($data['ConfigName']); + } elseif (\array_key_exists('ConfigName', $data) && null === $data['ConfigName']) { + $object->setConfigName(null); } - if (property_exists($data, 'ConfigName') && $data->{'ConfigName'} !== null) { - $object->setConfigName($data->{'ConfigName'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getFile()) { - $data->{'File'} = $this->normalizer->normalize($object->getFile(), 'json', $context); + $dataArray = []; + if ($data->isInitialized('file') && null !== $data->getFile()) { + $dataArray['File'] = $this->normalizer->normalize($data->getFile(), 'json', $context); } - if (null !== $object->getConfigID()) { - $data->{'ConfigID'} = $object->getConfigID(); + if ($data->isInitialized('runtime') && null !== $data->getRuntime()) { + $dataArray['Runtime'] = $this->normalizer->normalize($data->getRuntime(), 'json', $context); } - if (null !== $object->getConfigName()) { - $data->{'ConfigName'} = $object->getConfigName(); + if ($data->isInitialized('configID') && null !== $data->getConfigID()) { + $dataArray['ConfigID'] = $data->getConfigID(); + } + if ($data->isInitialized('configName') && null !== $data->getConfigName()) { + $dataArray['ConfigName'] = $data->getConfigName(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecConfigsItem::class => false]; } } diff --git a/src/Normalizer/TaskSpecContainerSpecConfigsItemRuntimeNormalizer.php b/src/Normalizer/TaskSpecContainerSpecConfigsItemRuntimeNormalizer.php new file mode 100644 index 00000000..0c974e41 --- /dev/null +++ b/src/Normalizer/TaskSpecContainerSpecConfigsItemRuntimeNormalizer.php @@ -0,0 +1,71 @@ + $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecConfigsItemRuntime::class => false]; + } +} diff --git a/src/Normalizer/TaskSpecContainerSpecDNSConfigNormalizer.php b/src/Normalizer/TaskSpecContainerSpecDNSConfigNormalizer.php index 3a7c854d..42702904 100644 --- a/src/Normalizer/TaskSpecContainerSpecDNSConfigNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecDNSConfigNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,75 +16,107 @@ class TaskSpecContainerSpecDNSConfigNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpecContainerSpecDNSConfig'; + return \Docker\API\Model\TaskSpecContainerSpecDNSConfig::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpecContainerSpecDNSConfig; + return \is_object($data) && \Docker\API\Model\TaskSpecContainerSpecDNSConfig::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskSpecContainerSpecDNSConfig(); - if (property_exists($data, 'Nameservers') && $data->{'Nameservers'} !== null) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Nameservers', $data) && null !== $data['Nameservers']) { $values = []; - foreach ($data->{'Nameservers'} as $value) { + foreach ($data['Nameservers'] as $value) { $values[] = $value; } $object->setNameservers($values); + unset($data['Nameservers']); + } elseif (\array_key_exists('Nameservers', $data) && null === $data['Nameservers']) { + $object->setNameservers(null); } - if (property_exists($data, 'Search') && $data->{'Search'} !== null) { + if (\array_key_exists('Search', $data) && null !== $data['Search']) { $values_1 = []; - foreach ($data->{'Search'} as $value_1) { + foreach ($data['Search'] as $value_1) { $values_1[] = $value_1; } $object->setSearch($values_1); + unset($data['Search']); + } elseif (\array_key_exists('Search', $data) && null === $data['Search']) { + $object->setSearch(null); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { + if (\array_key_exists('Options', $data) && null !== $data['Options']) { $values_2 = []; - foreach ($data->{'Options'} as $value_2) { + foreach ($data['Options'] as $value_2) { $values_2[] = $value_2; } $object->setOptions($values_2); + unset($data['Options']); + } elseif (\array_key_exists('Options', $data) && null === $data['Options']) { + $object->setOptions(null); + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_3; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getNameservers()) { + $dataArray = []; + if ($data->isInitialized('nameservers') && null !== $data->getNameservers()) { $values = []; - foreach ($object->getNameservers() as $value) { + foreach ($data->getNameservers() as $value) { $values[] = $value; } - $data->{'Nameservers'} = $values; + $dataArray['Nameservers'] = $values; } - if (null !== $object->getSearch()) { + if ($data->isInitialized('search') && null !== $data->getSearch()) { $values_1 = []; - foreach ($object->getSearch() as $value_1) { + foreach ($data->getSearch() as $value_1) { $values_1[] = $value_1; } - $data->{'Search'} = $values_1; + $dataArray['Search'] = $values_1; } - if (null !== $object->getOptions()) { + if ($data->isInitialized('options') && null !== $data->getOptions()) { $values_2 = []; - foreach ($object->getOptions() as $value_2) { + foreach ($data->getOptions() as $value_2) { $values_2[] = $value_2; } - $data->{'Options'} = $values_2; + $dataArray['Options'] = $values_2; + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_3; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecDNSConfig::class => false]; } } diff --git a/src/Normalizer/TaskSpecContainerSpecNormalizer.php b/src/Normalizer/TaskSpecContainerSpecNormalizer.php index ed3f7ef8..9ad76a63 100644 --- a/src/Normalizer/TaskSpecContainerSpecNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,237 +16,415 @@ class TaskSpecContainerSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpecContainerSpec'; + return \Docker\API\Model\TaskSpecContainerSpec::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpecContainerSpec; + return \is_object($data) && \Docker\API\Model\TaskSpecContainerSpec::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskSpecContainerSpec(); - if (property_exists($data, 'Image') && $data->{'Image'} !== null) { - $object->setImage($data->{'Image'}); + if (\array_key_exists('TTY', $data) && \is_int($data['TTY'])) { + $data['TTY'] = (bool) $data['TTY']; + } + if (\array_key_exists('OpenStdin', $data) && \is_int($data['OpenStdin'])) { + $data['OpenStdin'] = (bool) $data['OpenStdin']; + } + if (\array_key_exists('ReadOnly', $data) && \is_int($data['ReadOnly'])) { + $data['ReadOnly'] = (bool) $data['ReadOnly']; + } + if (\array_key_exists('Init', $data) && \is_int($data['Init'])) { + $data['Init'] = (bool) $data['Init']; } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Image', $data) && null !== $data['Image']) { + $object->setImage($data['Image']); + unset($data['Image']); + } elseif (\array_key_exists('Image', $data) && null === $data['Image']) { + $object->setImage(null); + } + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key => $value) { + foreach ($data['Labels'] as $key => $value) { $values[$key] = $value; } $object->setLabels($values); + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); } - if (property_exists($data, 'Command') && $data->{'Command'} !== null) { + if (\array_key_exists('Command', $data) && null !== $data['Command']) { $values_1 = []; - foreach ($data->{'Command'} as $value_1) { + foreach ($data['Command'] as $value_1) { $values_1[] = $value_1; } $object->setCommand($values_1); + unset($data['Command']); + } elseif (\array_key_exists('Command', $data) && null === $data['Command']) { + $object->setCommand(null); } - if (property_exists($data, 'Args') && $data->{'Args'} !== null) { + if (\array_key_exists('Args', $data) && null !== $data['Args']) { $values_2 = []; - foreach ($data->{'Args'} as $value_2) { + foreach ($data['Args'] as $value_2) { $values_2[] = $value_2; } $object->setArgs($values_2); + unset($data['Args']); + } elseif (\array_key_exists('Args', $data) && null === $data['Args']) { + $object->setArgs(null); } - if (property_exists($data, 'Hostname') && $data->{'Hostname'} !== null) { - $object->setHostname($data->{'Hostname'}); + if (\array_key_exists('Hostname', $data) && null !== $data['Hostname']) { + $object->setHostname($data['Hostname']); + unset($data['Hostname']); + } elseif (\array_key_exists('Hostname', $data) && null === $data['Hostname']) { + $object->setHostname(null); } - if (property_exists($data, 'Env') && $data->{'Env'} !== null) { + if (\array_key_exists('Env', $data) && null !== $data['Env']) { $values_3 = []; - foreach ($data->{'Env'} as $value_3) { + foreach ($data['Env'] as $value_3) { $values_3[] = $value_3; } $object->setEnv($values_3); - } - if (property_exists($data, 'Dir') && $data->{'Dir'} !== null) { - $object->setDir($data->{'Dir'}); - } - if (property_exists($data, 'User') && $data->{'User'} !== null) { - $object->setUser($data->{'User'}); - } - if (property_exists($data, 'Groups') && $data->{'Groups'} !== null) { + unset($data['Env']); + } elseif (\array_key_exists('Env', $data) && null === $data['Env']) { + $object->setEnv(null); + } + if (\array_key_exists('Dir', $data) && null !== $data['Dir']) { + $object->setDir($data['Dir']); + unset($data['Dir']); + } elseif (\array_key_exists('Dir', $data) && null === $data['Dir']) { + $object->setDir(null); + } + if (\array_key_exists('User', $data) && null !== $data['User']) { + $object->setUser($data['User']); + unset($data['User']); + } elseif (\array_key_exists('User', $data) && null === $data['User']) { + $object->setUser(null); + } + if (\array_key_exists('Groups', $data) && null !== $data['Groups']) { $values_4 = []; - foreach ($data->{'Groups'} as $value_4) { + foreach ($data['Groups'] as $value_4) { $values_4[] = $value_4; } $object->setGroups($values_4); - } - if (property_exists($data, 'Privileges') && $data->{'Privileges'} !== null) { - $object->setPrivileges($this->denormalizer->denormalize($data->{'Privileges'}, 'Docker\\API\\Model\\TaskSpecContainerSpecPrivileges', 'json', $context)); - } - if (property_exists($data, 'TTY') && $data->{'TTY'} !== null) { - $object->setTTY($data->{'TTY'}); - } - if (property_exists($data, 'OpenStdin') && $data->{'OpenStdin'} !== null) { - $object->setOpenStdin($data->{'OpenStdin'}); - } - if (property_exists($data, 'ReadOnly') && $data->{'ReadOnly'} !== null) { - $object->setReadOnly($data->{'ReadOnly'}); - } - if (property_exists($data, 'Mounts') && $data->{'Mounts'} !== null) { + unset($data['Groups']); + } elseif (\array_key_exists('Groups', $data) && null === $data['Groups']) { + $object->setGroups(null); + } + if (\array_key_exists('Privileges', $data) && null !== $data['Privileges']) { + $object->setPrivileges($this->denormalizer->denormalize($data['Privileges'], \Docker\API\Model\TaskSpecContainerSpecPrivileges::class, 'json', $context)); + unset($data['Privileges']); + } elseif (\array_key_exists('Privileges', $data) && null === $data['Privileges']) { + $object->setPrivileges(null); + } + if (\array_key_exists('TTY', $data) && null !== $data['TTY']) { + $object->setTTY($data['TTY']); + unset($data['TTY']); + } elseif (\array_key_exists('TTY', $data) && null === $data['TTY']) { + $object->setTTY(null); + } + if (\array_key_exists('OpenStdin', $data) && null !== $data['OpenStdin']) { + $object->setOpenStdin($data['OpenStdin']); + unset($data['OpenStdin']); + } elseif (\array_key_exists('OpenStdin', $data) && null === $data['OpenStdin']) { + $object->setOpenStdin(null); + } + if (\array_key_exists('ReadOnly', $data) && null !== $data['ReadOnly']) { + $object->setReadOnly($data['ReadOnly']); + unset($data['ReadOnly']); + } elseif (\array_key_exists('ReadOnly', $data) && null === $data['ReadOnly']) { + $object->setReadOnly(null); + } + if (\array_key_exists('Mounts', $data) && null !== $data['Mounts']) { $values_5 = []; - foreach ($data->{'Mounts'} as $value_5) { - $values_5[] = $this->denormalizer->denormalize($value_5, 'Docker\\API\\Model\\Mount', 'json', $context); + foreach ($data['Mounts'] as $value_5) { + $values_5[] = $this->denormalizer->denormalize($value_5, \Docker\API\Model\Mount::class, 'json', $context); } $object->setMounts($values_5); - } - if (property_exists($data, 'StopSignal') && $data->{'StopSignal'} !== null) { - $object->setStopSignal($data->{'StopSignal'}); - } - if (property_exists($data, 'StopGracePeriod') && $data->{'StopGracePeriod'} !== null) { - $object->setStopGracePeriod($data->{'StopGracePeriod'}); - } - if (property_exists($data, 'HealthCheck') && $data->{'HealthCheck'} !== null) { - $object->setHealthCheck($this->denormalizer->denormalize($data->{'HealthCheck'}, 'Docker\\API\\Model\\HealthConfig', 'json', $context)); - } - if (property_exists($data, 'Hosts') && $data->{'Hosts'} !== null) { + unset($data['Mounts']); + } elseif (\array_key_exists('Mounts', $data) && null === $data['Mounts']) { + $object->setMounts(null); + } + if (\array_key_exists('StopSignal', $data) && null !== $data['StopSignal']) { + $object->setStopSignal($data['StopSignal']); + unset($data['StopSignal']); + } elseif (\array_key_exists('StopSignal', $data) && null === $data['StopSignal']) { + $object->setStopSignal(null); + } + if (\array_key_exists('StopGracePeriod', $data) && null !== $data['StopGracePeriod']) { + $object->setStopGracePeriod($data['StopGracePeriod']); + unset($data['StopGracePeriod']); + } elseif (\array_key_exists('StopGracePeriod', $data) && null === $data['StopGracePeriod']) { + $object->setStopGracePeriod(null); + } + if (\array_key_exists('HealthCheck', $data) && null !== $data['HealthCheck']) { + $object->setHealthCheck($this->denormalizer->denormalize($data['HealthCheck'], \Docker\API\Model\HealthConfig::class, 'json', $context)); + unset($data['HealthCheck']); + } elseif (\array_key_exists('HealthCheck', $data) && null === $data['HealthCheck']) { + $object->setHealthCheck(null); + } + if (\array_key_exists('Hosts', $data) && null !== $data['Hosts']) { $values_6 = []; - foreach ($data->{'Hosts'} as $value_6) { + foreach ($data['Hosts'] as $value_6) { $values_6[] = $value_6; } $object->setHosts($values_6); + unset($data['Hosts']); + } elseif (\array_key_exists('Hosts', $data) && null === $data['Hosts']) { + $object->setHosts(null); } - if (property_exists($data, 'DNSConfig') && $data->{'DNSConfig'} !== null) { - $object->setDNSConfig($this->denormalizer->denormalize($data->{'DNSConfig'}, 'Docker\\API\\Model\\TaskSpecContainerSpecDNSConfig', 'json', $context)); + if (\array_key_exists('DNSConfig', $data) && null !== $data['DNSConfig']) { + $object->setDNSConfig($this->denormalizer->denormalize($data['DNSConfig'], \Docker\API\Model\TaskSpecContainerSpecDNSConfig::class, 'json', $context)); + unset($data['DNSConfig']); + } elseif (\array_key_exists('DNSConfig', $data) && null === $data['DNSConfig']) { + $object->setDNSConfig(null); } - if (property_exists($data, 'Secrets') && $data->{'Secrets'} !== null) { + if (\array_key_exists('Secrets', $data) && null !== $data['Secrets']) { $values_7 = []; - foreach ($data->{'Secrets'} as $value_7) { - $values_7[] = $this->denormalizer->denormalize($value_7, 'Docker\\API\\Model\\TaskSpecContainerSpecSecretsItem', 'json', $context); + foreach ($data['Secrets'] as $value_7) { + $values_7[] = $this->denormalizer->denormalize($value_7, \Docker\API\Model\TaskSpecContainerSpecSecretsItem::class, 'json', $context); } $object->setSecrets($values_7); + unset($data['Secrets']); + } elseif (\array_key_exists('Secrets', $data) && null === $data['Secrets']) { + $object->setSecrets(null); } - if (property_exists($data, 'Configs') && $data->{'Configs'} !== null) { + if (\array_key_exists('Configs', $data) && null !== $data['Configs']) { $values_8 = []; - foreach ($data->{'Configs'} as $value_8) { - $values_8[] = $this->denormalizer->denormalize($value_8, 'Docker\\API\\Model\\TaskSpecContainerSpecConfigsItem', 'json', $context); + foreach ($data['Configs'] as $value_8) { + $values_8[] = $this->denormalizer->denormalize($value_8, \Docker\API\Model\TaskSpecContainerSpecConfigsItem::class, 'json', $context); } $object->setConfigs($values_8); - } - if (property_exists($data, 'Isolation') && $data->{'Isolation'} !== null) { - $object->setIsolation($data->{'Isolation'}); + unset($data['Configs']); + } elseif (\array_key_exists('Configs', $data) && null === $data['Configs']) { + $object->setConfigs(null); + } + if (\array_key_exists('Isolation', $data) && null !== $data['Isolation']) { + $object->setIsolation($data['Isolation']); + unset($data['Isolation']); + } elseif (\array_key_exists('Isolation', $data) && null === $data['Isolation']) { + $object->setIsolation(null); + } + if (\array_key_exists('Init', $data) && null !== $data['Init']) { + $object->setInit($data['Init']); + unset($data['Init']); + } elseif (\array_key_exists('Init', $data) && null === $data['Init']) { + $object->setInit(null); + } + if (\array_key_exists('Sysctls', $data) && null !== $data['Sysctls']) { + $values_9 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Sysctls'] as $key_1 => $value_9) { + $values_9[$key_1] = $value_9; + } + $object->setSysctls($values_9); + unset($data['Sysctls']); + } elseif (\array_key_exists('Sysctls', $data) && null === $data['Sysctls']) { + $object->setSysctls(null); + } + if (\array_key_exists('CapabilityAdd', $data) && null !== $data['CapabilityAdd']) { + $values_10 = []; + foreach ($data['CapabilityAdd'] as $value_10) { + $values_10[] = $value_10; + } + $object->setCapabilityAdd($values_10); + unset($data['CapabilityAdd']); + } elseif (\array_key_exists('CapabilityAdd', $data) && null === $data['CapabilityAdd']) { + $object->setCapabilityAdd(null); + } + if (\array_key_exists('CapabilityDrop', $data) && null !== $data['CapabilityDrop']) { + $values_11 = []; + foreach ($data['CapabilityDrop'] as $value_11) { + $values_11[] = $value_11; + } + $object->setCapabilityDrop($values_11); + unset($data['CapabilityDrop']); + } elseif (\array_key_exists('CapabilityDrop', $data) && null === $data['CapabilityDrop']) { + $object->setCapabilityDrop(null); + } + if (\array_key_exists('Ulimits', $data) && null !== $data['Ulimits']) { + $values_12 = []; + foreach ($data['Ulimits'] as $value_12) { + $values_12[] = $this->denormalizer->denormalize($value_12, \Docker\API\Model\TaskSpecContainerSpecUlimitsItem::class, 'json', $context); + } + $object->setUlimits($values_12); + unset($data['Ulimits']); + } elseif (\array_key_exists('Ulimits', $data) && null === $data['Ulimits']) { + $object->setUlimits(null); + } + foreach ($data as $key_2 => $value_13) { + if (preg_match('/.*/', (string) $key_2)) { + $object[$key_2] = $value_13; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getImage()) { - $data->{'Image'} = $object->getImage(); + $dataArray = []; + if ($data->isInitialized('image') && null !== $data->getImage()) { + $dataArray['Image'] = $data->getImage(); } - if (null !== $object->getLabels()) { - $values = new \stdClass(); - foreach ($object->getLabels() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values = []; + foreach ($data->getLabels() as $key => $value) { + $values[$key] = $value; } - $data->{'Labels'} = $values; + $dataArray['Labels'] = $values; } - if (null !== $object->getCommand()) { + if ($data->isInitialized('command') && null !== $data->getCommand()) { $values_1 = []; - foreach ($object->getCommand() as $value_1) { + foreach ($data->getCommand() as $value_1) { $values_1[] = $value_1; } - $data->{'Command'} = $values_1; + $dataArray['Command'] = $values_1; } - if (null !== $object->getArgs()) { + if ($data->isInitialized('args') && null !== $data->getArgs()) { $values_2 = []; - foreach ($object->getArgs() as $value_2) { + foreach ($data->getArgs() as $value_2) { $values_2[] = $value_2; } - $data->{'Args'} = $values_2; + $dataArray['Args'] = $values_2; } - if (null !== $object->getHostname()) { - $data->{'Hostname'} = $object->getHostname(); + if ($data->isInitialized('hostname') && null !== $data->getHostname()) { + $dataArray['Hostname'] = $data->getHostname(); } - if (null !== $object->getEnv()) { + if ($data->isInitialized('env') && null !== $data->getEnv()) { $values_3 = []; - foreach ($object->getEnv() as $value_3) { + foreach ($data->getEnv() as $value_3) { $values_3[] = $value_3; } - $data->{'Env'} = $values_3; + $dataArray['Env'] = $values_3; } - if (null !== $object->getDir()) { - $data->{'Dir'} = $object->getDir(); + if ($data->isInitialized('dir') && null !== $data->getDir()) { + $dataArray['Dir'] = $data->getDir(); } - if (null !== $object->getUser()) { - $data->{'User'} = $object->getUser(); + if ($data->isInitialized('user') && null !== $data->getUser()) { + $dataArray['User'] = $data->getUser(); } - if (null !== $object->getGroups()) { + if ($data->isInitialized('groups') && null !== $data->getGroups()) { $values_4 = []; - foreach ($object->getGroups() as $value_4) { + foreach ($data->getGroups() as $value_4) { $values_4[] = $value_4; } - $data->{'Groups'} = $values_4; + $dataArray['Groups'] = $values_4; } - if (null !== $object->getPrivileges()) { - $data->{'Privileges'} = $this->normalizer->normalize($object->getPrivileges(), 'json', $context); + if ($data->isInitialized('privileges') && null !== $data->getPrivileges()) { + $dataArray['Privileges'] = $this->normalizer->normalize($data->getPrivileges(), 'json', $context); } - if (null !== $object->getTTY()) { - $data->{'TTY'} = $object->getTTY(); + if ($data->isInitialized('tTY') && null !== $data->getTTY()) { + $dataArray['TTY'] = $data->getTTY(); } - if (null !== $object->getOpenStdin()) { - $data->{'OpenStdin'} = $object->getOpenStdin(); + if ($data->isInitialized('openStdin') && null !== $data->getOpenStdin()) { + $dataArray['OpenStdin'] = $data->getOpenStdin(); } - if (null !== $object->getReadOnly()) { - $data->{'ReadOnly'} = $object->getReadOnly(); + if ($data->isInitialized('readOnly') && null !== $data->getReadOnly()) { + $dataArray['ReadOnly'] = $data->getReadOnly(); } - if (null !== $object->getMounts()) { + if ($data->isInitialized('mounts') && null !== $data->getMounts()) { $values_5 = []; - foreach ($object->getMounts() as $value_5) { + foreach ($data->getMounts() as $value_5) { $values_5[] = $this->normalizer->normalize($value_5, 'json', $context); } - $data->{'Mounts'} = $values_5; + $dataArray['Mounts'] = $values_5; } - if (null !== $object->getStopSignal()) { - $data->{'StopSignal'} = $object->getStopSignal(); + if ($data->isInitialized('stopSignal') && null !== $data->getStopSignal()) { + $dataArray['StopSignal'] = $data->getStopSignal(); } - if (null !== $object->getStopGracePeriod()) { - $data->{'StopGracePeriod'} = $object->getStopGracePeriod(); + if ($data->isInitialized('stopGracePeriod') && null !== $data->getStopGracePeriod()) { + $dataArray['StopGracePeriod'] = $data->getStopGracePeriod(); } - if (null !== $object->getHealthCheck()) { - $data->{'HealthCheck'} = $this->normalizer->normalize($object->getHealthCheck(), 'json', $context); + if ($data->isInitialized('healthCheck') && null !== $data->getHealthCheck()) { + $dataArray['HealthCheck'] = $this->normalizer->normalize($data->getHealthCheck(), 'json', $context); } - if (null !== $object->getHosts()) { + if ($data->isInitialized('hosts') && null !== $data->getHosts()) { $values_6 = []; - foreach ($object->getHosts() as $value_6) { + foreach ($data->getHosts() as $value_6) { $values_6[] = $value_6; } - $data->{'Hosts'} = $values_6; + $dataArray['Hosts'] = $values_6; } - if (null !== $object->getDNSConfig()) { - $data->{'DNSConfig'} = $this->normalizer->normalize($object->getDNSConfig(), 'json', $context); + if ($data->isInitialized('dNSConfig') && null !== $data->getDNSConfig()) { + $dataArray['DNSConfig'] = $this->normalizer->normalize($data->getDNSConfig(), 'json', $context); } - if (null !== $object->getSecrets()) { + if ($data->isInitialized('secrets') && null !== $data->getSecrets()) { $values_7 = []; - foreach ($object->getSecrets() as $value_7) { + foreach ($data->getSecrets() as $value_7) { $values_7[] = $this->normalizer->normalize($value_7, 'json', $context); } - $data->{'Secrets'} = $values_7; + $dataArray['Secrets'] = $values_7; } - if (null !== $object->getConfigs()) { + if ($data->isInitialized('configs') && null !== $data->getConfigs()) { $values_8 = []; - foreach ($object->getConfigs() as $value_8) { + foreach ($data->getConfigs() as $value_8) { $values_8[] = $this->normalizer->normalize($value_8, 'json', $context); } - $data->{'Configs'} = $values_8; + $dataArray['Configs'] = $values_8; + } + if ($data->isInitialized('isolation') && null !== $data->getIsolation()) { + $dataArray['Isolation'] = $data->getIsolation(); + } + if ($data->isInitialized('init') && null !== $data->getInit()) { + $dataArray['Init'] = $data->getInit(); + } + if ($data->isInitialized('sysctls') && null !== $data->getSysctls()) { + $values_9 = []; + foreach ($data->getSysctls() as $key_1 => $value_9) { + $values_9[$key_1] = $value_9; + } + $dataArray['Sysctls'] = $values_9; } - if (null !== $object->getIsolation()) { - $data->{'Isolation'} = $object->getIsolation(); + if ($data->isInitialized('capabilityAdd') && null !== $data->getCapabilityAdd()) { + $values_10 = []; + foreach ($data->getCapabilityAdd() as $value_10) { + $values_10[] = $value_10; + } + $dataArray['CapabilityAdd'] = $values_10; + } + if ($data->isInitialized('capabilityDrop') && null !== $data->getCapabilityDrop()) { + $values_11 = []; + foreach ($data->getCapabilityDrop() as $value_11) { + $values_11[] = $value_11; + } + $dataArray['CapabilityDrop'] = $values_11; + } + if ($data->isInitialized('ulimits') && null !== $data->getUlimits()) { + $values_12 = []; + foreach ($data->getUlimits() as $value_12) { + $values_12[] = $this->normalizer->normalize($value_12, 'json', $context); + } + $dataArray['Ulimits'] = $values_12; + } + foreach ($data as $key_2 => $value_13) { + if (preg_match('/.*/', (string) $key_2)) { + $dataArray[$key_2] = $value_13; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpec::class => false]; } } diff --git a/src/Normalizer/TaskSpecContainerSpecPrivilegesAppArmorNormalizer.php b/src/Normalizer/TaskSpecContainerSpecPrivilegesAppArmorNormalizer.php new file mode 100644 index 00000000..d296764f --- /dev/null +++ b/src/Normalizer/TaskSpecContainerSpecPrivilegesAppArmorNormalizer.php @@ -0,0 +1,80 @@ +setMode($data['Mode']); + unset($data['Mode']); + } elseif (\array_key_exists('Mode', $data) && null === $data['Mode']) { + $object->setMode(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('mode') && null !== $data->getMode()) { + $dataArray['Mode'] = $data->getMode(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor::class => false]; + } +} diff --git a/src/Normalizer/TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer.php b/src/Normalizer/TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer.php index 8d9eb5da..977fe850 100644 --- a/src/Normalizer/TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,83 @@ class TaskSpecContainerSpecPrivilegesCredentialSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpecContainerSpecPrivilegesCredentialSpec'; + return \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec; + return \is_object($data) && \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec(); - if (property_exists($data, 'File') && $data->{'File'} !== null) { - $object->setFile($data->{'File'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Config', $data) && null !== $data['Config']) { + $object->setConfig($data['Config']); + unset($data['Config']); + } elseif (\array_key_exists('Config', $data) && null === $data['Config']) { + $object->setConfig(null); + } + if (\array_key_exists('File', $data) && null !== $data['File']) { + $object->setFile($data['File']); + unset($data['File']); + } elseif (\array_key_exists('File', $data) && null === $data['File']) { + $object->setFile(null); + } + if (\array_key_exists('Registry', $data) && null !== $data['Registry']) { + $object->setRegistry($data['Registry']); + unset($data['Registry']); + } elseif (\array_key_exists('Registry', $data) && null === $data['Registry']) { + $object->setRegistry(null); } - if (property_exists($data, 'Registry') && $data->{'Registry'} !== null) { - $object->setRegistry($data->{'Registry'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getFile()) { - $data->{'File'} = $object->getFile(); + $dataArray = []; + if ($data->isInitialized('config') && null !== $data->getConfig()) { + $dataArray['Config'] = $data->getConfig(); } - if (null !== $object->getRegistry()) { - $data->{'Registry'} = $object->getRegistry(); + if ($data->isInitialized('file') && null !== $data->getFile()) { + $dataArray['File'] = $data->getFile(); + } + if ($data->isInitialized('registry') && null !== $data->getRegistry()) { + $dataArray['Registry'] = $data->getRegistry(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class => false]; } } diff --git a/src/Normalizer/TaskSpecContainerSpecPrivilegesNormalizer.php b/src/Normalizer/TaskSpecContainerSpecPrivilegesNormalizer.php index 65e95c75..01bbeeb9 100644 --- a/src/Normalizer/TaskSpecContainerSpecPrivilegesNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecPrivilegesNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,104 @@ class TaskSpecContainerSpecPrivilegesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpecContainerSpecPrivileges'; + return \Docker\API\Model\TaskSpecContainerSpecPrivileges::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpecContainerSpecPrivileges; + return \is_object($data) && \Docker\API\Model\TaskSpecContainerSpecPrivileges::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskSpecContainerSpecPrivileges(); - if (property_exists($data, 'CredentialSpec') && $data->{'CredentialSpec'} !== null) { - $object->setCredentialSpec($this->denormalizer->denormalize($data->{'CredentialSpec'}, 'Docker\\API\\Model\\TaskSpecContainerSpecPrivilegesCredentialSpec', 'json', $context)); + if (\array_key_exists('NoNewPrivileges', $data) && \is_int($data['NoNewPrivileges'])) { + $data['NoNewPrivileges'] = (bool) $data['NoNewPrivileges']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('CredentialSpec', $data) && null !== $data['CredentialSpec']) { + $object->setCredentialSpec($this->denormalizer->denormalize($data['CredentialSpec'], \Docker\API\Model\TaskSpecContainerSpecPrivilegesCredentialSpec::class, 'json', $context)); + unset($data['CredentialSpec']); + } elseif (\array_key_exists('CredentialSpec', $data) && null === $data['CredentialSpec']) { + $object->setCredentialSpec(null); + } + if (\array_key_exists('SELinuxContext', $data) && null !== $data['SELinuxContext']) { + $object->setSELinuxContext($this->denormalizer->denormalize($data['SELinuxContext'], \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class, 'json', $context)); + unset($data['SELinuxContext']); + } elseif (\array_key_exists('SELinuxContext', $data) && null === $data['SELinuxContext']) { + $object->setSELinuxContext(null); + } + if (\array_key_exists('Seccomp', $data) && null !== $data['Seccomp']) { + $object->setSeccomp($this->denormalizer->denormalize($data['Seccomp'], \Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp::class, 'json', $context)); + unset($data['Seccomp']); + } elseif (\array_key_exists('Seccomp', $data) && null === $data['Seccomp']) { + $object->setSeccomp(null); + } + if (\array_key_exists('AppArmor', $data) && null !== $data['AppArmor']) { + $object->setAppArmor($this->denormalizer->denormalize($data['AppArmor'], \Docker\API\Model\TaskSpecContainerSpecPrivilegesAppArmor::class, 'json', $context)); + unset($data['AppArmor']); + } elseif (\array_key_exists('AppArmor', $data) && null === $data['AppArmor']) { + $object->setAppArmor(null); + } + if (\array_key_exists('NoNewPrivileges', $data) && null !== $data['NoNewPrivileges']) { + $object->setNoNewPrivileges($data['NoNewPrivileges']); + unset($data['NoNewPrivileges']); + } elseif (\array_key_exists('NoNewPrivileges', $data) && null === $data['NoNewPrivileges']) { + $object->setNoNewPrivileges(null); } - if (property_exists($data, 'SELinuxContext') && $data->{'SELinuxContext'} !== null) { - $object->setSELinuxContext($this->denormalizer->denormalize($data->{'SELinuxContext'}, 'Docker\\API\\Model\\TaskSpecContainerSpecPrivilegesSELinuxContext', 'json', $context)); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getCredentialSpec()) { - $data->{'CredentialSpec'} = $this->normalizer->normalize($object->getCredentialSpec(), 'json', $context); + $dataArray = []; + if ($data->isInitialized('credentialSpec') && null !== $data->getCredentialSpec()) { + $dataArray['CredentialSpec'] = $this->normalizer->normalize($data->getCredentialSpec(), 'json', $context); } - if (null !== $object->getSELinuxContext()) { - $data->{'SELinuxContext'} = $this->normalizer->normalize($object->getSELinuxContext(), 'json', $context); + if ($data->isInitialized('sELinuxContext') && null !== $data->getSELinuxContext()) { + $dataArray['SELinuxContext'] = $this->normalizer->normalize($data->getSELinuxContext(), 'json', $context); + } + if ($data->isInitialized('seccomp') && null !== $data->getSeccomp()) { + $dataArray['Seccomp'] = $this->normalizer->normalize($data->getSeccomp(), 'json', $context); + } + if ($data->isInitialized('appArmor') && null !== $data->getAppArmor()) { + $dataArray['AppArmor'] = $this->normalizer->normalize($data->getAppArmor(), 'json', $context); + } + if ($data->isInitialized('noNewPrivileges') && null !== $data->getNoNewPrivileges()) { + $dataArray['NoNewPrivileges'] = $data->getNoNewPrivileges(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecPrivileges::class => false]; } } diff --git a/src/Normalizer/TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer.php b/src/Normalizer/TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer.php index 27e1c667..0a7d436c 100644 --- a/src/Normalizer/TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,63 +16,104 @@ class TaskSpecContainerSpecPrivilegesSELinuxContextNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpecContainerSpecPrivilegesSELinuxContext'; + return \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext; + return \is_object($data) && \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext(); - if (property_exists($data, 'Disable') && $data->{'Disable'} !== null) { - $object->setDisable($data->{'Disable'}); + if (\array_key_exists('Disable', $data) && \is_int($data['Disable'])) { + $data['Disable'] = (bool) $data['Disable']; + } + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Disable', $data) && null !== $data['Disable']) { + $object->setDisable($data['Disable']); + unset($data['Disable']); + } elseif (\array_key_exists('Disable', $data) && null === $data['Disable']) { + $object->setDisable(null); + } + if (\array_key_exists('User', $data) && null !== $data['User']) { + $object->setUser($data['User']); + unset($data['User']); + } elseif (\array_key_exists('User', $data) && null === $data['User']) { + $object->setUser(null); } - if (property_exists($data, 'User') && $data->{'User'} !== null) { - $object->setUser($data->{'User'}); + if (\array_key_exists('Role', $data) && null !== $data['Role']) { + $object->setRole($data['Role']); + unset($data['Role']); + } elseif (\array_key_exists('Role', $data) && null === $data['Role']) { + $object->setRole(null); } - if (property_exists($data, 'Role') && $data->{'Role'} !== null) { - $object->setRole($data->{'Role'}); + if (\array_key_exists('Type', $data) && null !== $data['Type']) { + $object->setType($data['Type']); + unset($data['Type']); + } elseif (\array_key_exists('Type', $data) && null === $data['Type']) { + $object->setType(null); } - if (property_exists($data, 'Type') && $data->{'Type'} !== null) { - $object->setType($data->{'Type'}); + if (\array_key_exists('Level', $data) && null !== $data['Level']) { + $object->setLevel($data['Level']); + unset($data['Level']); + } elseif (\array_key_exists('Level', $data) && null === $data['Level']) { + $object->setLevel(null); } - if (property_exists($data, 'Level') && $data->{'Level'} !== null) { - $object->setLevel($data->{'Level'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getDisable()) { - $data->{'Disable'} = $object->getDisable(); + $dataArray = []; + if ($data->isInitialized('disable') && null !== $data->getDisable()) { + $dataArray['Disable'] = $data->getDisable(); } - if (null !== $object->getUser()) { - $data->{'User'} = $object->getUser(); + if ($data->isInitialized('user') && null !== $data->getUser()) { + $dataArray['User'] = $data->getUser(); } - if (null !== $object->getRole()) { - $data->{'Role'} = $object->getRole(); + if ($data->isInitialized('role') && null !== $data->getRole()) { + $dataArray['Role'] = $data->getRole(); } - if (null !== $object->getType()) { - $data->{'Type'} = $object->getType(); + if ($data->isInitialized('type') && null !== $data->getType()) { + $dataArray['Type'] = $data->getType(); } - if (null !== $object->getLevel()) { - $data->{'Level'} = $object->getLevel(); + if ($data->isInitialized('level') && null !== $data->getLevel()) { + $dataArray['Level'] = $data->getLevel(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecPrivilegesSELinuxContext::class => false]; } } diff --git a/src/Normalizer/TaskSpecContainerSpecPrivilegesSeccompNormalizer.php b/src/Normalizer/TaskSpecContainerSpecPrivilegesSeccompNormalizer.php new file mode 100644 index 00000000..d77e254d --- /dev/null +++ b/src/Normalizer/TaskSpecContainerSpecPrivilegesSeccompNormalizer.php @@ -0,0 +1,89 @@ +setMode($data['Mode']); + unset($data['Mode']); + } elseif (\array_key_exists('Mode', $data) && null === $data['Mode']) { + $object->setMode(null); + } + if (\array_key_exists('Profile', $data) && null !== $data['Profile']) { + $object->setProfile($data['Profile']); + unset($data['Profile']); + } elseif (\array_key_exists('Profile', $data) && null === $data['Profile']) { + $object->setProfile(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('mode') && null !== $data->getMode()) { + $dataArray['Mode'] = $data->getMode(); + } + if ($data->isInitialized('profile') && null !== $data->getProfile()) { + $dataArray['Profile'] = $data->getProfile(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecPrivilegesSeccomp::class => false]; + } +} diff --git a/src/Normalizer/TaskSpecContainerSpecSecretsItemFileNormalizer.php b/src/Normalizer/TaskSpecContainerSpecSecretsItemFileNormalizer.php index 3c5cb100..48fde771 100644 --- a/src/Normalizer/TaskSpecContainerSpecSecretsItemFileNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecSecretsItemFileNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,57 +16,92 @@ class TaskSpecContainerSpecSecretsItemFileNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpecContainerSpecSecretsItemFile'; + return \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile; + return \is_object($data) && \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('UID', $data) && null !== $data['UID']) { + $object->setUID($data['UID']); + unset($data['UID']); + } elseif (\array_key_exists('UID', $data) && null === $data['UID']) { + $object->setUID(null); } - if (property_exists($data, 'UID') && $data->{'UID'} !== null) { - $object->setUID($data->{'UID'}); + if (\array_key_exists('GID', $data) && null !== $data['GID']) { + $object->setGID($data['GID']); + unset($data['GID']); + } elseif (\array_key_exists('GID', $data) && null === $data['GID']) { + $object->setGID(null); } - if (property_exists($data, 'GID') && $data->{'GID'} !== null) { - $object->setGID($data->{'GID'}); + if (\array_key_exists('Mode', $data) && null !== $data['Mode']) { + $object->setMode($data['Mode']); + unset($data['Mode']); + } elseif (\array_key_exists('Mode', $data) && null === $data['Mode']) { + $object->setMode(null); } - if (property_exists($data, 'Mode') && $data->{'Mode'} !== null) { - $object->setMode($data->{'Mode'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getUID()) { - $data->{'UID'} = $object->getUID(); + if ($data->isInitialized('uID') && null !== $data->getUID()) { + $dataArray['UID'] = $data->getUID(); } - if (null !== $object->getGID()) { - $data->{'GID'} = $object->getGID(); + if ($data->isInitialized('gID') && null !== $data->getGID()) { + $dataArray['GID'] = $data->getGID(); } - if (null !== $object->getMode()) { - $data->{'Mode'} = $object->getMode(); + if ($data->isInitialized('mode') && null !== $data->getMode()) { + $dataArray['Mode'] = $data->getMode(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class => false]; } } diff --git a/src/Normalizer/TaskSpecContainerSpecSecretsItemNormalizer.php b/src/Normalizer/TaskSpecContainerSpecSecretsItemNormalizer.php index fe526d31..b5a06b29 100644 --- a/src/Normalizer/TaskSpecContainerSpecSecretsItemNormalizer.php +++ b/src/Normalizer/TaskSpecContainerSpecSecretsItemNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,51 +16,83 @@ class TaskSpecContainerSpecSecretsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpecContainerSpecSecretsItem'; + return \Docker\API\Model\TaskSpecContainerSpecSecretsItem::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpecContainerSpecSecretsItem; + return \is_object($data) && \Docker\API\Model\TaskSpecContainerSpecSecretsItem::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskSpecContainerSpecSecretsItem(); - if (property_exists($data, 'File') && $data->{'File'} !== null) { - $object->setFile($this->denormalizer->denormalize($data->{'File'}, 'Docker\\API\\Model\\TaskSpecContainerSpecSecretsItemFile', 'json', $context)); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('File', $data) && null !== $data['File']) { + $object->setFile($this->denormalizer->denormalize($data['File'], \Docker\API\Model\TaskSpecContainerSpecSecretsItemFile::class, 'json', $context)); + unset($data['File']); + } elseif (\array_key_exists('File', $data) && null === $data['File']) { + $object->setFile(null); + } + if (\array_key_exists('SecretID', $data) && null !== $data['SecretID']) { + $object->setSecretID($data['SecretID']); + unset($data['SecretID']); + } elseif (\array_key_exists('SecretID', $data) && null === $data['SecretID']) { + $object->setSecretID(null); } - if (property_exists($data, 'SecretID') && $data->{'SecretID'} !== null) { - $object->setSecretID($data->{'SecretID'}); + if (\array_key_exists('SecretName', $data) && null !== $data['SecretName']) { + $object->setSecretName($data['SecretName']); + unset($data['SecretName']); + } elseif (\array_key_exists('SecretName', $data) && null === $data['SecretName']) { + $object->setSecretName(null); } - if (property_exists($data, 'SecretName') && $data->{'SecretName'} !== null) { - $object->setSecretName($data->{'SecretName'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getFile()) { - $data->{'File'} = $this->normalizer->normalize($object->getFile(), 'json', $context); + $dataArray = []; + if ($data->isInitialized('file') && null !== $data->getFile()) { + $dataArray['File'] = $this->normalizer->normalize($data->getFile(), 'json', $context); } - if (null !== $object->getSecretID()) { - $data->{'SecretID'} = $object->getSecretID(); + if ($data->isInitialized('secretID') && null !== $data->getSecretID()) { + $dataArray['SecretID'] = $data->getSecretID(); } - if (null !== $object->getSecretName()) { - $data->{'SecretName'} = $object->getSecretName(); + if ($data->isInitialized('secretName') && null !== $data->getSecretName()) { + $dataArray['SecretName'] = $data->getSecretName(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecSecretsItem::class => false]; } } diff --git a/src/Normalizer/TaskSpecContainerSpecUlimitsItemNormalizer.php b/src/Normalizer/TaskSpecContainerSpecUlimitsItemNormalizer.php new file mode 100644 index 00000000..5c27e793 --- /dev/null +++ b/src/Normalizer/TaskSpecContainerSpecUlimitsItemNormalizer.php @@ -0,0 +1,98 @@ +setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Soft', $data) && null !== $data['Soft']) { + $object->setSoft($data['Soft']); + unset($data['Soft']); + } elseif (\array_key_exists('Soft', $data) && null === $data['Soft']) { + $object->setSoft(null); + } + if (\array_key_exists('Hard', $data) && null !== $data['Hard']) { + $object->setHard($data['Hard']); + unset($data['Hard']); + } elseif (\array_key_exists('Hard', $data) && null === $data['Hard']) { + $object->setHard(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); + } + if ($data->isInitialized('soft') && null !== $data->getSoft()) { + $dataArray['Soft'] = $data->getSoft(); + } + if ($data->isInitialized('hard') && null !== $data->getHard()) { + $dataArray['Hard'] = $data->getHard(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecContainerSpecUlimitsItem::class => false]; + } +} diff --git a/src/Normalizer/TaskSpecLogDriverNormalizer.php b/src/Normalizer/TaskSpecLogDriverNormalizer.php index da3d6b7c..ab29fee3 100644 --- a/src/Normalizer/TaskSpecLogDriverNormalizer.php +++ b/src/Normalizer/TaskSpecLogDriverNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,53 +16,82 @@ class TaskSpecLogDriverNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpecLogDriver'; + return \Docker\API\Model\TaskSpecLogDriver::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpecLogDriver; + return \is_object($data) && \Docker\API\Model\TaskSpecLogDriver::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskSpecLogDriver(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { + if (\array_key_exists('Options', $data) && null !== $data['Options']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key => $value) { + foreach ($data['Options'] as $key => $value) { $values[$key] = $value; } $object->setOptions($values); + unset($data['Options']); + } elseif (\array_key_exists('Options', $data) && null === $data['Options']) { + $object->setOptions(null); + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $object[$key_1] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getOptions()) { - $values = new \stdClass(); - foreach ($object->getOptions() as $key => $value) { - $values->{$key} = $value; + if ($data->isInitialized('options') && null !== $data->getOptions()) { + $values = []; + foreach ($data->getOptions() as $key => $value) { + $values[$key] = $value; + } + $dataArray['Options'] = $values; + } + foreach ($data as $key_1 => $value_1) { + if (preg_match('/.*/', (string) $key_1)) { + $dataArray[$key_1] = $value_1; } - $data->{'Options'} = $values; } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecLogDriver::class => false]; } } diff --git a/src/Normalizer/TaskSpecNetworkAttachmentSpecNormalizer.php b/src/Normalizer/TaskSpecNetworkAttachmentSpecNormalizer.php new file mode 100644 index 00000000..917f862f --- /dev/null +++ b/src/Normalizer/TaskSpecNetworkAttachmentSpecNormalizer.php @@ -0,0 +1,80 @@ +setContainerID($data['ContainerID']); + unset($data['ContainerID']); + } elseif (\array_key_exists('ContainerID', $data) && null === $data['ContainerID']) { + $object->setContainerID(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('containerID') && null !== $data->getContainerID()) { + $dataArray['ContainerID'] = $data->getContainerID(); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecNetworkAttachmentSpec::class => false]; + } +} diff --git a/src/Normalizer/TaskSpecNetworksItemNormalizer.php b/src/Normalizer/TaskSpecNetworksItemNormalizer.php deleted file mode 100644 index d4ff72fd..00000000 --- a/src/Normalizer/TaskSpecNetworksItemNormalizer.php +++ /dev/null @@ -1,71 +0,0 @@ -{'Target'} !== null) { - $object->setTarget($data->{'Target'}); - } - if (property_exists($data, 'Aliases') && $data->{'Aliases'} !== null) { - $values = []; - foreach ($data->{'Aliases'} as $value) { - $values[] = $value; - } - $object->setAliases($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getTarget()) { - $data->{'Target'} = $object->getTarget(); - } - if (null !== $object->getAliases()) { - $values = []; - foreach ($object->getAliases() as $value) { - $values[] = $value; - } - $data->{'Aliases'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/TaskSpecNormalizer.php b/src/Normalizer/TaskSpecNormalizer.php index eeadc845..ad6e1b21 100644 --- a/src/Normalizer/TaskSpecNormalizer.php +++ b/src/Normalizer/TaskSpecNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,95 +16,154 @@ class TaskSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpec'; + return \Docker\API\Model\TaskSpec::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpec; + return \is_object($data) && \Docker\API\Model\TaskSpec::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\TaskSpec(); - if (property_exists($data, 'PluginSpec') && $data->{'PluginSpec'} !== null) { - $object->setPluginSpec($this->denormalizer->denormalize($data->{'PluginSpec'}, 'Docker\\API\\Model\\TaskSpecPluginSpec', 'json', $context)); - } - if (property_exists($data, 'ContainerSpec') && $data->{'ContainerSpec'} !== null) { - $object->setContainerSpec($this->denormalizer->denormalize($data->{'ContainerSpec'}, 'Docker\\API\\Model\\TaskSpecContainerSpec', 'json', $context)); - } - if (property_exists($data, 'Resources') && $data->{'Resources'} !== null) { - $object->setResources($this->denormalizer->denormalize($data->{'Resources'}, 'Docker\\API\\Model\\TaskSpecResources', 'json', $context)); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'RestartPolicy') && $data->{'RestartPolicy'} !== null) { - $object->setRestartPolicy($this->denormalizer->denormalize($data->{'RestartPolicy'}, 'Docker\\API\\Model\\TaskSpecRestartPolicy', 'json', $context)); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'Placement') && $data->{'Placement'} !== null) { - $object->setPlacement($this->denormalizer->denormalize($data->{'Placement'}, 'Docker\\API\\Model\\TaskSpecPlacement', 'json', $context)); - } - if (property_exists($data, 'ForceUpdate') && $data->{'ForceUpdate'} !== null) { - $object->setForceUpdate($data->{'ForceUpdate'}); - } - if (property_exists($data, 'Runtime') && $data->{'Runtime'} !== null) { - $object->setRuntime($data->{'Runtime'}); - } - if (property_exists($data, 'Networks') && $data->{'Networks'} !== null) { + $object = new \Docker\API\Model\TaskSpec(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('PluginSpec', $data) && null !== $data['PluginSpec']) { + $object->setPluginSpec($this->denormalizer->denormalize($data['PluginSpec'], \Docker\API\Model\TaskSpecPluginSpec::class, 'json', $context)); + unset($data['PluginSpec']); + } elseif (\array_key_exists('PluginSpec', $data) && null === $data['PluginSpec']) { + $object->setPluginSpec(null); + } + if (\array_key_exists('ContainerSpec', $data) && null !== $data['ContainerSpec']) { + $object->setContainerSpec($this->denormalizer->denormalize($data['ContainerSpec'], \Docker\API\Model\TaskSpecContainerSpec::class, 'json', $context)); + unset($data['ContainerSpec']); + } elseif (\array_key_exists('ContainerSpec', $data) && null === $data['ContainerSpec']) { + $object->setContainerSpec(null); + } + if (\array_key_exists('NetworkAttachmentSpec', $data) && null !== $data['NetworkAttachmentSpec']) { + $object->setNetworkAttachmentSpec($this->denormalizer->denormalize($data['NetworkAttachmentSpec'], \Docker\API\Model\TaskSpecNetworkAttachmentSpec::class, 'json', $context)); + unset($data['NetworkAttachmentSpec']); + } elseif (\array_key_exists('NetworkAttachmentSpec', $data) && null === $data['NetworkAttachmentSpec']) { + $object->setNetworkAttachmentSpec(null); + } + if (\array_key_exists('Resources', $data) && null !== $data['Resources']) { + $object->setResources($this->denormalizer->denormalize($data['Resources'], \Docker\API\Model\TaskSpecResources::class, 'json', $context)); + unset($data['Resources']); + } elseif (\array_key_exists('Resources', $data) && null === $data['Resources']) { + $object->setResources(null); + } + if (\array_key_exists('RestartPolicy', $data) && null !== $data['RestartPolicy']) { + $object->setRestartPolicy($this->denormalizer->denormalize($data['RestartPolicy'], \Docker\API\Model\TaskSpecRestartPolicy::class, 'json', $context)); + unset($data['RestartPolicy']); + } elseif (\array_key_exists('RestartPolicy', $data) && null === $data['RestartPolicy']) { + $object->setRestartPolicy(null); + } + if (\array_key_exists('Placement', $data) && null !== $data['Placement']) { + $object->setPlacement($this->denormalizer->denormalize($data['Placement'], \Docker\API\Model\TaskSpecPlacement::class, 'json', $context)); + unset($data['Placement']); + } elseif (\array_key_exists('Placement', $data) && null === $data['Placement']) { + $object->setPlacement(null); + } + if (\array_key_exists('ForceUpdate', $data) && null !== $data['ForceUpdate']) { + $object->setForceUpdate($data['ForceUpdate']); + unset($data['ForceUpdate']); + } elseif (\array_key_exists('ForceUpdate', $data) && null === $data['ForceUpdate']) { + $object->setForceUpdate(null); + } + if (\array_key_exists('Runtime', $data) && null !== $data['Runtime']) { + $object->setRuntime($data['Runtime']); + unset($data['Runtime']); + } elseif (\array_key_exists('Runtime', $data) && null === $data['Runtime']) { + $object->setRuntime(null); + } + if (\array_key_exists('Networks', $data) && null !== $data['Networks']) { $values = []; - foreach ($data->{'Networks'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\TaskSpecNetworksItem', 'json', $context); + foreach ($data['Networks'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\NetworkAttachmentConfig::class, 'json', $context); } $object->setNetworks($values); - } - if (property_exists($data, 'LogDriver') && $data->{'LogDriver'} !== null) { - $object->setLogDriver($this->denormalizer->denormalize($data->{'LogDriver'}, 'Docker\\API\\Model\\TaskSpecLogDriver', 'json', $context)); + unset($data['Networks']); + } elseif (\array_key_exists('Networks', $data) && null === $data['Networks']) { + $object->setNetworks(null); + } + if (\array_key_exists('LogDriver', $data) && null !== $data['LogDriver']) { + $object->setLogDriver($this->denormalizer->denormalize($data['LogDriver'], \Docker\API\Model\TaskSpecLogDriver::class, 'json', $context)); + unset($data['LogDriver']); + } elseif (\array_key_exists('LogDriver', $data) && null === $data['LogDriver']) { + $object->setLogDriver(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getPluginSpec()) { - $data->{'PluginSpec'} = $this->normalizer->normalize($object->getPluginSpec(), 'json', $context); + $dataArray = []; + if ($data->isInitialized('pluginSpec') && null !== $data->getPluginSpec()) { + $dataArray['PluginSpec'] = $this->normalizer->normalize($data->getPluginSpec(), 'json', $context); } - if (null !== $object->getContainerSpec()) { - $data->{'ContainerSpec'} = $this->normalizer->normalize($object->getContainerSpec(), 'json', $context); + if ($data->isInitialized('containerSpec') && null !== $data->getContainerSpec()) { + $dataArray['ContainerSpec'] = $this->normalizer->normalize($data->getContainerSpec(), 'json', $context); } - if (null !== $object->getResources()) { - $data->{'Resources'} = $this->normalizer->normalize($object->getResources(), 'json', $context); + if ($data->isInitialized('networkAttachmentSpec') && null !== $data->getNetworkAttachmentSpec()) { + $dataArray['NetworkAttachmentSpec'] = $this->normalizer->normalize($data->getNetworkAttachmentSpec(), 'json', $context); } - if (null !== $object->getRestartPolicy()) { - $data->{'RestartPolicy'} = $this->normalizer->normalize($object->getRestartPolicy(), 'json', $context); + if ($data->isInitialized('resources') && null !== $data->getResources()) { + $dataArray['Resources'] = $this->normalizer->normalize($data->getResources(), 'json', $context); } - if (null !== $object->getPlacement()) { - $data->{'Placement'} = $this->normalizer->normalize($object->getPlacement(), 'json', $context); + if ($data->isInitialized('restartPolicy') && null !== $data->getRestartPolicy()) { + $dataArray['RestartPolicy'] = $this->normalizer->normalize($data->getRestartPolicy(), 'json', $context); } - if (null !== $object->getForceUpdate()) { - $data->{'ForceUpdate'} = $object->getForceUpdate(); + if ($data->isInitialized('placement') && null !== $data->getPlacement()) { + $dataArray['Placement'] = $this->normalizer->normalize($data->getPlacement(), 'json', $context); } - if (null !== $object->getRuntime()) { - $data->{'Runtime'} = $object->getRuntime(); + if ($data->isInitialized('forceUpdate') && null !== $data->getForceUpdate()) { + $dataArray['ForceUpdate'] = $data->getForceUpdate(); } - if (null !== $object->getNetworks()) { + if ($data->isInitialized('runtime') && null !== $data->getRuntime()) { + $dataArray['Runtime'] = $data->getRuntime(); + } + if ($data->isInitialized('networks') && null !== $data->getNetworks()) { $values = []; - foreach ($object->getNetworks() as $value) { + foreach ($data->getNetworks() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'Networks'} = $values; + $dataArray['Networks'] = $values; + } + if ($data->isInitialized('logDriver') && null !== $data->getLogDriver()) { + $dataArray['LogDriver'] = $this->normalizer->normalize($data->getLogDriver(), 'json', $context); } - if (null !== $object->getLogDriver()) { - $data->{'LogDriver'} = $this->normalizer->normalize($object->getLogDriver(), 'json', $context); + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpec::class => false]; } } diff --git a/src/Normalizer/TaskSpecPlacementNormalizer.php b/src/Normalizer/TaskSpecPlacementNormalizer.php index 11995be6..81664c71 100644 --- a/src/Normalizer/TaskSpecPlacementNormalizer.php +++ b/src/Normalizer/TaskSpecPlacementNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,75 +16,116 @@ class TaskSpecPlacementNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpecPlacement'; + return \Docker\API\Model\TaskSpecPlacement::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpecPlacement; + return \is_object($data) && \Docker\API\Model\TaskSpecPlacement::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskSpecPlacement(); - if (property_exists($data, 'Constraints') && $data->{'Constraints'} !== null) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Constraints', $data) && null !== $data['Constraints']) { $values = []; - foreach ($data->{'Constraints'} as $value) { + foreach ($data['Constraints'] as $value) { $values[] = $value; } $object->setConstraints($values); + unset($data['Constraints']); + } elseif (\array_key_exists('Constraints', $data) && null === $data['Constraints']) { + $object->setConstraints(null); } - if (property_exists($data, 'Preferences') && $data->{'Preferences'} !== null) { + if (\array_key_exists('Preferences', $data) && null !== $data['Preferences']) { $values_1 = []; - foreach ($data->{'Preferences'} as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\TaskSpecPlacementPreferencesItem', 'json', $context); + foreach ($data['Preferences'] as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, \Docker\API\Model\TaskSpecPlacementPreferencesItem::class, 'json', $context); } $object->setPreferences($values_1); + unset($data['Preferences']); + } elseif (\array_key_exists('Preferences', $data) && null === $data['Preferences']) { + $object->setPreferences(null); } - if (property_exists($data, 'Platforms') && $data->{'Platforms'} !== null) { + if (\array_key_exists('MaxReplicas', $data) && null !== $data['MaxReplicas']) { + $object->setMaxReplicas($data['MaxReplicas']); + unset($data['MaxReplicas']); + } elseif (\array_key_exists('MaxReplicas', $data) && null === $data['MaxReplicas']) { + $object->setMaxReplicas(null); + } + if (\array_key_exists('Platforms', $data) && null !== $data['Platforms']) { $values_2 = []; - foreach ($data->{'Platforms'} as $value_2) { - $values_2[] = $this->denormalizer->denormalize($value_2, 'Docker\\API\\Model\\Platform', 'json', $context); + foreach ($data['Platforms'] as $value_2) { + $values_2[] = $this->denormalizer->denormalize($value_2, \Docker\API\Model\Platform::class, 'json', $context); } $object->setPlatforms($values_2); + unset($data['Platforms']); + } elseif (\array_key_exists('Platforms', $data) && null === $data['Platforms']) { + $object->setPlatforms(null); + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_3; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getConstraints()) { + $dataArray = []; + if ($data->isInitialized('constraints') && null !== $data->getConstraints()) { $values = []; - foreach ($object->getConstraints() as $value) { + foreach ($data->getConstraints() as $value) { $values[] = $value; } - $data->{'Constraints'} = $values; + $dataArray['Constraints'] = $values; } - if (null !== $object->getPreferences()) { + if ($data->isInitialized('preferences') && null !== $data->getPreferences()) { $values_1 = []; - foreach ($object->getPreferences() as $value_1) { + foreach ($data->getPreferences() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } - $data->{'Preferences'} = $values_1; + $dataArray['Preferences'] = $values_1; } - if (null !== $object->getPlatforms()) { + if ($data->isInitialized('maxReplicas') && null !== $data->getMaxReplicas()) { + $dataArray['MaxReplicas'] = $data->getMaxReplicas(); + } + if ($data->isInitialized('platforms') && null !== $data->getPlatforms()) { $values_2 = []; - foreach ($object->getPlatforms() as $value_2) { + foreach ($data->getPlatforms() as $value_2) { $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); } - $data->{'Platforms'} = $values_2; + $dataArray['Platforms'] = $values_2; + } + foreach ($data as $key => $value_3) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_3; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecPlacement::class => false]; } } diff --git a/src/Normalizer/TaskSpecPlacementPreferencesItemNormalizer.php b/src/Normalizer/TaskSpecPlacementPreferencesItemNormalizer.php index 6c236491..525a7422 100644 --- a/src/Normalizer/TaskSpecPlacementPreferencesItemNormalizer.php +++ b/src/Normalizer/TaskSpecPlacementPreferencesItemNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,39 +16,65 @@ class TaskSpecPlacementPreferencesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpecPlacementPreferencesItem'; + return \Docker\API\Model\TaskSpecPlacementPreferencesItem::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpecPlacementPreferencesItem; + return \is_object($data) && \Docker\API\Model\TaskSpecPlacementPreferencesItem::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskSpecPlacementPreferencesItem(); - if (property_exists($data, 'Spread') && $data->{'Spread'} !== null) { - $object->setSpread($this->denormalizer->denormalize($data->{'Spread'}, 'Docker\\API\\Model\\TaskSpecPlacementPreferencesItemSpread', 'json', $context)); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Spread', $data) && null !== $data['Spread']) { + $object->setSpread($this->denormalizer->denormalize($data['Spread'], \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class, 'json', $context)); + unset($data['Spread']); + } elseif (\array_key_exists('Spread', $data) && null === $data['Spread']) { + $object->setSpread(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getSpread()) { - $data->{'Spread'} = $this->normalizer->normalize($object->getSpread(), 'json', $context); + $dataArray = []; + if ($data->isInitialized('spread') && null !== $data->getSpread()) { + $dataArray['Spread'] = $this->normalizer->normalize($data->getSpread(), 'json', $context); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecPlacementPreferencesItem::class => false]; } } diff --git a/src/Normalizer/TaskSpecPlacementPreferencesItemSpreadNormalizer.php b/src/Normalizer/TaskSpecPlacementPreferencesItemSpreadNormalizer.php index 2e20a9f6..a1e349c4 100644 --- a/src/Normalizer/TaskSpecPlacementPreferencesItemSpreadNormalizer.php +++ b/src/Normalizer/TaskSpecPlacementPreferencesItemSpreadNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,39 +16,65 @@ class TaskSpecPlacementPreferencesItemSpreadNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpecPlacementPreferencesItemSpread'; + return \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread; + return \is_object($data) && \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskSpecPlacementPreferencesItemSpread(); - if (property_exists($data, 'SpreadDescriptor') && $data->{'SpreadDescriptor'} !== null) { - $object->setSpreadDescriptor($data->{'SpreadDescriptor'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('SpreadDescriptor', $data) && null !== $data['SpreadDescriptor']) { + $object->setSpreadDescriptor($data['SpreadDescriptor']); + unset($data['SpreadDescriptor']); + } elseif (\array_key_exists('SpreadDescriptor', $data) && null === $data['SpreadDescriptor']) { + $object->setSpreadDescriptor(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getSpreadDescriptor()) { - $data->{'SpreadDescriptor'} = $object->getSpreadDescriptor(); + $dataArray = []; + if ($data->isInitialized('spreadDescriptor') && null !== $data->getSpreadDescriptor()) { + $dataArray['SpreadDescriptor'] = $data->getSpreadDescriptor(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecPlacementPreferencesItemSpread::class => false]; } } diff --git a/src/Normalizer/TaskSpecPluginSpecNormalizer.php b/src/Normalizer/TaskSpecPluginSpecNormalizer.php index 63cad2d7..d97ed8da 100644 --- a/src/Normalizer/TaskSpecPluginSpecNormalizer.php +++ b/src/Normalizer/TaskSpecPluginSpecNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,65 +16,103 @@ class TaskSpecPluginSpecNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpecPluginSpec'; + return \Docker\API\Model\TaskSpecPluginSpec::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpecPluginSpec; + return \is_object($data) && \Docker\API\Model\TaskSpecPluginSpec::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskSpecPluginSpec(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); + if (\array_key_exists('Disabled', $data) && \is_int($data['Disabled'])) { + $data['Disabled'] = (bool) $data['Disabled']; + } + if (null === $data || false === \is_array($data)) { + return $object; } - if (property_exists($data, 'Remote') && $data->{'Remote'} !== null) { - $object->setRemote($data->{'Remote'}); + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); } - if (property_exists($data, 'Disabled') && $data->{'Disabled'} !== null) { - $object->setDisabled($data->{'Disabled'}); + if (\array_key_exists('Remote', $data) && null !== $data['Remote']) { + $object->setRemote($data['Remote']); + unset($data['Remote']); + } elseif (\array_key_exists('Remote', $data) && null === $data['Remote']) { + $object->setRemote(null); } - if (property_exists($data, 'PluginPrivilege') && $data->{'PluginPrivilege'} !== null) { + if (\array_key_exists('Disabled', $data) && null !== $data['Disabled']) { + $object->setDisabled($data['Disabled']); + unset($data['Disabled']); + } elseif (\array_key_exists('Disabled', $data) && null === $data['Disabled']) { + $object->setDisabled(null); + } + if (\array_key_exists('PluginPrivilege', $data) && null !== $data['PluginPrivilege']) { $values = []; - foreach ($data->{'PluginPrivilege'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\TaskSpecPluginSpecPluginPrivilegeItem', 'json', $context); + foreach ($data['PluginPrivilege'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \Docker\API\Model\PluginPrivilege::class, 'json', $context); } $object->setPluginPrivilege($values); + unset($data['PluginPrivilege']); + } elseif (\array_key_exists('PluginPrivilege', $data) && null === $data['PluginPrivilege']) { + $object->setPluginPrivilege(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); } - if (null !== $object->getRemote()) { - $data->{'Remote'} = $object->getRemote(); + if ($data->isInitialized('remote') && null !== $data->getRemote()) { + $dataArray['Remote'] = $data->getRemote(); } - if (null !== $object->getDisabled()) { - $data->{'Disabled'} = $object->getDisabled(); + if ($data->isInitialized('disabled') && null !== $data->getDisabled()) { + $dataArray['Disabled'] = $data->getDisabled(); } - if (null !== $object->getPluginPrivilege()) { + if ($data->isInitialized('pluginPrivilege') && null !== $data->getPluginPrivilege()) { $values = []; - foreach ($object->getPluginPrivilege() as $value) { + foreach ($data->getPluginPrivilege() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } - $data->{'PluginPrivilege'} = $values; + $dataArray['PluginPrivilege'] = $values; + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecPluginSpec::class => false]; } } diff --git a/src/Normalizer/TaskSpecPluginSpecPluginPrivilegeItemNormalizer.php b/src/Normalizer/TaskSpecPluginSpecPluginPrivilegeItemNormalizer.php deleted file mode 100644 index 51bf3e7e..00000000 --- a/src/Normalizer/TaskSpecPluginSpecPluginPrivilegeItemNormalizer.php +++ /dev/null @@ -1,77 +0,0 @@ -{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Description') && $data->{'Description'} !== null) { - $object->setDescription($data->{'Description'}); - } - if (property_exists($data, 'Value') && $data->{'Value'} !== null) { - $values = []; - foreach ($data->{'Value'} as $value) { - $values[] = $value; - } - $object->setValue($values); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getDescription()) { - $data->{'Description'} = $object->getDescription(); - } - if (null !== $object->getValue()) { - $values = []; - foreach ($object->getValue() as $value) { - $values[] = $value; - } - $data->{'Value'} = $values; - } - - return $data; - } -} diff --git a/src/Normalizer/TaskSpecResourcesNormalizer.php b/src/Normalizer/TaskSpecResourcesNormalizer.php index a8b7e0fc..43a1d187 100644 --- a/src/Normalizer/TaskSpecResourcesNormalizer.php +++ b/src/Normalizer/TaskSpecResourcesNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class TaskSpecResourcesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpecResources'; + return \Docker\API\Model\TaskSpecResources::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpecResources; + return \is_object($data) && \Docker\API\Model\TaskSpecResources::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskSpecResources(); - if (property_exists($data, 'Limits') && $data->{'Limits'} !== null) { - $object->setLimits($this->denormalizer->denormalize($data->{'Limits'}, 'Docker\\API\\Model\\ResourceObject', 'json', $context)); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Limits', $data) && null !== $data['Limits']) { + $object->setLimits($this->denormalizer->denormalize($data['Limits'], \Docker\API\Model\Limit::class, 'json', $context)); + unset($data['Limits']); + } elseif (\array_key_exists('Limits', $data) && null === $data['Limits']) { + $object->setLimits(null); + } + if (\array_key_exists('Reservations', $data) && null !== $data['Reservations']) { + $object->setReservations($this->denormalizer->denormalize($data['Reservations'], \Docker\API\Model\ResourceObject::class, 'json', $context)); + unset($data['Reservations']); + } elseif (\array_key_exists('Reservations', $data) && null === $data['Reservations']) { + $object->setReservations(null); } - if (property_exists($data, 'Reservation') && $data->{'Reservation'} !== null) { - $object->setReservation($this->denormalizer->denormalize($data->{'Reservation'}, 'Docker\\API\\Model\\ResourceObject', 'json', $context)); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getLimits()) { - $data->{'Limits'} = $this->normalizer->normalize($object->getLimits(), 'json', $context); + $dataArray = []; + if ($data->isInitialized('limits') && null !== $data->getLimits()) { + $dataArray['Limits'] = $this->normalizer->normalize($data->getLimits(), 'json', $context); } - if (null !== $object->getReservation()) { - $data->{'Reservation'} = $this->normalizer->normalize($object->getReservation(), 'json', $context); + if ($data->isInitialized('reservations') && null !== $data->getReservations()) { + $dataArray['Reservations'] = $this->normalizer->normalize($data->getReservations(), 'json', $context); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecResources::class => false]; } } diff --git a/src/Normalizer/TaskSpecRestartPolicyNormalizer.php b/src/Normalizer/TaskSpecRestartPolicyNormalizer.php index c2600da0..8dc2cd39 100644 --- a/src/Normalizer/TaskSpecRestartPolicyNormalizer.php +++ b/src/Normalizer/TaskSpecRestartPolicyNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,57 +16,92 @@ class TaskSpecRestartPolicyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskSpecRestartPolicy'; + return \Docker\API\Model\TaskSpecRestartPolicy::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskSpecRestartPolicy; + return \is_object($data) && \Docker\API\Model\TaskSpecRestartPolicy::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskSpecRestartPolicy(); - if (property_exists($data, 'Condition') && $data->{'Condition'} !== null) { - $object->setCondition($data->{'Condition'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Condition', $data) && null !== $data['Condition']) { + $object->setCondition($data['Condition']); + unset($data['Condition']); + } elseif (\array_key_exists('Condition', $data) && null === $data['Condition']) { + $object->setCondition(null); + } + if (\array_key_exists('Delay', $data) && null !== $data['Delay']) { + $object->setDelay($data['Delay']); + unset($data['Delay']); + } elseif (\array_key_exists('Delay', $data) && null === $data['Delay']) { + $object->setDelay(null); } - if (property_exists($data, 'Delay') && $data->{'Delay'} !== null) { - $object->setDelay($data->{'Delay'}); + if (\array_key_exists('MaxAttempts', $data) && null !== $data['MaxAttempts']) { + $object->setMaxAttempts($data['MaxAttempts']); + unset($data['MaxAttempts']); + } elseif (\array_key_exists('MaxAttempts', $data) && null === $data['MaxAttempts']) { + $object->setMaxAttempts(null); } - if (property_exists($data, 'MaxAttempts') && $data->{'MaxAttempts'} !== null) { - $object->setMaxAttempts($data->{'MaxAttempts'}); + if (\array_key_exists('Window', $data) && null !== $data['Window']) { + $object->setWindow($data['Window']); + unset($data['Window']); + } elseif (\array_key_exists('Window', $data) && null === $data['Window']) { + $object->setWindow(null); } - if (property_exists($data, 'Window') && $data->{'Window'} !== null) { - $object->setWindow($data->{'Window'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getCondition()) { - $data->{'Condition'} = $object->getCondition(); + $dataArray = []; + if ($data->isInitialized('condition') && null !== $data->getCondition()) { + $dataArray['Condition'] = $data->getCondition(); } - if (null !== $object->getDelay()) { - $data->{'Delay'} = $object->getDelay(); + if ($data->isInitialized('delay') && null !== $data->getDelay()) { + $dataArray['Delay'] = $data->getDelay(); } - if (null !== $object->getMaxAttempts()) { - $data->{'MaxAttempts'} = $object->getMaxAttempts(); + if ($data->isInitialized('maxAttempts') && null !== $data->getMaxAttempts()) { + $dataArray['MaxAttempts'] = $data->getMaxAttempts(); } - if (null !== $object->getWindow()) { - $data->{'Window'} = $object->getWindow(); + if ($data->isInitialized('window') && null !== $data->getWindow()) { + $dataArray['Window'] = $data->getWindow(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskSpecRestartPolicy::class => false]; } } diff --git a/src/Normalizer/TaskStatusContainerStatusNormalizer.php b/src/Normalizer/TaskStatusContainerStatusNormalizer.php deleted file mode 100644 index f0ca8958..00000000 --- a/src/Normalizer/TaskStatusContainerStatusNormalizer.php +++ /dev/null @@ -1,69 +0,0 @@ -{'ContainerID'} !== null) { - $object->setContainerID($data->{'ContainerID'}); - } - if (property_exists($data, 'PID') && $data->{'PID'} !== null) { - $object->setPID($data->{'PID'}); - } - if (property_exists($data, 'ExitCode') && $data->{'ExitCode'} !== null) { - $object->setExitCode($data->{'ExitCode'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getContainerID()) { - $data->{'ContainerID'} = $object->getContainerID(); - } - if (null !== $object->getPID()) { - $data->{'PID'} = $object->getPID(); - } - if (null !== $object->getExitCode()) { - $data->{'ExitCode'} = $object->getExitCode(); - } - - return $data; - } -} diff --git a/src/Normalizer/TaskStatusNormalizer.php b/src/Normalizer/TaskStatusNormalizer.php index b5776e9d..4f78e244 100644 --- a/src/Normalizer/TaskStatusNormalizer.php +++ b/src/Normalizer/TaskStatusNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,63 +16,110 @@ class TaskStatusNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\TaskStatus'; + return \Docker\API\Model\TaskStatus::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\TaskStatus; + return \is_object($data) && \Docker\API\Model\TaskStatus::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\TaskStatus(); - if (property_exists($data, 'Timestamp') && $data->{'Timestamp'} !== null) { - $object->setTimestamp($data->{'Timestamp'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Timestamp', $data) && null !== $data['Timestamp']) { + $object->setTimestamp($data['Timestamp']); + unset($data['Timestamp']); + } elseif (\array_key_exists('Timestamp', $data) && null === $data['Timestamp']) { + $object->setTimestamp(null); + } + if (\array_key_exists('State', $data) && null !== $data['State']) { + $object->setState($data['State']); + unset($data['State']); + } elseif (\array_key_exists('State', $data) && null === $data['State']) { + $object->setState(null); + } + if (\array_key_exists('Message', $data) && null !== $data['Message']) { + $object->setMessage($data['Message']); + unset($data['Message']); + } elseif (\array_key_exists('Message', $data) && null === $data['Message']) { + $object->setMessage(null); } - if (property_exists($data, 'State') && $data->{'State'} !== null) { - $object->setState($data->{'State'}); + if (\array_key_exists('Err', $data) && null !== $data['Err']) { + $object->setErr($data['Err']); + unset($data['Err']); + } elseif (\array_key_exists('Err', $data) && null === $data['Err']) { + $object->setErr(null); } - if (property_exists($data, 'Message') && $data->{'Message'} !== null) { - $object->setMessage($data->{'Message'}); + if (\array_key_exists('ContainerStatus', $data) && null !== $data['ContainerStatus']) { + $object->setContainerStatus($this->denormalizer->denormalize($data['ContainerStatus'], \Docker\API\Model\ContainerStatus::class, 'json', $context)); + unset($data['ContainerStatus']); + } elseif (\array_key_exists('ContainerStatus', $data) && null === $data['ContainerStatus']) { + $object->setContainerStatus(null); } - if (property_exists($data, 'Err') && $data->{'Err'} !== null) { - $object->setErr($data->{'Err'}); + if (\array_key_exists('PortStatus', $data) && null !== $data['PortStatus']) { + $object->setPortStatus($this->denormalizer->denormalize($data['PortStatus'], \Docker\API\Model\PortStatus::class, 'json', $context)); + unset($data['PortStatus']); + } elseif (\array_key_exists('PortStatus', $data) && null === $data['PortStatus']) { + $object->setPortStatus(null); } - if (property_exists($data, 'ContainerStatus') && $data->{'ContainerStatus'} !== null) { - $object->setContainerStatus($this->denormalizer->denormalize($data->{'ContainerStatus'}, 'Docker\\API\\Model\\TaskStatusContainerStatus', 'json', $context)); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getTimestamp()) { - $data->{'Timestamp'} = $object->getTimestamp(); + $dataArray = []; + if ($data->isInitialized('timestamp') && null !== $data->getTimestamp()) { + $dataArray['Timestamp'] = $data->getTimestamp(); } - if (null !== $object->getState()) { - $data->{'State'} = $object->getState(); + if ($data->isInitialized('state') && null !== $data->getState()) { + $dataArray['State'] = $data->getState(); } - if (null !== $object->getMessage()) { - $data->{'Message'} = $object->getMessage(); + if ($data->isInitialized('message') && null !== $data->getMessage()) { + $dataArray['Message'] = $data->getMessage(); } - if (null !== $object->getErr()) { - $data->{'Err'} = $object->getErr(); + if ($data->isInitialized('err') && null !== $data->getErr()) { + $dataArray['Err'] = $data->getErr(); } - if (null !== $object->getContainerStatus()) { - $data->{'ContainerStatus'} = $this->normalizer->normalize($object->getContainerStatus(), 'json', $context); + if ($data->isInitialized('containerStatus') && null !== $data->getContainerStatus()) { + $dataArray['ContainerStatus'] = $this->normalizer->normalize($data->getContainerStatus(), 'json', $context); + } + if ($data->isInitialized('portStatus') && null !== $data->getPortStatus()) { + $dataArray['PortStatus'] = $this->normalizer->normalize($data->getPortStatus(), 'json', $context); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\TaskStatus::class => false]; } } diff --git a/src/Normalizer/ThrottleDeviceNormalizer.php b/src/Normalizer/ThrottleDeviceNormalizer.php index 1e1fb1a6..6226b6a0 100644 --- a/src/Normalizer/ThrottleDeviceNormalizer.php +++ b/src/Normalizer/ThrottleDeviceNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,74 @@ class ThrottleDeviceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\ThrottleDevice'; + return \Docker\API\Model\ThrottleDevice::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\ThrottleDevice; + return \is_object($data) && \Docker\API\Model\ThrottleDevice::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\ThrottleDevice(); - if (property_exists($data, 'Path') && $data->{'Path'} !== null) { - $object->setPath($data->{'Path'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Path', $data) && null !== $data['Path']) { + $object->setPath($data['Path']); + unset($data['Path']); + } elseif (\array_key_exists('Path', $data) && null === $data['Path']) { + $object->setPath(null); + } + if (\array_key_exists('Rate', $data) && null !== $data['Rate']) { + $object->setRate($data['Rate']); + unset($data['Rate']); + } elseif (\array_key_exists('Rate', $data) && null === $data['Rate']) { + $object->setRate(null); } - if (property_exists($data, 'Rate') && $data->{'Rate'} !== null) { - $object->setRate($data->{'Rate'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getPath()) { - $data->{'Path'} = $object->getPath(); + $dataArray = []; + if ($data->isInitialized('path') && null !== $data->getPath()) { + $dataArray['Path'] = $data->getPath(); } - if (null !== $object->getRate()) { - $data->{'Rate'} = $object->getRate(); + if ($data->isInitialized('rate') && null !== $data->getRate()) { + $dataArray['Rate'] = $data->getRate(); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } - return $data; + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\ThrottleDevice::class => false]; } } diff --git a/src/Normalizer/VersionGetResponse200ComponentsItemNormalizer.php b/src/Normalizer/VersionGetResponse200ComponentsItemNormalizer.php deleted file mode 100644 index 2944c81f..00000000 --- a/src/Normalizer/VersionGetResponse200ComponentsItemNormalizer.php +++ /dev/null @@ -1,69 +0,0 @@ -{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($data->{'Version'}); - } - if (property_exists($data, 'Details') && $data->{'Details'} !== null) { - $object->setDetails($data->{'Details'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getVersion()) { - $data->{'Version'} = $object->getVersion(); - } - if (null !== $object->getDetails()) { - $data->{'Details'} = $object->getDetails(); - } - - return $data; - } -} diff --git a/src/Normalizer/VersionGetResponse200Normalizer.php b/src/Normalizer/VersionGetResponse200Normalizer.php deleted file mode 100644 index fe12bb61..00000000 --- a/src/Normalizer/VersionGetResponse200Normalizer.php +++ /dev/null @@ -1,131 +0,0 @@ -{'Platform'} !== null) { - $object->setPlatform($this->denormalizer->denormalize($data->{'Platform'}, 'Docker\\API\\Model\\VersionGetResponse200Platform', 'json', $context)); - } - if (property_exists($data, 'Components') && $data->{'Components'} !== null) { - $values = []; - foreach ($data->{'Components'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\VersionGetResponse200ComponentsItem', 'json', $context); - } - $object->setComponents($values); - } - if (property_exists($data, 'Version') && $data->{'Version'} !== null) { - $object->setVersion($data->{'Version'}); - } - if (property_exists($data, 'ApiVersion') && $data->{'ApiVersion'} !== null) { - $object->setApiVersion($data->{'ApiVersion'}); - } - if (property_exists($data, 'MinAPIVersion') && $data->{'MinAPIVersion'} !== null) { - $object->setMinAPIVersion($data->{'MinAPIVersion'}); - } - if (property_exists($data, 'GitCommit') && $data->{'GitCommit'} !== null) { - $object->setGitCommit($data->{'GitCommit'}); - } - if (property_exists($data, 'GoVersion') && $data->{'GoVersion'} !== null) { - $object->setGoVersion($data->{'GoVersion'}); - } - if (property_exists($data, 'Os') && $data->{'Os'} !== null) { - $object->setOs($data->{'Os'}); - } - if (property_exists($data, 'Arch') && $data->{'Arch'} !== null) { - $object->setArch($data->{'Arch'}); - } - if (property_exists($data, 'KernelVersion') && $data->{'KernelVersion'} !== null) { - $object->setKernelVersion($data->{'KernelVersion'}); - } - if (property_exists($data, 'Experimental') && $data->{'Experimental'} !== null) { - $object->setExperimental($data->{'Experimental'}); - } - if (property_exists($data, 'BuildTime') && $data->{'BuildTime'} !== null) { - $object->setBuildTime($data->{'BuildTime'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getPlatform()) { - $data->{'Platform'} = $this->normalizer->normalize($object->getPlatform(), 'json', $context); - } - if (null !== $object->getComponents()) { - $values = []; - foreach ($object->getComponents() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data->{'Components'} = $values; - } - if (null !== $object->getVersion()) { - $data->{'Version'} = $object->getVersion(); - } - if (null !== $object->getApiVersion()) { - $data->{'ApiVersion'} = $object->getApiVersion(); - } - if (null !== $object->getMinAPIVersion()) { - $data->{'MinAPIVersion'} = $object->getMinAPIVersion(); - } - if (null !== $object->getGitCommit()) { - $data->{'GitCommit'} = $object->getGitCommit(); - } - if (null !== $object->getGoVersion()) { - $data->{'GoVersion'} = $object->getGoVersion(); - } - if (null !== $object->getOs()) { - $data->{'Os'} = $object->getOs(); - } - if (null !== $object->getArch()) { - $data->{'Arch'} = $object->getArch(); - } - if (null !== $object->getKernelVersion()) { - $data->{'KernelVersion'} = $object->getKernelVersion(); - } - if (null !== $object->getExperimental()) { - $data->{'Experimental'} = $object->getExperimental(); - } - if (null !== $object->getBuildTime()) { - $data->{'BuildTime'} = $object->getBuildTime(); - } - - return $data; - } -} diff --git a/src/Normalizer/VersionGetResponse200PlatformNormalizer.php b/src/Normalizer/VersionGetResponse200PlatformNormalizer.php deleted file mode 100644 index 78fb1cb1..00000000 --- a/src/Normalizer/VersionGetResponse200PlatformNormalizer.php +++ /dev/null @@ -1,57 +0,0 @@ -{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - - return $data; - } -} diff --git a/src/Normalizer/VolumeCreateOptionsNormalizer.php b/src/Normalizer/VolumeCreateOptionsNormalizer.php new file mode 100644 index 00000000..d3782f6a --- /dev/null +++ b/src/Normalizer/VolumeCreateOptionsNormalizer.php @@ -0,0 +1,132 @@ +setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Driver', $data) && null !== $data['Driver']) { + $object->setDriver($data['Driver']); + unset($data['Driver']); + } elseif (\array_key_exists('Driver', $data) && null === $data['Driver']) { + $object->setDriver(null); + } + if (\array_key_exists('DriverOpts', $data) && null !== $data['DriverOpts']) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['DriverOpts'] as $key => $value) { + $values[$key] = $value; + } + $object->setDriverOpts($values); + unset($data['DriverOpts']); + } elseif (\array_key_exists('DriverOpts', $data) && null === $data['DriverOpts']) { + $object->setDriverOpts(null); + } + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { + $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Labels'] as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $object->setLabels($values_1); + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + if (\array_key_exists('ClusterVolumeSpec', $data) && null !== $data['ClusterVolumeSpec']) { + $object->setClusterVolumeSpec($this->denormalizer->denormalize($data['ClusterVolumeSpec'], \Docker\API\Model\ClusterVolumeSpec::class, 'json', $context)); + unset($data['ClusterVolumeSpec']); + } elseif (\array_key_exists('ClusterVolumeSpec', $data) && null === $data['ClusterVolumeSpec']) { + $object->setClusterVolumeSpec(null); + } + foreach ($data as $key_2 => $value_2) { + if (preg_match('/.*/', (string) $key_2)) { + $object[$key_2] = $value_2; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('name') && null !== $data->getName()) { + $dataArray['Name'] = $data->getName(); + } + if ($data->isInitialized('driver') && null !== $data->getDriver()) { + $dataArray['Driver'] = $data->getDriver(); + } + if ($data->isInitialized('driverOpts') && null !== $data->getDriverOpts()) { + $values = []; + foreach ($data->getDriverOpts() as $key => $value) { + $values[$key] = $value; + } + $dataArray['DriverOpts'] = $values; + } + if ($data->isInitialized('labels') && null !== $data->getLabels()) { + $values_1 = []; + foreach ($data->getLabels() as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; + } + $dataArray['Labels'] = $values_1; + } + if ($data->isInitialized('clusterVolumeSpec') && null !== $data->getClusterVolumeSpec()) { + $dataArray['ClusterVolumeSpec'] = $this->normalizer->normalize($data->getClusterVolumeSpec(), 'json', $context); + } + foreach ($data as $key_2 => $value_2) { + if (preg_match('/.*/', (string) $key_2)) { + $dataArray[$key_2] = $value_2; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\VolumeCreateOptions::class => false]; + } +} diff --git a/src/Normalizer/VolumeListResponseNormalizer.php b/src/Normalizer/VolumeListResponseNormalizer.php new file mode 100644 index 00000000..bfe73c74 --- /dev/null +++ b/src/Normalizer/VolumeListResponseNormalizer.php @@ -0,0 +1,105 @@ +denormalizer->denormalize($value, \Docker\API\Model\Volume::class, 'json', $context); + } + $object->setVolumes($values); + unset($data['Volumes']); + } elseif (\array_key_exists('Volumes', $data) && null === $data['Volumes']) { + $object->setVolumes(null); + } + if (\array_key_exists('Warnings', $data) && null !== $data['Warnings']) { + $values_1 = []; + foreach ($data['Warnings'] as $value_1) { + $values_1[] = $value_1; + } + $object->setWarnings($values_1); + unset($data['Warnings']); + } elseif (\array_key_exists('Warnings', $data) && null === $data['Warnings']) { + $object->setWarnings(null); + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('volumes') && null !== $data->getVolumes()) { + $values = []; + foreach ($data->getVolumes() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $dataArray['Volumes'] = $values; + } + if ($data->isInitialized('warnings') && null !== $data->getWarnings()) { + $values_1 = []; + foreach ($data->getWarnings() as $value_1) { + $values_1[] = $value_1; + } + $dataArray['Warnings'] = $values_1; + } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_2; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\VolumeListResponse::class => false]; + } +} diff --git a/src/Normalizer/VolumeNormalizer.php b/src/Normalizer/VolumeNormalizer.php index 4ad137b2..56d563cd 100644 --- a/src/Normalizer/VolumeNormalizer.php +++ b/src/Normalizer/VolumeNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,111 +16,158 @@ class VolumeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\Volume'; + return \Docker\API\Model\Volume::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\Volume; + return \is_object($data) && \Docker\API\Model\Volume::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; - } - $object = new \Docker\API\Model\Volume(); - if (property_exists($data, 'Name') && $data->{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($data->{'Driver'}); - } - if (property_exists($data, 'Mountpoint') && $data->{'Mountpoint'} !== null) { - $object->setMountpoint($data->{'Mountpoint'}); + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); } - if (property_exists($data, 'CreatedAt') && $data->{'CreatedAt'} !== null) { - $object->setCreatedAt($data->{'CreatedAt'}); + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } - if (property_exists($data, 'Status') && $data->{'Status'} !== null) { + $object = new \Docker\API\Model\Volume(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Name', $data) && null !== $data['Name']) { + $object->setName($data['Name']); + unset($data['Name']); + } elseif (\array_key_exists('Name', $data) && null === $data['Name']) { + $object->setName(null); + } + if (\array_key_exists('Driver', $data) && null !== $data['Driver']) { + $object->setDriver($data['Driver']); + unset($data['Driver']); + } elseif (\array_key_exists('Driver', $data) && null === $data['Driver']) { + $object->setDriver(null); + } + if (\array_key_exists('Mountpoint', $data) && null !== $data['Mountpoint']) { + $object->setMountpoint($data['Mountpoint']); + unset($data['Mountpoint']); + } elseif (\array_key_exists('Mountpoint', $data) && null === $data['Mountpoint']) { + $object->setMountpoint(null); + } + if (\array_key_exists('CreatedAt', $data) && null !== $data['CreatedAt']) { + $object->setCreatedAt($data['CreatedAt']); + unset($data['CreatedAt']); + } elseif (\array_key_exists('CreatedAt', $data) && null === $data['CreatedAt']) { + $object->setCreatedAt(null); + } + if (\array_key_exists('Status', $data) && null !== $data['Status']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Status'} as $key => $value) { - $values[$key] = $value; + foreach ($data['Status'] as $key => $value) { + $values[$key] = $this->denormalizer->denormalize($value, \Docker\API\Model\VolumeStatusItem::class, 'json', $context); } $object->setStatus($values); + unset($data['Status']); + } elseif (\array_key_exists('Status', $data) && null === $data['Status']) { + $object->setStatus(null); } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { + if (\array_key_exists('Labels', $data) && null !== $data['Labels']) { $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key_1 => $value_1) { + foreach ($data['Labels'] as $key_1 => $value_1) { $values_1[$key_1] = $value_1; } $object->setLabels($values_1); - } - if (property_exists($data, 'Scope') && $data->{'Scope'} !== null) { - $object->setScope($data->{'Scope'}); - } - if (property_exists($data, 'Options') && $data->{'Options'} !== null) { + unset($data['Labels']); + } elseif (\array_key_exists('Labels', $data) && null === $data['Labels']) { + $object->setLabels(null); + } + if (\array_key_exists('Scope', $data) && null !== $data['Scope']) { + $object->setScope($data['Scope']); + unset($data['Scope']); + } elseif (\array_key_exists('Scope', $data) && null === $data['Scope']) { + $object->setScope(null); + } + if (\array_key_exists('ClusterVolume', $data) && null !== $data['ClusterVolume']) { + $object->setClusterVolume($this->denormalizer->denormalize($data['ClusterVolume'], \Docker\API\Model\ClusterVolume::class, 'json', $context)); + unset($data['ClusterVolume']); + } elseif (\array_key_exists('ClusterVolume', $data) && null === $data['ClusterVolume']) { + $object->setClusterVolume(null); + } + if (\array_key_exists('Options', $data) && null !== $data['Options']) { $values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Options'} as $key_2 => $value_2) { + foreach ($data['Options'] as $key_2 => $value_2) { $values_2[$key_2] = $value_2; } $object->setOptions($values_2); - } - if (property_exists($data, 'UsageData') && $data->{'UsageData'} !== null) { - $object->setUsageData($this->denormalizer->denormalize($data->{'UsageData'}, 'Docker\\API\\Model\\VolumeUsageData', 'json', $context)); + unset($data['Options']); + } elseif (\array_key_exists('Options', $data) && null === $data['Options']) { + $object->setOptions(null); + } + if (\array_key_exists('UsageData', $data) && null !== $data['UsageData']) { + $object->setUsageData($this->denormalizer->denormalize($data['UsageData'], \Docker\API\Model\VolumeUsageData::class, 'json', $context)); + unset($data['UsageData']); + } elseif (\array_key_exists('UsageData', $data) && null === $data['UsageData']) { + $object->setUsageData(null); + } + foreach ($data as $key_3 => $value_3) { + if (preg_match('/.*/', (string) $key_3)) { + $object[$key_3] = $value_3; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); + $dataArray = []; + $dataArray['Name'] = $data->getName(); + $dataArray['Driver'] = $data->getDriver(); + $dataArray['Mountpoint'] = $data->getMountpoint(); + if ($data->isInitialized('createdAt') && null !== $data->getCreatedAt()) { + $dataArray['CreatedAt'] = $data->getCreatedAt(); + } + if ($data->isInitialized('status') && null !== $data->getStatus()) { + $values = []; + foreach ($data->getStatus() as $key => $value) { + $values[$key] = $this->normalizer->normalize($value, 'json', $context); + } + $dataArray['Status'] = $values; } - if (null !== $object->getMountpoint()) { - $data->{'Mountpoint'} = $object->getMountpoint(); + $values_1 = []; + foreach ($data->getLabels() as $key_1 => $value_1) { + $values_1[$key_1] = $value_1; } - if (null !== $object->getCreatedAt()) { - $data->{'CreatedAt'} = $object->getCreatedAt(); + $dataArray['Labels'] = $values_1; + $dataArray['Scope'] = $data->getScope(); + if ($data->isInitialized('clusterVolume') && null !== $data->getClusterVolume()) { + $dataArray['ClusterVolume'] = $this->normalizer->normalize($data->getClusterVolume(), 'json', $context); } - if (null !== $object->getStatus()) { - $values = new \stdClass(); - foreach ($object->getStatus() as $key => $value) { - $values->{$key} = $value; - } - $data->{'Status'} = $values; - } - if (null !== $object->getLabels()) { - $values_1 = new \stdClass(); - foreach ($object->getLabels() as $key_1 => $value_1) { - $values_1->{$key_1} = $value_1; - } - $data->{'Labels'} = $values_1; + $values_2 = []; + foreach ($data->getOptions() as $key_2 => $value_2) { + $values_2[$key_2] = $value_2; } - if (null !== $object->getScope()) { - $data->{'Scope'} = $object->getScope(); + $dataArray['Options'] = $values_2; + if ($data->isInitialized('usageData') && null !== $data->getUsageData()) { + $dataArray['UsageData'] = $this->normalizer->normalize($data->getUsageData(), 'json', $context); } - if (null !== $object->getOptions()) { - $values_2 = new \stdClass(); - foreach ($object->getOptions() as $key_2 => $value_2) { - $values_2->{$key_2} = $value_2; + foreach ($data as $key_3 => $value_3) { + if (preg_match('/.*/', (string) $key_3)) { + $dataArray[$key_3] = $value_3; } - $data->{'Options'} = $values_2; - } - if (null !== $object->getUsageData()) { - $data->{'UsageData'} = $this->normalizer->normalize($object->getUsageData(), 'json', $context); } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\Volume::class => false]; } } diff --git a/src/Normalizer/VolumeStatusItemNormalizer.php b/src/Normalizer/VolumeStatusItemNormalizer.php new file mode 100644 index 00000000..b0cfc603 --- /dev/null +++ b/src/Normalizer/VolumeStatusItemNormalizer.php @@ -0,0 +1,71 @@ + $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\VolumeStatusItem::class => false]; + } +} diff --git a/src/Normalizer/VolumeUsageDataNormalizer.php b/src/Normalizer/VolumeUsageDataNormalizer.php index 17f9bbe3..5fdae900 100644 --- a/src/Normalizer/VolumeUsageDataNormalizer.php +++ b/src/Normalizer/VolumeUsageDataNormalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,45 +16,70 @@ class VolumeUsageDataNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\VolumeUsageData'; + return \Docker\API\Model\VolumeUsageData::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\VolumeUsageData; + return \is_object($data) && \Docker\API\Model\VolumeUsageData::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\VolumeUsageData(); - if (property_exists($data, 'Size') && $data->{'Size'} !== null) { - $object->setSize($data->{'Size'}); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('Size', $data) && null !== $data['Size']) { + $object->setSize($data['Size']); + unset($data['Size']); + } elseif (\array_key_exists('Size', $data) && null === $data['Size']) { + $object->setSize(null); + } + if (\array_key_exists('RefCount', $data) && null !== $data['RefCount']) { + $object->setRefCount($data['RefCount']); + unset($data['RefCount']); + } elseif (\array_key_exists('RefCount', $data) && null === $data['RefCount']) { + $object->setRefCount(null); } - if (property_exists($data, 'RefCount') && $data->{'RefCount'} !== null) { - $object->setRefCount($data->{'RefCount'}); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getSize()) { - $data->{'Size'} = $object->getSize(); - } - if (null !== $object->getRefCount()) { - $data->{'RefCount'} = $object->getRefCount(); + $dataArray = []; + $dataArray['Size'] = $data->getSize(); + $dataArray['RefCount'] = $data->getRefCount(); + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\VolumeUsageData::class => false]; } } diff --git a/src/Normalizer/VolumesCreatePostBodyNormalizer.php b/src/Normalizer/VolumesCreatePostBodyNormalizer.php deleted file mode 100644 index 5082e104..00000000 --- a/src/Normalizer/VolumesCreatePostBodyNormalizer.php +++ /dev/null @@ -1,91 +0,0 @@ -{'Name'} !== null) { - $object->setName($data->{'Name'}); - } - if (property_exists($data, 'Driver') && $data->{'Driver'} !== null) { - $object->setDriver($data->{'Driver'}); - } - if (property_exists($data, 'DriverOpts') && $data->{'DriverOpts'} !== null) { - $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'DriverOpts'} as $key => $value) { - $values[$key] = $value; - } - $object->setDriverOpts($values); - } - if (property_exists($data, 'Labels') && $data->{'Labels'} !== null) { - $values_1 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); - foreach ($data->{'Labels'} as $key_1 => $value_1) { - $values_1[$key_1] = $value_1; - } - $object->setLabels($values_1); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getName()) { - $data->{'Name'} = $object->getName(); - } - if (null !== $object->getDriver()) { - $data->{'Driver'} = $object->getDriver(); - } - if (null !== $object->getDriverOpts()) { - $values = new \stdClass(); - foreach ($object->getDriverOpts() as $key => $value) { - $values->{$key} = $value; - } - $data->{'DriverOpts'} = $values; - } - if (null !== $object->getLabels()) { - $values_1 = new \stdClass(); - foreach ($object->getLabels() as $key_1 => $value_1) { - $values_1->{$key_1} = $value_1; - } - $data->{'Labels'} = $values_1; - } - - return $data; - } -} diff --git a/src/Normalizer/VolumesGetResponse200Normalizer.php b/src/Normalizer/VolumesGetResponse200Normalizer.php deleted file mode 100644 index 18529677..00000000 --- a/src/Normalizer/VolumesGetResponse200Normalizer.php +++ /dev/null @@ -1,79 +0,0 @@ -{'Volumes'} !== null) { - $values = []; - foreach ($data->{'Volumes'} as $value) { - $values[] = $this->denormalizer->denormalize($value, 'Docker\\API\\Model\\Volume', 'json', $context); - } - $object->setVolumes($values); - } - if (property_exists($data, 'Warnings') && $data->{'Warnings'} !== null) { - $values_1 = []; - foreach ($data->{'Warnings'} as $value_1) { - $values_1[] = $value_1; - } - $object->setWarnings($values_1); - } - - return $object; - } - - public function normalize($object, $format = null, array $context = []) - { - $data = new \stdClass(); - if (null !== $object->getVolumes()) { - $values = []; - foreach ($object->getVolumes() as $value) { - $values[] = $this->normalizer->normalize($value, 'json', $context); - } - $data->{'Volumes'} = $values; - } - if (null !== $object->getWarnings()) { - $values_1 = []; - foreach ($object->getWarnings() as $value_1) { - $values_1[] = $value_1; - } - $data->{'Warnings'} = $values_1; - } - - return $data; - } -} diff --git a/src/Normalizer/VolumesNamePutBodyNormalizer.php b/src/Normalizer/VolumesNamePutBodyNormalizer.php new file mode 100644 index 00000000..ee9fc720 --- /dev/null +++ b/src/Normalizer/VolumesNamePutBodyNormalizer.php @@ -0,0 +1,80 @@ +setSpec($this->denormalizer->denormalize($data['Spec'], \Docker\API\Model\ClusterVolumeSpec::class, 'json', $context)); + unset($data['Spec']); + } elseif (\array_key_exists('Spec', $data) && null === $data['Spec']) { + $object->setSpec(null); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $dataArray = []; + if ($data->isInitialized('spec') && null !== $data->getSpec()) { + $dataArray['Spec'] = $this->normalizer->normalize($data->getSpec(), 'json', $context); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value; + } + } + + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\VolumesNamePutBody::class => false]; + } +} diff --git a/src/Normalizer/VolumesPrunePostResponse200Normalizer.php b/src/Normalizer/VolumesPrunePostResponse200Normalizer.php index e9f57652..f4b2f773 100644 --- a/src/Normalizer/VolumesPrunePostResponse200Normalizer.php +++ b/src/Normalizer/VolumesPrunePostResponse200Normalizer.php @@ -2,14 +2,11 @@ declare(strict_types=1); -/* - * This file has been auto generated by Jane, - * - * Do no edit it directly. - */ - namespace Docker\API\Normalizer; +use Docker\API\Runtime\Normalizer\CheckArray; +use Docker\API\Runtime\Normalizer\ValidatorTrait; +use Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -19,53 +16,82 @@ class VolumesPrunePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return $type === 'Docker\\API\\Model\\VolumesPrunePostResponse200'; + return \Docker\API\Model\VolumesPrunePostResponse200::class === $type; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return $data instanceof \Docker\API\Model\VolumesPrunePostResponse200; + return \is_object($data) && \Docker\API\Model\VolumesPrunePostResponse200::class === $data::class; } - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!is_object($data)) { - return null; + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \Docker\API\Model\VolumesPrunePostResponse200(); - if (property_exists($data, 'VolumesDeleted') && $data->{'VolumesDeleted'} !== null) { + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('VolumesDeleted', $data) && null !== $data['VolumesDeleted']) { $values = []; - foreach ($data->{'VolumesDeleted'} as $value) { + foreach ($data['VolumesDeleted'] as $value) { $values[] = $value; } $object->setVolumesDeleted($values); + unset($data['VolumesDeleted']); + } elseif (\array_key_exists('VolumesDeleted', $data) && null === $data['VolumesDeleted']) { + $object->setVolumesDeleted(null); } - if (property_exists($data, 'SpaceReclaimed') && $data->{'SpaceReclaimed'} !== null) { - $object->setSpaceReclaimed($data->{'SpaceReclaimed'}); + if (\array_key_exists('SpaceReclaimed', $data) && null !== $data['SpaceReclaimed']) { + $object->setSpaceReclaimed($data['SpaceReclaimed']); + unset($data['SpaceReclaimed']); + } elseif (\array_key_exists('SpaceReclaimed', $data) && null === $data['SpaceReclaimed']) { + $object->setSpaceReclaimed(null); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; } - public function normalize($object, $format = null, array $context = []) + public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $data = new \stdClass(); - if (null !== $object->getVolumesDeleted()) { + $dataArray = []; + if ($data->isInitialized('volumesDeleted') && null !== $data->getVolumesDeleted()) { $values = []; - foreach ($object->getVolumesDeleted() as $value) { + foreach ($data->getVolumesDeleted() as $value) { $values[] = $value; } - $data->{'VolumesDeleted'} = $values; + $dataArray['VolumesDeleted'] = $values; } - if (null !== $object->getSpaceReclaimed()) { - $data->{'SpaceReclaimed'} = $object->getSpaceReclaimed(); + if ($data->isInitialized('spaceReclaimed') && null !== $data->getSpaceReclaimed()) { + $dataArray['SpaceReclaimed'] = $data->getSpaceReclaimed(); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $dataArray[$key] = $value_1; + } } - return $data; + return $dataArray; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\Docker\API\Model\VolumesPrunePostResponse200::class => false]; } } diff --git a/src/Runtime/Client/BaseEndpoint.php b/src/Runtime/Client/BaseEndpoint.php new file mode 100644 index 00000000..cc02bbf8 --- /dev/null +++ b/src/Runtime/Client/BaseEndpoint.php @@ -0,0 +1,84 @@ +getQueryOptionsResolver()->resolve($this->queryParameters); + $optionsResolved = array_map(static fn ($value) => $value ?? '', $optionsResolved); + + return http_build_query($optionsResolved, '', '&', \PHP_QUERY_RFC3986); + } + + public function getHeaders(array $baseHeaders = []): array + { + return array_merge($this->getExtraHeaders(), $baseHeaders, $this->getHeadersOptionsResolver()->resolve($this->headerParameters)); + } + + protected function getQueryOptionsResolver(): OptionsResolver + { + return new OptionsResolver(); + } + + protected function getHeadersOptionsResolver(): OptionsResolver + { + return new OptionsResolver(); + } + + // ---------------------------------------------------------------------------------------------------- + // Used for OpenApi2 compatibility + protected function getFormBody(): array + { + return [['Content-Type' => ['application/x-www-form-urlencoded']], http_build_query($this->getFormOptionsResolver()->resolve($this->formParameters))]; + } + + protected function getMultipartBody($streamFactory = null): array + { + $bodyBuilder = new MultipartStreamBuilder($streamFactory); + $formParameters = $this->getFormOptionsResolver()->resolve($this->formParameters); + foreach ($formParameters as $key => $value) { + $bodyBuilder->addResource($key, $value); + } + + return [['Content-Type' => ['multipart/form-data; boundary="'.($bodyBuilder->getBoundary().'"')]], $bodyBuilder->build()]; + } + + protected function getFormOptionsResolver(): OptionsResolver + { + return new OptionsResolver(); + } + + protected function getSerializedBody(SerializerInterface $serializer): array + { + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; + } +} diff --git a/src/Runtime/Client/Client.php b/src/Runtime/Client/Client.php new file mode 100644 index 00000000..12eb7316 --- /dev/null +++ b/src/Runtime/Client/Client.php @@ -0,0 +1,80 @@ +httpClient = $httpClient; + $this->requestFactory = $requestFactory; + $this->serializer = $serializer; + $this->streamFactory = $streamFactory; + } + + public function executeEndpoint(Endpoint $endpoint, string $fetch = self::FETCH_OBJECT) + { + if (self::FETCH_RESPONSE === $fetch) { + trigger_deprecation('jane-php/open-api-common', '7.3', 'Using %s::%s method with $fetch parameter equals to response is deprecated, use %s::%s instead.', __CLASS__, __METHOD__, __CLASS__, 'executeRawEndpoint'); + + return $this->executeRawEndpoint($endpoint); + } + + return $endpoint->parseResponse($this->processEndpoint($endpoint), $this->serializer, $fetch); + } + + public function executeRawEndpoint(Endpoint $endpoint): ResponseInterface + { + return $this->processEndpoint($endpoint); + } + + private function processEndpoint(Endpoint $endpoint): ResponseInterface + { + [$bodyHeaders, $body] = $endpoint->getBody($this->serializer, $this->streamFactory); + $queryString = $endpoint->getQueryString(); + $uriGlue = !str_contains($endpoint->getUri(), '?') ? '?' : '&'; + $uri = '' !== $queryString ? $endpoint->getUri().$uriGlue.$queryString : $endpoint->getUri(); + $request = $this->requestFactory->createRequest($endpoint->getMethod(), $uri); + if ($body) { + if ($body instanceof StreamInterface) { + $request = $request->withBody($body); + } elseif (\is_resource($body)) { + $request = $request->withBody($this->streamFactory->createStreamFromResource($body)); + } elseif (\strlen($body) <= 4000 && @file_exists($body)) { + // more than 4096 chars will trigger an error + $request = $request->withBody($this->streamFactory->createStreamFromFile($body)); + } else { + $request = $request->withBody($this->streamFactory->createStream($body)); + } + } + foreach ($endpoint->getHeaders($bodyHeaders) as $name => $value) { + $request = $request->withHeader($name, !\is_bool($value) ? $value : ($value ? 'true' : 'false')); + } + if (\count($endpoint->getAuthenticationScopes()) > 0) { + $scopes = []; + foreach ($endpoint->getAuthenticationScopes() as $scope) { + $scopes[] = $scope; + } + $request = $request->withHeader(AuthenticationRegistry::SCOPES_HEADER, $scopes); + } + + return $this->httpClient->sendRequest($request); + } +} diff --git a/src/Runtime/Client/CustomQueryResolver.php b/src/Runtime/Client/CustomQueryResolver.php new file mode 100644 index 00000000..5586812f --- /dev/null +++ b/src/Runtime/Client/CustomQueryResolver.php @@ -0,0 +1,12 @@ +hasHeader('Content-Type') ? current($response->getHeader('Content-Type')) : null; + + return $this->transformResponseBody($response, $serializer, $contentType); + } +} diff --git a/src/Runtime/Normalizer/CheckArray.php b/src/Runtime/Normalizer/CheckArray.php new file mode 100644 index 00000000..74ad5247 --- /dev/null +++ b/src/Runtime/Normalizer/CheckArray.php @@ -0,0 +1,13 @@ + is_numeric($key), \ARRAY_FILTER_USE_KEY)) === \count($array); + } +} diff --git a/src/Runtime/Normalizer/ReferenceNormalizer.php b/src/Runtime/Normalizer/ReferenceNormalizer.php new file mode 100644 index 00000000..eb0ab50f --- /dev/null +++ b/src/Runtime/Normalizer/ReferenceNormalizer.php @@ -0,0 +1,29 @@ +getReferenceUri(); + + return $ref; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return $data instanceof Reference; + } + + public function getSupportedTypes(?string $format): array + { + return [Reference::class => false]; + } +} diff --git a/src/Runtime/Normalizer/ValidationException.php b/src/Runtime/Normalizer/ValidationException.php new file mode 100644 index 00000000..c9c05707 --- /dev/null +++ b/src/Runtime/Normalizer/ValidationException.php @@ -0,0 +1,26 @@ +violationList = $violationList; + parent::__construct(\sprintf('Model validation failed with %d errors.', $violationList->count()), 400); + } + + public function getViolationList(): ConstraintViolationListInterface + { + return $this->violationList; + } +} diff --git a/src/Runtime/Normalizer/ValidatorTrait.php b/src/Runtime/Normalizer/ValidatorTrait.php new file mode 100644 index 00000000..771678b5 --- /dev/null +++ b/src/Runtime/Normalizer/ValidatorTrait.php @@ -0,0 +1,20 @@ +validate($data, $constraint); + if ($violations->count() > 0) { + throw new ValidationException($violations); + } + } +}