User Guide
Reference
API Reference
API endpoints
REST
RESTful
API operations
API payloads
Network service API reference
See https://docs.openstack.org/api-ref/network/ .
In these methods, {network_id}
, {subnet_id}
, {port_id}
, {router_id}
, and {floatingip_id}
are placeholders that should be replaced with the actual IDs of the respective resources. These methods allow you to manage networks, subnets, ports, routers, and floating IPs in the Network service.
List networks
Show network details
Bash GET /v2.0/networks/{ network_id}
Create a network
JSON {
"network" : {
"name" : "network_name" ,
"admin_state_up" : true
}
}
Update a network
Bash PUT /v2.0/networks/{ network_id}
Request body
JSON {
"network" : {
"name" : "new_network_name"
}
}
Delete a network
Bash DELETE /v2.0/networks/{ network_id}
List subnets
Show subnet details
Bash GET /v2.0/subnets/{ subnet_id}
Create a subnet
Request body
JSON {
"subnet" : {
"network_id" : "network_id" ,
"ip_version" : 4 ,
"cidr" : "192.168.1.0/24"
}
}
Update a subnet
Bash PUT /v2.0/subnets/{ subnet_id}
Request body
JSON {
"subnet" : {
"name" : "new_subnet_name"
}
}
Delete a subnet
Bash DELETE /v2.0/subnets/{ subnet_id}
List ports
Show port details
Bash GET /v2.0/ports/{ port_id}
Create a port
Request body
JSON {
"port" : {
"network_id" : "network_id" ,
"admin_state_up" : true
}
}
Update a port
Bash PUT /v2.0/ports/{ port_id}
Request body
JSON {
"port" : {
"name" : "new_port_name"
}
}
Delete a port
Bash - ` DELETE /v2.0/ports/{ port_id} `
### List routers
``` bash
GET /v2.0/routers
Show router details
Bash GET /v2.0/routers/{ router_id}
Create a router
Request body
JSON {
"router" : {
"name" : "router_name" ,
"admin_state_up" : true
}
}
Update a router
Bash PUT /v2.0/routers/{ router_id}
Request body
JSON {
"router" : {
"name" : "new_router_name"
}
}
Delete a router
Bash DELETE /v2.0/routers/{ router_id}
Add interface to router
Bash PUT /v2.0/routers/{ router_id} /add_router_interface
Request body
JSON {
"subnet_id" : "subnet_id"
}
Remove interface from router
Bash PUT /v2.0/routers/{ router_id} /remove_router_interface
Request body
JSON {
"subnet_id" : "subnet_id"
}
List floating IPs
Bash GET /v2.0/floatingips
Show floating IP details
Bash GET /v2.0/floatingips/{ floatingip_id}
Create a floating IP
Text Only POST /v2.0/floatingips
Request body
JSON {
"floatingip" : {
"floating_network_id" : "public_network_id"
}
}
Update a floating IP
Bash PUT /v2.0/floatingips/{ floatingip_id}
Request body
JSON {
"floatingip" : {
"port_id" : "port_id"
}
}
Delete a floating IP
Text Only DELETE /v2.0/floatingips/{floatingip_id}
March 7, 2024 at 9:24 PM
March 4, 2024 at 6:26 PM