Use singular tag names in swagger.yaml

This is required to make the type generation put things in the
correct directory, but unfortunately makes the names in the
documentation menu look a bit crap.

I think the best solution would be to add a `x-display-name`
extension to tags to determine how the tags show up in the menu,
rather than it depend on the name of the tag. I shall do this in
a follow-up PR - for now, let's fix the breakage.

Fixes #29045

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
(cherry picked from commit 30a9249e15)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
Ben Firshman 2016-12-02 14:14:36 +00:00 committed by Victor Vieux
parent f1ea64fa07
commit 94f3ccc31e

View file

@ -89,21 +89,21 @@ info:
# The tags on paths define the menu sections in the ReDoc documentation, so
# the usage of tags must make sense for that:
# - They should be plural, not singular.
# - They should be singular, not plural.
# - There should not be too many tags, or the menu becomes unwieldly. For
# example, it is preferable to add a path to the "System" tag instead of
# creating a tag with a single path in it.
# - The order of tags in this list defines the order in the menu.
tags:
# Primary objects
- name: "Containers"
- name: "Container"
description: |
Create and manage containers.
- name: "Images"
- name: "Networks"
- name: "Image"
- name: "Network"
description: |
Networks are user-defined networks that containers can be attached to. See the [networking documentation](https://docs.docker.com/engine/userguide/networking/) for more information.
- name: "Volumes"
- name: "Volume"
description: |
Create and manage persistent storage that can be attached to containers.
- name: "Exec"
@ -111,22 +111,22 @@ tags:
Run new commands inside running containers. See the [command-line reference](https://docs.docker.com/engine/reference/commandline/exec/) for more information.
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`.
- name: "Secrets"
- name: "Secret"
# Swarm things
- name: "Swarm"
description: |
Engines can be clustered together in a swarm. See [the swarm mode documentation](https://docs.docker.com/engine/swarm/) for more information.
- name: "Nodes"
- name: "Node"
description: |
Nodes are instances of the Engine participating in a swarm. Swarm mode must be enabled for these endpoints to work.
- name: "Services"
- name: "Service"
description: |
Services are the definitions of tasks to run on a swarm. Swarm mode must be enabled for these endpoints to work.
- name: "Tasks"
- name: "Task"
description: |
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.
# System things
- name: "Plugins"
- name: "Plugin"
- name: "System"
definitions:
@ -2618,7 +2618,7 @@ paths:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
tags: ["Containers"]
tags: ["Container"]
/containers/create:
post:
summary: "Create a container"
@ -2817,7 +2817,7 @@ paths:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/json:
get:
summary: "Inspect a container"
@ -3093,7 +3093,7 @@ paths:
type: "boolean"
default: false
description: "Return the size of container as fields `SizeRw` and `SizeRootFs`"
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/top:
get:
summary: "List processes running inside a container"
@ -3169,7 +3169,7 @@ paths:
description: "The arguments to pass to `ps`. For example, `aux`"
type: "string"
default: "-ef"
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/logs:
get:
summary: "Get container logs"
@ -3238,7 +3238,7 @@ paths:
description: "Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines."
type: "string"
default: "all"
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/changes:
get:
summary: "Get changes on a containers filesystem"
@ -3294,7 +3294,7 @@ paths:
required: true
description: "ID or name of the container"
type: "string"
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/export:
get:
summary: "Export a container"
@ -3322,7 +3322,7 @@ paths:
required: true
description: "ID or name of the container"
type: "string"
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/stats:
get:
summary: "Get container stats based on resource usage"
@ -3450,7 +3450,7 @@ paths:
description: "Stream the output. If false, the stats will be output once and then it will disconnect."
type: "boolean"
default: true
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/resize:
post:
summary: "Resize a container TTY"
@ -3488,7 +3488,7 @@ paths:
in: "query"
description: "Width of the tty session in characters"
type: "integer"
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/start:
post:
summary: "Start a container"
@ -3521,7 +3521,7 @@ paths:
in: "query"
description: "Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`."
type: "string"
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/stop:
post:
summary: "Stop a container"
@ -3554,7 +3554,7 @@ paths:
in: "query"
description: "Number of seconds to wait before killing the container"
type: "integer"
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/restart:
post:
summary: "Restart a container"
@ -3583,7 +3583,7 @@ paths:
in: "query"
description: "Number of seconds to wait before killing the container"
type: "integer"
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/kill:
post:
summary: "Kill a container"
@ -3614,7 +3614,7 @@ paths:
description: "Signal to send to the container as an integer or string (e.g. `SIGINT`)"
type: "string"
default: "SIGKILL"
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/update:
post:
summary: "Update a container"
@ -3675,7 +3675,7 @@ paths:
RestartPolicy:
MaximumRetryCount: 4
Name: "on-failure"
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/rename:
post:
summary: "Rename a container"
@ -3709,7 +3709,7 @@ paths:
required: true
description: "New name for the container"
type: "string"
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/pause:
post:
summary: "Pause a container"
@ -3738,7 +3738,7 @@ paths:
required: true
description: "ID or name of the container"
type: "string"
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/unpause:
post:
summary: "Unpause a container"
@ -3764,7 +3764,7 @@ paths:
required: true
description: "ID or name of the container"
type: "string"
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/attach:
post:
summary: "Attach to a container"
@ -3908,7 +3908,7 @@ paths:
description: "Attach to `stderr`"
type: "boolean"
default: false
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/attach/ws:
get:
summary: "Attach to a container via a websocket"
@ -3968,7 +3968,7 @@ paths:
description: "Attach to `stderr`"
type: "boolean"
default: false
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/wait:
post:
summary: "Wait for a container"
@ -4003,7 +4003,7 @@ paths:
required: true
description: "ID or name of the container"
type: "string"
tags: ["Containers"]
tags: ["Container"]
/containers/{id}:
delete:
summary: "Remove a container"
@ -4042,7 +4042,7 @@ paths:
description: "If the container is running, kill it before removing it."
type: "boolean"
default: false
tags: ["Containers"]
tags: ["Container"]
/containers/{id}/archive:
head:
summary: "Get information about files in a container"
@ -4088,7 +4088,7 @@ paths:
required: true
description: "Resource in the containers filesystem to archive."
type: "string"
tags: ["Containers"]
tags: ["Container"]
get:
summary: "Get an archive of a filesystem resource in a container"
description: "Get an tar archive of a resource in the filesystem of container id."
@ -4131,7 +4131,7 @@ paths:
required: true
description: "Resource in the containers filesystem to archive."
type: "string"
tags: ["Containers"]
tags: ["Container"]
put:
summary: "Extract an archive of files or folders to a directory in a container"
description: "Upload a tar archive to be extracted to a path in the filesystem of container id."
@ -4182,7 +4182,7 @@ paths:
description: "The input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz."
schema:
type: "string"
tags: ["Containers"]
tags: ["Container"]
/containers/prune:
post:
summary: "Delete stopped containers"
@ -4210,7 +4210,7 @@ paths:
description: "Server error"
schema:
$ref: "#/definitions/ErrorResponse"
tags: ["Containers"]
tags: ["Container"]
/images/json:
get:
summary: "List Images"
@ -4281,7 +4281,7 @@ paths:
description: "Show digest information as a `RepoDigests` field on each image."
type: "boolean"
default: false
tags: ["Images"]
tags: ["Image"]
/build:
post:
summary: "Build an image"
@ -4428,7 +4428,7 @@ paths:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
tags: ["Images"]
tags: ["Image"]
/images/create:
post:
summary: "Create an image"
@ -4473,7 +4473,7 @@ paths:
in: "header"
description: "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)"
type: "string"
tags: ["Images"]
tags: ["Image"]
/images/{name}/json:
get:
summary: "Inspect an image"
@ -4579,7 +4579,7 @@ paths:
description: "Image name or id"
type: "string"
required: true
tags: ["Images"]
tags: ["Image"]
/images/{name}/history:
get:
summary: "Get the history of an image"
@ -4649,7 +4649,7 @@ paths:
description: "Image name or ID"
type: "string"
required: true
tags: ["Images"]
tags: ["Image"]
/images/{name}/push:
post:
summary: "Push an image"
@ -4688,7 +4688,7 @@ paths:
description: "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)"
type: "string"
required: true
tags: ["Images"]
tags: ["Image"]
/images/{name}/tag:
post:
summary: "Tag an image"
@ -4727,7 +4727,7 @@ paths:
in: "query"
description: "The name of the new tag."
type: "string"
tags: ["Images"]
tags: ["Image"]
/images/{name}:
delete:
summary: "Remove an image"
@ -4778,7 +4778,7 @@ paths:
description: "Do not delete untagged parent images"
type: "boolean"
default: false
tags: ["Images"]
tags: ["Image"]
/images/search:
get:
summary: "Search images"
@ -4844,7 +4844,7 @@ paths:
- `is-automated=(true|false)`
- `is-official=(true|false)`
type: "string"
tags: ["Images"]
tags: ["Image"]
/images/prune:
post:
summary: "Delete unused images"
@ -4882,7 +4882,7 @@ paths:
description: "Server error"
schema:
$ref: "#/definitions/ErrorResponse"
tags: ["Images"]
tags: ["Image"]
/auth:
post:
summary: "Check auth configuration"
@ -5261,7 +5261,7 @@ paths:
in: "query"
description: "`Dockerfile` instructions to apply while committing"
type: "string"
tags: ["Images"]
tags: ["Image"]
/events:
get:
summary: "Monitor events"
@ -5487,7 +5487,7 @@ paths:
description: "Image name or ID"
type: "string"
required: true
tags: ["Images"]
tags: ["Image"]
/images/get:
get:
summary: "Export several images"
@ -5517,7 +5517,7 @@ paths:
type: "array"
items:
type: "string"
tags: ["Images"]
tags: ["Image"]
/images/load:
post:
summary: "Import images"
@ -5549,7 +5549,7 @@ paths:
description: "Suppress progress details during load."
type: "boolean"
default: false
tags: ["Images"]
tags: ["Image"]
/containers/{id}/exec:
post:
summary: "Create an exec instance"
@ -5832,7 +5832,7 @@ paths:
driver name.
type: "string"
format: "json"
tags: ["Volumes"]
tags: ["Volume"]
/volumes/create:
post:
@ -5882,7 +5882,7 @@ paths:
com.example.some-label: "some-value"
com.example.some-other-label: "some-other-value"
Driver: "custom"
tags: ["Volumes"]
tags: ["Volume"]
/volumes/{name}:
get:
@ -5908,7 +5908,7 @@ paths:
required: true
description: "Volume name or ID"
type: "string"
tags: ["Volumes"]
tags: ["Volume"]
delete:
summary: "Remove a volume"
@ -5940,7 +5940,7 @@ paths:
description: "Force the removal of the volume"
type: "boolean"
default: false
tags: ["Volumes"]
tags: ["Volume"]
/volumes/prune:
post:
summary: "Delete unused volumes"
@ -5968,7 +5968,7 @@ paths:
description: "Server error"
schema:
$ref: "#/definitions/ErrorResponse"
tags: ["Volumes"]
tags: ["Volume"]
/networks:
get:
summary: "List networks"
@ -6049,7 +6049,7 @@ paths:
- `name=<network-name>` Matches all or part of a network name.
- `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks.
type: "string"
tags: ["Networks"]
tags: ["Network"]
/networks/{id}:
get:
@ -6072,7 +6072,7 @@ paths:
description: "Network ID or name"
required: true
type: "string"
tags: ["Networks"]
tags: ["Network"]
delete:
summary: "Remove a network"
@ -6094,7 +6094,7 @@ paths:
description: "Network ID or name"
required: true
type: "string"
tags: ["Networks"]
tags: ["Network"]
/networks/create:
post:
@ -6190,7 +6190,7 @@ paths:
Labels:
com.example.some-label: "some-value"
com.example.some-other-label: "some-other-value"
tags: ["Networks"]
tags: ["Network"]
/networks/{id}/connect:
post:
@ -6236,7 +6236,7 @@ paths:
IPAMConfig:
IPv4Address: "172.24.56.89"
IPv6Address: "2001:db8::5689"
tags: ["Networks"]
tags: ["Network"]
/networks/{id}/disconnect:
post:
@ -6277,7 +6277,7 @@ paths:
Force:
type: "boolean"
description: "Force the container to disconnect from the network."
tags: ["Networks"]
tags: ["Network"]
/networks/prune:
post:
summary: "Delete unused networks"
@ -6301,7 +6301,7 @@ paths:
description: "Server error"
schema:
$ref: "#/definitions/ErrorResponse"
tags: ["Networks"]
tags: ["Network"]
/plugins:
get:
summary: "List plugins"
@ -6394,7 +6394,7 @@ paths:
description: "Server error"
schema:
$ref: "#/definitions/ErrorResponse"
tags: ["Plugins"]
tags: ["Plugin"]
/plugins/pull:
post:
@ -6451,7 +6451,7 @@ paths:
in: "header"
description: "A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)"
type: "string"
tags: ["Plugins"]
tags: ["Plugin"]
/plugins/{name}:
get:
summary: "Inspect a plugin"
@ -6475,7 +6475,7 @@ paths:
description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted."
required: true
type: "string"
tags: ["Plugins"]
tags: ["Plugin"]
delete:
summary: "Remove a plugin"
operationId: "PluginDelete"
@ -6503,7 +6503,7 @@ paths:
description: "Disable the plugin before removing. This may result in issues if the plugin is in use by a container."
type: "boolean"
default: false
tags: ["Plugins"]
tags: ["Plugin"]
/plugins/{name}/enable:
post:
summary: "Enable a plugin"
@ -6526,7 +6526,7 @@ paths:
description: "Set the HTTP client timeout (in seconds)"
type: "integer"
default: 0
tags: ["Plugins"]
tags: ["Plugin"]
/plugins/{name}/disable:
post:
summary: "Disable a plugin"
@ -6544,7 +6544,7 @@ paths:
description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted."
required: true
type: "string"
tags: ["Plugins"]
tags: ["Plugin"]
/plugins/create:
post:
summary: "Create a plugin"
@ -6570,7 +6570,7 @@ paths:
schema:
type: "string"
format: "binary"
tags: ["Plugins"]
tags: ["Plugin"]
/plugins/{name}/push:
post:
summary: "Push a plugin"
@ -6594,7 +6594,7 @@ paths:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
tags: ["Plugins"]
tags: ["Plugin"]
/plugins/{name}/set:
post:
summary: "Configure a plugin"
@ -6625,7 +6625,7 @@ paths:
description: "Server error"
schema:
$ref: "#/definitions/ErrorResponse"
tags: ["Plugins"]
tags: ["Plugin"]
/nodes:
get:
summary: "List nodes"
@ -6654,7 +6654,7 @@ paths:
- `name=<node name>`
- `role=`(`manager`|`worker`)`
type: "string"
tags: ["Nodes"]
tags: ["Node"]
/nodes/{id}:
get:
summary: "Inspect a node"
@ -6678,7 +6678,7 @@ paths:
description: "The ID or name of the node"
type: "string"
required: true
tags: ["Nodes"]
tags: ["Node"]
delete:
summary: "Delete a node"
operationId: "NodeDelete"
@ -6704,7 +6704,7 @@ paths:
description: "Force remove a node from the swarm"
default: false
type: "boolean"
tags: ["Nodes"]
tags: ["Node"]
/nodes/{id}/update:
post:
summary: "Update a node"
@ -6736,7 +6736,7 @@ paths:
type: "integer"
format: "int64"
required: true
tags: ["Nodes"]
tags: ["Node"]
/swarm:
get:
summary: "Inspect swarm"
@ -7034,7 +7034,7 @@ paths:
- `id=<service id>`
- `name=<service name>`
- `label=<service label>`
tags: ["Services"]
tags: ["Service"]
/services/create:
post:
summary: "Create a service"
@ -7131,7 +7131,7 @@ paths:
in: "header"
description: "A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)"
type: "string"
tags: ["Services"]
tags: ["Service"]
/services/{id}:
get:
summary: "Inspect a service"
@ -7155,7 +7155,7 @@ paths:
description: "ID or name of service."
required: true
type: "string"
tags: ["Services"]
tags: ["Service"]
delete:
summary: "Delete a service"
operationId: "ServiceDelete"
@ -7176,7 +7176,7 @@ paths:
description: "ID or name of service."
required: true
type: "string"
tags: ["Services"]
tags: ["Service"]
/services/{id}/update:
post:
summary: "Update a service"
@ -7251,7 +7251,7 @@ paths:
description: "A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)"
type: "string"
tags: ["Services"]
tags: ["Service"]
/services/{id}/logs:
get:
summary: "Get service logs"
@ -7328,7 +7328,7 @@ paths:
description: "Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines."
type: "string"
default: "all"
tags: ["Services"]
tags: ["Service"]
/tasks:
get:
summary: "List tasks"
@ -7471,7 +7471,7 @@ paths:
- `node=<node id or name>`
- `label=key` or `label="key=value"`
- `desired-state=(running | shutdown | accepted)`
tags: ["Tasks"]
tags: ["Task"]
/tasks/{id}:
get:
summary: "Inspect a task"
@ -7497,7 +7497,7 @@ paths:
description: "ID of the task"
required: true
type: "string"
tags: ["Tasks"]
tags: ["Task"]
/secrets:
get:
summary: "List secrets"
@ -7531,7 +7531,7 @@ paths:
A JSON encoded value of the filters (a `map[string][]string`) to process on the secrets list. Available filters:
- `names=<secret name>`
tags: ["Secrets"]
tags: ["Secret"]
/secrets/create:
post:
summary: "Create a secret"
@ -7575,7 +7575,7 @@ paths:
Labels:
foo: "bar"
Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg=="
tags: ["Secrets"]
tags: ["Secret"]
/secrets/{id}:
get:
summary: "Inspect a secret"
@ -7613,7 +7613,7 @@ paths:
required: true
type: "string"
description: "ID of the secret"
tags: ["Secrets"]
tags: ["Secret"]
delete:
summary: "Delete a secret"
operationId: "SecretDelete"
@ -7636,4 +7636,4 @@ paths:
required: true
type: "string"
description: "ID of the secret"
tags: ["Secrets"]
tags: ["Secret"]