API v2.0 reference

Postman collection

A ready-to-use Postman collection for the GSLB.me REST API v2.0: every call from this reference, plus an end-to-end test suite that checks the whole API and cleans up after itself.

Import and run

  1. In Postman choose Import and select both downloaded files.
  2. Select the GSLB.me 2.0 environment and fill in api_username (your e-mail address) and api_password (your API password).
  3. Open API reference to try any call, or run End-to-end test suite from the Collection Runner.

Authentication is set once on the collection, so every request is signed automatically. The password is stored as a secret in the environment.

Run it from the command line

npm install -g newman
newman run "GSLB.me-2.0.postman_collection.json" \
  -e "GSLB.me-2.0.postman_environment.json" \
  --folder "End-to-end test suite"

Variables

VariableDefaultPurpose
baseUrlhttps://api.gslb.me/2.0API endpoint
api_usernameYour account e-mail address
api_passwordYour API password (secret)
zone_name, geohost_name, target_name, reporting_graph_idmydomain.com, mygeohost, 2.2.2.3, 783Used by the API reference requests: change them to your own objects
test_zone(empty)Optional zone name for the test suite; a unique name is generated when empty

The end-to-end test suite

The suite creates a temporary zone, runs zones, records, geohosts, targets, statistics and reporting calls, checks every response, and deletes everything again.

Safe by design. The suite stops immediately if your credentials are refused, and it aborts before creating anything if the test zone already exists, so a real zone is never changed or deleted. Free accounts are limited to one zone and one geohost: delete your own zone first or use a paid account. If a run stops half-way, run the Cleanup folder.

StepChecks
00 · Check credentials and initialise the runHTTP 200; At least one health check is available
01 · List alertsHTTP 200; alert list is present
02 · List balancing algorithmsHTTP 200; geolb.any and geolb.roundrobin are offered
03 · List georouting countriesHTTP 200; countries are listed
04 · Safety check: the test zone must not existTest zone does not exist yet (choose another test_zone if this fails)
05 · Create zoneHTTP 200; returncode is 0
06 · Create the same zone again (must be refused)HTTP 403; returncode is 6
07 · Get zoneHTTP 200; zone name matches; zone has records section
08 · Modify zoneHTTP 200; returncode is 0
09 · Get zone (changes applied)HTTP 200; ttl is 1800 and zone is active
10 · Create zone recordsHTTP 200; returncode is 0
11 · Get zone recordsHTTP 200; the two new records are returned
12 · Modify zone recordHTTP 200; returncode is 0
13 · Commit zoneHTTP 200; returncode is 0
14 · Get zone (nothing pending)HTTP 200; needscommit is false after commit
15 · Get zone records (changes applied)HTTP 200; A record was modified
16 · Delete zone recordsHTTP 200; returncode is 0
17 · Commit zone (after deleting records)HTTP 200; returncode is 0
18 · Create geohostHTTP 200
19 · Create geohost target AHTTP 200
20 · Create geohost target BHTTP 200
21 · Commit geohostHTTP 200
22 · Get geohostHTTP 200; response mentions the geohost
23 · Get geohost targetHTTP 200; response mentions the target address
24 · Modify geohost targetHTTP 200
25 · Commit geohost (after modifying the target)HTTP 200
26 · Get zone statisticsHTTP 200
27 · Get geohost statisticsHTTP 200
28 · Get geohost reporting graphs listHTTP 200
29 · Delete geohost target AHTTP 200
30 · Delete geohost target BHTTP 200
31 · Delete geohostHTTP 200
32 · Delete zoneHTTP 200; returncode is 0
33 · Delete the zone again (must be “not found”)HTTP 404; returncode is 2
34 · Get zone (gone)zone no longer exists

Assertions follow the documented examples (status codes and returncode values). For the geohost, target, statistics and reporting calls, whose response bodies are not documented, the suite verifies the HTTP status and, where possible, that the response mentions the object it created.