Skip to main content

Asynchronous Kong client

Project description

Async Python Client for Kong

PyPI version Python versions Build codecov

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 services
  • cli.routes CRUD operations on routes
  • cli.plugins CRUD operations on plugins
  • cli.consumers CRUD operations on consumers
  • 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


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)

Uploaded Source

Built Distribution

aio_kong-0.8.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

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

Hashes for aio-kong-0.8.0.tar.gz
Algorithm Hash digest
SHA256 991d3357d01f8a1cc4f828efd904ca69f04689b651661bf998fdb8bd28232ba9
MD5 2c3d1a95bbe8631a50685844855a1656
BLAKE2b-256 2eff3494157cfad622e6b9758a4405989f5b2804366eadfde3e7010735954237

See more details on using hashes here.

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

Hashes for aio_kong-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0230caa3232cda31050d4884be25358577e45e49ac1bea7a2dae990d93d4fe67
MD5 86e4137f0f03ede15089fb85c8ce83be
BLAKE2b-256 b23cbb3752b188c9e76aeaaaa917862565599149f9a221cefabbf43f6f60d211

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page