Skip to main content

Asynchronous Kong Client

Project description

Async Python Client for Kong

PyPI version Python versions Build codecov Downloads

Tested with kong v2.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-2.8.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aio_kong-2.8.1-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aio-kong-2.8.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.7 Linux/5.15.0-1020-azure

File hashes

Hashes for aio-kong-2.8.1.tar.gz
Algorithm Hash digest
SHA256 f86780a940af0aaab5f7bc11464017c092a4e15dc5a442f3c8aedcc55e28b0ba
MD5 e3545d7992cda08547367fc95487b9cc
BLAKE2b-256 8655fd180b69f3e30cbb1f3386c4afbd37b72725618b472bdd3fbe3f7c55bfca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aio_kong-2.8.1-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.7 Linux/5.15.0-1020-azure

File hashes

Hashes for aio_kong-2.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 08fe5b8767fbe8f5033a836cb8f6c6f59531e1c44bb2f345da32952d5971619a
MD5 7c215d3b4c81380ef50af87a7d3385a6
BLAKE2b-256 75598fffe86a2eeedce974d0a06a896e966f9b88923b7c7a45ff6d39f083512a

See more details on using hashes here.

Supported by

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