From 90294e9bdbfd3edd6d5bbbdcfdc26c27481482a8 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sun, 11 Jul 2021 22:43:45 +0200 Subject: [PATCH 01/18] Add RestartPolicy "no" to swagger docs Signed-off-by: Tobias Gesellchen Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.41.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api/v1.41.yaml b/docs/api/v1.41.yaml index 95b37bd94b..820c76e940 100644 --- a/docs/api/v1.41.yaml +++ b/docs/api/v1.41.yaml @@ -382,11 +382,13 @@ definitions: type: "string" description: | - 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 enum: - "" + - "no" - "always" - "unless-stopped" - "on-failure" From 050f5f29f74daccf381c62d9af76abeb6138f89a Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sun, 11 Jul 2021 22:46:19 +0200 Subject: [PATCH 02/18] Add "changes" query parameter for /image/create to swagger docs Signed-off-by: Tobias Gesellchen Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.41.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/api/v1.41.yaml b/docs/api/v1.41.yaml index 820c76e940..57ea85347d 100644 --- a/docs/api/v1.41.yaml +++ b/docs/api/v1.41.yaml @@ -7502,6 +7502,18 @@ paths: Refer to the [authentication section](#section/Authentication) for details. type: "string" + - name: "changes" + in: "query" + description: | + Apply `Dockerfile` instructions to the image that is created, + for example: `changes=ENV DEBUG=true`. + Note that `ENV DEBUG=true` should be URI component encoded. + + Supported `Dockerfile` instructions: + `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` + type: "array" + items: + type: "string" - name: "platform" in: "query" description: "Platform in the format os[/arch[/variant]]" From 9ac2d04617170341546fb6909af64287b4049cf8 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sun, 11 Jul 2021 22:48:34 +0200 Subject: [PATCH 03/18] Fix ContainerSummary swagger docs Signed-off-by: Tobias Gesellchen Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.41.yaml | 132 ++++++++++++++++++++++---------------------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/docs/api/v1.41.yaml b/docs/api/v1.41.yaml index 57ea85347d..0927c34ec8 100644 --- a/docs/api/v1.41.yaml +++ b/docs/api/v1.41.yaml @@ -4024,73 +4024,71 @@ definitions: Warning: "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" ContainerSummary: - type: "array" - items: - type: "object" - properties: - Id: - description: "The ID of this container" + type: "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" - x-go-name: "ID" - Names: - description: "The names that this container has been given" - type: "array" - items: + 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" - 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" + 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)." @@ -5263,7 +5261,9 @@ paths: 200: description: "no error" schema: - $ref: "#/definitions/ContainerSummary" + type: "array" + items: + $ref: "#/definitions/ContainerSummary" examples: application/json: - Id: "8dfafdbc3a40" From 6e421a1823dfd978dbdb37d4515e4642d082aa1b Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sun, 11 Jul 2021 22:50:07 +0200 Subject: [PATCH 04/18] Use explicit object names for improved swagger based code generation Signed-off-by: Tobias Gesellchen Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.41.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/api/v1.41.yaml b/docs/api/v1.41.yaml index 0927c34ec8..fcb1698aca 100644 --- a/docs/api/v1.41.yaml +++ b/docs/api/v1.41.yaml @@ -4366,7 +4366,6 @@ definitions: type: "string" example: "2020-06-22T15:49:27.000000000+00:00" - SystemInfo: type: "object" properties: @@ -8507,6 +8506,7 @@ paths: description: "Exec configuration" schema: type: "object" + title: "ExecConfig" properties: AttachStdin: type: "boolean" @@ -8597,6 +8597,7 @@ paths: in: "body" schema: type: "object" + title: "ExecStartConfig" properties: Detach: type: "boolean" @@ -9139,6 +9140,7 @@ paths: required: true schema: type: "object" + title: "NetworkCreateRequest" required: ["Name"] properties: Name: @@ -9249,6 +9251,7 @@ paths: required: true schema: type: "object" + title: "NetworkDisconnectRequest" properties: Container: type: "string" @@ -9295,6 +9298,7 @@ paths: required: true schema: type: "object" + title: "NetworkConnectRequest" properties: Container: type: "string" @@ -9954,6 +9958,7 @@ paths: required: true schema: type: "object" + title: "SwarmInitRequest" properties: ListenAddr: description: | @@ -10052,6 +10057,7 @@ paths: required: true schema: type: "object" + title: "SwarmJoinRequest" properties: ListenAddr: description: | @@ -10212,6 +10218,7 @@ paths: required: true schema: type: "object" + title: "SwarmUnlockRequest" properties: UnlockKey: description: "The swarm's unlock key." From 7248ebcd7ebd5b11ef3e4acfe93886898627f4cc Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Thu, 19 Aug 2021 20:25:16 +0200 Subject: [PATCH 05/18] Extract PluginPrivilegeItem as explicit type definition Signed-off-by: Tobias Gesellchen Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.41.yaml | 75 +++++++++++++-------------------------------- 1 file changed, 22 insertions(+), 53 deletions(-) diff --git a/docs/api/v1.41.yaml b/docs/api/v1.41.yaml index fcb1698aca..3a5a5fe373 100644 --- a/docs/api/v1.41.yaml +++ b/docs/api/v1.41.yaml @@ -2190,6 +2190,24 @@ definitions: type: "string" x-nullable: false + PluginPrivilegeItem: + description: | + Describes a permission the user has to accept upon installing + the plugin. + type: "object" + properties: + Name: + type: "string" + example: "network" + Description: + type: "string" + Value: + type: "array" + items: + type: "string" + example: + - "host" + Plugin: description: "A plugin for the Engine API" type: "object" @@ -2972,19 +2990,7 @@ definitions: PluginPrivilege: type: "array" items: - description: | - Describes a permission accepted by the user upon installing the - plugin. - type: "object" - properties: - Name: - type: "string" - Description: - type: "string" - Value: - type: "array" - items: - type: "string" + $ref: "#/definitions/PluginPrivilegeItem" ContainerSpec: type: "object" description: | @@ -9383,20 +9389,7 @@ paths: schema: type: "array" items: - description: | - Describes a permission the user has to accept upon installing - the plugin. - type: "object" - title: "PluginPrivilegeItem" - properties: - Name: - type: "string" - Description: - type: "string" - Value: - type: "array" - items: - type: "string" + $ref: "#/definitions/PluginPrivilegeItem" example: - Name: "network" Description: "" @@ -9472,19 +9465,7 @@ paths: schema: type: "array" items: - description: | - Describes a permission accepted by the user upon installing the - plugin. - type: "object" - properties: - Name: - type: "string" - Description: - type: "string" - Value: - type: "array" - items: - type: "string" + $ref: "#/definitions/PluginPrivilegeItem" example: - Name: "network" Description: "" @@ -9656,19 +9637,7 @@ paths: schema: type: "array" items: - description: | - Describes a permission accepted by the user upon installing the - plugin. - type: "object" - properties: - Name: - type: "string" - Description: - type: "string" - Value: - type: "array" - items: - type: "string" + $ref: "#/definitions/PluginPrivilegeItem" example: - Name: "network" Description: "" From c0bc82cef1c7124540ddf67ef3cab3292e39cca9 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sun, 11 Jul 2021 22:54:23 +0200 Subject: [PATCH 06/18] Fix swagger docs to match the opencontainers image-spec Signed-off-by: Tobias Gesellchen Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.41.yaml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/api/v1.41.yaml b/docs/api/v1.41.yaml index 3a5a5fe373..6f7f994f60 100644 --- a/docs/api/v1.41.yaml +++ b/docs/api/v1.41.yaml @@ -11309,14 +11309,14 @@ paths: description: | A descriptor struct containing digest, media type, and size. properties: - MediaType: + mediaType: type: "string" - Size: + size: type: "integer" format: "int64" - Digest: + digest: type: "string" - URLs: + urls: type: "array" items: type: "string" @@ -11327,17 +11327,17 @@ paths: items: type: "object" properties: - Architecture: + architecture: type: "string" - OS: + os: type: "string" - OSVersion: + os.version: type: "string" - OSFeatures: + os.features: type: "array" items: type: "string" - Variant: + variant: type: "string" Features: type: "array" @@ -11352,12 +11352,12 @@ paths: URLs: - "" Platforms: - - Architecture: "amd64" - OS: "linux" - OSVersion: "" - OSFeatures: + - architecture: "amd64" + os: "linux" + os.version: "" + os.features: - "" - Variant: "" + variant: "" Features: - "" 401: From d3d78c1ae3bf6f243c0bbee7160343a203a9d3c7 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sun, 11 Jul 2021 22:43:45 +0200 Subject: [PATCH 07/18] Add RestartPolicy "no" to swagger docs Signed-off-by: Tobias Gesellchen Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.40.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api/v1.40.yaml b/docs/api/v1.40.yaml index 9266e9598a..19751c451f 100644 --- a/docs/api/v1.40.yaml +++ b/docs/api/v1.40.yaml @@ -382,11 +382,13 @@ definitions: type: "string" description: | - 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 enum: - "" + - "no" - "always" - "unless-stopped" - "on-failure" From 0e719f8a00e345c3595f5e21c3e4c1e71f924e2f Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sun, 11 Jul 2021 22:46:19 +0200 Subject: [PATCH 08/18] Add "changes" query parameter for /image/create to swagger docs Signed-off-by: Tobias Gesellchen Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.40.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/api/v1.40.yaml b/docs/api/v1.40.yaml index 19751c451f..b76da6e427 100644 --- a/docs/api/v1.40.yaml +++ b/docs/api/v1.40.yaml @@ -7334,6 +7334,18 @@ paths: Refer to the [authentication section](#section/Authentication) for details. type: "string" + - name: "changes" + in: "query" + description: | + Apply `Dockerfile` instructions to the image that is created, + for example: `changes=ENV DEBUG=true`. + Note that `ENV DEBUG=true` should be URI component encoded. + + Supported `Dockerfile` instructions: + `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` + type: "array" + items: + type: "string" - name: "platform" in: "query" description: "Platform in the format os[/arch[/variant]]" From 8168d1877d6ae8f0a6803530104c50759254848b Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sun, 11 Jul 2021 22:48:34 +0200 Subject: [PATCH 09/18] Fix ContainerSummary swagger docs Signed-off-by: Tobias Gesellchen Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.40.yaml | 132 ++++++++++++++++++++++---------------------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/docs/api/v1.40.yaml b/docs/api/v1.40.yaml index b76da6e427..0bcc117de7 100644 --- a/docs/api/v1.40.yaml +++ b/docs/api/v1.40.yaml @@ -3871,73 +3871,71 @@ definitions: Warning: "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" ContainerSummary: - type: "array" - items: - type: "object" - properties: - Id: - description: "The ID of this container" + type: "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" - x-go-name: "ID" - Names: - description: "The names that this container has been given" - type: "array" - items: + 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" - 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" + 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)." @@ -5105,7 +5103,9 @@ paths: 200: description: "no error" schema: - $ref: "#/definitions/ContainerSummary" + type: "array" + items: + $ref: "#/definitions/ContainerSummary" examples: application/json: - Id: "8dfafdbc3a40" From be93e50a581ee74d202e85c2f9610d2c78f4e496 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sun, 11 Jul 2021 22:50:07 +0200 Subject: [PATCH 10/18] Use explicit object names for improved swagger based code generation Signed-off-by: Tobias Gesellchen Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.40.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/api/v1.40.yaml b/docs/api/v1.40.yaml index 0bcc117de7..660e67d739 100644 --- a/docs/api/v1.40.yaml +++ b/docs/api/v1.40.yaml @@ -4213,7 +4213,6 @@ definitions: type: "string" example: "2020-06-22T15:49:27.000000000+00:00" - SystemInfo: type: "object" properties: @@ -8337,6 +8336,7 @@ paths: description: "Exec configuration" schema: type: "object" + title: "ExecConfig" properties: AttachStdin: type: "boolean" @@ -8427,6 +8427,7 @@ paths: in: "body" schema: type: "object" + title: "ExecStartConfig" properties: Detach: type: "boolean" @@ -8969,6 +8970,7 @@ paths: required: true schema: type: "object" + title: "NetworkCreateRequest" required: ["Name"] properties: Name: @@ -9079,6 +9081,7 @@ paths: required: true schema: type: "object" + title: "NetworkDisconnectRequest" properties: Container: type: "string" @@ -9125,6 +9128,7 @@ paths: required: true schema: type: "object" + title: "NetworkConnectRequest" properties: Container: type: "string" @@ -9784,6 +9788,7 @@ paths: required: true schema: type: "object" + title: "SwarmJoinRequest" properties: ListenAddr: description: | @@ -9882,6 +9887,7 @@ paths: required: true schema: type: "object" + title: "SwarmInitRequest" properties: ListenAddr: description: | @@ -10042,6 +10048,7 @@ paths: required: true schema: type: "object" + title: "SwarmUnlockRequest" properties: UnlockKey: description: "The swarm's unlock key." From 6153c2f08d9043fd0f436b390aaf608867ebc7df Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Thu, 19 Aug 2021 20:25:16 +0200 Subject: [PATCH 11/18] Extract PluginPrivilegeItem as explicit type definition Signed-off-by: Tobias Gesellchen Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.40.yaml | 75 +++++++++++++-------------------------------- 1 file changed, 22 insertions(+), 53 deletions(-) diff --git a/docs/api/v1.40.yaml b/docs/api/v1.40.yaml index 660e67d739..cb059b022e 100644 --- a/docs/api/v1.40.yaml +++ b/docs/api/v1.40.yaml @@ -2159,6 +2159,24 @@ definitions: type: "string" x-nullable: false + PluginPrivilegeItem: + description: | + Describes a permission the user has to accept upon installing + the plugin. + type: "object" + properties: + Name: + type: "string" + example: "network" + Description: + type: "string" + Value: + type: "array" + items: + type: "string" + example: + - "host" + Plugin: description: "A plugin for the Engine API" type: "object" @@ -2941,19 +2959,7 @@ definitions: PluginPrivilege: type: "array" items: - description: | - Describes a permission accepted by the user upon installing the - plugin. - type: "object" - properties: - Name: - type: "string" - Description: - type: "string" - Value: - type: "array" - items: - type: "string" + $ref: "#/definitions/PluginPrivilegeItem" ContainerSpec: type: "object" description: | @@ -9213,20 +9219,7 @@ paths: schema: type: "array" items: - description: | - Describes a permission the user has to accept upon installing - the plugin. - type: "object" - title: "PluginPrivilegeItem" - properties: - Name: - type: "string" - Description: - type: "string" - Value: - type: "array" - items: - type: "string" + $ref: "#/definitions/PluginPrivilegeItem" example: - Name: "network" Description: "" @@ -9302,19 +9295,7 @@ paths: schema: type: "array" items: - description: | - Describes a permission accepted by the user upon installing the - plugin. - type: "object" - properties: - Name: - type: "string" - Description: - type: "string" - Value: - type: "array" - items: - type: "string" + $ref: "#/definitions/PluginPrivilegeItem" example: - Name: "network" Description: "" @@ -9486,19 +9467,7 @@ paths: schema: type: "array" items: - description: | - Describes a permission accepted by the user upon installing the - plugin. - type: "object" - properties: - Name: - type: "string" - Description: - type: "string" - Value: - type: "array" - items: - type: "string" + $ref: "#/definitions/PluginPrivilegeItem" example: - Name: "network" Description: "" From 62cf748df92a918cf38b17850c5b728f42c014c9 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sun, 11 Jul 2021 22:54:23 +0200 Subject: [PATCH 12/18] Fix swagger docs to match the opencontainers image-spec Signed-off-by: Tobias Gesellchen Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.40.yaml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/api/v1.40.yaml b/docs/api/v1.40.yaml index cb059b022e..9a41e13e1b 100644 --- a/docs/api/v1.40.yaml +++ b/docs/api/v1.40.yaml @@ -11134,14 +11134,14 @@ paths: description: | A descriptor struct containing digest, media type, and size. properties: - MediaType: + mediaType: type: "string" - Size: + size: type: "integer" format: "int64" - Digest: + digest: type: "string" - URLs: + urls: type: "array" items: type: "string" @@ -11152,17 +11152,17 @@ paths: items: type: "object" properties: - Architecture: + architecture: type: "string" - OS: + os: type: "string" - OSVersion: + os.version: type: "string" - OSFeatures: + os.features: type: "array" items: type: "string" - Variant: + variant: type: "string" Features: type: "array" @@ -11177,12 +11177,12 @@ paths: URLs: - "" Platforms: - - Architecture: "amd64" - OS: "linux" - OSVersion: "" - OSFeatures: + - architecture: "amd64" + os: "linux" + os.version: "" + os.features: - "" - Variant: "" + variant: "" Features: - "" 401: From 92ed6ca3566c79cf29f9f4fc9360833d7a0fa8f6 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 21 Aug 2021 20:58:25 +0200 Subject: [PATCH 13/18] api/swagger: fix up event-types and move to definitions Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.41.yaml | 94 +++++++++++++++++++++++++++------------------ 1 file changed, 56 insertions(+), 38 deletions(-) diff --git a/docs/api/v1.41.yaml b/docs/api/v1.41.yaml index 6f7f994f60..514c97ee4e 100644 --- a/docs/api/v1.41.yaml +++ b/docs/api/v1.41.yaml @@ -5204,6 +5204,61 @@ definitions: additionalProperties: type: "string" + EventActor: + description: | + Actor describes something that generates events, like a container, network, + or a volume. + type: "object" + properties: + ID: + description: "The ID of the object emitting the event" + type: "string" + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Attributes: + description: | + Various key/value attributes of the object, depending on its type. + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-label-value" + image: "alpine:latest" + name: "my-container" + + EventMessage: + description: | + EventMessage represents the information an event contains. + type: "object" + title: "SystemEventsResponse" + properties: + Type: + description: "The type of object emitting the event" + type: "string" + enum: ["builder", "config", "container", "daemon", "image", "network", "node", "plugin", "secret", "service", "volume"] + example: "container" + Action: + description: "The type of event" + type: "string" + example: "create" + Actor: + $ref: "#/definitions/EventActor" + scope: + description: | + Scope of the event. Engine events are `local` scope. Cluster (Swarm) + events are `swarm` scope. + type: "string" + enum: ["local", "swarm"] + time: + description: "Timestamp of event" + type: "integer" + format: "int64" + example: 1629574695 + timeNano: + description: "Timestamp of event, with nanosecond accuracy" + type: "integer" + format: "int64" + example: 1629574695515050031 + paths: /containers/json: get: @@ -8193,44 +8248,7 @@ paths: 200: description: "no error" schema: - type: "object" - title: "SystemEventsResponse" - properties: - Type: - description: "The type of object emitting the event" - type: "string" - Action: - description: "The type of event" - type: "string" - Actor: - type: "object" - properties: - ID: - description: "The ID of the object emitting the event" - type: "string" - Attributes: - description: "Various key/value attributes of the object, depending on its type" - type: "object" - additionalProperties: - type: "string" - time: - description: "Timestamp of event" - type: "integer" - timeNano: - description: "Timestamp of event, with nanosecond accuracy" - type: "integer" - format: "int64" - examples: - application/json: - Type: "container" - Action: "create" - Actor: - ID: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" - Attributes: - com.example.some-label: "some-label-value" - image: "alpine" - name: "my-container" - time: 1461943101 + $ref: "#/definitions/EventMessage" 400: description: "bad parameter" schema: From 24a43d934c9f8b696d6a60a3fc3b28a89f7294f2 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 21 Aug 2021 23:38:30 +0200 Subject: [PATCH 14/18] api/swagger: rename PluginPrivilegeItem to PluginPrivilege To match the name in Go Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.41.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/api/v1.41.yaml b/docs/api/v1.41.yaml index 514c97ee4e..430eafde80 100644 --- a/docs/api/v1.41.yaml +++ b/docs/api/v1.41.yaml @@ -2190,11 +2190,12 @@ definitions: type: "string" x-nullable: false - PluginPrivilegeItem: + PluginPrivilege: description: | Describes a permission the user has to accept upon installing the plugin. type: "object" + x-go-name: "PluginPrivilege" properties: Name: type: "string" @@ -2990,7 +2991,7 @@ definitions: PluginPrivilege: type: "array" items: - $ref: "#/definitions/PluginPrivilegeItem" + $ref: "#/definitions/PluginPrivilege" ContainerSpec: type: "object" description: | @@ -9407,7 +9408,7 @@ paths: schema: type: "array" items: - $ref: "#/definitions/PluginPrivilegeItem" + $ref: "#/definitions/PluginPrivilege" example: - Name: "network" Description: "" @@ -9483,7 +9484,7 @@ paths: schema: type: "array" items: - $ref: "#/definitions/PluginPrivilegeItem" + $ref: "#/definitions/PluginPrivilege" example: - Name: "network" Description: "" @@ -9655,7 +9656,7 @@ paths: schema: type: "array" items: - $ref: "#/definitions/PluginPrivilegeItem" + $ref: "#/definitions/PluginPrivilege" example: - Name: "network" Description: "" From a65804adc47a29d99eff2babca03ce90b169bc8b Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 21 Aug 2021 23:40:44 +0200 Subject: [PATCH 15/18] api/swagger: move DistributionInspect to definitions Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.41.yaml | 159 +++++++++++++++++++++++++++----------------- 1 file changed, 98 insertions(+), 61 deletions(-) diff --git a/docs/api/v1.41.yaml b/docs/api/v1.41.yaml index 430eafde80..18dddc97c1 100644 --- a/docs/api/v1.41.yaml +++ b/docs/api/v1.41.yaml @@ -5260,6 +5260,103 @@ definitions: format: "int64" example: 1629574695515050031 + OCIDescriptor: + type: "object" + x-go-name: Descriptor + description: | + A descriptor struct containing digest, media type, and size, as defined in + the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + properties: + mediaType: + description: | + The media type of the object this schema refers to. + type: "string" + example: "application/vnd.docker.distribution.manifest.v2+json" + digest: + description: | + The digest of the targeted content. + type: "string" + example: "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96" + size: + description: | + The size in bytes of the blob. + type: "integer" + format: "int64" + example: 3987495 + # TODO Not yet including these fields for now, as they are nil / omitted in our response. + # urls: + # description: | + # List of URLs from which this object MAY be downloaded. + # type: "array" + # items: + # type: "string" + # format: "uri" + # annotations: + # description: | + # Arbitrary metadata relating to the targeted content. + # type: "object" + # additionalProperties: + # type: "string" + # platform: + # $ref: "#/definitions/OCIPlatform" + + OCIPlatform: + type: "object" + x-go-name: Platform + description: | + Describes the platform which the image in the manifest runs on, as defined + in the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md). + properties: + architecture: + description: | + The CPU architecture, for example `amd64` or `ppc64`. + type: "string" + example: "arm" + os: + description: | + The operating system, for example `linux` or `windows`. + type: "string" + example: "windows" + os.version: + description: | + Optional field specifying the operating system version, for example on + Windows `10.0.19041.1165`. + type: "string" + example: "10.0.19041.1165" + os.features: + description: | + Optional field specifying an array of strings, each listing a required + OS feature (for example on Windows `win32k`). + type: "array" + items: + type: "string" + example: + - "win32k" + variant: + description: | + Optional field specifying a variant of the CPU, for example `v7` to + specify ARMv7 when architecture is `arm`. + type: "string" + example: "v7" + + DistributionInspect: + type: "object" + x-go-name: DistributionInspect + title: "DistributionInspectResponse" + required: [Descriptor, Platforms] + description: | + Describes the result obtained from contacting the registry to retrieve + image metadata. + properties: + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Platforms: + type: "array" + description: | + An array containing all platforms supported by the image. + items: + $ref: "#/definitions/OCIPlatform" + paths: /containers/json: get: @@ -11318,67 +11415,7 @@ paths: 200: description: "descriptor and platform information" schema: - type: "object" - x-go-name: DistributionInspect - title: "DistributionInspectResponse" - required: [Descriptor, Platforms] - properties: - Descriptor: - type: "object" - description: | - A descriptor struct containing digest, media type, and size. - properties: - mediaType: - type: "string" - size: - type: "integer" - format: "int64" - digest: - type: "string" - urls: - type: "array" - items: - type: "string" - Platforms: - type: "array" - description: | - An array containing all platforms supported by the image. - items: - type: "object" - properties: - architecture: - type: "string" - os: - type: "string" - os.version: - type: "string" - os.features: - 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" - os.version: "" - os.features: - - "" - variant: "" - Features: - - "" + $ref: "#/definitions/DistributionInspect" 401: description: "Failed authentication or no image found" schema: From 0b5a2e3c871eb86ff9a0284a0ab7406884a2b3b3 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 21 Aug 2021 20:58:25 +0200 Subject: [PATCH 16/18] api/swagger: fix up event-types and move to definitions Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.40.yaml | 94 +++++++++++++++++++++++++++------------------ 1 file changed, 56 insertions(+), 38 deletions(-) diff --git a/docs/api/v1.40.yaml b/docs/api/v1.40.yaml index 9a41e13e1b..5bd4d18e6c 100644 --- a/docs/api/v1.40.yaml +++ b/docs/api/v1.40.yaml @@ -5046,6 +5046,61 @@ definitions: additionalProperties: type: "string" + EventActor: + description: | + Actor describes something that generates events, like a container, network, + or a volume. + type: "object" + properties: + ID: + description: "The ID of the object emitting the event" + type: "string" + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Attributes: + description: | + Various key/value attributes of the object, depending on its type. + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-label-value" + image: "alpine:latest" + name: "my-container" + + EventMessage: + description: | + EventMessage represents the information an event contains. + type: "object" + title: "SystemEventsResponse" + properties: + Type: + description: "The type of object emitting the event" + type: "string" + enum: ["builder", "config", "container", "daemon", "image", "network", "node", "plugin", "secret", "service", "volume"] + example: "container" + Action: + description: "The type of event" + type: "string" + example: "create" + Actor: + $ref: "#/definitions/EventActor" + scope: + description: | + Scope of the event. Engine events are `local` scope. Cluster (Swarm) + events are `swarm` scope. + type: "string" + enum: ["local", "swarm"] + time: + description: "Timestamp of event" + type: "integer" + format: "int64" + example: 1629574695 + timeNano: + description: "Timestamp of event, with nanosecond accuracy" + type: "integer" + format: "int64" + example: 1629574695515050031 + paths: /containers/json: get: @@ -8023,44 +8078,7 @@ paths: 200: description: "no error" schema: - type: "object" - title: "SystemEventsResponse" - properties: - Type: - description: "The type of object emitting the event" - type: "string" - Action: - description: "The type of event" - type: "string" - Actor: - type: "object" - properties: - ID: - description: "The ID of the object emitting the event" - type: "string" - Attributes: - description: "Various key/value attributes of the object, depending on its type" - type: "object" - additionalProperties: - type: "string" - time: - description: "Timestamp of event" - type: "integer" - timeNano: - description: "Timestamp of event, with nanosecond accuracy" - type: "integer" - format: "int64" - examples: - application/json: - Type: "container" - Action: "create" - Actor: - ID: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" - Attributes: - com.example.some-label: "some-label-value" - image: "alpine" - name: "my-container" - time: 1461943101 + $ref: "#/definitions/EventMessage" 400: description: "bad parameter" schema: From ebd709f80c222ce326233b7d9607186d6df353b8 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 21 Aug 2021 23:38:30 +0200 Subject: [PATCH 17/18] api/swagger: rename PluginPrivilegeItem to PluginPrivilege To match the name in Go Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.40.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/api/v1.40.yaml b/docs/api/v1.40.yaml index 5bd4d18e6c..8ef9e1ad23 100644 --- a/docs/api/v1.40.yaml +++ b/docs/api/v1.40.yaml @@ -2159,11 +2159,12 @@ definitions: type: "string" x-nullable: false - PluginPrivilegeItem: + PluginPrivilege: description: | Describes a permission the user has to accept upon installing the plugin. type: "object" + x-go-name: "PluginPrivilege" properties: Name: type: "string" @@ -2959,7 +2960,7 @@ definitions: PluginPrivilege: type: "array" items: - $ref: "#/definitions/PluginPrivilegeItem" + $ref: "#/definitions/PluginPrivilege" ContainerSpec: type: "object" description: | @@ -9237,7 +9238,7 @@ paths: schema: type: "array" items: - $ref: "#/definitions/PluginPrivilegeItem" + $ref: "#/definitions/PluginPrivilege" example: - Name: "network" Description: "" @@ -9313,7 +9314,7 @@ paths: schema: type: "array" items: - $ref: "#/definitions/PluginPrivilegeItem" + $ref: "#/definitions/PluginPrivilege" example: - Name: "network" Description: "" @@ -9485,7 +9486,7 @@ paths: schema: type: "array" items: - $ref: "#/definitions/PluginPrivilegeItem" + $ref: "#/definitions/PluginPrivilege" example: - Name: "network" Description: "" From 16cb04c2e8aabb7dbae0cc71fa56d0182a83e361 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 21 Aug 2021 23:40:44 +0200 Subject: [PATCH 18/18] api/swagger: move DistributionInspect to definitions Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.40.yaml | 159 +++++++++++++++++++++++++++----------------- 1 file changed, 98 insertions(+), 61 deletions(-) diff --git a/docs/api/v1.40.yaml b/docs/api/v1.40.yaml index 8ef9e1ad23..6ba71df3af 100644 --- a/docs/api/v1.40.yaml +++ b/docs/api/v1.40.yaml @@ -5102,6 +5102,103 @@ definitions: format: "int64" example: 1629574695515050031 + OCIDescriptor: + type: "object" + x-go-name: Descriptor + description: | + A descriptor struct containing digest, media type, and size, as defined in + the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + properties: + mediaType: + description: | + The media type of the object this schema refers to. + type: "string" + example: "application/vnd.docker.distribution.manifest.v2+json" + digest: + description: | + The digest of the targeted content. + type: "string" + example: "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96" + size: + description: | + The size in bytes of the blob. + type: "integer" + format: "int64" + example: 3987495 + # TODO Not yet including these fields for now, as they are nil / omitted in our response. + # urls: + # description: | + # List of URLs from which this object MAY be downloaded. + # type: "array" + # items: + # type: "string" + # format: "uri" + # annotations: + # description: | + # Arbitrary metadata relating to the targeted content. + # type: "object" + # additionalProperties: + # type: "string" + # platform: + # $ref: "#/definitions/OCIPlatform" + + OCIPlatform: + type: "object" + x-go-name: Platform + description: | + Describes the platform which the image in the manifest runs on, as defined + in the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md). + properties: + architecture: + description: | + The CPU architecture, for example `amd64` or `ppc64`. + type: "string" + example: "arm" + os: + description: | + The operating system, for example `linux` or `windows`. + type: "string" + example: "windows" + os.version: + description: | + Optional field specifying the operating system version, for example on + Windows `10.0.19041.1165`. + type: "string" + example: "10.0.19041.1165" + os.features: + description: | + Optional field specifying an array of strings, each listing a required + OS feature (for example on Windows `win32k`). + type: "array" + items: + type: "string" + example: + - "win32k" + variant: + description: | + Optional field specifying a variant of the CPU, for example `v7` to + specify ARMv7 when architecture is `arm`. + type: "string" + example: "v7" + + DistributionInspect: + type: "object" + x-go-name: DistributionInspect + title: "DistributionInspectResponse" + required: [Descriptor, Platforms] + description: | + Describes the result obtained from contacting the registry to retrieve + image metadata. + properties: + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Platforms: + type: "array" + description: | + An array containing all platforms supported by the image. + items: + $ref: "#/definitions/OCIPlatform" + paths: /containers/json: get: @@ -11143,67 +11240,7 @@ paths: 200: description: "descriptor and platform information" schema: - type: "object" - x-go-name: DistributionInspect - title: "DistributionInspectResponse" - required: [Descriptor, Platforms] - properties: - Descriptor: - type: "object" - description: | - A descriptor struct containing digest, media type, and size. - properties: - mediaType: - type: "string" - size: - type: "integer" - format: "int64" - digest: - type: "string" - urls: - type: "array" - items: - type: "string" - Platforms: - type: "array" - description: | - An array containing all platforms supported by the image. - items: - type: "object" - properties: - architecture: - type: "string" - os: - type: "string" - os.version: - type: "string" - os.features: - 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" - os.version: "" - os.features: - - "" - variant: "" - Features: - - "" + $ref: "#/definitions/DistributionInspect" 401: description: "Failed authentication or no image found" schema: