Simple wrapper around the Kong Admin REST API.
- Kong (0.10.x)
Kong is available in Hex, the package can be installed
by adding kong
to your list of dependencies in mix.exs
:
def deps do
[{:kong, "~> 0.0.1"}]
end
You can configure which Node the client connects with. If not set, it will default to http://localhost:8001
.
config :kong, host: "http://example.com:8001"
This library mostly maps Elixir types to Kong Admin API requests and responses. You should consult the Kong documentation on how to form your requests.
List APIs:
{:ok, apis} = Kong.API.list
Passing Querystring parameters to the list call:
{:ok, page_one} = Kong.API.list size: 10
{:ok, page_two} = Kong.API.list size: 10, offset: page_one["offset"]
Creating a new API:
{:ok, api} = Kong.API.add %{name: "Testing", upstream_url: "http://localhost:4000/api", hosts: ["api.example.com"]}
Documentation can be found at https://hexdocs.pm/kong.
- Tests
- Node Routes
- Cluster Routes
- API Routes
- Consumer Routes
- Plugin Routes
- Certificate Routes
- SNI Routes
- Upstream Routes
- Target Routes