Skip to content
This repository was archived by the owner on Oct 26, 2019. It is now read-only.

Commit 1ad9310

Browse files
committed
Generate 1.27 version
1 parent 58b7edb commit 1ad9310

11 files changed

+77
-39
lines changed

docker-swagger.yaml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ produces:
1919
consumes:
2020
- "application/json"
2121
- "text/plain"
22-
basePath: "/v1.26"
22+
basePath: "/v1.27"
2323
info:
2424
title: "Docker Engine API"
25-
version: "1.26"
25+
version: "1.27"
2626
x-logo:
2727
url: "https://docs.docker.com/images/logo-docker-main.png"
2828
description: |
@@ -44,18 +44,19 @@ info:
4444
4545
The API is usually changed in each release of Docker, so API calls are versioned to ensure that clients don't break.
4646
47-
For Docker Engine >= 1.13.1, the API version is 1.26. To lock to this version, you prefix the URL with `/v1.26`. For example, calling `/info` is the same as calling `/v1.26/info`.
47+
For Docker Engine >= 17.03.1, the API version is 1.27. To lock to this version, you prefix the URL with `/v1.27`. For example, calling `/info` is the same as calling `/v1.27/info`.
4848
4949
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.
5050
5151
In previous versions of Docker, it was possible to access the API without providing a version. This behaviour is now deprecated will be removed in a future version of Docker.
5252
5353
The API uses an open schema model, which means server may add extra properties to responses. Likewise, the server will ignore any extra query parameters and request body properties. When you write clients, you need to ignore additional properties in responses to ensure they do not break when talking to newer Docker daemons.
5454
55-
This documentation is for version 1.26 of the API, which was introduced with Docker 1.13.1. Use this table to find documentation for previous versions of the API:
55+
This documentation is for version 1.27 of the API, which was introduced with Docker 17.03.1. Use this table to find documentation for previous versions of the API:
5656
5757
Docker version | API version | Changes
5858
----------------|-------------|---------
59+
1.13.1 & 17.03.0 | [1.26](https://docs.docker.com/engine/api/v1.26/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-26-api-changes)
5960
1.13.0 | [1.25](https://docs.docker.com/engine/api/v1.25/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-25-api-changes)
6061
1.12.x | [1.24](https://docs.docker.com/engine/api/v1.24/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-24-api-changes)
6162
1.11.x | [1.23](https://docs.docker.com/engine/api/v1.23/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-23-api-changes)
@@ -117,8 +118,6 @@ tags:
117118
Run new commands inside running containers. See the [command-line reference](https://docs.docker.com/engine/reference/commandline/exec/) for more information.
118119
119120
To exec a command in a container, you first need to create an exec instance, then start it. These two API endpoints are wrapped up in a single command-line command, `docker exec`.
120-
- name: "Secret"
121-
x-displayName: "Secrets"
122121
# Swarm things
123122
- name: "Swarm"
124123
x-displayName: "Swarm"
@@ -136,6 +135,10 @@ tags:
136135
x-displayName: "Tasks"
137136
description: |
138137
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.
138+
- name: "Secret"
139+
x-displayName: "Secrets"
140+
description: |
141+
Secrets are sensitive data that can be used by services. Swarm mode must be enabled for these endpoints to work.
139142
# System things
140143
- name: "Plugin"
141144
x-displayName: "Plugins"
@@ -3377,7 +3380,13 @@ paths:
33773380
description: |
33783381
This endpoint returns a live stream of a container’s resource usage statistics.
33793382
3380-
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.
3383+
The `precpu_stats` is the CPU statistic of last read, which is used
3384+
for calculating the CPU usage percentage. It is not the same as the
3385+
`cpu_stats` field.
3386+
3387+
If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is
3388+
nil then for compatibility with older daemons the length of the
3389+
corresponding `cpu_usage.percpu_usage` array should be used.
33813390
operationId: "ContainerStats"
33823391
produces:
33833392
- "application/json"
@@ -3457,6 +3466,7 @@ paths:
34573466
total_usage: 100215355
34583467
usage_in_kernelmode: 30000000
34593468
system_cpu_usage: 739306590000000
3469+
online_cpus: 4
34603470
throttling_data:
34613471
periods: 0
34623472
throttled_periods: 0
@@ -3472,6 +3482,7 @@ paths:
34723482
total_usage: 100093996
34733483
usage_in_kernelmode: 30000000
34743484
system_cpu_usage: 9492140000000
3485+
online_cpus: 4
34753486
throttling_data:
34763487
periods: 0
34773488
throttled_periods: 0
@@ -6499,7 +6510,7 @@ paths:
64996510
schema:
65006511
$ref: "#/definitions/ErrorResponse"
65016512
parameters:
6502-
- name: "name"
6513+
- name: "remote"
65036514
in: "query"
65046515
description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted."
65056516
required: true
@@ -6830,14 +6841,6 @@ paths:
68306841
type: "array"
68316842
items:
68326843
$ref: "#/definitions/Node"
6833-
400:
6834-
description: "bad parameter"
6835-
schema:
6836-
$ref: "#/definitions/ErrorResponse"
6837-
404:
6838-
description: "no such node"
6839-
schema:
6840-
$ref: "#/definitions/ErrorResponse"
68416844
500:
68426845
description: "server error"
68436846
schema:
@@ -7930,6 +7933,10 @@ paths:
79307933
description: "server error"
79317934
schema:
79327935
$ref: "#/definitions/ErrorResponse"
7936+
503:
7937+
description: "node is not part of a swarm"
7938+
schema:
7939+
$ref: "#/definitions/ErrorResponse"
79337940
parameters:
79347941
- name: "id"
79357942
in: "path"

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static function create($httpClient = null)
3030
if (null === $httpClient) {
3131
$httpClient = \Http\Discovery\HttpClientDiscovery::find();
3232
$plugins = [];
33-
$uri = \Http\Discovery\UriFactoryDiscovery::find()->createUri('v1.26');
33+
$uri = \Http\Discovery\UriFactoryDiscovery::find()->createUri('v1.27');
3434
$plugins[] = new \Http\Client\Common\Plugin\AddPathPlugin($uri);
3535
$httpClient = new \Http\Client\Common\PluginClient($httpClient, $plugins);
3636
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file has been auto generated by Jane,
7+
*
8+
* Do no edit it directly.
9+
*/
10+
11+
namespace Docker\API\Exception;
12+
13+
class SecretUpdateServiceUnavailableException extends \RuntimeException implements ServerException
14+
{
15+
private $errorResponse;
16+
17+
public function __construct(\Docker\API\Model\ErrorResponse $errorResponse)
18+
{
19+
parent::__construct('node is not part of a swarm', 503);
20+
$this->errorResponse = $errorResponse;
21+
}
22+
23+
public function getErrorResponse()
24+
{
25+
return $this->errorResponse;
26+
}
27+
}

src/Resource/ContainerAsyncResourceTrait.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,13 @@ public function containerExport(string $id, array $parameters = [], string $fetc
369369
/**
370370
* This endpoint returns a live stream of a container’s resource usage statistics.
371371
372-
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.
372+
The `precpu_stats` is the CPU statistic of last read, which is used
373+
for calculating the CPU usage percentage. It is not the same as the
374+
`cpu_stats` field.
375+
376+
If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is
377+
nil then for compatibility with older daemons the length of the
378+
corresponding `cpu_usage.percpu_usage` array should be used.
373379
374380
*
375381
* @param string $id ID or name of the container

src/Resource/ContainerResourceTrait.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,13 @@ public function containerExport(string $id, array $parameters = [], string $fetc
334334
/**
335335
* This endpoint returns a live stream of a container’s resource usage statistics.
336336
337-
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.
337+
The `precpu_stats` is the CPU statistic of last read, which is used
338+
for calculating the CPU usage percentage. It is not the same as the
339+
`cpu_stats` field.
340+
341+
If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is
342+
nil then for compatibility with older daemons the length of the
343+
corresponding `cpu_usage.percpu_usage` array should be used.
338344
339345
*
340346
* @param string $id ID or name of the container

src/Resource/NodeAsyncResourceTrait.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ trait NodeAsyncResourceTrait
2323
* @param string $fetch Fetch mode (object or response)
2424
* @param \Amp\CancellationToken $cancellationToken Token to cancel the request
2525
*
26-
* @throws \Docker\API\Exception\NodeListBadRequestException
27-
* @throws \Docker\API\Exception\NodeListNotFoundException
2826
* @throws \Docker\API\Exception\NodeListInternalServerErrorException
2927
* @throws \Docker\API\Exception\NodeListServiceUnavailableException
3028
*
@@ -47,12 +45,6 @@ public function nodeList(array $parameters = [], string $fetch = self::FETCH_OBJ
4745
if (200 === $response->getStatus()) {
4846
return $this->serializer->deserialize((yield $response->getBody()), 'Docker\\API\\Model\\Node[]', 'json');
4947
}
50-
if (400 === $response->getStatus()) {
51-
throw new \Docker\API\Exception\NodeListBadRequestException($this->serializer->deserialize((yield $response->getBody()), 'Docker\\API\\Model\\ErrorResponse', 'json'));
52-
}
53-
if (404 === $response->getStatus()) {
54-
throw new \Docker\API\Exception\NodeListNotFoundException($this->serializer->deserialize((yield $response->getBody()), 'Docker\\API\\Model\\ErrorResponse', 'json'));
55-
}
5648
if (500 === $response->getStatus()) {
5749
throw new \Docker\API\Exception\NodeListInternalServerErrorException($this->serializer->deserialize((yield $response->getBody()), 'Docker\\API\\Model\\ErrorResponse', 'json'));
5850
}

src/Resource/NodeResourceTrait.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ trait NodeResourceTrait
2222
* }
2323
* @param string $fetch Fetch mode (object or response)
2424
*
25-
* @throws \Docker\API\Exception\NodeListBadRequestException
26-
* @throws \Docker\API\Exception\NodeListNotFoundException
2725
* @throws \Docker\API\Exception\NodeListInternalServerErrorException
2826
* @throws \Docker\API\Exception\NodeListServiceUnavailableException
2927
*
@@ -43,12 +41,6 @@ public function nodeList(array $parameters = [], string $fetch = self::FETCH_OBJ
4341
if (200 === $response->getStatusCode()) {
4442
return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\Node[]', 'json');
4543
}
46-
if (400 === $response->getStatusCode()) {
47-
throw new \Docker\API\Exception\NodeListBadRequestException($this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\ErrorResponse', 'json'));
48-
}
49-
if (404 === $response->getStatusCode()) {
50-
throw new \Docker\API\Exception\NodeListNotFoundException($this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\ErrorResponse', 'json'));
51-
}
5244
if (500 === $response->getStatusCode()) {
5345
throw new \Docker\API\Exception\NodeListInternalServerErrorException($this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\ErrorResponse', 'json'));
5446
}

src/Resource/PluginAsyncResourceTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function pluginList(array $parameters = [], string $fetch = self::FETCH_O
5353
/**
5454
* @param array $parameters {
5555
*
56-
* @var string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted.
56+
* @var string $remote The name of the plugin. The `:latest` tag is optional, and is the default if omitted.
5757
* }
5858
*
5959
* @param string $fetch Fetch mode (object or response)
@@ -67,7 +67,7 @@ public function getPluginPrivileges(array $parameters = [], string $fetch = self
6767
{
6868
return \Amp\call(function () use ($parameters, $fetch, $cancellationToken) {
6969
$queryParam = new QueryParam();
70-
$queryParam->addQueryParameter('name', true, ['string']);
70+
$queryParam->addQueryParameter('remote', true, ['string']);
7171
$url = '/plugins/privileges';
7272
$url = $url . ('?' . $queryParam->buildQueryString($parameters));
7373
$headers = array_merge(['Accept' => ['application/json']], $queryParam->buildHeaders($parameters));

src/Resource/PluginResourceTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function pluginList(array $parameters = [], string $fetch = self::FETCH_O
4848
/**
4949
* @param array $parameters {
5050
*
51-
* @var string $name The name of the plugin. The `:latest` tag is optional, and is the default if omitted.
51+
* @var string $remote The name of the plugin. The `:latest` tag is optional, and is the default if omitted.
5252
* }
5353
*
5454
* @param string $fetch Fetch mode (object or response)
@@ -60,7 +60,7 @@ public function pluginList(array $parameters = [], string $fetch = self::FETCH_O
6060
public function getPluginPrivileges(array $parameters = [], string $fetch = self::FETCH_OBJECT)
6161
{
6262
$queryParam = new QueryParam($this->streamFactory);
63-
$queryParam->addQueryParameter('name', true, ['string']);
63+
$queryParam->addQueryParameter('remote', true, ['string']);
6464
$url = '/plugins/privileges';
6565
$url = $url . ('?' . $queryParam->buildQueryString($parameters));
6666
$headers = array_merge(['Accept' => ['application/json']], $queryParam->buildHeaders($parameters));

src/Resource/SecretAsyncResourceTrait.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ public function secretInspect(string $id, array $parameters = [], string $fetch
204204
*
205205
* @throws \Docker\API\Exception\SecretUpdateNotFoundException
206206
* @throws \Docker\API\Exception\SecretUpdateInternalServerErrorException
207+
* @throws \Docker\API\Exception\SecretUpdateServiceUnavailableException
207208
*
208209
* @return \Amp\Promise<\Amp\Artax\Response|null>
209210
*/
@@ -231,6 +232,9 @@ public function secretUpdate(string $id, \Docker\API\Model\SecretSpec $body, arr
231232
if (500 === $response->getStatus()) {
232233
throw new \Docker\API\Exception\SecretUpdateInternalServerErrorException($this->serializer->deserialize((yield $response->getBody()), 'Docker\\API\\Model\\ErrorResponse', 'json'));
233234
}
235+
if (503 === $response->getStatus()) {
236+
throw new \Docker\API\Exception\SecretUpdateServiceUnavailableException($this->serializer->deserialize((yield $response->getBody()), 'Docker\\API\\Model\\ErrorResponse', 'json'));
237+
}
234238
}
235239

236240
return $response;

0 commit comments

Comments
 (0)