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
| Action | Method | Endpoint |
|---|---|---|
| List networks | GET | /networks |
| Create network | POST | /networks |
| List subnets | GET | /networks/{SLUG}/subnet |
| Create subnet | POST | /networks/{SLUG}/subnet |
| Delete subnet | DELETE | /networks/{SLUG}/subnet/{SUBNET_ID} |
| List ports | GET | /networks/{SLUG}/ports |
| Delete port | DELETE | /networks/{SLUG}/ports/{PORT_ID} |
| List network categories | GET | /network/categories |
| Attach network to VM | POST | /virtual-machines/{SLUG}/attach-network |
| Detach network from VM | POST | /virtual-machines/{SLUG}/detach-network |