Skip to content

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 ​

GET/v1/workspaces/{wid}/vpcsSearch VPCs in a workspace

Lists the VPCs in a workspace, with pagination.

Path parameters

NameTypeDescription
widstringWorkspace ID

All path parameters are required. All query parameters are optional.

Query parameters

NameTypeDescription
qstringQuick search by name or ID
idstring[]Filter to specific VPC IDs
namestringFilter by name
descriptionstringFilter by description

Plus the shared pagination parameters. Returns a paged list of VPC objects.

Create a VPC ​

POST/v1/workspaces/{wid}/vpcsCreate a VPC

Creates a new VPC. Responds 201 Created with the VPC object.

Path parameters

NameTypeDescription
widstringWorkspace ID

Request body

FieldTypeRequiredDescription
namestringyesDisplay name, 4 to 32 characters
descriptionstringyesDescription, up to 240 characters
rangestringnoPrivate 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.
bash
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 ​

GET/v1/vpcs/{vid}Fetch VPC details

Path parameters

NameTypeDescription
vidstringVPC ID

Returns the full VPC object, with id, name, description, owner, normalized range, and nullable vni for the overlay network identifier.

Update a VPC ​

PATCH/v1/vpcs/{vid}Update a VPC

Updates the name or description of a VPC. Every field is optional. Send only what you are changing. Null values leave fields unchanged.

Path parameters

NameTypeDescription
vidstringVPC ID

Request body

FieldTypeDescription
namestring or nullNew name, 4 to 32 characters
descriptionstring or nullNew description, up to 240 characters

Returns the updated VPC object.

Delete a VPC ​

DELETE/v1/vpcs/{vid}Delete a VPC

Deletes the VPC. Fails if any instance is still attached.

Path parameters

NameTypeDescription
vidstringVPC ID

Returns 200 OK with a WorkflowData object. Poll the workflow as described under Asynchronous operations.

List instances in a VPC ​

GET/v1/vpcs/{vid}/instancesList instances attached to a VPC

Returns the instances currently attached to the VPC, with pagination.

Path parameters

NameTypeDescription
vidstringVPC ID

All path parameters are required. All query parameters are optional.

Query parameters

NameTypeDescription
qstringQuick 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 ​

GET/v1/instances/{iid}/vpcsList VPCs attached to an instance

Returns the VPCs currently attached to an instance, with pagination.

Path parameters

NameTypeDescription
iidstringInstance ID

All path parameters are required. All query parameters are optional.

Query parameters

NameTypeDescription
qstringQuick 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 ​

POST/v1/instances/{iid}/vpcsAttach a VPC to an instance

Attaches 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

NameTypeDescription
iidstringInstance ID

Request body

FieldTypeRequiredDescription
vpcstringyesVPC ID to attach

Returns 201 Created with a WorkflowData object for the queued network update. See Asynchronous operations.

Detach a VPC from an instance ​

DELETE/v1/instances/{iid}/vpcs/{vid}Detach a VPC from an instance

Removes the attachment between an instance and a VPC, freeing the private address.

Path parameters

NameTypeDescription
iidstringInstance ID
vidstringVPC ID

Returns 200 OK with a WorkflowData object. Poll the workflow as described under Asynchronous operations.