From 39aeb042a4d34f0666be218618fa99d913d5cf00 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Mon, 14 Nov 2016 14:26:04 -0500 Subject: [PATCH] Generate GraphDriver from spec, and fix up image spec. Signed-off-by: Daniel Nephin Upstream-commit: 8d5f558de016814ab3629bd0b5b7cc5fd98805b3 Component: engine --- components/engine/api/swagger.yaml | 40 +++++++++++++++++-- .../engine/api/types/graph_driver_data.go | 17 ++++++++ components/engine/api/types/types.go | 7 ---- .../engine/hack/generate-swagger-api.sh | 1 + 4 files changed, 54 insertions(+), 11 deletions(-) create mode 100644 components/engine/api/types/graph_driver_data.go diff --git a/components/engine/api/swagger.yaml b/components/engine/api/swagger.yaml index 1cc6cdb28b..3bf244554f 100644 --- a/components/engine/api/swagger.yaml +++ b/components/engine/api/swagger.yaml @@ -829,22 +829,40 @@ definitions: items: $ref: "#/definitions/Port" - GraphDriver: - description: "Information about this container's graph driver." + 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 + - GraphDrvier + - RootFS properties: Id: type: "string" + x-nullable: false RepoTags: type: "array" items: @@ -855,37 +873,51 @@ definitions: 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/Config" DockerVersion: type: "string" + x-nullable: false Author: type: "string" + x-nullable: false Config: $ref: "#/definitions/Config" 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/GraphDriver" + $ref: "#/definitions/GraphDriverData" RootFS: type: "object" + required: [Type] properties: Type: type: "string" + x-nullable: false Layers: type: "array" items: @@ -2934,7 +2966,7 @@ paths: HostConfig: $ref: "#/definitions/HostConfig" GraphDriver: - $ref: "#/definitions/GraphDriver" + $ref: "#/definitions/GraphDriverData" SizeRw: description: "The size of files that have been created or changed by this container." type: "integer" diff --git a/components/engine/api/types/graph_driver_data.go b/components/engine/api/types/graph_driver_data.go new file mode 100644 index 0000000000..4d9bf1c62c --- /dev/null +++ b/components/engine/api/types/graph_driver_data.go @@ -0,0 +1,17 @@ +package types + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// GraphDriverData Information about a container's graph driver. +// swagger:model GraphDriverData +type GraphDriverData struct { + + // data + // Required: true + Data map[string]string `json:"Data"` + + // name + // Required: true + Name string `json:"Name"` +} diff --git a/components/engine/api/types/types.go b/components/engine/api/types/types.go index 6206ad31d0..3539b0b05b 100644 --- a/components/engine/api/types/types.go +++ b/components/engine/api/types/types.go @@ -17,13 +17,6 @@ import ( "github.com/docker/go-connections/nat" ) -// GraphDriverData returns Image's graph driver config info -// when calling inspect command -type GraphDriverData struct { - Name string - Data map[string]string -} - // RootFS returns Image's RootFS description including the layer IDs. type RootFS struct { Type string diff --git a/components/engine/hack/generate-swagger-api.sh b/components/engine/hack/generate-swagger-api.sh index 81fb3dfe3e..0edda3c68b 100755 --- a/components/engine/hack/generate-swagger-api.sh +++ b/components/engine/hack/generate-swagger-api.sh @@ -4,6 +4,7 @@ set -eu swagger generate model -f api/swagger.yaml \ -t api -m types --skip-validator -C api/swagger-gen.yaml \ -n ErrorResponse \ + -n GraphDriverData \ -n IdResponse \ -n ImageDeleteResponseItem \ -n ImageSummary \