List a cloud's regions
/v1/clouds/{cloud}/regions Lists the regions (data centers) of a cloud where servers can be created. Pass a region's id as region when you create a server.
Your own servers (custom) have no regions here: the list is empty. A cloud that isn't open to your account, or that doesn't exist, answers 404 not_found.
Scopes
Any valid token can make this request.
Path parameters
| Field | Type and description |
|---|---|
cloud Required | string A cloud's id, as One of: |
Query parameters
| Field | Type and description |
|---|---|
limit | integer 1 to 100 Default How many items to return, from 1 to 100. Default 25. |
cursor | string 1 to 1,024 characters The |
sort | string Default The field to sort by. Each list names the fields it can be sorted by. One of: |
order | string Default
One of: |
Example request
curl "https://api.rabbitflare.com/v1/clouds/digitalocean/regions" \
-H "Authorization: Bearer $RABBITFLARE_TOKEN" const res = await fetch("https://api.rabbitflare.com/v1/clouds/digitalocean/regions", {
headers: {
Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,
},
});
if (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);
const { data, pagination } = await res.json();
console.log(data, pagination.nextCursor); import { Rabbitflare } from "@rabbitflare/api";
const rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });
for await (const item of rf.catalog.regions.list({ cloud: "digitalocean" })) {
console.log(item);
} <?php
$ch = curl_init('https://api.rabbitflare.com/v1/clouds/digitalocean/regions');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),
],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($body === false || $status >= 400) {
throw new RuntimeException("Rabbitflare API error $status: $body");
}
$answer = json_decode($body, true);
print_r($answer['data']);
echo $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL; import os
import requests
response = requests.get(
"https://api.rabbitflare.com/v1/clouds/digitalocean/regions",
headers={
"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"],
},
timeout=120,
)
response.raise_for_status()
answer = response.json()
print(answer["data"], answer["pagination"]["nextCursor"]) Response
200 OK Returns a list of Region objects in data, with a Pagination object in pagination.
The Region object's fields 7 fields
| Field | Type and description |
|---|---|
id | string The region's id. Pass it as |
name | string The region's name, as the panel shows it. |
city | string The city the data center is in, or near. |
country | string The country, in English. |
countryCode | string The country's two-letter ISO 3166-1 code. |
continent | string The part of the world, as the panel groups regions. Known values: |
cloud | string The cloud the region belongs to. Known values: |
Example response
{
"data": [
{
"id": "ams3",
"name": "Amsterdam 3",
"city": "Amsterdam",
"country": "Netherlands",
"countryCode": "NL",
"continent": "Europe",
"cloud": "digitalocean"
},
{
"id": "fra1",
"name": "Frankfurt 1",
"city": "Frankfurt",
"country": "Germany",
"countryCode": "DE",
"continent": "Europe",
"cloud": "digitalocean"
},
{
"id": "lon1",
"name": "London 1",
"city": "London",
"country": "United Kingdom",
"countryCode": "GB",
"continent": "Europe",
"cloud": "digitalocean"
},
{
"id": "nyc3",
"name": "New York 3",
"city": "New York",
"country": "United States",
"countryCode": "US",
"continent": "North America",
"cloud": "digitalocean"
}
],
"pagination": {
"limit": 25,
"hasMore": false,
"nextCursor": null
}
} Errors
The errors this request can answer besides those every request can (a missing token, a missing scope, the rate limits). Each answer is an Error object (see Errors).
| Status and code | When, and what to do |
|---|---|
400 invalid_ | The cursor isn't one this list gave, or was made with other filters or another sort. Start again from the first page, or keep the filters and sort the cursor was made with. |
400 invalid_ | A query parameter is unknown or has a wrong value ( Correct or remove the parameter named in |
404 not_ | The resource doesn't exist, or isn't this account's. Check the id. Ids of other accounts' resources answer the same way. |