API Gateway
The Admin HTTP API routes that load, inspect and remove API Gateway specifications.
Each route calls one procedure of the API Gateway WAMP API. That page is the contract for what each operation does and how it fails. This page gives the routes and what is particular to HTTP. The request and error mapping that every Admin HTTP API route shares is in Admin HTTP API.
Routes
| Method | Path | WAMP procedure |
|---|---|---|
POST | /api_specs | bondy.http_gateway.api.load |
POST | /services/load_api_spec | bondy.http_gateway.api.load |
GET | /api_specs | bondy.http_gateway.api.list |
GET | /api_specs/:id | bondy.http_gateway.api.get |
GET | /api_specs/:id/info | bondy.http_gateway.api.get |
DELETE | /api_specs/:id | bondy.http_gateway.api.delete |
The two POST routes are equivalent.
Loading a specification
The request body is the specification, as JSON. A successful load answers with an empty body.
curl -X POST "http://localhost:18081/api_specs" \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "@my_api.json"A specification that fails validation answers with the error as the JSON body, with code set to the error URI. The status follows from the URI:
| Error | Status |
|---|---|
bondy.error.missing_required_value | 400 |
wamp.error.invalid_argument | 400 |
bondy.error.invalid_value | 400 |
bondy.error.http_gateway.invalid_expression | 500 |
bondy.error.internal_error | 500 |
The load errors say when each one occurs.
Reading specifications
GET /api_specs/:id answers with the stored specification. GET /api_specs answers with an array of every stored specification.
GET /api_specs/:id/info answers with a summary of the stored specification: the properties id, name, host and realm_uri, and meta and ts when the specification has them. The summary leaves out the versions and paths.
curl "http://localhost:18081/api_specs/com.market.demo/info"{
"host": "_",
"id": "com.market.demo",
"meta": {},
"name": "Marketplace Demo API",
"realm_uri": "com.market.demo"
}A GET for an id that is not stored answers 404, with code set to bondy.error.not_found.
Deleting a specification
DELETE /api_specs/:id deletes the specification and stops serving its paths. It succeeds whether or not the id is stored.
curl -X DELETE "http://localhost:18081/api_specs/com.market.demo"