A wrapper for the Uptime Kuma Socket.IO API
Find a file
lucasheld e1da9708c6 adjust python-socketio client depencency
Uptime kuma uses JavaScript Socket.IO version 4.x. This requires python-socketio version 5.x.
2022-08-02 11:33:54 +02:00
scripts add readme 2022-07-10 21:57:22 +02:00
uptime_kuma_api check argument conditions 2022-07-10 18:07:11 +02:00
.gitignore prepare pypi release and fix add monitor 2022-07-07 22:17:47 +02:00
README.md add link to ansible collection 2022-07-10 22:54:04 +02:00
requirements.txt adjust python-socketio client depencency 2022-08-02 11:33:54 +02:00
setup.py prepare pypi release and fix add monitor 2022-07-07 22:17:47 +02:00

uptime-kuma-api

A wrapper for the Uptime Kuma WebSocket API

uptime-kuma-api is a Python wrapper for the Uptime Kuma WebSocket API.

This package was developed to configure Uptime Kuma with Ansible. The Ansible collection can be found at https://github.com/lucasheld/ansible-uptime-kuma.

Installation

uptime-kuma-api is available on the Python Package Index (PyPI).

You can install it using pip:

pip install uptime_kuma_api

Examples

Once you have installed the python package, you can use it to communicate with an Uptime Kuma instance.

To do so, import UptimeKumaApi from the library and specify the Uptime Kuma server url, username and password to initialize the connection.

>>> from uptime_kuma_api import UptimeKumaApi
>>> api = UptimeKumaApi('INSERT_URL')
>>> api.login('INSERT_USERNAME', 'INSERT_PASSWORD')

Now you can call one of the existing methods of the instance. For example create a new monitor:

>>> result = api.add_monitor(type_=MonitorType.HTTP, name="new monitor", url="http://192.168.1.1")
>>> print(result)
{'msg': 'Added Successfully.', 'monitor_id': 1}