mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add whitespace and create a script to run generation
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
b06c352783
commit
02e1ffd76c
3 changed files with 53 additions and 12 deletions
8
Makefile
8
Makefile
|
@ -140,8 +140,6 @@ win: build ## cross build the binary for windows
|
||||||
|
|
||||||
.PHONY: swagger-gen
|
.PHONY: swagger-gen
|
||||||
swagger-gen:
|
swagger-gen:
|
||||||
docker run --rm -v $(PWD):/work -w /work quay.io/goswagger/swagger \
|
docker run --rm -v $(PWD):/work -w /work \
|
||||||
generate model -m "types" -f api/swagger.yaml -t api/ --skip-validator \
|
--entrypoint hack/generate-swagger-api.sh \
|
||||||
-n Volume \
|
quay.io/goswagger/swagger
|
||||||
-n Port \
|
|
||||||
-n ImageSummary
|
|
||||||
|
|
|
@ -84,6 +84,7 @@ definitions:
|
||||||
PrivatePort: 8080
|
PrivatePort: 8080
|
||||||
PublicPort: 80
|
PublicPort: 80
|
||||||
Type: "tcp"
|
Type: "tcp"
|
||||||
|
|
||||||
MountPoint:
|
MountPoint:
|
||||||
type: "object"
|
type: "object"
|
||||||
description: "A mount point inside a container"
|
description: "A mount point inside a container"
|
||||||
|
@ -104,6 +105,7 @@ definitions:
|
||||||
type: "boolean"
|
type: "boolean"
|
||||||
Propagation:
|
Propagation:
|
||||||
type: "string"
|
type: "string"
|
||||||
|
|
||||||
DeviceMapping:
|
DeviceMapping:
|
||||||
type: "object"
|
type: "object"
|
||||||
description: "A device mapping between the host and container"
|
description: "A device mapping between the host and container"
|
||||||
|
@ -118,6 +120,7 @@ definitions:
|
||||||
PathOnHost: "/dev/deviceName"
|
PathOnHost: "/dev/deviceName"
|
||||||
PathInContainer: "/dev/deviceName"
|
PathInContainer: "/dev/deviceName"
|
||||||
CgroupPermissions: "mrw"
|
CgroupPermissions: "mrw"
|
||||||
|
|
||||||
ThrottleDevice:
|
ThrottleDevice:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
|
@ -129,6 +132,7 @@ definitions:
|
||||||
type: "integer"
|
type: "integer"
|
||||||
format: "int64"
|
format: "int64"
|
||||||
minimum: 0
|
minimum: 0
|
||||||
|
|
||||||
Mount:
|
Mount:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
|
@ -188,6 +192,7 @@ definitions:
|
||||||
type: "object"
|
type: "object"
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
type: "string"
|
type: "string"
|
||||||
|
|
||||||
RestartPolicy:
|
RestartPolicy:
|
||||||
description: |
|
description: |
|
||||||
The behavior to apply when the container exits. The default is not to restart.
|
The behavior to apply when the container exits. The default is not to restart.
|
||||||
|
@ -209,6 +214,7 @@ definitions:
|
||||||
type: "integer"
|
type: "integer"
|
||||||
description: "If `on-failure` is used, the number of times to retry before giving up"
|
description: "If `on-failure` is used, the number of times to retry before giving up"
|
||||||
default: {}
|
default: {}
|
||||||
|
|
||||||
Resources:
|
Resources:
|
||||||
description: "A container's resources (cgroups config, ulimits, etc)"
|
description: "A container's resources (cgroups config, ulimits, etc)"
|
||||||
type: "object"
|
type: "object"
|
||||||
|
@ -680,6 +686,7 @@ definitions:
|
||||||
type: "array"
|
type: "array"
|
||||||
items:
|
items:
|
||||||
type: "string"
|
type: "string"
|
||||||
|
|
||||||
NetworkConfig:
|
NetworkConfig:
|
||||||
description: "TODO: check is correct"
|
description: "TODO: check is correct"
|
||||||
type: "object"
|
type: "object"
|
||||||
|
@ -700,6 +707,7 @@ definitions:
|
||||||
type: "array"
|
type: "array"
|
||||||
items:
|
items:
|
||||||
$ref: "#/definitions/Port"
|
$ref: "#/definitions/Port"
|
||||||
|
|
||||||
GraphDriver:
|
GraphDriver:
|
||||||
description: "Information about this container's graph driver."
|
description: "Information about this container's graph driver."
|
||||||
type: "object"
|
type: "object"
|
||||||
|
@ -710,6 +718,7 @@ definitions:
|
||||||
type: "object"
|
type: "object"
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
type: "string"
|
type: "string"
|
||||||
|
|
||||||
Image:
|
Image:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
|
@ -829,6 +838,7 @@ definitions:
|
||||||
username: "hannibal"
|
username: "hannibal"
|
||||||
password: "xxxx"
|
password: "xxxx"
|
||||||
serveraddress: "https://index.docker.io/v1/"
|
serveraddress: "https://index.docker.io/v1/"
|
||||||
|
|
||||||
ProcessConfig:
|
ProcessConfig:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
|
@ -844,6 +854,7 @@ definitions:
|
||||||
type: "array"
|
type: "array"
|
||||||
items:
|
items:
|
||||||
type: "string"
|
type: "string"
|
||||||
|
|
||||||
Volume:
|
Volume:
|
||||||
type: "object"
|
type: "object"
|
||||||
required: [Name, Driver, Mountpoint, Labels, Scope]
|
required: [Name, Driver, Mountpoint, Labels, Scope]
|
||||||
|
@ -911,6 +922,7 @@ definitions:
|
||||||
com.example.some-label: "some-value"
|
com.example.some-label: "some-value"
|
||||||
com.example.some-other-label: "some-other-value"
|
com.example.some-other-label: "some-other-value"
|
||||||
Scope: "local"
|
Scope: "local"
|
||||||
|
|
||||||
Network:
|
Network:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
|
@ -980,6 +992,7 @@ definitions:
|
||||||
type: "object"
|
type: "object"
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
type: "string"
|
type: "string"
|
||||||
|
|
||||||
NetworkContainer:
|
NetworkContainer:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
|
@ -991,6 +1004,7 @@ definitions:
|
||||||
type: "string"
|
type: "string"
|
||||||
IPv6Address:
|
IPv6Address:
|
||||||
type: "string"
|
type: "string"
|
||||||
|
|
||||||
BuildInfo:
|
BuildInfo:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
|
@ -1008,6 +1022,7 @@ definitions:
|
||||||
type: "string"
|
type: "string"
|
||||||
progressDetail:
|
progressDetail:
|
||||||
$ref: "#/definitions/ProgressDetail"
|
$ref: "#/definitions/ProgressDetail"
|
||||||
|
|
||||||
CreateImageInfo:
|
CreateImageInfo:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
|
@ -1019,6 +1034,7 @@ definitions:
|
||||||
type: "string"
|
type: "string"
|
||||||
progressDetail:
|
progressDetail:
|
||||||
$ref: "#/definitions/ProgressDetail"
|
$ref: "#/definitions/ProgressDetail"
|
||||||
|
|
||||||
PushImageInfo:
|
PushImageInfo:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
|
@ -1044,6 +1060,7 @@ definitions:
|
||||||
type: "integer"
|
type: "integer"
|
||||||
message:
|
message:
|
||||||
type: "integer"
|
type: "integer"
|
||||||
|
|
||||||
Error:
|
Error:
|
||||||
description: "Represents an error."
|
description: "Represents an error."
|
||||||
type: "object"
|
type: "object"
|
||||||
|
@ -1054,6 +1071,7 @@ definitions:
|
||||||
type: "string"
|
type: "string"
|
||||||
example:
|
example:
|
||||||
message: "Something went wrong."
|
message: "Something went wrong."
|
||||||
|
|
||||||
EndpointSettings:
|
EndpointSettings:
|
||||||
description: "Configuration for a network endpoint."
|
description: "Configuration for a network endpoint."
|
||||||
type: "object"
|
type: "object"
|
||||||
|
@ -1097,6 +1115,7 @@ definitions:
|
||||||
format: "int64"
|
format: "int64"
|
||||||
MacAddress:
|
MacAddress:
|
||||||
type: "string"
|
type: "string"
|
||||||
|
|
||||||
PluginMount:
|
PluginMount:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
|
@ -1118,6 +1137,7 @@ definitions:
|
||||||
type: "array"
|
type: "array"
|
||||||
items:
|
items:
|
||||||
type: "string"
|
type: "string"
|
||||||
|
|
||||||
PluginDevice:
|
PluginDevice:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
|
@ -1131,6 +1151,7 @@ definitions:
|
||||||
type: "string"
|
type: "string"
|
||||||
Path:
|
Path:
|
||||||
type: "string"
|
type: "string"
|
||||||
|
|
||||||
Plugin:
|
Plugin:
|
||||||
description: "A plugin for the Remote API"
|
description: "A plugin for the Remote API"
|
||||||
type: "object"
|
type: "object"
|
||||||
|
@ -1317,6 +1338,7 @@ definitions:
|
||||||
Description: "command line arguments"
|
Description: "command line arguments"
|
||||||
Settable: null
|
Settable: null
|
||||||
Value: []
|
Value: []
|
||||||
|
|
||||||
NodeSpec:
|
NodeSpec:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
|
@ -5299,26 +5321,32 @@ paths:
|
||||||
type: "string"
|
type: "string"
|
||||||
tags:
|
tags:
|
||||||
- "Exec"
|
- "Exec"
|
||||||
|
|
||||||
/volumes:
|
/volumes:
|
||||||
get:
|
get:
|
||||||
summary: "List volumes"
|
summary: "List volumes"
|
||||||
operationId: "GetVolumesList"
|
operationId: "VolumesList"
|
||||||
produces:
|
produces: ["application/json"]
|
||||||
- "application/json"
|
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: "No error"
|
description: "Summary volume data that matches the query"
|
||||||
schema:
|
schema:
|
||||||
type: "object"
|
type: "object"
|
||||||
|
required: [Volumes, Warnings]
|
||||||
properties:
|
properties:
|
||||||
Volumes:
|
Volumes:
|
||||||
type: "array"
|
type: "array"
|
||||||
|
x-nullable: false
|
||||||
|
description: "List of volumes"
|
||||||
items:
|
items:
|
||||||
$ref: "#/definitions/Volume"
|
$ref: "#/definitions/Volume"
|
||||||
Warnings:
|
Warnings:
|
||||||
type: "array"
|
type: "array"
|
||||||
|
x-nullable: false
|
||||||
|
description: "Warnings that occurred when fetching the list of volumes"
|
||||||
items:
|
items:
|
||||||
type: "string"
|
type: "string"
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
application/json:
|
application/json:
|
||||||
Volumes:
|
Volumes:
|
||||||
|
@ -5338,14 +5366,21 @@ paths:
|
||||||
- name: "filters"
|
- name: "filters"
|
||||||
in: "query"
|
in: "query"
|
||||||
description: |
|
description: |
|
||||||
JSON encoded value of the filters (a `map[string][]string`) to process on the volumes list. Available filters:
|
JSON encoded value of the filters (a `map[string][]string`) to
|
||||||
|
process on the volumes list. Available filters:
|
||||||
|
|
||||||
- `name=<volume-name>` Matches all or part of a volume name.
|
- `name=<volume-name>` Matches all or part of a volume name.
|
||||||
- `dangling=<boolean>` 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.
|
- `dangling=<boolean>` When set to `true` (or `1`), returns all
|
||||||
- `driver=<volume-driver-name>` Matches all or part of a volume driver name.
|
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=<volume-driver-name>` Matches all or part of a volume
|
||||||
|
driver name.
|
||||||
type: "string"
|
type: "string"
|
||||||
|
format: "json"
|
||||||
tags:
|
tags:
|
||||||
- "Volume"
|
- "Volume"
|
||||||
|
|
||||||
/volumes/create:
|
/volumes/create:
|
||||||
post:
|
post:
|
||||||
summary: "Create a volume"
|
summary: "Create a volume"
|
||||||
|
|
8
hack/generate-swagger-api.sh
Executable file
8
hack/generate-swagger-api.sh
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
swagger generate model -f api/swagger.yaml \
|
||||||
|
-t api -m types --skip-validator \
|
||||||
|
-n Volume \
|
||||||
|
-n Port \
|
||||||
|
-n ImageSummary
|
Loading…
Add table
Reference in a new issue