Create a server
We provision customer servers by placing a package order. Direct instance creation is staff-only. The public creation endpoint is:
POST /v1/workspaces/{wid}/ordersChoose a package and image
Read List packages and Get a package to choose a SERVER package. Inspect its fixed and open fields. Supply any required open values in the item's spec, with kind: "SERVER". Package specs use ram in MiB and disk in GiB.
Choose a template or backup from Images. A server purchase requires properties containing kind: "SERVER" and the image ID. Identifiers are strings.
Place the order
The caller needs the workspace admin role. We bill the workspace owner's account. This example assumes the selected package fixes all required server fields. Replace the package code and image ID with available values.
curl -X POST "https://api.galaxygate.net/v1/workspaces/$WORKSPACE_ID/orders" \
-H "Authorization: Bearer $GALAXYGATE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"kind": "PURCHASE",
"items": [{
"package_code": "vps-small",
"resource_name": "web-01",
"properties": { "kind": "SERVER", "image": "1447636552321908736" }
}]
}'See Place an order for all request fields and server spec options.
Complete collection and follow provisioning
We return 200 OK with CreateOrderResponse, containing order, authorized, collection, and nullable invoice_id. This response is not a workflow.
NONE: no collection is required.IN_FLIGHT: a stored payment method is being charged.REQUIRED: open checkout for the invoice through Open a checkout.APPROVAL_REQUIRED: the workspace owner must approve the order.OWNER_REQUIRED: the account owner must complete collection.
Prepaid fixed packages provision after payment. Postpaid purchases require consolidated billing. Postpaid and metered-only orders collect nothing up front. Read Get an order to follow its status and use Search instances to find the new server.
Fetch the instance at GET /v1/instances/{iid}. Its state becomes AVAILABLE after provisioning, or FAILED on failure. Read live online state separately. Back off when requests return 429 Too Many Requests.
Remove the server
Read the instance's billing subject ID, then follow Cancel a purchase:
POST /v1/subjects/{sid}/cancelWe return 200 OK with SubjectView and stop billing. Save required data before cancellation. For a purchase not yet delivered, cancel its order instead.
Next step
Read Power controls or Run code with cloud-init.