Skip to main content

Asynchronous Kong Client

Project description

Async Python Client for Kong

PyPI version Python versions Build codecov Downloads

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

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

Uploaded Source

Built Distribution

aio_kong-3.5.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

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

Hashes for aio_kong-3.5.0.tar.gz
Algorithm Hash digest
SHA256 4fef9329abbbe37a46f3c84b68fcb4c3504585d93ac181a957af00cb6b57244b
MD5 e4fca68b934800e4524fd0eabd1b768c
BLAKE2b-256 41d3445cd39564156d934ae1447559826a1e84390391a4e09d48e4ac7349095f

See more details on using hashes here.

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

Hashes for aio_kong-3.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d55135a1cbfee87b6f718f9370a36f62081ad01d8816f3b33744e603ad7ce434
MD5 e1d928b13b0964214258a33c140373f0
BLAKE2b-256 b0be7db8bee246e2fb87db15dd6f88d436c64968820ab1161365cabf91c96623

See more details on using hashes here.

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