Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a8b2272ab372cde394227d193dbb985b58b13bfa)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -663,6 +663,71 @@ definitions: |
| 663 | 663 |
1000000 (1 ms). 0 means inherit. |
| 664 | 664 |
type: "integer" |
| 665 | 665 |
|
| 666 |
+ Health: |
|
| 667 |
+ description: | |
|
| 668 |
+ Health stores information about the container's healthcheck results. |
|
| 669 |
+ type: "object" |
|
| 670 |
+ properties: |
|
| 671 |
+ Status: |
|
| 672 |
+ description: | |
|
| 673 |
+ Status is one of `none`, `starting`, `healthy` or `unhealthy` |
|
| 674 |
+ |
|
| 675 |
+ - "none" Indicates there is no healthcheck |
|
| 676 |
+ - "starting" Starting indicates that the container is not yet ready |
|
| 677 |
+ - "healthy" Healthy indicates that the container is running correctly |
|
| 678 |
+ - "unhealthy" Unhealthy indicates that the container has a problem |
|
| 679 |
+ type: "string" |
|
| 680 |
+ enum: |
|
| 681 |
+ - "none" |
|
| 682 |
+ - "starting" |
|
| 683 |
+ - "healthy" |
|
| 684 |
+ - "unhealthy" |
|
| 685 |
+ example: "healthy" |
|
| 686 |
+ FailingStreak: |
|
| 687 |
+ description: "FailingStreak is the number of consecutive failures" |
|
| 688 |
+ type: "integer" |
|
| 689 |
+ example: 0 |
|
| 690 |
+ Log: |
|
| 691 |
+ type: "array" |
|
| 692 |
+ description: | |
|
| 693 |
+ Log contains the last few results (oldest first) |
|
| 694 |
+ items: |
|
| 695 |
+ x-nullable: true |
|
| 696 |
+ $ref: "#/definitions/HealthcheckResult" |
|
| 697 |
+ |
|
| 698 |
+ HealthcheckResult: |
|
| 699 |
+ description: | |
|
| 700 |
+ HealthcheckResult stores information about a single run of a healthcheck probe |
|
| 701 |
+ type: "object" |
|
| 702 |
+ properties: |
|
| 703 |
+ Start: |
|
| 704 |
+ description: | |
|
| 705 |
+ Date and time at which this check started in |
|
| 706 |
+ [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. |
|
| 707 |
+ type: "string" |
|
| 708 |
+ format: "date-time" |
|
| 709 |
+ example: "2020-01-04T10:44:24.496525531Z" |
|
| 710 |
+ End: |
|
| 711 |
+ description: | |
|
| 712 |
+ Date and time at which this check ended in |
|
| 713 |
+ [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. |
|
| 714 |
+ type: "string" |
|
| 715 |
+ format: "dateTime" |
|
| 716 |
+ example: "2020-01-04T10:45:21.364524523Z" |
|
| 717 |
+ ExitCode: |
|
| 718 |
+ description: | |
|
| 719 |
+ ExitCode meanings: |
|
| 720 |
+ |
|
| 721 |
+ - `0` healthy |
|
| 722 |
+ - `1` unhealthy |
|
| 723 |
+ - `2` reserved (considered unhealthy) |
|
| 724 |
+ - other values: error running probe |
|
| 725 |
+ type: "integer" |
|
| 726 |
+ example: 0 |
|
| 727 |
+ Output: |
|
| 728 |
+ description: "Output from last check" |
|
| 729 |
+ type: "string" |
|
| 730 |
+ |
|
| 666 | 731 |
HostConfig: |
| 667 | 732 |
description: "Container configuration that depends on the host we are running on" |
| 668 | 733 |
allOf: |
| ... | ... |
@@ -1078,6 +1143,42 @@ definitions: |
| 1078 | 1078 |
items: |
| 1079 | 1079 |
type: "string" |
| 1080 | 1080 |
|
| 1081 |
+ NetworkingConfig: |
|
| 1082 |
+ description: | |
|
| 1083 |
+ NetworkingConfig represents the container's networking configuration for |
|
| 1084 |
+ each of its interfaces. |
|
| 1085 |
+ It is used for the networking configs specified in the `docker create` |
|
| 1086 |
+ and `docker network connect` commands. |
|
| 1087 |
+ type: "object" |
|
| 1088 |
+ properties: |
|
| 1089 |
+ EndpointsConfig: |
|
| 1090 |
+ description: | |
|
| 1091 |
+ A mapping of network name to endpoint configuration for that network. |
|
| 1092 |
+ type: "object" |
|
| 1093 |
+ additionalProperties: |
|
| 1094 |
+ $ref: "#/definitions/EndpointSettings" |
|
| 1095 |
+ example: |
|
| 1096 |
+ # putting an example here, instead of using the example values from |
|
| 1097 |
+ # /definitions/EndpointSettings, because containers/create currently |
|
| 1098 |
+ # does not support attaching to multiple networks, so the example request |
|
| 1099 |
+ # would be confusing if it showed that multiple networks can be contained |
|
| 1100 |
+ # in the EndpointsConfig. |
|
| 1101 |
+ # TODO remove once we support multiple networks on container create (see https://github.com/moby/moby/blob/07e6b843594e061f82baa5fa23c2ff7d536c2a05/daemon/create.go#L323) |
|
| 1102 |
+ EndpointsConfig: |
|
| 1103 |
+ isolated_nw: |
|
| 1104 |
+ IPAMConfig: |
|
| 1105 |
+ IPv4Address: "172.20.30.33" |
|
| 1106 |
+ IPv6Address: "2001:db8:abcd::3033" |
|
| 1107 |
+ LinkLocalIPs: |
|
| 1108 |
+ - "169.254.34.68" |
|
| 1109 |
+ - "fe80::3468" |
|
| 1110 |
+ Links: |
|
| 1111 |
+ - "container_1" |
|
| 1112 |
+ - "container_2" |
|
| 1113 |
+ Aliases: |
|
| 1114 |
+ - "server_x" |
|
| 1115 |
+ - "server_y" |
|
| 1116 |
+ |
|
| 1081 | 1117 |
NetworkSettings: |
| 1082 | 1118 |
description: "NetworkSettings exposes the network settings in the API" |
| 1083 | 1119 |
type: "object" |
| ... | ... |
@@ -3165,14 +3266,7 @@ definitions: |
| 3165 | 3165 |
description: "Specifies which networks the service should attach to." |
| 3166 | 3166 |
type: "array" |
| 3167 | 3167 |
items: |
| 3168 |
- type: "object" |
|
| 3169 |
- properties: |
|
| 3170 |
- Target: |
|
| 3171 |
- type: "string" |
|
| 3172 |
- Aliases: |
|
| 3173 |
- type: "array" |
|
| 3174 |
- items: |
|
| 3175 |
- type: "string" |
|
| 3168 |
+ $ref: "#/definitions/NetworkAttachmentConfig" |
|
| 3176 | 3169 |
LogDriver: |
| 3177 | 3170 |
description: | |
| 3178 | 3171 |
Specifies the log driver to use for tasks created from this spec. If |
| ... | ... |
@@ -3449,14 +3543,8 @@ definitions: |
| 3449 | 3449 |
description: "Specifies which networks the service should attach to." |
| 3450 | 3450 |
type: "array" |
| 3451 | 3451 |
items: |
| 3452 |
- type: "object" |
|
| 3453 |
- properties: |
|
| 3454 |
- Target: |
|
| 3455 |
- type: "string" |
|
| 3456 |
- Aliases: |
|
| 3457 |
- type: "array" |
|
| 3458 |
- items: |
|
| 3459 |
- type: "string" |
|
| 3452 |
+ $ref: "#/definitions/NetworkAttachmentConfig" |
|
| 3453 |
+ |
|
| 3460 | 3454 |
EndpointSpec: |
| 3461 | 3455 |
$ref: "#/definitions/EndpointSpec" |
| 3462 | 3456 |
|
| ... | ... |
@@ -3834,6 +3922,71 @@ definitions: |
| 3834 | 3834 |
Spec: |
| 3835 | 3835 |
$ref: "#/definitions/ConfigSpec" |
| 3836 | 3836 |
|
| 3837 |
+ ContainerState: |
|
| 3838 |
+ description: | |
|
| 3839 |
+ ContainerState stores container's running state. It's part of ContainerJSONBase |
|
| 3840 |
+ and will be returned by the "inspect" command. |
|
| 3841 |
+ type: "object" |
|
| 3842 |
+ properties: |
|
| 3843 |
+ Status: |
|
| 3844 |
+ description: | |
|
| 3845 |
+ String representation of the container state. Can be one of "created", |
|
| 3846 |
+ "running", "paused", "restarting", "removing", "exited", or "dead". |
|
| 3847 |
+ type: "string" |
|
| 3848 |
+ enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"] |
|
| 3849 |
+ example: "running" |
|
| 3850 |
+ Running: |
|
| 3851 |
+ description: | |
|
| 3852 |
+ Whether this container is running. |
|
| 3853 |
+ |
|
| 3854 |
+ Note that a running container can be _paused_. The `Running` and `Paused` |
|
| 3855 |
+ booleans are not mutually exclusive: |
|
| 3856 |
+ |
|
| 3857 |
+ When pausing a container (on Linux), the freezer cgroup is used to suspend |
|
| 3858 |
+ all processes in the container. Freezing the process requires the process to |
|
| 3859 |
+ be running. As a result, paused containers are both `Running` _and_ `Paused`. |
|
| 3860 |
+ |
|
| 3861 |
+ Use the `Status` field instead to determine if a container's state is "running". |
|
| 3862 |
+ type: "boolean" |
|
| 3863 |
+ example: true |
|
| 3864 |
+ Paused: |
|
| 3865 |
+ description: "Whether this container is paused." |
|
| 3866 |
+ type: "boolean" |
|
| 3867 |
+ example: false |
|
| 3868 |
+ Restarting: |
|
| 3869 |
+ description: "Whether this container is restarting." |
|
| 3870 |
+ type: "boolean" |
|
| 3871 |
+ example: false |
|
| 3872 |
+ OOMKilled: |
|
| 3873 |
+ description: | |
|
| 3874 |
+ Whether this container has been killed because it ran out of memory. |
|
| 3875 |
+ type: "boolean" |
|
| 3876 |
+ example: false |
|
| 3877 |
+ Dead: |
|
| 3878 |
+ type: "boolean" |
|
| 3879 |
+ example: false |
|
| 3880 |
+ Pid: |
|
| 3881 |
+ description: "The process ID of this container" |
|
| 3882 |
+ type: "integer" |
|
| 3883 |
+ example: 1234 |
|
| 3884 |
+ ExitCode: |
|
| 3885 |
+ description: "The last exit code of this container" |
|
| 3886 |
+ type: "integer" |
|
| 3887 |
+ example: 0 |
|
| 3888 |
+ Error: |
|
| 3889 |
+ type: "string" |
|
| 3890 |
+ StartedAt: |
|
| 3891 |
+ description: "The time when this container was last started." |
|
| 3892 |
+ type: "string" |
|
| 3893 |
+ example: "2020-01-06T09:06:59.461876391Z" |
|
| 3894 |
+ FinishedAt: |
|
| 3895 |
+ description: "The time when this container last exited." |
|
| 3896 |
+ type: "string" |
|
| 3897 |
+ example: "2020-01-06T09:07:59.461876391Z" |
|
| 3898 |
+ Health: |
|
| 3899 |
+ x-nullable: true |
|
| 3900 |
+ $ref: "#/definitions/Health" |
|
| 3901 |
+ |
|
| 3837 | 3902 |
SystemInfo: |
| 3838 | 3903 |
type: "object" |
| 3839 | 3904 |
properties: |
| ... | ... |
@@ -4634,6 +4787,28 @@ definitions: |
| 4634 | 4634 |
IP address and ports at which this node can be reached. |
| 4635 | 4635 |
type: "string" |
| 4636 | 4636 |
|
| 4637 |
+ NetworkAttachmentConfig: |
|
| 4638 |
+ description: | |
|
| 4639 |
+ Specifies how a service should be attached to a particular network. |
|
| 4640 |
+ type: "object" |
|
| 4641 |
+ properties: |
|
| 4642 |
+ Target: |
|
| 4643 |
+ description: | |
|
| 4644 |
+ The target network for attachment. Must be a network name or ID. |
|
| 4645 |
+ type: "string" |
|
| 4646 |
+ Aliases: |
|
| 4647 |
+ description: | |
|
| 4648 |
+ Discoverable alternate names for the service on this network. |
|
| 4649 |
+ type: "array" |
|
| 4650 |
+ items: |
|
| 4651 |
+ type: "string" |
|
| 4652 |
+ DriverOpts: |
|
| 4653 |
+ description: | |
|
| 4654 |
+ Driver attachment options for the network target. |
|
| 4655 |
+ type: "object" |
|
| 4656 |
+ additionalProperties: |
|
| 4657 |
+ type: "string" |
|
| 4658 |
+ |
|
| 4637 | 4659 |
paths: |
| 4638 | 4660 |
/containers/json: |
| 4639 | 4661 |
get: |
| ... | ... |
@@ -4861,16 +5036,7 @@ paths: |
| 4861 | 4861 |
HostConfig: |
| 4862 | 4862 |
$ref: "#/definitions/HostConfig" |
| 4863 | 4863 |
NetworkingConfig: |
| 4864 |
- description: "This container's networking configuration." |
|
| 4865 |
- type: "object" |
|
| 4866 |
- properties: |
|
| 4867 |
- EndpointsConfig: |
|
| 4868 |
- description: | |
|
| 4869 |
- A mapping of network name to endpoint configuration |
|
| 4870 |
- for that network. |
|
| 4871 |
- type: "object" |
|
| 4872 |
- additionalProperties: |
|
| 4873 |
- $ref: "#/definitions/EndpointSettings" |
|
| 4864 |
+ $ref: "#/definitions/NetworkingConfig" |
|
| 4874 | 4865 |
example: |
| 4875 | 4866 |
Hostname: "" |
| 4876 | 4867 |
Domainname: "" |
| ... | ... |
@@ -5063,54 +5229,10 @@ paths: |
| 5063 | 5063 |
items: |
| 5064 | 5064 |
type: "string" |
| 5065 | 5065 |
State: |
| 5066 |
- description: "The state of the container." |
|
| 5067 |
- type: "object" |
|
| 5068 |
- properties: |
|
| 5069 |
- Status: |
|
| 5070 |
- description: | |
|
| 5071 |
- The status of the container. For example, `"running"` or `"exited"`. |
|
| 5072 |
- type: "string" |
|
| 5073 |
- enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"] |
|
| 5074 |
- Running: |
|
| 5075 |
- description: | |
|
| 5076 |
- Whether this container is running. |
|
| 5077 |
- |
|
| 5078 |
- Note that a running container can be _paused_. The `Running` and `Paused` |
|
| 5079 |
- booleans are not mutually exclusive: |
|
| 5080 |
- |
|
| 5081 |
- When pausing a container (on Linux), the cgroups freezer is used to suspend |
|
| 5082 |
- all processes in the container. Freezing the process requires the process to |
|
| 5083 |
- be running. As a result, paused containers are both `Running` _and_ `Paused`. |
|
| 5084 |
- |
|
| 5085 |
- Use the `Status` field instead to determine if a container's state is "running". |
|
| 5086 |
- type: "boolean" |
|
| 5087 |
- Paused: |
|
| 5088 |
- description: "Whether this container is paused." |
|
| 5089 |
- type: "boolean" |
|
| 5090 |
- Restarting: |
|
| 5091 |
- description: "Whether this container is restarting." |
|
| 5092 |
- type: "boolean" |
|
| 5093 |
- OOMKilled: |
|
| 5094 |
- description: "Whether this container has been killed because it ran out of memory." |
|
| 5095 |
- type: "boolean" |
|
| 5096 |
- Dead: |
|
| 5097 |
- type: "boolean" |
|
| 5098 |
- Pid: |
|
| 5099 |
- description: "The process ID of this container" |
|
| 5100 |
- type: "integer" |
|
| 5101 |
- ExitCode: |
|
| 5102 |
- description: "The last exit code of this container" |
|
| 5103 |
- type: "integer" |
|
| 5104 |
- Error: |
|
| 5105 |
- type: "string" |
|
| 5106 |
- StartedAt: |
|
| 5107 |
- description: "The time when this container was last started." |
|
| 5108 |
- type: "string" |
|
| 5109 |
- FinishedAt: |
|
| 5110 |
- description: "The time when this container last exited." |
|
| 5111 |
- type: "string" |
|
| 5066 |
+ x-nullable: true |
|
| 5067 |
+ $ref: "#/definitions/ContainerState" |
|
| 5112 | 5068 |
Image: |
| 5113 |
- description: "The container's image" |
|
| 5069 |
+ description: "The container's image ID" |
|
| 5114 | 5070 |
type: "string" |
| 5115 | 5071 |
ResolvConfPath: |
| 5116 | 5072 |
type: "string" |
| ... | ... |
@@ -5180,6 +5302,8 @@ paths: |
| 5180 | 5180 |
Domainname: "" |
| 5181 | 5181 |
Env: |
| 5182 | 5182 |
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
| 5183 |
+ Healthcheck: |
|
| 5184 |
+ Test: ["CMD-SHELL", "exit 0"] |
|
| 5183 | 5185 |
Hostname: "ba033ac44011" |
| 5184 | 5186 |
Image: "ubuntu" |
| 5185 | 5187 |
Labels: |
| ... | ... |
@@ -5291,6 +5415,14 @@ paths: |
| 5291 | 5291 |
Error: "" |
| 5292 | 5292 |
ExitCode: 9 |
| 5293 | 5293 |
FinishedAt: "2015-01-06T15:47:32.080254511Z" |
| 5294 |
+ Health: |
|
| 5295 |
+ Status: "healthy" |
|
| 5296 |
+ FailingStreak: 0 |
|
| 5297 |
+ Log: |
|
| 5298 |
+ - Start: "2019-12-22T10:59:05.6385933Z" |
|
| 5299 |
+ End: "2019-12-22T10:59:05.8078452Z" |
|
| 5300 |
+ ExitCode: 0 |
|
| 5301 |
+ Output: "" |
|
| 5294 | 5302 |
OOMKilled: false |
| 5295 | 5303 |
Dead: false |
| 5296 | 5304 |
Paused: false |
| ... | ... |
@@ -5591,6 +5723,16 @@ paths: |
| 5591 | 5591 |
If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is |
| 5592 | 5592 |
nil then for compatibility with older daemons the length of the |
| 5593 | 5593 |
corresponding `cpu_usage.percpu_usage` array should be used. |
| 5594 |
+ |
|
| 5595 |
+ To calculate the values shown by the `stats` command of the docker cli tool |
|
| 5596 |
+ the following formulas can be used: |
|
| 5597 |
+ * used_memory = `memory_stats.usage - memory_stats.stats.cache` |
|
| 5598 |
+ * available_memory = `memory_stats.limit` |
|
| 5599 |
+ * Memory usage % = `(used_memory / available_memory) * 100.0` |
|
| 5600 |
+ * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` |
|
| 5601 |
+ * system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage` |
|
| 5602 |
+ * number_cpus = `lenght(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus` |
|
| 5603 |
+ * CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0` |
|
| 5594 | 5604 |
operationId: "ContainerStats" |
| 5595 | 5605 |
produces: ["application/json"] |
| 5596 | 5606 |
responses: |
| ... | ... |
@@ -5762,8 +5904,6 @@ paths: |
| 5762 | 5762 |
description: "no error" |
| 5763 | 5763 |
304: |
| 5764 | 5764 |
description: "container already started" |
| 5765 |
- schema: |
|
| 5766 |
- $ref: "#/definitions/ErrorResponse" |
|
| 5767 | 5765 |
404: |
| 5768 | 5766 |
description: "no such container" |
| 5769 | 5767 |
schema: |
| ... | ... |
@@ -5798,8 +5938,6 @@ paths: |
| 5798 | 5798 |
description: "no error" |
| 5799 | 5799 |
304: |
| 5800 | 5800 |
description: "container already stopped" |
| 5801 |
- schema: |
|
| 5802 |
- $ref: "#/definitions/ErrorResponse" |
|
| 5803 | 5801 |
404: |
| 5804 | 5802 |
description: "no such container" |
| 5805 | 5803 |
schema: |
| ... | ... |
@@ -6924,6 +7062,10 @@ paths: |
| 6924 | 6924 |
in: "query" |
| 6925 | 6925 |
description: "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled." |
| 6926 | 6926 |
type: "string" |
| 6927 |
+ - name: "message" |
|
| 6928 |
+ in: "query" |
|
| 6929 |
+ description: "Set commit message for imported image." |
|
| 6930 |
+ type: "string" |
|
| 6927 | 6931 |
- name: "inputImage" |
| 6928 | 6932 |
in: "body" |
| 6929 | 6933 |
description: "Image content if the value `-` has been specified in fromSrc query parameter" |