List subnets
const options = {method: 'GET'};
fetch('https://api.example.com/v1/regions/{region}/compute/subnets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/regions/{region}/compute/subnets"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request GET \
--url https://api.example.com/v1/regions/{region}/compute/subnetsimport requests
url = "https://api.example.com/v1/regions/{region}/compute/subnets"
response = requests.get(url)
print(response.text){
"success": true,
"data": [
{
"id": "<string>",
"name": "<string>",
"networkId": "<string>",
"cidr": "<string>",
"status": "active",
"gateway": "<string>",
"availableIps": 123,
"createdAt": "2023-11-07T05:31:56Z"
}
]
}Networks
List subnets
List network subnets for IP mapping
GET
/
v1
/
regions
/
{region}
/
compute
/
subnets
List subnets
const options = {method: 'GET'};
fetch('https://api.example.com/v1/regions/{region}/compute/subnets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/regions/{region}/compute/subnets"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request GET \
--url https://api.example.com/v1/regions/{region}/compute/subnetsimport requests
url = "https://api.example.com/v1/regions/{region}/compute/subnets"
response = requests.get(url)
print(response.text){
"success": true,
"data": [
{
"id": "<string>",
"name": "<string>",
"networkId": "<string>",
"cidr": "<string>",
"status": "active",
"gateway": "<string>",
"availableIps": 123,
"createdAt": "2023-11-07T05:31:56Z"
}
]
}Was this page helpful?