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))

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.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.2.tar.gz (21.9 kB view details)

Uploaded Source

Built Distributions

aio_kong-0.8.2-py39-none-any.whl (12.7 kB view details)

Uploaded Python 3.9

aio_kong-0.8.2-py38-none-any.whl (12.7 kB view details)

Uploaded Python 3.8

aio_kong-0.8.2-py37-none-any.whl (12.7 kB view details)

Uploaded Python 3.7

aio_kong-0.8.2-py36-none-any.whl (12.7 kB view details)

Uploaded Python 3.6

File details

Details for the file aio-kong-0.8.2.tar.gz.

File metadata

  • Download URL: aio-kong-0.8.2.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0

File hashes

Hashes for aio-kong-0.8.2.tar.gz
Algorithm Hash digest
SHA256 2c1c00e2bddc4b0b1c98177731410f29793c1ff66f89cf16cf8e360a00a3c1e1
MD5 ffe0b790dba30d8f53dbbe9823664b90
BLAKE2b-256 3a2bbb7cfc53dac6d89784796fef7c186f97cd44974d178fa1618bbc0a465f23

See more details on using hashes here.

Provenance

File details

Details for the file aio_kong-0.8.2-py39-none-any.whl.

File metadata

  • Download URL: aio_kong-0.8.2-py39-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0

File hashes

Hashes for aio_kong-0.8.2-py39-none-any.whl
Algorithm Hash digest
SHA256 445d093bcaeb69e6a576be505a26cae2668dadcf5bfd788faae30201b8a0f013
MD5 b098a9d9569ee9b8833d2f484e85492d
BLAKE2b-256 d0a2184fdd890aee7f8fbf24b46378a0eea3f4e4df470f3f304efce458cec0a5

See more details on using hashes here.

Provenance

File details

Details for the file aio_kong-0.8.2-py38-none-any.whl.

File metadata

  • Download URL: aio_kong-0.8.2-py38-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for aio_kong-0.8.2-py38-none-any.whl
Algorithm Hash digest
SHA256 ab12e895250d44c02727889af32d8015978b5b9b8d0e12cc706cecea6f31cc35
MD5 ce38a2b59fa0be6213e4c094892655cb
BLAKE2b-256 fbcd7e15cebc8e6309882dfecc564a7a977871d7a4bd52d68f1b595b04770cca

See more details on using hashes here.

Provenance

File details

Details for the file aio_kong-0.8.2-py37-none-any.whl.

File metadata

  • Download URL: aio_kong-0.8.2-py37-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3.7
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for aio_kong-0.8.2-py37-none-any.whl
Algorithm Hash digest
SHA256 8b8081c080e5a43e59ef4593b57f8c936086b4dd33d703592360778a4c0f795f
MD5 9c23f8de65ddc91a32ab89aaa5d545c0
BLAKE2b-256 3ba9ffb7f65751080d6598fe0f43408691693e40975895644dae7830ef986ebc

See more details on using hashes here.

Provenance

File details

Details for the file aio_kong-0.8.2-py36-none-any.whl.

File metadata

  • Download URL: aio_kong-0.8.2-py36-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3.6
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.12

File hashes

Hashes for aio_kong-0.8.2-py36-none-any.whl
Algorithm Hash digest
SHA256 d162c7e1f868e73ef09a3d68726bbc1417a46dc52530add8ce5502c9fd725dd6
MD5 0c1cd1d03ff82214d85348b97b2db007
BLAKE2b-256 c1467469885e8db22c5d295337eedd0823ceed730e6ceee28063e874b6d94183

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