Skip to main content

watchCvmState

GET /cvms/{cvmId}/state (Server-Sent Events) Watches CVM state changes in real-time via Server-Sent Events (SSE). Resolves when the CVM reaches the target status; rejects on timeout or abort. Automatically retries on connection timeouts. Parameters: Options: Returns: CvmState — the final state when target is reached. Errors: Example — Wait for CVM to start:
Example — With abort support:
Unlike other SDK functions, watchCvmState does not have a safe variant. Use try/catch for error handling.