DNS Global Server Load Balancing

Enable DNS global server load balancing

Description

Enable DNS global server load balancing

URI

PUT /admin-api/global/1/gslb

JSON Body Parameters

  • enable

    type: boolean

    required: yes

  • max_dns_results

    type: integer

    required: no

    description: limit the maximum number of DNS results returned

Example Request

Shell

curl -X PUT https://{admin-site}/admin-api/global/1/gslb -d '{ "enable": true, "max_dns_results": 2 }'

Example Response

Status: 200 OK
{"status":0}

Get the configuration of gateway nodes

Description

Get the configuration of gateway nodes

URI

GET /admin-api/gslb/get_nodes

Example Request

Shell

curl https://{admin-site}/admin-api/gslb/get_nodes

Example Response

Status: 200 OK
{
    "data": [
        {
            "gateway_name": "test-gateway-1",
            "ip": "27.0.0.3",
            "partition_id": 1,
            "node_id": 2,
            "high_watermark": 100,
            "low_watermark": 10,
            "metric": "active_conns",
            "latitude": "35.709026",
            "country": "Japan",
            "gateway_id": 1,
            "longitude": "139.731993"
        },
        {
            "gateway_name": "test-gateway-1",
            "ip": "27.0.0.2",
            "ipv6": "1000::abcd",
            "node_id": 1,
            "high_watermark": 100,
            "low_watermark": 10,
            "metric": "active_conns",
            "partition_id": 1,
            "latitude": "35.709026",
            "country": "Japan",
            "gateway_id": 1,
            "longitude": "139.731993"
        },
        {
            "gateway_name": "test-gateway-2",
            "ip": "183.17.230.135",
            "partition_id": 1,
            "node_id": 4,
            "high_watermark": 100,
            "low_watermark": 10,
            "metric": "active_conns",
            "latitude": "22.547",
            "country": "China",
            "gateway_id": 2,
            "longitude": "114.085947"
        },
        {
            "gateway_name": "test-gateway-2",
            "ip": "183.17.230.134",
            "partition_id": 1,
            "node_id": 3,
            "high_watermark": 100,
            "low_watermark": 10,
            "metric": "active_conns",
            "latitude": "22.547",
            "country": "China",
            "gateway_id": 2,
            "longitude": "114.085947"
        },
        {
            "gateway_name": "test-gateway-3",
            "ip": "223.252.64.0",
            "partition_id": 1,
            "node_id": 6,
            "high_watermark": 100,
            "low_watermark": 10,
            "metric": "active_conns",
            "latitude": "35.022843",
            "country": "Japan",
            "gateway_id": 3,
            "longitude": "136.902530"
        }
    ],
    "status": 0,
    "time": 1621601935
}

Update the configuration of gateway nodes

Description

Update the configuration of gateway nodes.

URI

POST /admin-api/glsb/update_nodes

JSON Body Parameters

  • id

    type: integer

    required: yes

    description: gateway node id

  • metric

    type: string

    required: yes

    description: type of reference metric: active_conns, rps, load_1m, load_5m, load_15m

  • low_watermark

    type: number

    required: yes

    description: this value indicates the threshold should slow traffic distribution to this gateway.

  • high_watermark

    type: number

    required: yes

    description: this value indicates the threshold should completely stop traffic distribution to this gateway.

Example Request

Shell

curl -X POST https://{admin-site}/admin-api/gslb/update_nodes -d '
[
    {"id": 1, "metric": "active_conns", "high_watermark": 101, "low_watermark": 11 },
    {"id": 2, "metric": "active_conns", "high_watermark": 102, "low_watermark": 12 }
]'

Example Response

Status: 200 OK
{
    "status": 0
}