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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aio_kong-2.8.2.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.11.0 Linux/5.15.0-1022-azure

File hashes

Hashes for aio_kong-2.8.2.tar.gz
Algorithm Hash digest
SHA256 4e9dacc7d77d3a8242d370d51f03a9004c9b44fa02f0dfc27ea1053de09d3f0a
MD5 59a4f11cd698c0d4c6f45fb03a5a29b8
BLAKE2b-256 51b0c94343b42493952df8ee6aa4d75b2699bb43681f0a22d9773de35640eb00

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for aio_kong-2.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f8409b2d913695c4df45f35cdf7bd05faeee5aba5c8ebd6fa06a612612259831
MD5 f4db095096555d8b3e4094928073b743
BLAKE2b-256 f01423ae1a8e41c141d6069ea541f87c479895ad33df8489e9ec2072c7557e15

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