Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

A python library for the Kong admin API

Project description

Python - Kong Client

This is a Python library for the Kong admin API.

It was build around kong 1.14.x specifications

Installation

PypI

pip install python-kongclient

Manual

  1. Clone the repository git clone git@github.com:haintd/python-kongclient.git
  2. Enter it cd python-kongclient
  3. Install it python setup.py install

Instructions

Import into your project

from kongclient import KongClient

Create a kong client

kong_client = KongClient(kong_url='https://localhost:8444', verify_ssl=True)

kong_client.services.create(name='httpbin', url='https://httpbin.org')
kong_client.services.add_route(service_id='httpbin', name='route', hosts=['httpbin.org'])
kong_client.routes.list()
...

For Python-Flask

from flask import Flask
from kongclient.flask import KongClient

app = Flask(__name__)
app.config['KONG_ADMIN_URL'] = 'https://localhost:8444'
app.config['KONG_ADMIN_VERIFY_SSL'] = True
kong_client = KongClient(app)

@app.route('/services', methods=['GET])
def get_services():
   return kong_client.services.list()

For more details, checkout kong documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for python-kongclient, version 1.1.1
Filename, size File type Python version Upload date Hashes
Filename, size python-kongclient-1.1.1.tar.gz (10.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page