Asynchronous Kong client
Project description
Async Python Client for Kong
Tested with kong v2.0
Installation & Testing
To install the package
pip install aio-kong
To run tests, clone and
./dev/install.sh
pytest --cov
: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=4))
The client has handlers for all Kong objects
cli.services
CRUD operations on servicescli.routes
CRUD operations on routescli.plugins
CRUD operations on pluginscli.consumers
CRUD operations on consumerscli.consumers
CRUD operations on consumerscli.certificates
CRUD operations on TLS certificatescli.snis
CRUD operations on SNIscli.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
aio-kong-0.8.0.tar.gz
(21.5 kB
view details)
Built Distribution
aio_kong-0.8.0-py3-none-any.whl
(12.0 kB
view details)
File details
Details for the file aio-kong-0.8.0.tar.gz
.
File metadata
- Download URL: aio-kong-0.8.0.tar.gz
- Upload date:
- Size: 21.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 991d3357d01f8a1cc4f828efd904ca69f04689b651661bf998fdb8bd28232ba9 |
|
MD5 | 2c3d1a95bbe8631a50685844855a1656 |
|
BLAKE2b-256 | 2eff3494157cfad622e6b9758a4405989f5b2804366eadfde3e7010735954237 |
Provenance
File details
Details for the file aio_kong-0.8.0-py3-none-any.whl
.
File metadata
- Download URL: aio_kong-0.8.0-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0230caa3232cda31050d4884be25358577e45e49ac1bea7a2dae990d93d4fe67 |
|
MD5 | 86e4137f0f03ede15089fb85c8ce83be |
|
BLAKE2b-256 | b23cbb3752b188c9e76aeaaaa917862565599149f9a221cefabbf43f6f60d211 |