Reference¶
Python API wrapper for Uptime Kuma.
UptimeKumaAuthenticationException
¶
Bases: UptimeKumaException
Uptime Kuma authentication exception.
UptimeKumaConnectionException
¶
Bases: UptimeKumaException
Uptime Kuma connection exception.
UptimeKumaMonitor
dataclass
¶
Bases: UptimeKumaBaseModel
Monitor model for Uptime Kuma.
UptimeKumaVersion
dataclass
¶
Bases: UptimeKumaBaseModel
Uptime Kuma version.
UpdateChecker
¶
UptimeKuma
¶
Uptime Kuma client.
__init__
¶
Initialize the Uptime Kuma client.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
ClientSession
|
An aiohttp ClientSession instance |
required |
base_url
|
URL or str
|
The base URL of the Uptime Kuma server |
required |
api_key
|
str or None
|
API key for authentication (default is None). |
None
|
timeout
|
float or None
|
Request timeout in seconds (default is 10 seconds if not specified). |
None
|
metrics
async
¶
Retrieve metrics from Uptime Kuma.
Fetches and parses Prometheus-style metrics from the Uptime Kuma API endpoint, extracting monitor-related metrics and returning them as a dictionary of UptimeKumaMonitor objects keyed by monitor name.
Returns:
Type | Description |
---|---|
dict[str, UptimeKumaMonitor]
|
A dictionary mapping monitor names to their corresponding UptimeKumaMonitor objects. |
Raises:
Type | Description |
---|---|
UptimeKumaAuthenticationException
|
If authentication with the Uptime Kuma API fails. |
UptimeKumaConnectionException
|
If there is a connection error, timeout, or other client error during the request. |