Compute API
The ThreatWinds Compute API provides compute instance management capabilities powered by Google Cloud Platform. It enables creating, listing, and managing virtual machine instances with power control operations.
Overview
ThreatWinds Compute API allows you to:
| Feature | Description | Documentation |
|---|---|---|
| Instance Management | Create, list, get, and delete compute instances | Instances |
| Power Management | Start, stop, restart, and reset instances | Instances |
Authentication
The Compute API supports two authentication methods:
| Authentication Method | Description |
|---|---|
| Bearer Token | Session-based authentication using Authorization: Bearer <token> header |
| API Key | API key authentication using api-key and api-secret headers |
For details on how to obtain authentication credentials, see the Authentication section.
API Endpoints
The base URL for the Compute API is:
https://apis.threatwinds.com/api/compute/v1
For detailed information about each endpoint, please refer to the specific documentation pages.
Error Response Headers
All error responses include the following custom headers:
| Header | Description |
|---|---|
| x-error | Human-readable error message describing what went wrong |
| x-error-id | Unique MD5 hash identifier for error tracking and support |
Error Codes
| Status Code | Description | Possible Cause |
|---|---|---|
| 200 | OK | Request successful (GET operations) |
| 201 | Created | Instance created successfully |
| 202 | Accepted | Power operation initiated successfully |
| 204 | No Content | Instance deleted successfully |
| 400 | Bad Request | Invalid parameters, malformed JSON, or validation error |
| 401 | Unauthorized | Missing or invalid authentication credentials |
| 403 | Forbidden | Quota exceeded (CreateInstance only) |
| 429 | Too Many Requests | Rate limit exceeded |
| 404 | Not Found | Instance or template not found |
| 500 | Internal Server Error | GCP operation failed or server-side error |
Rate Limiting and Quotas
The Compute API enforces both rate limits and resource quotas:
- Rate limits control how many requests you can make per minute for each operation type
- Resource quotas control the maximum number of concurrent instances based on your subscription tier
Use the Billing API to check your current limits, quotas, and usage.
Common Workflows
Creating an Instance
- User sends
POST /instanceswith template and config IDs - System validates the template and network configuration
- Instance is provisioned on Google Cloud Platform
- Instance record is saved with
PROVISIONINGstatus - Instance transitions to
RUNNINGonce provisioning completes
Managing Instance Lifecycle
- Stop: Graceful shutdown of a running instance via
POST /instances/:id/stop - Start: Resume a stopped instance via
POST /instances/:id/start - Restart: Hard reset via
POST /instances/:id/restart - Reset: Hard reset (like pressing the reset button) via
POST /instances/:id/reset - Delete: Terminate and remove the instance via
DELETE /instances/:id