install:: pip install uptime-kuma-api
import:: from uptime_kuma_api import UptimeKumaApi
github::
doc:: uptime-kuma-api
from uptime_kuma_api import UptimeKumaApi, MonitorType
with UptimeKumaApi('INSERT_URL') as api:
api.login('INSERT_USERNAME', 'INSERT_PASSWORD')
api.add_monitor(
type=MonitorType.HTTP,
name="Google",
url="https://google.com"
)
不同 Type 参数是不一样的,比如 HTTP 参数是 url,换成 PING 则是 hostname。