Use the Networks API to manage private networks for your Bare Metal Cloud (BMC) servers. You can create custom private IP address ranges, select a default network for each location, and manage the networks assigned to your servers.
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 Private Network
Send a POST request to:
POST /private-networksCode language: HTTP (http)
The request body requires a network name, location, whether to use the default network, and the network's CIDR. For example:
{
"name": "my-private-network",
"location": "PHX",
"locationDefault": false,
"cidr": "10.10.0.0/24",
"description": "My private network"
}Code language: JSON / JSON with Comments (json)
Replace the example values with your desired network configuration. Supported CIDR ranges are:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
Note
Each location has a default private network. The first network created for a location becomes the default network. The maximum total number of networks is limited. For more info, see quotas and limits.
Find out more
View Private Networks
To retrieve all private networks, send a GET request to:
GET /networks/v1/private-networksCode language: HTTP (http)
Include the location query parameter to filter the result:
GET /networks/v1/private-networks?location=PHXCode language: HTTP (http)
To view a specific private network, send request to:
GET /networks/v1/private-networks/[PRIVATE_NETWORK_ID]Code language: HTTP (http)
Replace [PRIVATE_NETWORK_ID] with the ID of the private network you want to view.
Find out more
Networks API - GET /private-networks
Networks API - GET /private-networks/[PRIVATE_NETWORK_ID]
Update a Private Network
To update a private network, send a PUT request to:
PUT /private-networks/[PRIVATE_NETWORK_ID]Code language: HTTP (http)
Replace [PRIVATE_NETWORK_ID] with the ID of the network you want to update.
You can update a network's name, description, and the locationDefault setting. The name must remain unique within the account. Only one network can be the default for a given location.
See the example request body:
{
"name": "updated-private-network",
"locationDefault": true,
"description": "Updated private network description"
}Code language: JSON / JSON with Comments (json)
Delete a Private Network
Warning
A deleted network cannot be retrieved.
Send a DELETE request to:
DELETE /private-networks/[PRIVATE_NETWORK_ID]Code language: HTTP (http)
Replace [PRIVATE_NETWORK_ID] with the ID of the network you want to delete.
The following restrictions apply:
- You cannot delete a private network while servers are assigned to it. Remove the servers from the network first.
- You cannot delete a default network if doing so would leave its location without a default network.
- If the default network is the only private network for its location, you can remove it for that location.