Get Geohost Configuration

This API method fetches a geohost configuration

Request

GET /geohost/geohost_name HTTP/1.0
Host: api.gslb.me 
Accept: encoding_type
Authorization: Basic base64_credentials

Where:

  • geohost_name is the name of the geohost you want to get configuration for (ie.: mygeohost.mydomain.com)
  • base64_credentials is username:password in base64-encoded format (HTTP Basic Authentication)
  • encoding_type is either application/xml or application/json (if the “Accept” header is omitted, response will be JSON-encoded)

Sample requests:

  • Raw request:
GET /geohost/mygeohost.mydomain.com HTTP/1.0
Host: api.gslb.me 
Accept: application/json
Authorization: Basic dGVzdHVzZXJAZ3NsYi5tZTp0ZXN0cGFzc3dvcmQK
  • Using curl:
curl -u testuser@gslb.me:testpassword -H "Accept: application/json" -k https://api.gslb.me/geohost/mygeohost.mydomain.com

Response

  • In case of invalid geohost:
HTTP/1.1 404 Not Found
Content-Type: application/json

{"message":"Zone not found","returncode":"2"}
  • In case of internal error:
HTTP/1.1 500 Server Error
Content-Type: application/json

{"message":"Internal error, please contact support@gslb.me","returncode":"4"}
  • In case of success:
HTTP/1.1 200 OK
Content-Type: application/json

{
  "geoHost":
  {
    "active":"false",
    "alerts":null,
    "cdn_minimumTargets":"0",
    "cdn_offload":"false",
    "cdn_offloadPercentage":"0",
    "howmanyreplies":"0",
    "lbAlgorithm":"geolb.proximity",
    "needscommit":"false",
    "TTL":"0",
    "georoutingRules":
    {"georoutingRule":[
        {
          "active":"true",
          "countries":
          {"georoutingRuleCountries":[
            {"countryCode":"BV","countryName":"Bouvet Island"},
            {"countryCode":"BW","countryName":"Botswana"},
            {"countryCode":"BR","countryName":"Brazil"}
          ]},
          "description":"",
          "fallbacklb":"geolb.roundrobin",
          "primarylb":"geolb.roundrobin",
          "targets":
          {"georoutingRuleTargets":[
            {"address":"canada-server.test.com","alias":"","priority":"primary"},
            {"address":"india-server.test.com","alias":"","priority":"primary"},
            {"address":"australia-server.test.com","alias":"","priority":"fallback"}
          ]}
        }
    }
    "targets":
    {
      "target":[
        {
          "active":"true",
          "address":"149.154.152.82",
          "alias":"target-name.domain.com",
          "checks":
          {
            "check":
            {
              "active":"true",
              "name":"HTTP healthcheck GET /",
              "parameters":
              {
                "parameter":[
                  {"type":"check.http.port","value":"80"},
                  {"type":"check.http.uri","value":"/"},
                  {"type":"check.http.statuscode","value":"200"},
                  {"type":"check.http.host","value":"cdn.gslb.me"},
                  {"type":"check.http.regexp","value":""},
                  {"type":"check.http.username","value":""},
                  {"type":"check.http.password","value":""},
                  {"type":"check.http.authenabled","value":"false"}
                ]
              },
              "timeout":"30",
              "typeTag":"check.http"
            }
          },
          "geoHostName":"mygeohost",
          "geoHostZoneName":"mydomain.com",
          "priority":"1",
          "reqChecks":"1",
          "schedule":"30",
          "weight":"1"
        },
        {
          "active":"true",
          "address":"149.154.158.46",
          "alias":"",
          "checks":
          {
            "check":
            {
              "active":"true",
              "name":"HTTP healthcheck GET /",
              "parameters":
              {
                "parameter":[
                  {"type":"check.http.port","value":"80"},
                  {"type":"check.http.uri","value":"/"},
                  {"type":"check.http.statuscode","value":"200"},
                  {"type":"check.http.host","value":"cdn.gslb.me"},
                  {"type":"check.http.regexp","value":""},
                  {"type":"check.http.username","value":""},
                  {"type":"check.http.password","value":""},
                  {"type":"check.http.authenabled","value":"false"}
                ]
              },
              "timeout":"30",
              "typeTag":"check.http"
            }
          },
          "geoHostName":"mygeohost",
          "geoHostZoneName":"mydomain.com",
          "priority":"1",
          "reqChecks":"1",
          "schedule":"30",
          "weight":"1"
        }
      ]
    }
  }
}

Where:

  • active: the state of the geohost
  • alerts: an array detailing all alerts configured for the geohost
  • cdn_minimumTargets: the minimum number of healthy targets that is required in order *NOT* to offload to CDN. In order enable CDN offload, cdn_offload must be set to true
  • cdn_offload: true if CDN offload is enabled for the geohost, false otherwise
  • cdn_offloadPercentage: the percentage of DNS requests that are replied with your CDN CNAME. In order to enable CDN offload, cdn_offload must be set to true
  • howmanyreplies: the maximum number of rrsets that a DNS reply can include
  • lbAlgorithm: the geohost balancing algorithm name. Currently supported algorithms are: geolb.roundrobin, geolb.priority, geolb.any, geolb.proximity, geolb.weighted
  • needscommit: true if the geohost includes changes that have to be committed in order to become active. To commit a geohost use the Commit Geohost method
  • TTL: the geohost TTL
  • georoutingRules: the set of configurations needed to enable georouting
  • georoutingRule: each georouting rule, which is built around a set of parameters:
    • active: set to true if the rule is active, set to false if disabled
    • countries: list of countries for which the rule is matched. The list is a georoutingRuleCountries object, that includes:
      • countryCode: the two letters country code
      • countryName: the descriptive country name
    • description: the mnemonic rule description
    • primarylb: the balancing algorithm used to select primary targets
    • fallbacklb: the balancing algorithm used to select fallback targets
    • targets: the list of primary and fallback targets used by the georouting rule. Each target is defined by the following parameters:
      • address: the IP address of FQDN for the target
      • alias: the IP address of FQDN for the target alias, if configured
      • priority: set to “primary” if the target is used as a primary, set to “fallback”if the target is used as a fallback
  • targets: array of targets. Each target is an IP address that is health-monitored through a set of “checks”:
    • active: set to true if the target is enabled, set to false otherwise
    • address: the IP address of the target
    • checks: the array of checks for the target. Fields are self-explanatory
    • geoHostName: the name of the geohost. Together with the field “geoHostZoneName” it defines the DNS FQDN of the geohost. The FQDN of the geohost is “geoHostName.geoHostZoneName
    • geoHostZoneName: the name of the DNS zone this geohost belongs to
    • priority: the target priority, only used if lbAlgorithm is set to geolb.priority
    • reqChecks: the minimum number of “healthy” checks needed to mark the target as “healthy”
    • schedule: schedule interval in seconds to run all checks for the target
    • weight: the target “weight”, only used if lbAlgorithm is set to geolb.weighted