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
- In Postman choose Import and select both downloaded files.
- Select the GSLB.me 2.0 environment and fill in
api_username(your e-mail address) andapi_password(your API password). - 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
| Variable | Default | Purpose |
|---|---|---|
baseUrl | https://api.gslb.me/2.0 | API endpoint |
api_username | Your account e-mail address | |
api_password | Your API password (secret) | |
zone_name, geohost_name, target_name, reporting_graph_id | mydomain.com, mygeohost, 2.2.2.3, 783 | Used 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.
| Step | Checks |
|---|---|
| 00 · Check credentials and initialise the run | HTTP 200; At least one health check is available |
| 01 · List alerts | HTTP 200; alert list is present |
| 02 · List balancing algorithms | HTTP 200; geolb.any and geolb.roundrobin are offered |
| 03 · List georouting countries | HTTP 200; countries are listed |
| 04 · Safety check: the test zone must not exist | Test zone does not exist yet (choose another test_zone if this fails) |
| 05 · Create zone | HTTP 200; returncode is 0 |
| 06 · Create the same zone again (must be refused) | HTTP 403; returncode is 6 |
| 07 · Get zone | HTTP 200; zone name matches; zone has records section |
| 08 · Modify zone | HTTP 200; returncode is 0 |
| 09 · Get zone (changes applied) | HTTP 200; ttl is 1800 and zone is active |
| 10 · Create zone records | HTTP 200; returncode is 0 |
| 11 · Get zone records | HTTP 200; the two new records are returned |
| 12 · Modify zone record | HTTP 200; returncode is 0 |
| 13 · Commit zone | HTTP 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 records | HTTP 200; returncode is 0 |
| 17 · Commit zone (after deleting records) | HTTP 200; returncode is 0 |
| 18 · Create geohost | HTTP 200 |
| 19 · Create geohost target A | HTTP 200 |
| 20 · Create geohost target B | HTTP 200 |
| 21 · Commit geohost | HTTP 200 |
| 22 · Get geohost | HTTP 200; response mentions the geohost |
| 23 · Get geohost target | HTTP 200; response mentions the target address |
| 24 · Modify geohost target | HTTP 200 |
| 25 · Commit geohost (after modifying the target) | HTTP 200 |
| 26 · Get zone statistics | HTTP 200 |
| 27 · Get geohost statistics | HTTP 200 |
| 28 · Get geohost reporting graphs list | HTTP 200 |
| 29 · Delete geohost target A | HTTP 200 |
| 30 · Delete geohost target B | HTTP 200 |
| 31 · Delete geohost | HTTP 200 |
| 32 · Delete zone | HTTP 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.