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

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

Uploaded Source

Built Distribution

aio_kong-3.3.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aio_kong-3.3.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.11.3 Linux/5.15.0-1037-azure

File hashes

Hashes for aio_kong-3.3.0.tar.gz
Algorithm Hash digest
SHA256 1f9c01f41f5b71a96bd12b45d128c9ad16125ac0759363c3259fd97ec885b36b
MD5 18b704e4ba93f1b81712318d4f81b3c0
BLAKE2b-256 8331de95273c3148aaa1c0116240bd7fb81cf16d48edd1d9f59a9a81989ea42a

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: aio_kong-3.3.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.11.3 Linux/5.15.0-1037-azure

File hashes

Hashes for aio_kong-3.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c91646c70f4afcebd533c38581b5e9e0ef77b6c479ab571b6b3afcfe9159e0b
MD5 df8bfcceabd6a61dbd56e203adcab783
BLAKE2b-256 08b5c355227bd294ac71b7fc8e6ed63032a6c055dea423e31ce4af345ed10860

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