wait_for_http
!wait_for_http
Category: control
Poll an HTTP endpoint until it responds (optionally with a specific status code), useful for waiting on an API or service to become ready after boot. Fails on timeout.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
url | string | yes | The HTTP(S) URL to poll. |
expected | int | no | Expected HTTP status code (e.g. 200). If omitted, any 2xx is accepted. |
timeout | int | no | Maximum seconds to wait. Default 300. |
delay | int | no | Seconds between polls. Default 5. |
verify_tls | bool | no | Verify the TLS certificate. Default false. |
Examples
- !wait_for_http
url: http://10.7.1.50:8080/health
expected: 200
timeout: 120