Skip to main content

Manage Networks

Create and manage virtual networks to isolate and connect your infrastructure.

Base URL: https://cloud.octosinfra.com/backend/api


Create a virtual network

curl -X POST "https://cloud.octosinfra.com/backend/api/networks" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "name=my-private-network" \
-F "cloud_provider=alto" \
-F "region=frankfurt" \
-F "project=default-126" \
-F "description=Private network for backend services"

Response:

{
"status": "Success",
"message": "Creating network!",
"data": {
"name": "my-private-network",
"slug": "my-private-network",
"service_name": "Network"
}
}

List all networks

curl -X GET "https://cloud.octosinfra.com/backend/api/networks?include=project,ipaddresses,region,parentable" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"

Attach a network to a VM

curl -X POST "https://cloud.octosinfra.com/backend/api/virtual-machines/{VIRTUAL_MACHINE_SLUG}/attach-network" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "network=my-private-network"

Detach a network from a VM

curl -X POST "https://cloud.octosinfra.com/backend/api/virtual-machines/{VIRTUAL_MACHINE_SLUG}/detach-network" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "network=my-private-network"

Endpoint reference

ActionMethodEndpoint
List networksGET/networks
Create networkPOST/networks
List subnetsGET/networks/{SLUG}/subnet
Create subnetPOST/networks/{SLUG}/subnet
Delete subnetDELETE/networks/{SLUG}/subnet/{SUBNET_ID}
List portsGET/networks/{SLUG}/ports
Delete portDELETE/networks/{SLUG}/ports/{PORT_ID}
List network categoriesGET/network/categories
Attach network to VMPOST/virtual-machines/{SLUG}/attach-network
Detach network from VMPOST/virtual-machines/{SLUG}/detach-network