Browse code

Merge pull request #31809 from vieux/bump_api

bump API to 1.28

Victor Vieux authored on 2017/03/15 03:53:52
Showing 9 changed files
... ...
@@ -21,7 +21,7 @@ import (
21 21
 // Common constants for daemon and client.
22 22
 const (
23 23
 	// DefaultVersion of Current REST API
24
-	DefaultVersion string = "1.27"
24
+	DefaultVersion string = "1.28"
25 25
 
26 26
 	// NoBaseImageSpecifier is the symbol used by the FROM
27 27
 	// command to specify that no base image is to be used.
... ...
@@ -520,9 +520,9 @@ func (s *containerRouter) wsContainersAttach(ctx context.Context, w http.Respons
520 520
 		}()
521 521
 
522 522
 		conn := <-wsChan
523
-		// In case version is higher than 1.27, a binary frame will be sent.
523
+		// In case version 1.28 and above, a binary frame will be sent.
524 524
 		// See 28176 for details.
525
-		if versions.GreaterThanOrEqualTo(version, "1.27") {
525
+		if versions.GreaterThanOrEqualTo(version, "1.28") {
526 526
 			conn.PayloadType = websocket.BinaryFrame
527 527
 		}
528 528
 		return conn, conn, conn, nil
... ...
@@ -255,7 +255,7 @@ func (s *imageRouter) getImagesJSON(ctx context.Context, w http.ResponseWriter,
255 255
 
256 256
 	version := httputils.VersionFromContext(ctx)
257 257
 	filterParam := r.Form.Get("filter")
258
-	if versions.LessThan(version, "1.28") && filterParam != "" {
258
+	if versions.LessThanOrEqualTo(version, "1.28") && filterParam != "" {
259 259
 		imageFilters.Add("reference", filterParam)
260 260
 	}
261 261
 
... ...
@@ -62,11 +62,11 @@ SKIP:
62 62
 		}
63 63
 
64 64
 		var nr *types.NetworkResource
65
-		// Versions < 1.27 fetches all the containers attached to a network
65
+		// Versions < 1.28 fetches all the containers attached to a network
66 66
 		// in a network list api call. It is a heavy weight operation when
67
-		// run across all the networks. Starting API version 1.27, this detailed
67
+		// run across all the networks. Starting API version 1.28, this detailed
68 68
 		// info is available for network specific GET API (equivalent to inspect)
69
-		if versions.LessThan(httputils.VersionFromContext(ctx), "1.27") {
69
+		if versions.LessThan(httputils.VersionFromContext(ctx), "1.28") {
70 70
 			nr = n.buildDetailedNetworkResources(nw, false)
71 71
 		} else {
72 72
 			nr = n.buildNetworkResource(nw)
... ...
@@ -19,10 +19,10 @@ produces:
19 19
 consumes:
20 20
   - "application/json"
21 21
   - "text/plain"
22
-basePath: "/v1.27"
22
+basePath: "/v1.28"
23 23
 info:
24 24
   title: "Docker Engine API"
25
-  version: "1.27"
25
+  version: "1.28"
26 26
   x-logo:
27 27
     url: "https://docs.docker.com/images/logo-docker-main.png"
28 28
   description: |
... ...
@@ -44,7 +44,7 @@ info:
44 44
 
45 45
     The API is usually changed in each release of Docker, so API calls are versioned to ensure that clients don't break.
46 46
 
47
-    For Docker Engine 17.04, 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`.
47
+    For Docker Engine 17.04, the API version is 1.28. To lock to this version, you prefix the URL with `/v1.28`. For example, calling `/info` is the same as calling `/v1.28/info`.
48 48
 
49 49
     Engine releases in the near future should support this version of the API, so your client will continue to work even if it is talking to a newer Engine.
50 50
 
... ...
@@ -52,11 +52,12 @@ info:
52 52
 
53 53
     The API uses an open schema model, which means server may add extra properties to responses. Likewise, the server will ignore any extra query parameters and request body properties. When you write clients, you need to ignore additional properties in responses to ensure they do not break when talking to newer Docker daemons.
54 54
 
55
-    This documentation is for version 1.27 of the API, which was introduced with Docker 17.04. Use this table to find documentation for previous versions of the API:
55
+    This documentation is for version 1.28 of the API, which was introduced with Docker 17.04. Use this table to find documentation for previous versions of the API:
56 56
 
57 57
     Docker version  | API version | Changes
58 58
     ----------------|-------------|---------
59
-    1.13.1 | [1.26](https://docs.docker.com/engine/api/v1.26/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-26-api-changes)
59
+    17.03.1 | [1.27](https://docs.docker.com/engine/api/v1.27/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-27-api-changes)
60
+    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)
60 61
     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)
61 62
     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)
62 63
     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)
... ...
@@ -38,7 +38,7 @@ func newCreateCommand(dockerCli *command.DockerCli) *cobra.Command {
38 38
 	flags.Var(&opts.mounts, flagMount, "Attach a filesystem mount to the service")
39 39
 	flags.Var(&opts.constraints, flagConstraint, "Placement constraints")
40 40
 	flags.Var(&opts.placementPrefs, flagPlacementPref, "Add a placement preference")
41
-	flags.SetAnnotation(flagPlacementPref, "version", []string{"1.27"})
41
+	flags.SetAnnotation(flagPlacementPref, "version", []string{"1.28"})
42 42
 	flags.Var(&opts.networks, flagNetwork, "Network attachments")
43 43
 	flags.Var(&opts.secrets, flagSecret, "Specify secrets to expose to the service")
44 44
 	flags.SetAnnotation(flagSecret, "version", []string{"1.25"})
... ...
@@ -498,15 +498,15 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
498 498
 	flags.SetAnnotation(flagUpdateMaxFailureRatio, "version", []string{"1.25"})
499 499
 
500 500
 	flags.Uint64Var(&opts.rollback.parallelism, flagRollbackParallelism, 1, "Maximum number of tasks rolled back simultaneously (0 to roll back all at once)")
501
-	flags.SetAnnotation(flagRollbackParallelism, "version", []string{"1.27"})
501
+	flags.SetAnnotation(flagRollbackParallelism, "version", []string{"1.28"})
502 502
 	flags.DurationVar(&opts.rollback.delay, flagRollbackDelay, time.Duration(0), "Delay between task rollbacks (ns|us|ms|s|m|h) (default 0s)")
503
-	flags.SetAnnotation(flagRollbackDelay, "version", []string{"1.27"})
503
+	flags.SetAnnotation(flagRollbackDelay, "version", []string{"1.28"})
504 504
 	flags.DurationVar(&opts.rollback.monitor, flagRollbackMonitor, time.Duration(0), "Duration after each task rollback to monitor for failure (ns|us|ms|s|m|h) (default 0s)")
505
-	flags.SetAnnotation(flagRollbackMonitor, "version", []string{"1.27"})
505
+	flags.SetAnnotation(flagRollbackMonitor, "version", []string{"1.28"})
506 506
 	flags.StringVar(&opts.rollback.onFailure, flagRollbackFailureAction, "pause", `Action on rollback failure ("pause"|"continue")`)
507
-	flags.SetAnnotation(flagRollbackFailureAction, "version", []string{"1.27"})
507
+	flags.SetAnnotation(flagRollbackFailureAction, "version", []string{"1.28"})
508 508
 	flags.Var(&opts.rollback.maxFailureRatio, flagRollbackMaxFailureRatio, "Failure rate to tolerate during a rollback")
509
-	flags.SetAnnotation(flagRollbackMaxFailureRatio, "version", []string{"1.27"})
509
+	flags.SetAnnotation(flagRollbackMaxFailureRatio, "version", []string{"1.28"})
510 510
 
511 511
 	flags.StringVar(&opts.endpoint.mode, flagEndpointMode, "vip", "Endpoint mode (vip or dnsrr)")
512 512
 
... ...
@@ -530,10 +530,10 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
530 530
 	flags.SetAnnotation(flagTTY, "version", []string{"1.25"})
531 531
 
532 532
 	flags.BoolVar(&opts.readOnly, flagReadOnly, false, "Mount the container's root filesystem as read only")
533
-	flags.SetAnnotation(flagReadOnly, "version", []string{"1.27"})
533
+	flags.SetAnnotation(flagReadOnly, "version", []string{"1.28"})
534 534
 
535 535
 	flags.StringVar(&opts.stopSignal, flagStopSignal, "", "Signal to stop the container")
536
-	flags.SetAnnotation(flagStopSignal, "version", []string{"1.27"})
536
+	flags.SetAnnotation(flagStopSignal, "version", []string{"1.28"})
537 537
 }
538 538
 
539 539
 const (
... ...
@@ -72,9 +72,9 @@ func newUpdateCommand(dockerCli *command.DockerCli) *cobra.Command {
72 72
 	flags.Var(&serviceOpts.mounts, flagMountAdd, "Add or update a mount on a service")
73 73
 	flags.Var(&serviceOpts.constraints, flagConstraintAdd, "Add or update a placement constraint")
74 74
 	flags.Var(&serviceOpts.placementPrefs, flagPlacementPrefAdd, "Add a placement preference")
75
-	flags.SetAnnotation(flagPlacementPrefAdd, "version", []string{"1.27"})
75
+	flags.SetAnnotation(flagPlacementPrefAdd, "version", []string{"1.28"})
76 76
 	flags.Var(&placementPrefOpts{}, flagPlacementPrefRemove, "Remove a placement preference")
77
-	flags.SetAnnotation(flagPlacementPrefRemove, "version", []string{"1.27"})
77
+	flags.SetAnnotation(flagPlacementPrefRemove, "version", []string{"1.28"})
78 78
 	flags.Var(&serviceOpts.endpoint.publishPorts, flagPublishAdd, "Add or update a published port")
79 79
 	flags.Var(&serviceOpts.groups, flagGroupAdd, "Add an additional supplementary user group to the container")
80 80
 	flags.SetAnnotation(flagGroupAdd, "version", []string{"1.25"})
... ...
@@ -132,7 +132,7 @@ func runUpdate(dockerCli *command.DockerCli, flags *pflag.FlagSet, serviceID str
132 132
 			return errors.New("other flags may not be combined with --rollback")
133 133
 		}
134 134
 
135
-		if versions.LessThan(dockerCli.Client().ClientVersion(), "1.27") {
135
+		if versions.LessThan(dockerCli.Client().ClientVersion(), "1.28") {
136 136
 			clientSideRollback = true
137 137
 			spec = service.PreviousSpec
138 138
 			if spec == nil {
... ...
@@ -13,18 +13,24 @@ keywords: "API, Docker, rcli, REST, documentation"
13 13
      will be rejected.
14 14
 -->
15 15
 
16
-## v1.27 API changes
16
+## v1.28 API changes
17
+
18
+[Docker Engine API v1.28](https://docs.docker.com/engine/api/v1.28/) documentation
17 19
 
18
-[Docker Engine API v1.27](https://docs.docker.com/engine/api/v1.27/) documentation
19 20
 
20 21
 * Optional query parameter `verbose` for `GET /networks/(id or name)` will now list all services with all the tasks, including the non-local tasks on the given network.
21
-* `GET /containers/(id or name)/attach/ws` now returns WebSocket in binary frame format for API version >= v1.27, and returns WebSocket in text frame format for API version< v1.27, for the purpose of backward-compatibility.
22
+* `GET /containers/(id or name)/attach/ws` now returns WebSocket in binary frame format for API version >= v1.28, and returns WebSocket in text frame format for API version< v1.28, for the purpose of backward-compatibility.
22 23
 * `GET /networks` is optimised only to return list of all networks and network specific information. List of all containers attached to a specific network is removed from this API and is only available using the network specific `GET /networks/{network-id}.
23 24
 * `GET /containers/json` now supports `publish` and `expose` filters to filter containers that expose or publish certain ports.
24 25
 * `POST /services/create` and `POST /services/(id or name)/update` now accept the `ReadOnly` parameter, which mounts the container's root filesystem as read only.
25 26
 * `POST /build` now accepts `extrahosts` parameter to specify a host to ip mapping to use during the build.
26 27
 * `POST /services/create` and `POST /services/(id or name)/update` now accept a `rollback` value for `FailureAction`.
27 28
 * `POST /services/create` and `POST /services/(id or name)/update` now accept an optional `RollbackConfig` object which specifies rollback options.
29
+
30
+## v1.27 API changes
31
+
32
+[Docker Engine API v1.27](https://docs.docker.com/engine/api/v1.27/) documentation
33
+
28 34
 * `GET /containers/(id or name)/stats` now includes an `online_cpus` field in both `precpu_stats` and `cpu_stats`. If this field is `nil` then for compatibility with older daemons the length of the corresponding `cpu_usage.percpu_usage` array should be used.
29 35
 
30 36
 ## v1.26 API changes