# External REST API Specification # # This is the specification of the REST API that needs to be supported # by the network ctrl for QuantumRestProxy to work correctly # # v1.1 # "state" maps to Quantum "admin_state_up" # "op-status maps to Quantum "status" (which is the operational status) # Create Network POST /quantum/v1.1/tenants/:tenant/networks { "network": { "id": "158233b0-ca9a-40b4-8614-54a4a99d47d1", "name": "test_network", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "state": "UP", "gateway": "" } } # Update Network - entries to update (like name/gateway are optional) PUT /quantum/v1.1/tenants/:tenant/networks/:network { "network": { "id": "158233b0-ca9a-40b4-8614-54a4a99d47d1", "name": "test_create_network", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "gateway": "10.0.0.1", "state": "UP", "subnets": [ { "id": "118233b0-ca9a-40b4-8614-54a4a99d47e1", "name": "test_subnet_1", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "cidr": "10.0.1.0/24", "gateway_ip": "10.0.1.1", "state": "UP", }, { "id": "128233b0-ca9a-40b4-8614-54a4a99d47e1", "name": "test_subnet_2", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "cidr": "10.10.1.0/24", "gateway_ip": "10.10.1.1", "state": "UP", }, ] } } # Delete Network DELETE /quantum/v1.1/tenants/:tenant/networks/:network # Create Port POST /quantum/v1.1/tenants/:tenant/networks/:network/ports { "port": { "id": "158233b0-ca9a-40b4-8614-54a4a99d47e1", "name": "test_port", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "state": "DOWN", } } # Update Port - entries to update (like state are optional) PUT /quantum/v1.1/tenants/:tenant/networks/:network/ports/:port { "port": { "id": "158233b0-ca9a-40b4-8614-54a4a99d47e1", "name": "test_new_port", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "state": "UP", } } # Delete Port DELETE /quantum/v1.1/tenants/:tenant/networks/:network/ports/:port # Create Attachment PUT /quantum/v1.1/tenants/:tenant/networks/:network/ports/:port/attachment { "attachment": { "id": "158233b0-ca9a-40b4-8614-54a4a99d47f1", "mac": "01:02:03:04:05:06" } } # Delete Attachment DELETE /quantum/v1.1/tenants/:tenant/networks/:network/ports/:port/attachment # Create Router POST /quantum/v1.1/tenants/:tenant/routers { "router": { "id": "158233b0-ca9a-40b4-8614-54a4a99d47d1", "name": "test_router", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "state": "DOWN", } } # Update Router - entries to update (like name) PUT /quantum/v1.1/tenants/:tenant/routers/:router { "router": { "id": "158233b0-ca9a-40b4-8614-54a4a99d47d1", "name": "test_new_router", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "state": "UP", } } # Delete Router DELETE /quantum/v1.1/tenants/:tenant/routers/:router # Add interface to router POST /quantum/v1.1/tenants/:tenant/routers/:router/interfaces { "interface": { "id": "158233b0-ca9a-40b4-8614-54a4a99d47d1", "network": { "id": "158233b0-ca9a-40b4-8614-54a4a99d47d1", "name": "test_network", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "gateway": "10.0.0.1", "state": "UP", } "subnet": { "id": "258233b0-ca9a-40b4-8614-54a4a99d47d1", "name": "test_subnet_1", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "cidr": "10.0.1.0/24", "gateway_ip": "10.0.1.1", "state": "UP", } } } # Delete Interface DELETE /quantum/v1.1/tenants/:tenant/routers/:router/interfaces/:interface # Send complete current topology to network ctrl PUT /quantum/v1.1/topology { "networks": [ { "gateway": "10.0.0.1", "id": "1e074fa0-bf8e-4e97-94cd-c6960455b04c", "name": "net1", "ports": [ { "attachment": { "id": "02b6c20d-5da1-402a-b8ac-8fb38dfbd46300", "mac": "12:34:56:78:ae:00" }, "device_id": "8212589b-68e6-4c6d-8bb1-955c5daeb111", "device_owner": "network:router_interface", "fixed_ips": [ { "ip_address": "10.0.0.1", "subnet_id": "0615bedf-db66-483b-a409-5513a88c15ab" } ], "id": "02b6c20d-5da1-402a-b8ac-8fb38dfbd463", "mac_address": "12:34:56:78:ae:00", "name": "", "network_id": "1e074fa0-bf8e-4e97-94cd-c6960455b04c", "state": "UP", "tenant_id": "test-tenant" } ], "shared": false, "state": "UP", "subnets": [ { "allocation_pools": [ { "end": "10.0.0.254", "start": "10.0.0.2" } ], "cidr": "10.0.0.0/24", "dns_nameservers": [], "enable_dhcp": true, "gateway_ip": "10.0.0.1", "host_routes": [], "id": "0615bedf-db66-483b-a409-5513a88c15ab", "ip_version": 4, "name": "", "network_id": "1e074fa0-bf8e-4e97-94cd-c6960455b04c", "shared": false, "tenant_id": "test-tenant" } ], "tenant_id": "test-tenant" }, { "gateway": "10.0.10.1", "id": "9aeed0c7-8efa-445d-bc3d-e999952604dc", "name": "net1", "ports": [ { "attachment": { "id": "9ec3db2a-3eb9-496d-98f1-25985fab41cc00", "mac": "12:34:56:78:90:60" }, "device_id": "6d3aa772-1d97-4f39-8bbe-efb4e73a452e", "device_owner": "network:router_interface", "fixed_ips": [ { "ip_address": "10.0.10.1", "subnet_id": "cbea34ab-8d8d-450b-8db4-c261f52bcbd5" } ], "id": "9ec3db2a-3eb9-496d-98f1-25985fab41cc", "mac_address": "12:34:56:78:90:60", "name": "", "network_id": "9aeed0c7-8efa-445d-bc3d-e999952604dc", "state": "UP", "tenant_id": "test-tenant" } ], "shared": false, "state": "UP", "subnets": [ { "allocation_pools": [ { "end": "10.0.10.254", "start": "10.0.10.2" } ], "cidr": "10.0.10.0/24", "dns_nameservers": [], "enable_dhcp": true, "gateway_ip": "10.0.10.1", "host_routes": [], "id": "cbea34ab-8d8d-450b-8db4-c261f52bcbd5", "ip_version": 4, "name": "", "network_id": "9aeed0c7-8efa-445d-bc3d-e999952604dc", "shared": false, "tenant_id": "test-tenant" } ], "tenant_id": "test-tenant" } ], "routers": [ { "external_gateway_info": null, "id": "8212589b-68e6-4c6d-8bb1-955c5daeb111", "interfaces": [ { "id": "1e074fa0-bf8e-4e97-94cd-c6960455b04c", "network": { "gateway": "10.0.0.1", "id": "1e074fa0-bf8e-4e97-94cd-c6960455b04c", "name": "net1", "shared": false, "state": "UP", "subnets": [ { "allocation_pools": [ { "end": "10.0.0.254", "start": "10.0.0.2" } ], "cidr": "10.0.0.0/24", "dns_nameservers": [], "enable_dhcp": true, "gateway_ip": "10.0.0.1", "host_routes": [], "id": "0615bedf-db66-483b-a409-5513a88c15ab", "ip_version": 4, "name": "", "network_id": "1e074fa0-bf8e-4e97-94cd-c6960455b04c", "shared": false, "tenant_id": "test-tenant" } ], "tenant_id": "test-tenant" }, "subnet": { "allocation_pools": [ { "end": "10.0.0.254", "start": "10.0.0.2" } ], "cidr": "10.0.0.0/24", "dns_nameservers": [], "enable_dhcp": true, "gateway_ip": "10.0.0.1", "host_routes": [], "id": "0615bedf-db66-483b-a409-5513a88c15ab", "ip_version": 4, "name": "", "network_id": "1e074fa0-bf8e-4e97-94cd-c6960455b04c", "shared": false, "tenant_id": "test-tenant" } } ], "name": "router1", "state": "UP", "tenant_id": "d999c7a7-00d2-4a25-b12e-84c50039dad2" }, { "external_gateway_info": null, "id": "6d3aa772-1d97-4f39-8bbe-efb4e73a452e", "interfaces": [ { "id": "9aeed0c7-8efa-445d-bc3d-e999952604dc", "network": { "gateway": "10.0.10.1", "id": "9aeed0c7-8efa-445d-bc3d-e999952604dc", "name": "net1", "shared": false, "state": "UP", "subnets": [ { "allocation_pools": [ { "end": "10.0.10.254", "start": "10.0.10.2" } ], "cidr": "10.0.10.0/24", "dns_nameservers": [], "enable_dhcp": true, "gateway_ip": "10.0.10.1", "host_routes": [], "id": "cbea34ab-8d8d-450b-8db4-c261f52bcbd5", "ip_version": 4, "name": "", "network_id": "9aeed0c7-8efa-445d-bc3d-e999952604dc", "shared": false, "tenant_id": "test-tenant" } ], "tenant_id": "test-tenant" }, "subnet": { "allocation_pools": [ { "end": "10.0.10.254", "start": "10.0.10.2" } ], "cidr": "10.0.10.0/24", "dns_nameservers": [], "enable_dhcp": true, "gateway_ip": "10.0.10.1", "host_routes": [], "id": "cbea34ab-8d8d-450b-8db4-c261f52bcbd5", "ip_version": 4, "name": "", "network_id": "9aeed0c7-8efa-445d-bc3d-e999952604dc", "shared": false, "tenant_id": "test-tenant" } } ], "name": "router1", "state": "UP", "tenant_id": "d999c7a7-00d2-4a25-b12e-84c50039dad2" } ] } # # Reads are not required to implemented by the network ctrl since they are # handled the proxy plugin locally. The following is provided as an optional # interface that can be implemented by the network ctrl for debug/support # # Read Networks GET /quantum/v1.1/tenants/:tenant/networks/:network { "network": { "id": "158233b0-ca9a-40b4-8614-54a4a99d47d1", "name": "test_network_1", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "op-status": "ACTIVE" } } GET /quantum/v1.1/tenants/:tenant/networks/:network/detail { "network": { "id": "158233b0-ca9a-40b4-8614-54a4a99d47d1", "name": "test_network_1", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "op-status": "ACTIVE" "gateway": "10.0.1.1", "ports": [ { "id": "158233b0-ca9a-40b4-8614-54a4a99d47e1", "name": "test_port_1", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "op-status": "UP", "attachment": { "id": "158233b0-ca9a-40b4-8614-54a4a99d4701", "mac": "01:02:03:00:00:01" } }, { "id": "158233b0-ca9a-40b4-8614-54a4a99d47e2", "name": "test_port_2", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "op-status": "UP", "attachment": { "id": "158233b0-ca9a-40b4-8614-54a4a99d4702", "mac": "01:02:03:00:00:02" } } ] } } # Read Ports GET /quantum/v1.1/tenants/:tenant/networks/:network/ports/:port { "port": { "id": "158233b0-ca9a-40b4-8614-54a4a99d47e1", "name": "test_port", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "op-status": "UP" } } GET /quantum/v1.1/tenants/:tenant/networks/:network/ports/:port/detail { "port": { "id": "158233b0-ca9a-40b4-8614-54a4a99d47e1", "name": "test_port", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "op-status": "UP", "attachment": { "id": "158233b0-ca9a-40b4-8614-54a4a99d4701", "mac": "01:02:03:00:00:01" } } } # Read Routers GET /quantum/v1.1/tenants/:tenant/routers/:router { "router": { "id": "158233b0-ca9a-40b4-8614-54a4a99d47d1", "name": "test_router_1", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "op-status": "ACTIVE" } GET /quantum/v1.1/tenants/:tenant/routers/:router/detail { "router": { "id": "158233b0-ca9a-40b4-8614-54a4a99d47d1", "name": "test_router_1", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "op-status": "ACTIVE", "interfaces": [ { "id": "158233b0-ca9a-40b4-8614-54a4a99d47e1", "network": { "id": "158233b0-ca9a-40b4-8614-54a4a99d47d1", "name": "test_network", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "op-status": "ACTIVE", "gateway": "10.0.0.1", } "subnet": { "id": "158233b0-ca9a-40b4-8614-54a4a99d4701", "name": "test_subnet_1", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "op-status": "ACTIVE", "cidr": "10.0.1.0/24", "gateway_ip": "10.0.1.1", } }, { "id": "158233b0-ca9a-40b4-8614-54a4a99d47e2", "network": { "id": "258233b0-ca9a-40b4-8614-54a4a99d47d1", "name": "test_network2", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "op-status": "ACTIVE", "gateway": "10.10.0.1", } "subnet": { "id": "158233b0-ca9a-40b4-8614-54a4a99d4702", "name": "new_subnet_1", "tenant_id": "a58233b0-ca9a-40b4-8614-54a4a99d47d1", "op-status": "ACTIVE", "cidr": "10.10.1.0/24", "gateway_ip": "10.10.1.1", } } ] } }