Automates geohosts creation, modification and deletion.
Base URL https://api.gslb.me/2.0. All requests require HTTP Basic authentication; set Accept to application/json or application/xml. Try these calls in the Postman collection.
Create geohost
POSThttps://api.gslb.me/2.0/geohost/{zone_name}
Creates a new geohost. After creating a geohost, it must be committed in order to become active.
Path parameters
| Parameter | Example | Description |
|---|---|---|
{zone_name} | mydomain.com | Name of the zone (domain) |
Request body
Send a JSON object (Content-Type: application/json) with these fields; the full request is shown below.
| Field | Example | Notes |
|---|---|---|
name | mygeohost | |
active | true | “true” or “false” |
alerts[].id | 34 | Alert id, as returned by Get alerts |
cdn_cname | my.cdn.cname | |
cdn_minimumtargets | 2 | |
cdn_offload | true | “true” enables CDN offload for the geohost |
cdn_offloadpercentage | 99 | |
howmanyreplies | 2 | Number of addresses returned in each DNS reply |
lbalgorithm | geolb.any | One of the tags returned by Get geohost balancing algorithms |
ttl | 6789 | Time to live, in seconds |
Example request
curl -u "username@mydomain.com:your-password" \
-X POST "https://api.gslb.me/2.0/geohost/mydomain.com" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "mygeohost",
"active": "true",
"alerts": [
{
"id": "34"
}
],
"cdn_cname": "my.cdn.cname",
"cdn_minimumtargets": "2",
"cdn_offload": "true",
"cdn_offloadpercentage": "99",
"howmanyreplies": "2",
"lbalgorithm": "geolb.any",
"ttl": "6789"
}'import requests
r = requests.post(
"https://api.gslb.me/2.0/geohost/mydomain.com",
auth=("username@mydomain.com", "your-password"),
headers={"Accept": "application/json", "Content-Type": "application/json"},
json={
"name": "mygeohost",
"active": "true",
"alerts": [
{
"id": "34"
}
],
"cdn_cname": "my.cdn.cname",
"cdn_minimumtargets": "2",
"cdn_offload": "true",
"cdn_offloadpercentage": "99",
"howmanyreplies": "2",
"lbalgorithm": "geolb.any",
"ttl": "6789"
},
)
print(r.status_code, r.json())const res = await fetch("https://api.gslb.me/2.0/geohost/mydomain.com", {
method: "POST",
headers: {
"Authorization": "Basic " + btoa("username@mydomain.com:your-password"),
"Accept": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "mygeohost",
"active": "true",
"alerts": [
{
"id": "34"
}
],
"cdn_cname": "my.cdn.cname",
"cdn_minimumtargets": "2",
"cdn_offload": "true",
"cdn_offloadpercentage": "99",
"howmanyreplies": "2",
"lbalgorithm": "geolb.any",
"ttl": "6789"
})
});
console.log(res.status, await res.json());Modify geohost
PUThttps://api.gslb.me/2.0/geohost/{geohost_name}.{zone_name}
Modifies an existing geohost. After modifying a geohost, it must be committed in order for the changes to become active.
Path parameters
| Parameter | Example | Description |
|---|---|---|
{geohost_name} | mygeohost | Name of the geohost, without the zone (the geohost FQDN is geohost_name.zone_name) |
{zone_name} | mydomain.com | Name of the zone (domain) |
Request body
Send a JSON object (Content-Type: application/json) with these fields; the full request is shown below.
| Field | Example | Notes |
|---|---|---|
active | true | “true” or “false” |
alerts[].id | 34 | Alert id, as returned by Get alerts |
cdn_cname | my.cdn.cname | |
cdn_minimumtargets | 1 | |
cdn_offload | false | “true” enables CDN offload for the geohost |
cdn_offloadpercentage | 1 | |
howmanyreplies | 1 | Number of addresses returned in each DNS reply |
lbalgorithm | geolb.any | One of the tags returned by Get geohost balancing algorithms |
ttl | 3322 | Time to live, in seconds |
Example request
curl -u "username@mydomain.com:your-password" \
-X PUT "https://api.gslb.me/2.0/geohost/mygeohost.mydomain.com" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"active": "true",
"alerts": [
{
"id": "34"
}
],
"cdn_cname": "my.cdn.cname",
"cdn_minimumtargets": "1",
"cdn_offload": "false",
"cdn_offloadpercentage": "1",
"howmanyreplies": "1",
"lbalgorithm": "geolb.any",
"ttl": "3322"
}'import requests
r = requests.put(
"https://api.gslb.me/2.0/geohost/mygeohost.mydomain.com",
auth=("username@mydomain.com", "your-password"),
headers={"Accept": "application/json", "Content-Type": "application/json"},
json={
"active": "true",
"alerts": [
{
"id": "34"
}
],
"cdn_cname": "my.cdn.cname",
"cdn_minimumtargets": "1",
"cdn_offload": "false",
"cdn_offloadpercentage": "1",
"howmanyreplies": "1",
"lbalgorithm": "geolb.any",
"ttl": "3322"
},
)
print(r.status_code, r.json())const res = await fetch("https://api.gslb.me/2.0/geohost/mygeohost.mydomain.com", {
method: "PUT",
headers: {
"Authorization": "Basic " + btoa("username@mydomain.com:your-password"),
"Accept": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
"active": "true",
"alerts": [
{
"id": "34"
}
],
"cdn_cname": "my.cdn.cname",
"cdn_minimumtargets": "1",
"cdn_offload": "false",
"cdn_offloadpercentage": "1",
"howmanyreplies": "1",
"lbalgorithm": "geolb.any",
"ttl": "3322"
})
});
console.log(res.status, await res.json());Get geohost
GEThttps://api.gslb.me/2.0/geohost/{geohost_name}.{zone_name}
Retrieves a geohost configuration
Path parameters
| Parameter | Example | Description |
|---|---|---|
{geohost_name} | mygeohost | Name of the geohost, without the zone (the geohost FQDN is geohost_name.zone_name) |
{zone_name} | mydomain.com | Name of the zone (domain) |
Example request
curl -u "username@mydomain.com:your-password" \
-X GET "https://api.gslb.me/2.0/geohost/mygeohost.mydomain.com" \
-H "Accept: application/json"import requests
r = requests.get(
"https://api.gslb.me/2.0/geohost/mygeohost.mydomain.com",
auth=("username@mydomain.com", "your-password"),
headers={"Accept": "application/json"},
)
print(r.status_code, r.json())const res = await fetch("https://api.gslb.me/2.0/geohost/mygeohost.mydomain.com", {
method: "GET",
headers: {
"Authorization": "Basic " + btoa("username@mydomain.com:your-password"),
"Accept": "application/json"
}
});
console.log(res.status, await res.json());Commit geohost
POSThttps://api.gslb.me/2.0/commit/geohost/{geohost_name}.{zone_name}
Makes a newly created or modified geohost active.
Path parameters
| Parameter | Example | Description |
|---|---|---|
{geohost_name} | mygeohost | Name of the geohost, without the zone (the geohost FQDN is geohost_name.zone_name) |
{zone_name} | mydomain.com | Name of the zone (domain) |
Example request
curl -u "username@mydomain.com:your-password" \
-X POST "https://api.gslb.me/2.0/commit/geohost/mygeohost.mydomain.com" \
-H "Accept: application/json"import requests
r = requests.post(
"https://api.gslb.me/2.0/commit/geohost/mygeohost.mydomain.com",
auth=("username@mydomain.com", "your-password"),
headers={"Accept": "application/json"},
)
print(r.status_code, r.json())const res = await fetch("https://api.gslb.me/2.0/commit/geohost/mygeohost.mydomain.com", {
method: "POST",
headers: {
"Authorization": "Basic " + btoa("username@mydomain.com:your-password"),
"Accept": "application/json"
}
});
console.log(res.status, await res.json());Delete geohost
DELETEhttps://api.gslb.me/2.0/geohost/{geohost_name}.{zone_name}
Deletes a geohost. The geohost is immediately deleted, no commit is required.
Path parameters
| Parameter | Example | Description |
|---|---|---|
{geohost_name} | mygeohost | Name of the geohost, without the zone (the geohost FQDN is geohost_name.zone_name) |
{zone_name} | mydomain.com | Name of the zone (domain) |
Example request
curl -u "username@mydomain.com:your-password" \
-X DELETE "https://api.gslb.me/2.0/geohost/mygeohost.mydomain.com" \
-H "Accept: application/json"import requests
r = requests.delete(
"https://api.gslb.me/2.0/geohost/mygeohost.mydomain.com",
auth=("username@mydomain.com", "your-password"),
headers={"Accept": "application/json"},
)
print(r.status_code, r.json())const res = await fetch("https://api.gslb.me/2.0/geohost/mygeohost.mydomain.com", {
method: "DELETE",
headers: {
"Authorization": "Basic " + btoa("username@mydomain.com:your-password"),
"Accept": "application/json"
}
});
console.log(res.status, await res.json());