diff --git a/README.md b/README.md index 97ec73f..224c023 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,10 @@ 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. +To do so, import `UptimeKumaApi` from the library and specify the Uptime Kuma server url (e.g. 'http://127.0.0.1:3001'), username and password to initialize the connection. ```python ->>> from uptime_kuma_api import UptimeKumaApi +>>> from uptime_kuma_api import UptimeKumaApi, MonitorType >>> api = UptimeKumaApi('INSERT_URL') >>> api.login('INSERT_USERNAME', 'INSERT_PASSWORD') ``` @@ -33,7 +33,13 @@ To do so, import `UptimeKumaApi` from the library and specify the Uptime Kuma se Now you can call one of the existing methods of the instance. For example create a new monitor: ```python ->>> result = api.add_monitor(type=MonitorType.HTTP, name="new monitor", url="http://192.168.1.1") +>>> result = api.add_monitor(type=MonitorType.HTTP, name="Google", url="https://google.com") >>> print(result) {'msg': 'Added Successfully.', 'monitorId': 1} ``` + +At the end, the connection to the API must be disconnected so that the program does not block. + +```python +>>> api.disconnect() +```