The Networks API lets you create and manage public networks. A public network allows multiple servers to be connected to the same network and have internet access. BMC servers can have multiple public networks with multiple public IP blocks.
All API requests in this guide are relative to:
https://api.phoenixnap.com/networks/v1Code language: HTTP (http)
Prerequisites
BMC API access token with the bmc scope (see API credentials).
Create a Public Network
Send a POST request to:
POST /public-networksCode language: HTTP (http)
Include the network name and location in the request body. Optional parameters include the description, IDs of previously purchased IP blocks, and the route advertisement boolean (for IPv6). For example:
{
"name": "my-public-network",
"location": "PHX",
"description": "My public network",
"ipBlocks": [
{
"id": "[IP_BLOCK_ID]"
}
]
"raEnabled": false
}Code language: JSON / JSON with Comments (json)
Note
Public networks do not have a default-network designation. Accounts can create a limited number of networks. See quotas and limits for more details.
Find out more
View Public Networks
To view all public networks, send a GET request to:
GET /public-networksCode language: HTTP (http)
Filter the results by location using the location query parameter:
GET /public-networks?location=PHXCode language: HTTP (http)
To view a specific public network, send a GET request to:
GET /public-networks/[PUBLIC_NETWORK_ID]Code language: HTTP (http)
Replace [PUBLIC_NETWORK_ID] with the public network's ID.
Find out more
Networks API - GET /public-networks
Networks API - GET /public-networks/[PUBLIC_NETWORK_ID]
Update a Public Network
Send a PATCH request to:
PATCH /public-networks/[PUBLIC_NETWORK_ID]Code language: HTTP (http)
Replace [PUBLIC_NETWORK_ID] with the network you want to update. For example, update a network's name and description:
{
"name": "updated-public-network",
"description": "Updated public network description"
}Code language: JSON / JSON with Comments (json)
You can also update the raEnabled field, which controls whether route advertisement is enabled for IPv6 blocks.
Assign a Public IP Block
Send a POST request to:
POST /public-networks/[PUBLIC_NETWORK_ID]/ip-blocksCode language: HTTP (http)
Specify the IP block ID in the request body:
{
"id": "[IP_BLOCK_ID]"
}Code language: JSON / JSON with Comments (json)
The following requirements apply:
- The IP block must not be in use by another resource (network or server).
- The IP block and public network must be in the same location.
- IPv4 block sizes must range from /29 to /22.
- IPv6 block size is /64.
- A public network can have up to 10 IPv4 blocks and one IPv6 block.
Remove a Public IP Block
Send a DELETE request to:
DELETE /public-networks/[PUBLIC_NETWORK_ID]/ip-blocks/[IP_BLOCK_ID]Code language: HTTP (http)
If a resource is using an IP address from the block, the request fails by default. To force removal, see Advanced Network Configuration.
Delete a Public Network
Warning
A deleted network cannot be retrieved.
Send a request to:
DELETE /public-networks/[PUBLIC_NETWORK_ID]Code language: HTTP (http)
The following restrictions apply:
- You can delete a public network only when no resources are attached to it.
- Deleting a network does not remove the associated IP blocks from your account. The blocks become unassigned and remain available for reuse.