Updated on 2024-06-17 GMT+08:00

Polling Results

Use cli-waiter to poll results, and ensure that its parameters are in JSON format and enclosed in double quotation marks. These parameters help you poll results:

hcloud ECS NovaShowServer --cli-region="ap-southeast-1" --server_id="e6b99563-xxxx-xxxx-xxxx-1820d4fd2a6" --cli-query="server.status" --cli-waiter="{\"expr\":\"server.status\",\"to\":\"ACTIVE\",\"timeout\":300}"
Result polling ended. server.status is the expected ACTIVE.
ACTIVE

In the value of cli-waiter, each field has a meaning as follows:

- expr: Required string, which is a JMESPath expression used to specify the field to poll for.

- to: Required string, which is the target value of the polled field.

- timeout: Optional int, which is the polling timeout in seconds. Range: 1 to 600. Default value: 180.

- interval: Optional int, which is the polling interval in seconds. Range: 2 to 10. Default value: 5.

Polling results with --cli-waiter may cause idempotence and cyclic API calls. Use this option for query APIs.