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

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

Uploaded Source

Built Distribution

aio_kong-3.4.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file aio_kong-3.4.0.tar.gz.

File metadata

  • Download URL: aio_kong-3.4.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-1021-azure

File hashes

Hashes for aio_kong-3.4.0.tar.gz
Algorithm Hash digest
SHA256 6822c2a014dff1832eca04ad913ddde961082f685c5e56ec2fb753b9505775e2
MD5 7ab4bac0ce09714bc54304602183214a
BLAKE2b-256 591246b4e01f3386c3436002cb80064bcfacab553fe4f0a08233c969d43d0a6f

See more details on using hashes here.

Provenance

File details

Details for the file aio_kong-3.4.0-py3-none-any.whl.

File metadata

  • Download URL: aio_kong-3.4.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-1021-azure

File hashes

Hashes for aio_kong-3.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de9c9aa253ca9fce46e5ac9a031373ab4ed13abef20e717c9f78a0e8918bbee6
MD5 82c97ee71f2806f380f63196aaf64047
BLAKE2b-256 2e3019cf02fae0a3bd0d6e66c3ea69d3fc980cfabaa33a2e69d691960fb125c8

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