Add healthcheck to api-ref

Change-Id: I652e239578fd883898920bdaf9e98fc90041ebc9
Partial-Implements: blueprint support-healthycheck
This commit is contained in:
weikeyou 2018-08-01 14:02:00 +08:00
parent cd7e76be1e
commit 0fc74ffd02
7 changed files with 65 additions and 4 deletions

View File

@ -59,6 +59,7 @@ Request
- hints: hints - hints: hints
- mounts: mounts - mounts: mounts
- privileged: privileged-request - privileged: privileged-request
- healthcheck: healthcheck-request
Request Example Request Example
---------------- ----------------
@ -97,6 +98,7 @@ Response
- auto_remove: auto_remove - auto_remove: auto_remove
- auto_heal: auto_heal - auto_heal: auto_heal
- privileged: privileged - privileged: privileged
- healthcheck: healthcheck
Response Example Response Example
@ -169,6 +171,7 @@ Response
- status_reason: status_reason - status_reason: status_reason
- ports: ports - ports: ports
- privileged: privileged - privileged: privileged
- healthcheck: healthcheck
Response Example Response Example
---------------- ----------------
@ -232,6 +235,7 @@ Response
- status_reason: status_reason - status_reason: status_reason
- ports: ports - ports: ports
- privileged: privileged - privileged: privileged
- healthcheck: healthcheck
Response Example Response Example
---------------- ----------------
@ -433,6 +437,7 @@ Return new container with updated attributes.
- status_reason: status_reason - status_reason: status_reason
- ports: ports - ports: ports
- privileged: privileged - privileged: privileged
- healthcheck: healthcheck
Response Example Response Example
---------------- ----------------

View File

@ -497,6 +497,32 @@ forced_down:
in: body in: body
required: true required: true
type: boolean type: boolean
healthcheck:
description: |
A dict of health check for the container. Specify a test command to
perform to check that the container is healthy. Four parameters are
supported:
* cmd: Command to run to check health.
* interval: Time between running the check in seconds.
* retries: Consecutive failures needed to report unhealthy.
* timeout: Maximum time to allow one check to run in seconds.
in: body
required: true
type: object
healthcheck-request:
description: |
A dict of health check for the container. Specify a test command to
perform to check that the container is healthy. Four parameters are
supported:
* cmd: Command to run to check health.
* interval: Time between running the check in seconds.
* retries: Consecutive failures needed to report unhealthy.
* timeout: Maximum time to allow one check to run in seconds.
in: body
required: false
type: object
hints: hints:
description: | description: |
The dictionary of data to send to the scheduler. The dictionary of data to send to the scheduler.

View File

@ -43,5 +43,11 @@
"destination": "/data" "destination": "/data"
} }
], ],
"privileged": false "privileged": false,
"healthcheck": {
"cmd": "stat /etc/passwd || exit 1",
"interval": 3,
"retries": 2,
"timeout": 5
}
} }

View File

@ -42,5 +42,11 @@
"privileged": false, "privileged": false,
"disk": 0, "disk": 0,
"user_id": "0a9cdb65757b4216935e27f333d1c48b", "user_id": "0a9cdb65757b4216935e27f333d1c48b",
"project_id": "77a89a275765486d86144caad70825e4" "project_id": "77a89a275765486d86144caad70825e4",
"healthcheck": {
"test": "stat /etc/passwd || exit 1",
"interval": 3,
"retries": 2,
"timeout": 5
}
} }

View File

@ -56,7 +56,13 @@
"ports": [], "ports": [],
"command": "/bin/sh -c 'echo hello'", "command": "/bin/sh -c 'echo hello'",
"cpu": 2.0, "cpu": 2.0,
"interactive": false "interactive": false,
"healthcheck": {
"test": "stat /etc/passwd || exit 1",
"interval": 3,
"retries": 2,
"timeout": 5
}
} }
], ],
"next": null "next": null

View File

@ -53,5 +53,11 @@
"ports": [], "ports": [],
"command": "/bin/sh -c 'echo hello'", "command": "/bin/sh -c 'echo hello'",
"cpu": 2.0, "cpu": 2.0,
"interactive": false "interactive": false,
"healthcheck": {
"test": "stat /etc/passwd || exit 1",
"interval": 3,
"retries": 2,
"timeout": 5
}
} }

View File

@ -51,4 +51,10 @@
"cpu": 3.0, "cpu": 3.0,
"interactive": false, "interactive": false,
"privileged": false, "privileged": false,
"healthcheck": {
"test": "stat /etc/passwd || exit 1",
"interval": 3,
"retries": 2,
"timeout": 5
}
} }