update_kuma-api

 

2023-07-14

  • install:: pip install uptime-kuma-api
  • import:: from uptime_kuma_api import UptimeKumaApi
  • github::
  • doc:: uptime-kuma-api

1
from uptime_kuma_api import UptimeKumaApi, MonitorType
2
3
with UptimeKumaApi('INSERT_URL') as api:
4
api.login('INSERT_USERNAME', 'INSERT_PASSWORD')
5
api.add_monitor(
6
type=MonitorType.HTTP,
7
name="Google",
8
url="https://google.com"
9
)

不同 Type 参数是不一样的,比如 HTTP 参数是 url,换成 PING 则是 hostname。