VPCs
A VPC (Virtual Private Cloud) is a private Layer 2 network isolated to your workspace. Each VPC has a CIDR range from which the platform automatically allocates an address when you attach an instance. Attaching a VPC adds a second NIC to the instance. Detaching removes it. A VPC cannot be deleted while any instance is attached.
VPC names must be 4 to 32 characters. The optional range must be an RFC 1918 private IPv4 CIDR with a prefix length from /16 through /28. We normalize it to the network address. When omitted or blank, we assign a random 192.168.X.0/24 range.
All path parameters are required string IDs. Request bodies are required where shown.
See Workspaces and scope and Pagination for shared conventions.
Search VPCs
/v1/workspaces/{wid}/vpcsSearch VPCs in a workspaceLists the VPCs in a workspace, with pagination.
Path parameters
| Name | Type | Description |
|---|---|---|
wid | string | Workspace ID |
All path parameters are required. All query parameters are optional.
Query parameters
| Name | Type | Description |
|---|---|---|
q | string | Quick search by name or ID |
id | string[] | Filter to specific VPC IDs |
name | string | Filter by name |
description | string | Filter by description |
Plus the shared pagination parameters. Returns a paged list of VPC objects.
Create a VPC
/v1/workspaces/{wid}/vpcsCreate a VPCCreates a new VPC. Responds 201 Created with the VPC object.
Path parameters
| Name | Type | Description |
|---|---|---|
wid | string | Workspace ID |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Display name, 4 to 32 characters |
description | string | yes | Description, up to 240 characters |
range | string | no | Private IPv4 CIDR from /16 through /28, for example 10.0.0.0/24. Defaults to a random 192.168.X.0/24 when omitted or blank. |
curl -X POST https://api.galaxygate.net/v1/workspaces/42/vpcs \
-H "Authorization: Bearer $GALAXYGATE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "backend-net",
"description": "Internal backend network",
"range": "10.10.0.0/24"
}'Returns the created VPC object.
Fetch a VPC
/v1/vpcs/{vid}Fetch VPC detailsPath parameters
| Name | Type | Description |
|---|---|---|
vid | string | VPC ID |
Returns the full VPC object, with id, name, description, owner, normalized range, and nullable vni for the overlay network identifier.
Update a VPC
/v1/vpcs/{vid}Update a VPCUpdates the name or description of a VPC. Every field is optional. Send only what you are changing. Null values leave fields unchanged.
Path parameters
| Name | Type | Description |
|---|---|---|
vid | string | VPC ID |
Request body
| Field | Type | Description |
|---|---|---|
name | string or null | New name, 4 to 32 characters |
description | string or null | New description, up to 240 characters |
Returns the updated VPC object.
Delete a VPC
/v1/vpcs/{vid}Delete a VPCDeletes the VPC. Fails if any instance is still attached.
Path parameters
| Name | Type | Description |
|---|---|---|
vid | string | VPC ID |
Returns 200 OK with a WorkflowData object. Poll the workflow as described under Asynchronous operations.
List instances in a VPC
/v1/vpcs/{vid}/instancesList instances attached to a VPCReturns the instances currently attached to the VPC, with pagination.
Path parameters
| Name | Type | Description |
|---|---|---|
vid | string | VPC ID |
All path parameters are required. All query parameters are optional.
Query parameters
| Name | Type | Description |
|---|---|---|
q | string | Quick search by instance name or ID |
Plus the shared pagination parameters. Returns a paged list of VPC-instance membership objects, each containing id, instance, and ip_address.
List VPCs attached to an instance
/v1/instances/{iid}/vpcsList VPCs attached to an instanceReturns the VPCs currently attached to an instance, with pagination.
Path parameters
| Name | Type | Description |
|---|---|---|
iid | string | Instance ID |
All path parameters are required. All query parameters are optional.
Query parameters
| Name | Type | Description |
|---|---|---|
q | string | Quick search by VPC name or ID |
Plus the shared pagination parameters. Returns a paged list of VPC-instance membership objects with id, vpc, ip_address, and mac.
Attach a VPC to an instance
/v1/instances/{iid}/vpcsAttach a VPC to an instanceAttaches a VPC to an instance and automatically allocates a private address from the VPC range. Both the instance and the VPC must belong to the same workspace. Responds 201 Created.
Path parameters
| Name | Type | Description |
|---|---|---|
iid | string | Instance ID |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
vpc | string | yes | VPC ID to attach |
Returns 201 Created with a WorkflowData object for the queued network update. See Asynchronous operations.
Detach a VPC from an instance
/v1/instances/{iid}/vpcs/{vid}Detach a VPC from an instanceRemoves the attachment between an instance and a VPC, freeing the private address.
Path parameters
| Name | Type | Description |
|---|---|---|
iid | string | Instance ID |
vid | string | VPC ID |
Returns 200 OK with a WorkflowData object. Poll the workflow as described under Asynchronous operations.