Status
Simple way to make a /status for your services with python and asyncio.
Install
pip install api-status
How it works ?
TL;DR;
Check a working example at: https://gitlab.com/cdlr75/status/-/blob/develop/tests/learning/example.py
Let say you have a coroutine that replies a dict with the desired status of your service:
async def status():
""" Returns our service status.
:returns: Misc info about our service.
:rtype: dict
"""
return {
"name": "MyService",
"status": "ok",
"version": "v1"
}
With api-status, to expose this through an HTTP endpoint:
from status import Server
server = Server(host="127.0.0.1", port=8080)
# register our status endpoint
server.add_route(status, method="GET", path=r"/status")
await server.start()
# the status is now available at http://127.0.0.1:8080/status
If you take care of graceful shutdowns for your services, call the method stop:
await server.stop()
Metadata
Release files for api-status 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| api-status-1.0.1.tar.gz | 10.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| api_status-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.9 kB
Release files / api-status-1.0.1.tar.gz
| Download URL | api-status-1.0.1.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
821e69adb3156e4b9b8562ed0b183121327a4653bc42083bd9ce8e0b05637489
|
|
BLAKE2b-256 checksum How to use checksums |
f93b87a5c524a4fd6d33066588a843971cba9a56cf354252e709aebbca051acd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.10
|
Release files / api_status-1.0.1-py3-none-any.whl
| Download URL | api_status-1.0.1-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54e8a47251dcdb90e2685cfa0be31015adc9a72e96affaf9d6d05c5b1fd340b6
|
|
BLAKE2b-256 checksum How to use checksums |
832f6e2afaa97ead3170e38e56209caf24bee97f0f6a4e819edc569e2ced83d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.10
|