Configuration

Get the GSLB configuration

GET /gslb/config

Get all GSLB Configuration

curl
curl -X GET "https://appliance.example.com/api/v1/gslb/config" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/gslb/config';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/gslb/config", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/gslb/config', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "GSLB Configuration",
  "data": {
    "version": 1,
    "nodes": [],
    "config": {
      "frontends": {
        "5f4-e49-f98-1d1": {
          "domain": "www.example.com",
          "timeToLive": "360",
          "backendId": "5f4-fa4-3a0-e71"
        }
      },
      "realservers": {
        "5f4-e4a-0f9-a60": {
          "ip": "192.168.68.201",
          "monitorIp": "",
          "name": "www-dc1",
          "weight": 1
        }
      },
      "backends": {
        "5f4-fa4-3a0-e71": {
          "name": "www-example",
          "monitor": "http",
          "monitorInterval": 10,
          "monitorTimeout": 5000,
          "monitorRetries": 2,
          "monitorUseSSL": false,
          "monitorURLPath": "/",
          "monitorPort": 80,
          "monitorExpectedCodes": [
            200,
            301
          ],
          "lbMethod": "wrr",
          "fallback": "any",
          "maxAddrsReturned": 1,
          "ripIds": [
            "5f4-e4a-0f9-a60"
          ]
        }
      }
    }
  }
}

Download the GSLB configuration

GET /gslb/config/download

Download GSLB Configuration as a File

curl
curl -X GET "https://appliance.example.com/api/v1/gslb/config/download" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/gslb/config/download';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/gslb/config/download", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/gslb/config/download', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "…",
  "data": []
}

Restore the GSLB configuration

POST /gslb/config/restore

Restore GSLB Configuration by Input

This change is staged. Send PUT /services/apply to apply it.

curl
curl -X POST "https://appliance.example.com/api/v1/gslb/config/restore" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/gslb/config/restore';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.post("https://appliance.example.com/api/v1/gslb/config/restore", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/gslb/config/restore', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Configuration restored"
}

Upload a GSLB configuration

POST /gslb/config/upload

Restore GSLB configuration

This change is staged. Send PUT /services/apply to apply it.

Body parameters
backup string Required

the file you would like to restore or load somewhere else

curl
curl -X POST "https://appliance.example.com/api/v1/gslb/config/upload" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "backup": "<backup>"
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/gslb/config/upload';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'backup' => '<backup>',
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "backup": "<backup>"
}

response = requests.post("https://appliance.example.com/api/v1/gslb/config/upload", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/gslb/config/upload', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "backup": "<backup>"
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Configuration restored from file"
}