Skip to main content

Overview

The Xloud Networking API provides full programmatic control over virtual network resources — networks, subnets, routers, ports, security groups, floating IPs, and QoS policies. The API uses a RESTful design with JSON bodies and project-scoped resource isolation.
Prerequisites
  • A valid project-scoped token from the Identity API
  • Base URL: https://api.<your-domain>/networking/v2.0
  • Network resources are project-isolated by default — shared resources are admin-managed

Key Endpoints

ResourceMethodEndpointDescription
List networksGET/networksList networks visible to the project
Create networkPOST/networksCreate a new tenant network
Get networkGET/networks/{id}Get network details
Delete networkDELETE/networks/{id}Delete a network
List subnetsGET/subnetsList subnets in the project
Create subnetPOST/subnetsCreate a subnet on a network
List routersGET/routersList routers in the project
Create routerPOST/routersCreate a new router
Add interfacePUT/routers/{id}/add_router_interfaceAttach subnet to router
Remove interfacePUT/routers/{id}/remove_router_interfaceDetach subnet from router
List portsGET/portsList all ports
Create portPOST/portsCreate a network port
List security groupsGET/security-groupsList security groups
Create security groupPOST/security-groupsCreate a security group
Add SG rulePOST/security-group-rulesAdd a rule to a security group
List floating IPsGET/floatingipsList floating IP allocations
Create floating IPPOST/floatingipsAllocate a floating IP
Associate floating IPPUT/floatingips/{id}Associate with a port
List QoS policiesGET/qos/policiesList QoS policies (admin)
Create QoS policyPOST/qos/policiesCreate a QoS policy (admin)

Create a Network and Subnet

curl -X POST https://api.<your-domain>/networking/v2.0/networks \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "network": {
      "name": "app-network",
      "admin_state_up": true
    }
  }'
{
  "network": {
    "id": "d4e5f6a7-b8c9-0123-d4e5-f6a7b8c90123",
    "name": "app-network",
    "status": "ACTIVE",
    "admin_state_up": true,
    "subnets": [],
    "shared": false,
    "tenant_id": "abc123"
  }
}

Routers

Create a router with external gateway
curl -X POST https://api.<your-domain>/networking/v2.0/routers \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "router": {
      "name": "app-router",
      "admin_state_up": true,
      "external_gateway_info": {
        "network_id": "<external-network-id>"
      }
    }
  }'

Security Groups

Create a security group
curl -X POST https://api.<your-domain>/networking/v2.0/security-groups \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "security_group": {
      "name": "web-servers",
      "description": "Allow HTTP/HTTPS and SSH inbound"
    }
  }'
Allow SSH inbound (TCP 22)
curl -X POST https://api.<your-domain>/networking/v2.0/security-group-rules \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "security_group_rule": {
      "security_group_id": "<sg-id>",
      "direction": "ingress",
      "protocol": "tcp",
      "port_range_min": 22,
      "port_range_max": 22,
      "remote_ip_prefix": "0.0.0.0/0"
    }
  }'
Allow HTTPS inbound (TCP 443)
curl -X POST https://api.<your-domain>/networking/v2.0/security-group-rules \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "security_group_rule": {
      "security_group_id": "<sg-id>",
      "direction": "ingress",
      "protocol": "tcp",
      "port_range_min": 443,
      "port_range_max": 443,
      "remote_ip_prefix": "0.0.0.0/0"
    }
  }'
Security group rule parameters:
ParameterValuesDescription
directioningress, egressTraffic direction
protocoltcp, udp, icmp, nullIP protocol
port_range_min165535Start of port range
port_range_max165535End of port range
remote_ip_prefixCIDR e.g. 10.0.0.0/8Source or destination IP range
remote_group_idSecurity group IDAllow traffic from another group

Floating IPs

Allocate a floating IP from external network
curl -X POST https://api.<your-domain>/networking/v2.0/floatingips \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "floatingip": {
      "floating_network_id": "<external-network-id>"
    }
  }'
Associate floating IP with a port
curl -X PUT https://api.<your-domain>/networking/v2.0/floatingips/{floatingip_id} \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "floatingip": {
      "port_id": "<instance-port-id>"
    }
  }'
Disassociate floating IP (keep allocated)
curl -X PUT https://api.<your-domain>/networking/v2.0/floatingips/{floatingip_id} \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "floatingip": { "port_id": null } }'
Release floating IP back to the pool
curl -X DELETE https://api.<your-domain>/networking/v2.0/floatingips/{floatingip_id} \
  -H "X-Auth-Token: $OS_TOKEN"

Ports

network_id
string
required
Network ID to create the port on.
name
string
Display name for the port.
fixed_ips
array
List of objects specifying subnet_id and optionally a specific ip_address.
security_groups
array
List of security group IDs to apply to this port.
Create a port with specific IP
curl -X POST https://api.<your-domain>/networking/v2.0/ports \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "port": {
      "network_id": "<network-id>",
      "name": "db-port",
      "fixed_ips": [
        { "subnet_id": "<subnet-id>", "ip_address": "192.168.10.50" }
      ],
      "security_groups": ["<sg-id>"]
    }
  }'

Network Resource Status

StatusMeaning
ACTIVEResource is operational
DOWNResource exists but is not passing traffic
BUILDResource is being provisioned
ERRORProvisioning or operation failed

Next Steps

Compute API

Launch instances connected to the networks you create

Network QoS

Apply bandwidth limits and DSCP marking via the QoS API

Identity API

Manage project membership and resource access

Automation

Script full network topology provisioning end-to-end