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

  1. User sends POST /instances with template and config IDs
  2. System validates the template and network configuration
  3. Instance is provisioned on Google Cloud Platform
  4. Instance record is saved with PROVISIONING status
  5. Instance transitions to RUNNING once provisioning completes

Managing Instance Lifecycle

  1. Stop: Graceful shutdown of a running instance via POST /instances/:id/stop
  2. Start: Resume a stopped instance via POST /instances/:id/start
  3. Restart: Hard reset via POST /instances/:id/restart
  4. Reset: Hard reset (like pressing the reset button) via POST /instances/:id/reset
  5. Delete: Terminate and remove the instance via DELETE /instances/:id

Table of contents