List Firewalls
curl -X GET "https://api.ubicloud.com/project/{project_id}/location/{location}/firewall" \
-H "Authorization: Bearer $API_KEY"
Path Parameters
The Ubicloud location/region
Response
Total number of firewalls
Array of firewall objects
Get Firewall Details
curl -X GET "https://api.ubicloud.com/project/{project_id}/location/{location}/firewall/{firewall_reference}" \
-H "Authorization: Bearer $API_KEY"
Response
ID of the firewallPattern: ^fw[0-9a-hj-km-np-tv-z]{24}$
Description of the firewall
Create Firewall
curl -X POST "https://api.ubicloud.com/project/{project_id}/location/{location}/firewall/{firewall_reference}" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "Production firewall"
}'
Body Parameters
Description of the firewall
Update Firewall
curl -X PATCH "https://api.ubicloud.com/project/{project_id}/location/{location}/firewall/{firewall_reference}" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "Updated production firewall"
}'
Body Parameters
New description for firewall
Delete Firewall
curl -X DELETE "https://api.ubicloud.com/project/{project_id}/location/{location}/firewall/{firewall_reference}" \
-H "Authorization: Bearer $API_KEY"
Returns a 204 No Content status code on successful deletion.
Create Firewall Rule
curl -X POST "https://api.ubicloud.com/project/{project_id}/location/{location}/firewall/{firewall_reference}/firewall-rule" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"cidr": "192.168.1.0/24",
"port_range": "80-443",
"description": "Allow HTTP/HTTPS traffic"
}'
Body Parameters
CIDR or private subnet id or name to allow
Description to use for the firewall rule
Attach Subnet to Firewall
curl -X POST "https://api.ubicloud.com/project/{project_id}/location/{location}/firewall/{firewall_reference}/attach-subnet" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"private_subnet_id": "pskkmx0f2vke4h36nk9cm8v8q0"
}'
Body Parameters
Private subnet id to attach
Detach Subnet from Firewall
curl -X POST "https://api.ubicloud.com/project/{project_id}/location/{location}/firewall/{firewall_reference}/detach-subnet" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"private_subnet_id": "pskkmx0f2vke4h36nk9cm8v8q0"
}'
Body Parameters
Private subnet id to detach