HTTP API Gateway Specification Reference
Bondy HTTP API Gateway acts as a reverse proxy by accepting incoming REST API actions and translating them into WAMP actions over a Realm's procedures and topics.
Bondy API Gateway is a reverse proxy that lets you manage, configure, and route requests to your WAMP APIs and also to external HTTP/REST APIs. It allows Bondy to be integrated into an existing HTTP/REST API ecosystem.
The following wamp api is used to configure and manage the API Gateway Specification:
Name | URI |
---|---|
Add an API Spec | bondy.http_gateway.api.add |
Get an API Spec | bondy.http_gateway.api.get |
List all API Specs | bondy.http_gateway.api.list |
Load an API Spec | bondy.http_gateway.api.load |
Delete an API Spec | bondy.http_gateway.api.delete |
WARNING
CURRENTLY NOT IMPLEMENTED
WARNING
CURRENTLY NOT IMPLEMENTED
bondy.http_gateway.api.get(api_spec_id) -> result(api_spec)
It allows to retrieve the requested api spec id.
This procedure is useful for example to be entirely sure to check if the api spec definition was properly loaded and activated.
0
stringREQUIREDThe id of the api spec you want to retrieve.
None.
0
objectThe api spec data
id
stringREQUIREDIMMUTABLEA global unique identifier for this API.
host
stringREQUIREDIMMUTABLEA string used for matching the incoming HTTP request HOST header value. Hosts with and without a trailing dot are equivalent for routing. Similarly, hosts with and without a leading dot are also equivalent e.g. cowboy.example.org
, cowboy.example.org.
and .cowboy.example.org
are equivalent. A pattern using the keyword :
and wildcard _
can be used to match multiple domains e.g. mydomain.:_
will match mydomain.foo
and mydomain.bar
but not mydomain.foo.baz
.
realm_uri
stringREQUIREDIMMUTABLEThe realm this API will target. An API can only target a single realm.
name
stringIMMUTABLEA display name for the API.
variables
mapIMMUTABLEA mapping of arbitrary variable names to values or expressions. This variables can be referenced by expressions in the children objects of this object.
defaults
mapIMMUTABLEA mapping of attributes to their default values. This values are inherited by children objects as defaults when their value is unset.
status_codes
mapIMMUTABLEA mapping of WAMP Error URIs to HTTP Status Codes. This values are inherited by children objects as defaults when their value is unset.
versions
array[VersionObject]REQUIREDIMMUTABLEAn array of Version Object instances.
None.
:: code-group
./wick --url ws://localhost:18080/ws \
--realm com.leapsight.bondy \
call bondy.http_gateway.api.get \
'com.market.demo' | jq
[
{
"defaults": {
"connect_timeout": 5000,
"headers": "{{variables.cors_headers}}",
"retries": 0,
"schemes": "{{variables.schemes}}",
"security": "{{variables.oauth2}}",
"timeout": 15000
},
"host": "_",
"id": "com.market.demo",
"meta": {},
"name": "Marketplace Demo API",
"realm_uri": "com.market.demo",
"status_codes": {
"com.example.error.internal_error": 500,
"com.example.error.not_found": 404,
"com.example.error.unknown_error": 500
},
"ts": -576459578303,
"variables": {},
"versions": {}
}
]
:::
bondy.http_gateway.api.list() -> result([api_spec])
It allows to retrieve the all loaded apis spec.
None
None.
0
array[object]The list of all loaded api specs.
id
stringREQUIREDIMMUTABLEA global unique identifier for this API.
host
stringREQUIREDIMMUTABLEA string used for matching the incoming HTTP request HOST header value. Hosts with and without a trailing dot are equivalent for routing. Similarly, hosts with and without a leading dot are also equivalent e.g. cowboy.example.org
, cowboy.example.org.
and .cowboy.example.org
are equivalent. A pattern using the keyword :
and wildcard _
can be used to match multiple domains e.g. mydomain.:_
will match mydomain.foo
and mydomain.bar
but not mydomain.foo.baz
.
realm_uri
stringREQUIREDIMMUTABLEThe realm this API will target. An API can only target a single realm.
name
stringIMMUTABLEA display name for the API.
variables
mapIMMUTABLEA mapping of arbitrary variable names to values or expressions. This variables can be referenced by expressions in the children objects of this object.
defaults
mapIMMUTABLEA mapping of attributes to their default values. This values are inherited by children objects as defaults when their value is unset.
status_codes
mapIMMUTABLEA mapping of WAMP Error URIs to HTTP Status Codes. This values are inherited by children objects as defaults when their value is unset.
versions
array[VersionObject]REQUIREDIMMUTABLEAn array of Version Object instances.
None.
./wick --url ws://localhost:18080/ws \
--realm com.leapsight.bondy \
call bondy.http_gateway.api.load \
bondy.http_gateway.api.load(api_spec_data)
Validates, loads and activates the api spec definition.
0
objectThe api spec data
id
stringREQUIREDIMMUTABLEA global unique identifier for this API.
host
stringREQUIREDIMMUTABLEA string used for matching the incoming HTTP request HOST header value. Hosts with and without a trailing dot are equivalent for routing. Similarly, hosts with and without a leading dot are also equivalent e.g. cowboy.example.org
, cowboy.example.org.
and .cowboy.example.org
are equivalent. A pattern using the keyword :
and wildcard _
can be used to match multiple domains e.g. mydomain.:_
will match mydomain.foo
and mydomain.bar
but not mydomain.foo.baz
.
realm_uri
stringREQUIREDIMMUTABLEThe realm this API will target. An API can only target a single realm.
name
stringIMMUTABLEA display name for the API.
variables
mapIMMUTABLEA mapping of arbitrary variable names to values or expressions. This variables can be referenced by expressions in the children objects of this object.
defaults
mapIMMUTABLEA mapping of attributes to their default values. This values are inherited by children objects as defaults when their value is unset.
status_codes
mapIMMUTABLEA mapping of WAMP Error URIs to HTTP Status Codes. This values are inherited by children objects as defaults when their value is unset.
versions
array[VersionObject]REQUIREDIMMUTABLEAn array of Version Object instances.
None.
None.
None.
Below there is an example loading the partial spec of the Marketplace api spec you can find at api_gateway_config.json
./wick --url ws://localhost:18080/ws \
--realm com.leapsight.bondy \
call bondy.http_gateway.api.load \
'{
"id":"com.market.demo",
"name":"Marketplace Demo API",
"host":"_",
"realm_uri":"com.market.demo",
"meta":{
},
"variables":{
},
"defaults":{
"retries":0,
"timeout":15000,
"connect_timeout":5000,
"schemes":"{{variables.schemes}}",
"security":"{{variables.oauth2}}",
"headers":"{{variables.cors_headers}}"
},
"status_codes": {
"com.example.error.not_found": 404,
"com.example.error.unknown_error": 500,
"com.example.error.internal_error": 500
},
"versions": {
}
}' | jq
None if it was loaded successfully