This endpoint initiates a hard reboot command for a targeted Nova Series GPU virtual machine instance using its unique Instance ID.
Reboot an Instance - Overview
Nova Series Reboot API allows authenticated users to reboot specific Nova Instance using its instance ID.
This endpoint is useful for remotely restarting instances through API integrations, automation scripts, and custom infrastructure management applications without manually accessing the Dataoorts dashboard.
When the reboot request is accepted, the API returns a confirmation message along with the instance's public IP address.
Important Note: Rebooting an instance may temporarily interrupt running applications, active connections, and workloads. Ensure that the reboot is appropriate for the target instance before submitting the request.
Endpoint
| Property | Value |
|---|---|
| HTTP Method | POST |
| Endpoint | /nova/reboot |
| Full URL | https://cloud.dataoorts.com/api/v1/nova/reboot |
| Authentication | Bearer Token |
| Content Type | application/json |
| Response Format | JSON |
Authentication
This endpoint requires a valid Dataoorts Unify API key.
Include your API key in the Authorization header using the Bearer authentication scheme.
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Accept: application/jsonGenerate or manage your API key through the Dataoorts Unify API.
Keep your API key confidential and never expose it in public repositories or client-side applications.
Request Parameters
The request body must be sent as JSON.
| Parameter | Type | Required | Description |
|---|---|---|---|
instance_id | Integer | Yes | The ID of the Nova instance you want to reboot. |
Provide the ID of the intended instance. Verify the identifier before submitting the request.
Request Examples
cURL - Use the following command to reboot a Nova instance:
curl --request POST \
--url "https://cloud.dataoorts.com/api/v1/nova/reboot" \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data '{
"instance_id": 429
}'Replace YOUR_API_KEY and the example instance ID with your actual values.
Python Example Implementation
The following example uses the requests library to submit a reboot request and display the returned status, message, and public IP address.
Install the required dependency:
pip install requestsimport os
import requests
API_URL = "https://cloud.dataoorts.com/api/v1/nova/reboot"
def reboot_nova_instance(
api_key: str,
instance_id: int,
) -> dict:
"""
Send a reboot request for a Nova instance.
Args:
api_key: Your Dataoorts Unify API key.
instance_id: The ID of the instance to reboot.
Returns:
dict: The JSON response returned by the API.
Raises:
requests.exceptions.RequestException:
If the HTTP request fails or returns an unsuccessful
HTTP status code.
ValueError:
If the response cannot be decoded as JSON.
"""
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
"Accept": "application/json",
}
payload = {
"instance_id": instance_id,
}
response = requests.post(
API_URL,
headers=headers,
json=payload,
timeout=60,
)
response.raise_for_status()
try:
return response.json()
except requests.exceptions.JSONDecodeError as exc:
raise ValueError(
"The API returned an invalid JSON response."
) from exc
if __name__ == "__main__":
api_key = os.getenv("DATAOORTS_API_KEY")
if not api_key:
raise RuntimeError(
"Set the DATAOORTS_API_KEY environment variable."
)
try:
result = reboot_nova_instance(
api_key=api_key,
instance_id=429,
)
print("Status:", result.get("status"))
print("Message:", result.get("message"))
print("Public IP:", result.get("public_ip"))
except requests.exceptions.RequestException as exc:
print(f"API request failed: {exc}.")
except ValueError as exc:
print(f"Invalid API response: {exc}.")Set your API key before running the script.
Linux / macOS
export DATAOORTS_API_KEY="YOUR_API_KEY"
python reboot_instance.pyWindows PowerShell
$env:DATAOORTS_API_KEY="YOUR_API_KEY"
python reboot_instance.pyReplace 429 with the ID of the instance you want to reboot.
Example Success Response
When the reboot request succeeds, the API returns a JSON response similar to the following:
{
"message": "Instance reboot command sent successfully.",
"public_ip": "86.38.238.57",
"status": "success"
}The returned values depend on the instance and the result of the request.
Response Fields
| Field | Type | Description |
|---|---|---|
status | String | Indicates the result of the API request. A successful response returns success. |
message | String | A confirmation message indicating that the reboot command was sent successfully. |
public_ip | String | The public IP address returned for the instance. |
Understanding the Reboot Process
A successful response confirms that the API reports the reboot command as sent successfully. It does not necessarily mean that the instance has completed rebooting or is ready to accept connections.
After submitting the request:
- Dataoorts Nova API processes the reboot command.
- The instance may temporarily become unreachable while restarting.
- Once reboot completed, verify instance status & connectivity before relying on it for production workload.
Important Notes
1. Correct Instance ID: Verify the instance_id before submitting the request to ensure that the intended instance is rebooted.
2. Temporary Service Interruption: Rebooting may interrupt running applications, active sessions, and network connections.
3. Reboot Completion: The success response confirms that the command was sent. Check the instance status separately to determine when it is operational again.
4. Handling Timeouts: If the request times out or returns an error, the reboot command may still have been processed. Check the instance state before retrying to avoid unnecessary repeated reboot requests.
Error Handling
If the request fails, the API may return an unsuccessful HTTP status code and a JSON response containing an error message.
Your application should handle authentication failures, invalid instance IDs, network errors, request timeouts, server errors, and unexpected response formats. The exact error codes and response messages depend on the API response.
In Python, response.raise_for_status() raises an exception for unsuccessful HTTP status codes. Do not assume that every response contains the same fields as the successful response shown above.
Get Help and Support
For assistance with Nova instance reboots or API integration, contact the Dataoorts support team at [email protected].
