Comments (2)
Thank you so much for the detailed answer, at the time of receipt I still get an error, but I think I can handle it over time, I understood the main principle. By the way, if you need help writing a manual, I can help in my free time. you can infiltrate me in tg @Ynot_Frost.
from uptime-kuma-api.
Here is a full example.
First you need to add the monitors themselves.
Then add a status page and save it with the publicGroupList
parameter. It consists of a name
(the title of the monitor section inside the status page), a weight
(to define the order if you have multiple monitor sections) and a monitorList
(the ids of the monitors you want to add to this status page section).
from uptime_kuma_api import UptimeKumaApi, MonitorType
username = "admin"
password = "secret123"
api = UptimeKumaApi("http://127.0.0.1:3001")
if api.need_setup():
api.setup(username, password)
api.login(username, password)
monitor_id_1 = api.add_monitor(
type=MonitorType.HTTP,
url="http://127.0.0.1",
name="monitor1"
)["monitorID"]
monitor_id_2 = api.add_monitor(
type=MonitorType.HTTP,
url="http://127.0.0.2",
name="monitor2"
)["monitorID"]
slug = "statuspage1"
api.add_status_page(
slug=slug,
title="Status Page 1"
)
api.save_status_page(
slug=slug,
publicGroupList=[
{
'name': 'Services',
'weight': 1,
'monitorList': [
{
"id": monitor_id_1
},
{
"id": monitor_id_2
}
]
}
]
)
api.disconnect()
from uptime-kuma-api.
Related Issues (20)
- need to modify the value of interval and retryInterval to make it lower than 20 HOT 2
- support uptime kuma v1.23.0 HOT 3
- Support for Quick Stats
- Retrieve monitor status inside get_monitors()
- Inconsistant Status calls using get_monitor_status HOT 1
- Missing return element in `api.delete_status_page` HOT 1
- set pathName or parent HOT 1
- Default info event does not fetch version under uptime-kuma with version 1.23.1 HOT 1
- save_status_page() failing because of unexpected keyword. HOT 3
- Bug: `api.add_tag()` takes 1 positional HOT 1
- Timeout on get_monitors()
- get_monitor_status for all monitors HOT 2
- error "list indices must be integers or slices, not str"
- ssl_verify argument not used in get_status_page()
- Is it possible to use a Proxy?
- 'NoneType' object ... error in adding a tag to a monitor HOT 1
- Feature Request: Add functionality to delete all monitors simultaneously
- Getting Timeout Error during Execution HOT 4
- 2fa supported HOT 1
- Add support for API Key instead of Username/Pass authentication?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uptime-kuma-api.