Asynchronous Kong Client
Project description
Async Python Client for Kong
Tested with kong v3.8
Installation & Testing
To install the package
pip install aio-kong
To run tests, clone and
make test
:warning: If you don't have Kong or postgres running locally, run the services first
make services
test certificates were generated using the command
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -nodes -subj '/CN=localhost'
Client
The client can be imported via
from kong.client import Kong
In a coroutine:
async with Kong() as cli:
services = await cli.services.get_list()
print(json.dumps([s.data for s in services], indent=2))
By default the url is obtained from the "KONG_ADMIN_URL" environment variable which defaults to http://127.0.0.1:8001.
The client has handlers for all Kong objects
- cli.services CRUD operations on services
- cli.routes CRUD operations on routes
- cli.plugins CRUD operations on plugins
- cli.consumers CRUD operations on consumers
- cli.certificates CRUD operations on TLS certificates
- cli.snis CRUD operations on SNIs
cli.acls
To list all ACLs
Apply a configuration
The client allow to apply a configuration object to kong:
await cli.apply_json(config)
Command line tool
The library install the kongfig
command line tool for uploading kong configuration files.
kongfig --yaml config.yaml
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aio_kong-3.5.0.tar.gz
.
File metadata
- Download URL: aio_kong-3.5.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fef9329abbbe37a46f3c84b68fcb4c3504585d93ac181a957af00cb6b57244b |
|
MD5 | e4fca68b934800e4524fd0eabd1b768c |
|
BLAKE2b-256 | 41d3445cd39564156d934ae1447559826a1e84390391a4e09d48e4ac7349095f |
File details
Details for the file aio_kong-3.5.0-py3-none-any.whl
.
File metadata
- Download URL: aio_kong-3.5.0-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d55135a1cbfee87b6f718f9370a36f62081ad01d8816f3b33744e603ad7ce434 |
|
MD5 | e1d928b13b0964214258a33c140373f0 |
|
BLAKE2b-256 | b0be7db8bee246e2fb87db15dd6f88d436c64968820ab1161365cabf91c96623 |