Wait for Device to Become Reachable
cnc_wait_for_device_reachableWait for a device to become reachable by polling its reachability state until it converges, replacing manual loops after creation or credential fixes.
Instructions
Poll a device until its reachability_state is CONN_STATE_REACHABLE.
Read-only convergence wait. Call it right after cnc_create_device (or after fixing credentials / admin state) instead of polling cnc_get_device in a loop. Pass exactly one of uuid / host_name. A new device typically moves UNKNOWN/CHECKING -> REACHABLE within a minute or two once it is attached to a Data Gateway.
Returns: str: On success: "Device () is reachable after Ns." plus a JSON summary (reachability_state, operational_state, dg_name, errors). On timeout (NOT an error): "Not reachable yet after Ns; current reachability_state=..., operational_state=..." plus the same summary — call again to keep waiting, or inspect 'errors' / dg_name. "Error: ..." only for API failures or when no device matches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | No | Device uuid (from cnc_create_device's impacted_objects). | |
| host_name | No | Device host name, exact match (e.g. 'PE1'). | |
| timeout_seconds | No | How long to wait in total (e.g. 180). | |
| interval_seconds | No | Seconds between polls (e.g. 10). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |