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

ParameterExampleDescription
{zone_name}mydomain.comName of the zone (domain)

Request body

Send a JSON object (Content-Type: application/json) with these fields; the full request is shown below.

FieldExampleNotes
namemygeohost
activetrue“true” or “false”
alerts[].id34Alert id, as returned by Get alerts
cdn_cnamemy.cdn.cname
cdn_minimumtargets2
cdn_offloadtrue“true” enables CDN offload for the geohost
cdn_offloadpercentage99
howmanyreplies2Number of addresses returned in each DNS reply
lbalgorithmgeolb.anyOne of the tags returned by Get geohost balancing algorithms
ttl6789Time to live, in seconds

Example request

cURL
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"
}'
Python
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())
JavaScript
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

ParameterExampleDescription
{geohost_name}mygeohostName of the geohost, without the zone (the geohost FQDN is geohost_name.zone_name)
{zone_name}mydomain.comName of the zone (domain)

Request body

Send a JSON object (Content-Type: application/json) with these fields; the full request is shown below.

FieldExampleNotes
activetrue“true” or “false”
alerts[].id34Alert id, as returned by Get alerts
cdn_cnamemy.cdn.cname
cdn_minimumtargets1
cdn_offloadfalse“true” enables CDN offload for the geohost
cdn_offloadpercentage1
howmanyreplies1Number of addresses returned in each DNS reply
lbalgorithmgeolb.anyOne of the tags returned by Get geohost balancing algorithms
ttl3322Time to live, in seconds

Example request

cURL
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"
}'
Python
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())
JavaScript
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

ParameterExampleDescription
{geohost_name}mygeohostName of the geohost, without the zone (the geohost FQDN is geohost_name.zone_name)
{zone_name}mydomain.comName of the zone (domain)

Example request

cURL
curl -u "username@mydomain.com:your-password" \
  -X GET "https://api.gslb.me/2.0/geohost/mygeohost.mydomain.com" \
  -H "Accept: application/json"
Python
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())
JavaScript
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

ParameterExampleDescription
{geohost_name}mygeohostName of the geohost, without the zone (the geohost FQDN is geohost_name.zone_name)
{zone_name}mydomain.comName of the zone (domain)

Example request

cURL
curl -u "username@mydomain.com:your-password" \
  -X POST "https://api.gslb.me/2.0/commit/geohost/mygeohost.mydomain.com" \
  -H "Accept: application/json"
Python
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())
JavaScript
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

ParameterExampleDescription
{geohost_name}mygeohostName of the geohost, without the zone (the geohost FQDN is geohost_name.zone_name)
{zone_name}mydomain.comName of the zone (domain)

Example request

cURL
curl -u "username@mydomain.com:your-password" \
  -X DELETE "https://api.gslb.me/2.0/geohost/mygeohost.mydomain.com" \
  -H "Accept: application/json"
Python
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())
JavaScript
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());