curl --request GET \
--url {schemes}://api.upsun.com/regions \
--header 'Authorization: Bearer <token>'import requests
url = "{schemes}://api.upsun.com/regions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('{schemes}://api.upsun.com/regions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "{schemes}://api.upsun.com/regions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{schemes}://api.upsun.com/regions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("{schemes}://api.upsun.com/regions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("{schemes}://api.upsun.com/regions")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"count": 123,
"regions": [
{
"id": "<string>",
"label": "<string>",
"zone": "<string>",
"selection_label": "<string>",
"project_label": "<string>",
"timezone": "<string>",
"available": true,
"private": true,
"endpoint": "<string>",
"provider": {
"name": "<string>",
"logo": "<string>"
},
"datacenter": {
"name": "<string>",
"label": "<string>",
"location": "<string>"
},
"environmental_impact": {
"zone": "<string>",
"carbon_intensity": "<string>",
"green": true
}
}
],
"_links": {
"self": {
"href": "<string>"
},
"previous": {
"href": "<string>"
},
"next": {
"href": "<string>"
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}List regions
Retrieves a list of available regions.
curl --request GET \
--url {schemes}://api.upsun.com/regions \
--header 'Authorization: Bearer <token>'import requests
url = "{schemes}://api.upsun.com/regions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('{schemes}://api.upsun.com/regions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "{schemes}://api.upsun.com/regions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{schemes}://api.upsun.com/regions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("{schemes}://api.upsun.com/regions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("{schemes}://api.upsun.com/regions")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"count": 123,
"regions": [
{
"id": "<string>",
"label": "<string>",
"zone": "<string>",
"selection_label": "<string>",
"project_label": "<string>",
"timezone": "<string>",
"available": true,
"private": true,
"endpoint": "<string>",
"provider": {
"name": "<string>",
"logo": "<string>"
},
"datacenter": {
"name": "<string>",
"label": "<string>",
"location": "<string>"
},
"environmental_impact": {
"zone": "<string>",
"carbon_intensity": "<string>",
"green": true
}
}
],
"_links": {
"self": {
"href": "<string>"
},
"previous": {
"href": "<string>"
},
"next": {
"href": "<string>"
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Allows filtering by available using one or more operators.
Show child attributes
Show child attributes
Allows filtering by private using one or more operators.
Show child attributes
Show child attributes
Allows filtering by zone using one or more operators.
Show child attributes
Show child attributes
Determines the number of items to show.
1 <= x <= 100Pagination cursor. This is automatically generated as necessary and provided in HAL links (_links); it should not be constructed externally.
Pagination cursor. This is automatically generated as necessary and provided in HAL links (_links); it should not be constructed externally.
Allows sorting by a single field.
Use a dash ("-") to sort descending.
Supported fields: id, created_at, updated_at.
"-updated_at"
Was this page helpful?