Skip to content
DRAFT

HTTP API Gateway ​

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.

Procedures ​

The following wamp api is used to configure and manage the API Gateway Specification:

NameURI
Add an API Specbondy.http_gateway.api.add
Get an API Specbondy.http_gateway.api.get
List all API Specsbondy.http_gateway.api.list
Load an API Specbondy.http_gateway.api.load
Delete an API Specbondy.http_gateway.api.delete

API Add ​

WARNING

CURRENTLY NOT IMPLEMENTED

API Delete ​

WARNING

CURRENTLY NOT IMPLEMENTED

API Get ​

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.

Call ​

Positional Args ​
0stringREQUIRED

The id of the api spec you want to retrieve.

Keyword Args ​

None.

Result ​

Positional Results ​
0object

The api spec data

Keyword Results ​

None.

Errors ​

Examples ​

Success Call

:: code-group

bash
./wick --url ws://localhost:18080/ws \
--realm com.leapsight.bondy \
call bondy.http_gateway.api.get \
'com.market.demo' | jq
json
[
  {
    "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": {}
  }
]

:::

API List ​

bondy.http_gateway.api.list() -> result([api_spec])

It allows to retrieve the all loaded apis spec.

Call ​

Positional Args ​

None

Keyword Args ​

None.

Result ​

Positional Results ​
0array[object]

The list of all loaded api specs.

Keyword Results ​

None.

Errors ​

Examples ​

Success Call
bash
./wick --url ws://localhost:18080/ws \
--realm com.leapsight.bondy \
call bondy.http_gateway.api.load \

API Load ​

bondy.http_gateway.api.load(api_spec_data)

Validates, loads and activates the api spec definition.

Call ​

Positional Args ​
0object

The api spec data

Keyword Args ​

None.

Result ​

Positional Results ​

None.

Keyword Results ​

None.

Errors ​

Examples ​

Below there is an example loading the partial spec of the Marketplace api spec you can find at api_gateway_config.json

Success Call
bash
./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
text
None if it was loaded successfully

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-ShareAlike (CC-BY-SA) 4.0 International license.
Bondy and Leapsight are registered trademarks of Leapsight Technologies Ltd.