Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tniah/python-kongclient
A Python library for Kong Admin API
https://github.com/tniah/python-kongclient
flask kong kong-api kong-api-gateway python python3
Last synced: about 1 month ago
JSON representation
A Python library for Kong Admin API
- Host: GitHub
- URL: https://github.com/tniah/python-kongclient
- Owner: tniah
- License: bsd-3-clause
- Created: 2019-11-16T02:27:28.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-19T03:07:58.000Z (over 2 years ago)
- Last Synced: 2024-11-16T03:11:52.361Z (about 2 months ago)
- Topics: flask, kong, kong-api, kong-api-gateway, python, python3
- Language: Python
- Homepage:
- Size: 59.6 KB
- Stars: 4
- Watchers: 1
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Python - Kong Client
This is a Python library for the Kong admin API.
It was build around [kong 1.14.x specifications](https://docs.konghq.com/1.4.x/admin-api/)
## Installation ##
### PypI ###
```sh
pip install python-kongclient
```### Manual ###
1. Clone the repository `git clone [email protected]:haintd/python-kongclient.git`
2. Enter it `cd python-kongclient`
3. Install it `python setup.py install`## Instructions
**Import into your project**
```sh
from kongclient import KongClient
```**Create a kong client**
```sh
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**
```sh
from flask import Flask
from kongclient.flask import KongClientapp = 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](https://docs.konghq.com/)