feat: drop support for Uptime Kuma versions < 1.21.3
BREAKING CHANGE: Uptime Kuma versions < 1.21.3 are not supported in uptime-kuma-api 1.x.x
This commit is contained in:
parent
77630e96b7
commit
f0c5f2ba9d
10 changed files with 57 additions and 177 deletions
|
@ -1,17 +1,10 @@
|
||||||
import unittest
|
import unittest
|
||||||
from packaging.version import parse as parse_version
|
|
||||||
|
|
||||||
from uptime_kuma_api import DockerType, UptimeKumaException
|
from uptime_kuma_api import UptimeKumaException
|
||||||
from uptime_kuma_test_case import UptimeKumaTestCase
|
from uptime_kuma_test_case import UptimeKumaTestCase
|
||||||
|
|
||||||
|
|
||||||
class TestApiKey(UptimeKumaTestCase):
|
class TestApiKey(UptimeKumaTestCase):
|
||||||
def setUp(self):
|
|
||||||
super(TestApiKey, self).setUp()
|
|
||||||
if parse_version(self.api.version) < parse_version("1.21"):
|
|
||||||
super(TestApiKey, self).tearDown()
|
|
||||||
self.skipTest("Unsupported in this Uptime Kuma version")
|
|
||||||
|
|
||||||
def test_api_key(self):
|
def test_api_key(self):
|
||||||
# get empty list to make sure that future accesses will also work
|
# get empty list to make sure that future accesses will also work
|
||||||
self.api.get_api_keys()
|
self.api.get_api_keys()
|
||||||
|
|
|
@ -1,17 +1,10 @@
|
||||||
import unittest
|
import unittest
|
||||||
from packaging.version import parse as parse_version
|
|
||||||
|
|
||||||
from uptime_kuma_api import DockerType, UptimeKumaException
|
from uptime_kuma_api import DockerType, UptimeKumaException
|
||||||
from uptime_kuma_test_case import UptimeKumaTestCase
|
from uptime_kuma_test_case import UptimeKumaTestCase
|
||||||
|
|
||||||
|
|
||||||
class TestDockerHost(UptimeKumaTestCase):
|
class TestDockerHost(UptimeKumaTestCase):
|
||||||
def setUp(self):
|
|
||||||
super(TestDockerHost, self).setUp()
|
|
||||||
if parse_version(self.api.version) < parse_version("1.18"):
|
|
||||||
super(TestDockerHost, self).tearDown()
|
|
||||||
self.skipTest("Unsupported in this Uptime Kuma version")
|
|
||||||
|
|
||||||
def test_docker_host(self):
|
def test_docker_host(self):
|
||||||
# get empty list to make sure that future accesses will also work
|
# get empty list to make sure that future accesses will also work
|
||||||
self.api.get_docker_hosts()
|
self.api.get_docker_hosts()
|
||||||
|
|
|
@ -1,17 +1,9 @@
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from packaging.version import parse as parse_version
|
|
||||||
|
|
||||||
from uptime_kuma_test_case import UptimeKumaTestCase
|
from uptime_kuma_test_case import UptimeKumaTestCase
|
||||||
|
|
||||||
|
|
||||||
class TestGameList(UptimeKumaTestCase):
|
class TestGameList(UptimeKumaTestCase):
|
||||||
def setUp(self):
|
|
||||||
super(TestGameList, self).setUp()
|
|
||||||
if parse_version(self.api.version) < parse_version("1.20"):
|
|
||||||
super(TestGameList, self).tearDown()
|
|
||||||
self.skipTest("Unsupported in this Uptime Kuma version")
|
|
||||||
|
|
||||||
def test_game_list(self):
|
def test_game_list(self):
|
||||||
game_list = self.api.get_game_list()
|
game_list = self.api.get_game_list()
|
||||||
self.assertTrue("keys" in game_list[0])
|
self.assertTrue("keys" in game_list[0])
|
||||||
|
|
|
@ -1,18 +1,10 @@
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from packaging.version import parse as parse_version
|
|
||||||
|
|
||||||
from uptime_kuma_api import UptimeKumaException, MaintenanceStrategy
|
from uptime_kuma_api import UptimeKumaException, MaintenanceStrategy
|
||||||
from uptime_kuma_test_case import UptimeKumaTestCase
|
from uptime_kuma_test_case import UptimeKumaTestCase
|
||||||
|
|
||||||
|
|
||||||
class TestMaintenance(UptimeKumaTestCase):
|
class TestMaintenance(UptimeKumaTestCase):
|
||||||
def setUp(self):
|
|
||||||
super(TestMaintenance, self).setUp()
|
|
||||||
if parse_version(self.api.version) < parse_version("1.19"):
|
|
||||||
super(TestMaintenance, self).tearDown()
|
|
||||||
self.skipTest("Unsupported in this Uptime Kuma version")
|
|
||||||
|
|
||||||
def test_maintenance(self):
|
def test_maintenance(self):
|
||||||
expected_maintenance = {
|
expected_maintenance = {
|
||||||
"title": "maintenance 1",
|
"title": "maintenance 1",
|
||||||
|
@ -25,13 +17,9 @@ class TestMaintenance(UptimeKumaTestCase):
|
||||||
"2022-12-29 22:36:00"
|
"2022-12-29 22:36:00"
|
||||||
],
|
],
|
||||||
"weekdays": [],
|
"weekdays": [],
|
||||||
"daysOfMonth": []
|
"daysOfMonth": [],
|
||||||
}
|
|
||||||
|
|
||||||
if parse_version(self.api.version) >= parse_version("1.21.2"):
|
|
||||||
expected_maintenance.update({
|
|
||||||
"timezoneOption": "Europe/Berlin"
|
"timezoneOption": "Europe/Berlin"
|
||||||
})
|
}
|
||||||
|
|
||||||
# add maintenance
|
# add maintenance
|
||||||
r = self.api.add_maintenance(**expected_maintenance)
|
r = self.api.add_maintenance(**expected_maintenance)
|
||||||
|
@ -225,9 +213,6 @@ class TestMaintenance(UptimeKumaTestCase):
|
||||||
self.do_test_maintenance_strategy(expected_maintenance)
|
self.do_test_maintenance_strategy(expected_maintenance)
|
||||||
|
|
||||||
def test_maintenance_strategy_cron(self):
|
def test_maintenance_strategy_cron(self):
|
||||||
if parse_version(self.api.version) < parse_version("1.21.2"):
|
|
||||||
self.skipTest("Unsupported in this Uptime Kuma version")
|
|
||||||
|
|
||||||
expected_maintenance = {
|
expected_maintenance = {
|
||||||
"title": "test",
|
"title": "test",
|
||||||
"description": "test",
|
"description": "test",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import unittest
|
import unittest
|
||||||
from packaging.version import parse as parse_version
|
|
||||||
|
|
||||||
from uptime_kuma_api import UptimeKumaException, MonitorType, AuthMethod
|
from uptime_kuma_api import UptimeKumaException, MonitorType, AuthMethod
|
||||||
from uptime_kuma_test_case import UptimeKumaTestCase
|
from uptime_kuma_test_case import UptimeKumaTestCase
|
||||||
|
@ -21,12 +20,9 @@ class TestMonitor(UptimeKumaTestCase):
|
||||||
"maxretries": 0,
|
"maxretries": 0,
|
||||||
"notificationIDList": [notification_id_1, notification_id_2],
|
"notificationIDList": [notification_id_1, notification_id_2],
|
||||||
"upsideDown": False,
|
"upsideDown": False,
|
||||||
"url": "http://127.0.0.1"
|
"url": "http://127.0.0.1",
|
||||||
}
|
|
||||||
if parse_version(self.api.version) >= parse_version("1.18"):
|
|
||||||
expected_monitor.update({
|
|
||||||
"resendInterval": 0
|
"resendInterval": 0
|
||||||
})
|
}
|
||||||
|
|
||||||
# add monitor
|
# add monitor
|
||||||
r = self.api.add_monitor(**expected_monitor)
|
r = self.api.add_monitor(**expected_monitor)
|
||||||
|
@ -132,7 +128,6 @@ class TestMonitor(UptimeKumaTestCase):
|
||||||
}
|
}
|
||||||
self.do_test_monitor_type(expected_monitor)
|
self.do_test_monitor_type(expected_monitor)
|
||||||
|
|
||||||
if parse_version(self.api.version) >= parse_version("1.21"):
|
|
||||||
expected_monitor = {
|
expected_monitor = {
|
||||||
"type": MonitorType.HTTP,
|
"type": MonitorType.HTTP,
|
||||||
"name": "monitor 1",
|
"name": "monitor 1",
|
||||||
|
@ -157,12 +152,9 @@ class TestMonitor(UptimeKumaTestCase):
|
||||||
expected_monitor = {
|
expected_monitor = {
|
||||||
"type": MonitorType.PING,
|
"type": MonitorType.PING,
|
||||||
"name": "monitor 1",
|
"name": "monitor 1",
|
||||||
"hostname": "127.0.0.1"
|
"hostname": "127.0.0.1",
|
||||||
}
|
|
||||||
if parse_version(self.api.version) >= parse_version("1.20"):
|
|
||||||
expected_monitor.update({
|
|
||||||
"packetSize": 56
|
"packetSize": 56
|
||||||
})
|
}
|
||||||
self.do_test_monitor_type(expected_monitor)
|
self.do_test_monitor_type(expected_monitor)
|
||||||
|
|
||||||
def test_monitor_type_keyword(self):
|
def test_monitor_type_keyword(self):
|
||||||
|
@ -175,9 +167,6 @@ class TestMonitor(UptimeKumaTestCase):
|
||||||
self.do_test_monitor_type(expected_monitor)
|
self.do_test_monitor_type(expected_monitor)
|
||||||
|
|
||||||
def test_monitor_type_grpc_keyword(self):
|
def test_monitor_type_grpc_keyword(self):
|
||||||
if parse_version(self.api.version) < parse_version("1.19"):
|
|
||||||
self.skipTest("Unsupported in this Uptime Kuma version")
|
|
||||||
|
|
||||||
expected_monitor = {
|
expected_monitor = {
|
||||||
"type": MonitorType.GRPC_KEYWORD,
|
"type": MonitorType.GRPC_KEYWORD,
|
||||||
"name": "monitor 1",
|
"name": "monitor 1",
|
||||||
|
@ -200,9 +189,6 @@ class TestMonitor(UptimeKumaTestCase):
|
||||||
self.do_test_monitor_type(expected_monitor)
|
self.do_test_monitor_type(expected_monitor)
|
||||||
|
|
||||||
def test_monitor_type_docker(self):
|
def test_monitor_type_docker(self):
|
||||||
if parse_version(self.api.version) < parse_version("1.18"):
|
|
||||||
self.skipTest("Unsupported in this Uptime Kuma version")
|
|
||||||
|
|
||||||
docker_host_id = self.add_docker_host()
|
docker_host_id = self.add_docker_host()
|
||||||
expected_monitor = {
|
expected_monitor = {
|
||||||
"type": MonitorType.DOCKER,
|
"type": MonitorType.DOCKER,
|
||||||
|
@ -232,9 +218,6 @@ class TestMonitor(UptimeKumaTestCase):
|
||||||
self.do_test_monitor_type(expected_monitor)
|
self.do_test_monitor_type(expected_monitor)
|
||||||
|
|
||||||
def test_monitor_type_gamedig(self):
|
def test_monitor_type_gamedig(self):
|
||||||
if parse_version(self.api.version) < parse_version("1.20"):
|
|
||||||
self.skipTest("Unsupported in this Uptime Kuma version")
|
|
||||||
|
|
||||||
game_list = self.api.get_game_list()
|
game_list = self.api.get_game_list()
|
||||||
game = game_list[0]["keys"][0]
|
game = game_list[0]["keys"][0]
|
||||||
expected_monitor = {
|
expected_monitor = {
|
||||||
|
@ -270,9 +253,6 @@ class TestMonitor(UptimeKumaTestCase):
|
||||||
self.do_test_monitor_type(expected_monitor)
|
self.do_test_monitor_type(expected_monitor)
|
||||||
|
|
||||||
def test_monitor_type_postgres(self):
|
def test_monitor_type_postgres(self):
|
||||||
if parse_version(self.api.version) < parse_version("1.18"):
|
|
||||||
self.skipTest("Unsupported in this Uptime Kuma version")
|
|
||||||
|
|
||||||
expected_monitor = {
|
expected_monitor = {
|
||||||
"type": MonitorType.POSTGRES,
|
"type": MonitorType.POSTGRES,
|
||||||
"name": "monitor 1",
|
"name": "monitor 1",
|
||||||
|
@ -282,9 +262,6 @@ class TestMonitor(UptimeKumaTestCase):
|
||||||
self.do_test_monitor_type(expected_monitor)
|
self.do_test_monitor_type(expected_monitor)
|
||||||
|
|
||||||
def test_monitor_type_mysql(self):
|
def test_monitor_type_mysql(self):
|
||||||
if parse_version(self.api.version) < parse_version("1.19"):
|
|
||||||
self.skipTest("Unsupported in this Uptime Kuma version")
|
|
||||||
|
|
||||||
expected_monitor = {
|
expected_monitor = {
|
||||||
"type": MonitorType.MYSQL,
|
"type": MonitorType.MYSQL,
|
||||||
"name": "monitor 1",
|
"name": "monitor 1",
|
||||||
|
@ -294,9 +271,6 @@ class TestMonitor(UptimeKumaTestCase):
|
||||||
self.do_test_monitor_type(expected_monitor)
|
self.do_test_monitor_type(expected_monitor)
|
||||||
|
|
||||||
def test_monitor_type_mongodb(self):
|
def test_monitor_type_mongodb(self):
|
||||||
if parse_version(self.api.version) < parse_version("1.20"):
|
|
||||||
self.skipTest("Unsupported in this Uptime Kuma version")
|
|
||||||
|
|
||||||
expected_monitor = {
|
expected_monitor = {
|
||||||
"type": MonitorType.MONGODB,
|
"type": MonitorType.MONGODB,
|
||||||
"name": "monitor 1",
|
"name": "monitor 1",
|
||||||
|
@ -305,9 +279,6 @@ class TestMonitor(UptimeKumaTestCase):
|
||||||
self.do_test_monitor_type(expected_monitor)
|
self.do_test_monitor_type(expected_monitor)
|
||||||
|
|
||||||
def test_monitor_type_radius(self):
|
def test_monitor_type_radius(self):
|
||||||
if parse_version(self.api.version) < parse_version("1.18"):
|
|
||||||
self.skipTest("Unsupported in this Uptime Kuma version")
|
|
||||||
|
|
||||||
expected_monitor = {
|
expected_monitor = {
|
||||||
"type": MonitorType.RADIUS,
|
"type": MonitorType.RADIUS,
|
||||||
"name": "monitor 1",
|
"name": "monitor 1",
|
||||||
|
@ -320,9 +291,6 @@ class TestMonitor(UptimeKumaTestCase):
|
||||||
self.do_test_monitor_type(expected_monitor)
|
self.do_test_monitor_type(expected_monitor)
|
||||||
|
|
||||||
def test_monitor_type_redis(self):
|
def test_monitor_type_redis(self):
|
||||||
if parse_version(self.api.version) < parse_version("1.20"):
|
|
||||||
self.skipTest("Unsupported in this Uptime Kuma version")
|
|
||||||
|
|
||||||
expected_monitor = {
|
expected_monitor = {
|
||||||
"type": MonitorType.REDIS,
|
"type": MonitorType.REDIS,
|
||||||
"name": "monitor 1",
|
"name": "monitor 1",
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import json
|
import json
|
||||||
import unittest
|
import unittest
|
||||||
from packaging.version import parse as parse_version
|
|
||||||
|
|
||||||
from uptime_kuma_test_case import UptimeKumaTestCase
|
from uptime_kuma_test_case import UptimeKumaTestCase
|
||||||
|
|
||||||
|
@ -16,19 +15,11 @@ class TestSettings(UptimeKumaTestCase):
|
||||||
"primaryBaseURL": "",
|
"primaryBaseURL": "",
|
||||||
"steamAPIKey": "",
|
"steamAPIKey": "",
|
||||||
"tlsExpiryNotifyDays": [7, 14, 21],
|
"tlsExpiryNotifyDays": [7, 14, 21],
|
||||||
"disableAuth": False
|
"disableAuth": False,
|
||||||
}
|
"trustProxy": False,
|
||||||
|
|
||||||
if parse_version(self.api.version) >= parse_version("1.18"):
|
|
||||||
expected_settings.update({
|
|
||||||
"trustProxy": False
|
|
||||||
})
|
|
||||||
|
|
||||||
if parse_version(self.api.version) >= parse_version("1.19"):
|
|
||||||
expected_settings.update({
|
|
||||||
"serverTimezone": "Europe/Berlin",
|
"serverTimezone": "Europe/Berlin",
|
||||||
"dnsCache": True,
|
"dnsCache": True
|
||||||
})
|
}
|
||||||
|
|
||||||
# set settings
|
# set settings
|
||||||
r = self.api.set_settings(self.password, **expected_settings)
|
r = self.api.set_settings(self.password, **expected_settings)
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from packaging.version import parse as parse_version
|
|
||||||
|
|
||||||
from uptime_kuma_api import UptimeKumaException, IncidentStyle
|
from uptime_kuma_api import UptimeKumaException, IncidentStyle
|
||||||
from uptime_kuma_test_case import UptimeKumaTestCase
|
from uptime_kuma_test_case import UptimeKumaTestCase
|
||||||
|
|
||||||
|
@ -36,12 +34,9 @@ class TestStatusPage(UptimeKumaTestCase):
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
}
|
|
||||||
if parse_version(self.api.version) >= parse_version("1.20"):
|
|
||||||
expected_status_page.update({
|
|
||||||
"googleAnalyticsId": ""
|
"googleAnalyticsId": ""
|
||||||
})
|
}
|
||||||
|
|
||||||
# add status page
|
# add status page
|
||||||
r = self.api.add_status_page(slug, expected_status_page["title"])
|
r = self.api.add_status_page(slug, expected_status_page["title"])
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from packaging.version import parse as parse_version
|
|
||||||
|
|
||||||
from uptime_kuma_api import UptimeKumaException
|
from uptime_kuma_api import UptimeKumaException
|
||||||
from uptime_kuma_test_case import UptimeKumaTestCase
|
from uptime_kuma_test_case import UptimeKumaTestCase
|
||||||
|
|
||||||
|
@ -28,7 +26,6 @@ class TestTag(UptimeKumaTestCase):
|
||||||
self.assertIsNotNone(tag)
|
self.assertIsNotNone(tag)
|
||||||
self.compare(tag, expected_tag)
|
self.compare(tag, expected_tag)
|
||||||
|
|
||||||
if parse_version(self.api.version) >= parse_version("1.20"):
|
|
||||||
# edit tag
|
# edit tag
|
||||||
expected_tag["name"] = "tag 1 new"
|
expected_tag["name"] = "tag 1 new"
|
||||||
expected_tag["color"] = "#000000"
|
expected_tag["color"] = "#000000"
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import unittest
|
import unittest
|
||||||
import warnings
|
import warnings
|
||||||
from packaging.version import parse as parse_version
|
|
||||||
|
|
||||||
from uptime_kuma_api import UptimeKumaApi, MonitorType, DockerType, UptimeKumaException
|
from uptime_kuma_api import UptimeKumaApi, MonitorType, DockerType
|
||||||
|
|
||||||
token = None
|
token = None
|
||||||
|
|
||||||
|
@ -74,19 +73,16 @@ class UptimeKumaTestCase(unittest.TestCase):
|
||||||
for status_page in status_pages:
|
for status_page in status_pages:
|
||||||
self.api.delete_status_page(status_page["slug"])
|
self.api.delete_status_page(status_page["slug"])
|
||||||
|
|
||||||
if parse_version(self.api.version) >= parse_version("1.18"):
|
|
||||||
# delete docker hosts
|
# delete docker hosts
|
||||||
docker_hosts = self.api.get_docker_hosts()
|
docker_hosts = self.api.get_docker_hosts()
|
||||||
for docker_host in docker_hosts:
|
for docker_host in docker_hosts:
|
||||||
self.api.delete_docker_host(docker_host["id"])
|
self.api.delete_docker_host(docker_host["id"])
|
||||||
|
|
||||||
if parse_version(self.api.version) >= parse_version("1.19"):
|
|
||||||
# delete maintenances
|
# delete maintenances
|
||||||
maintenances = self.api.get_maintenances()
|
maintenances = self.api.get_maintenances()
|
||||||
for maintenance in maintenances:
|
for maintenance in maintenances:
|
||||||
self.api.delete_maintenance(maintenance["id"])
|
self.api.delete_maintenance(maintenance["id"])
|
||||||
|
|
||||||
if parse_version(self.api.version) >= parse_version("1.21"):
|
|
||||||
# delete api keys
|
# delete api keys
|
||||||
api_keys = self.api.get_api_keys()
|
api_keys = self.api.get_api_keys()
|
||||||
for api_key in api_keys:
|
for api_key in api_keys:
|
||||||
|
|
|
@ -11,7 +11,6 @@ from typing import Any
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import socketio
|
import socketio
|
||||||
from packaging.version import parse as parse_version
|
|
||||||
|
|
||||||
from . import (AuthMethod,
|
from . import (AuthMethod,
|
||||||
DockerType,
|
DockerType,
|
||||||
|
@ -718,10 +717,6 @@ class UptimeKumaApi(object):
|
||||||
# GAMEDIG
|
# GAMEDIG
|
||||||
game: str = None
|
game: str = None
|
||||||
) -> dict:
|
) -> dict:
|
||||||
# https://github.com/louislam/uptime-kuma/compare/1.21.1...1.21.2#diff-f672603317047f3e6f27b0d7a44f6f244b7dbb5d0d0a85f1059a6b0bc2cb9aa0L910
|
|
||||||
if parse_version(self.version) < parse_version("1.21.2"):
|
|
||||||
maxretries = 0
|
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
"type": type,
|
"type": type,
|
||||||
"name": name,
|
"name": name,
|
||||||
|
@ -730,18 +725,10 @@ class UptimeKumaApi(object):
|
||||||
"maxretries": maxretries,
|
"maxretries": maxretries,
|
||||||
"notificationIDList": notificationIDList,
|
"notificationIDList": notificationIDList,
|
||||||
"upsideDown": upsideDown,
|
"upsideDown": upsideDown,
|
||||||
}
|
"resendInterval": resendInterval,
|
||||||
|
|
||||||
if parse_version(self.version) >= parse_version("1.18"):
|
|
||||||
data.update({
|
|
||||||
"resendInterval": resendInterval
|
|
||||||
})
|
|
||||||
|
|
||||||
if parse_version(self.version) >= parse_version("1.21"):
|
|
||||||
data.update({
|
|
||||||
"description": description,
|
"description": description,
|
||||||
"httpBodyEncoding": httpBodyEncoding
|
"httpBodyEncoding": httpBodyEncoding
|
||||||
})
|
}
|
||||||
|
|
||||||
if type in [MonitorType.KEYWORD, MonitorType.GRPC_KEYWORD]:
|
if type in [MonitorType.KEYWORD, MonitorType.GRPC_KEYWORD]:
|
||||||
data.update({
|
data.update({
|
||||||
|
@ -799,7 +786,6 @@ class UptimeKumaApi(object):
|
||||||
})
|
})
|
||||||
|
|
||||||
# PING
|
# PING
|
||||||
if parse_version(self.version) >= parse_version("1.20"):
|
|
||||||
data.update({
|
data.update({
|
||||||
"packetSize": packetSize,
|
"packetSize": packetSize,
|
||||||
})
|
})
|
||||||
|
@ -906,14 +892,11 @@ class UptimeKumaApi(object):
|
||||||
"strategy": strategy,
|
"strategy": strategy,
|
||||||
"weekdays": weekdays,
|
"weekdays": weekdays,
|
||||||
"daysOfMonth": daysOfMonth,
|
"daysOfMonth": daysOfMonth,
|
||||||
"timeRange": timeRange
|
"timeRange": timeRange,
|
||||||
}
|
|
||||||
if parse_version(self.version) >= parse_version("1.21.2"):
|
|
||||||
data.update({
|
|
||||||
"cron": cron,
|
"cron": cron,
|
||||||
"durationMinutes": durationMinutes,
|
"durationMinutes": durationMinutes,
|
||||||
"timezoneOption": timezoneOption,
|
"timezoneOption": timezoneOption
|
||||||
})
|
}
|
||||||
return data
|
return data
|
||||||
|
|
||||||
# monitor
|
# monitor
|
||||||
|
@ -1211,11 +1194,6 @@ class UptimeKumaApi(object):
|
||||||
]
|
]
|
||||||
"""
|
"""
|
||||||
r = self._call('getGameList')
|
r = self._call('getGameList')
|
||||||
# Workaround, gamelist is not available on first call.
|
|
||||||
# Fixed in https://github.com/louislam/uptime-kuma/commit/7b8ed01f272fc4c6b69ff6299185e936a5e63735
|
|
||||||
# Exists in 1.20.0 - 1.21.0
|
|
||||||
if not r:
|
|
||||||
r = self._call('getGameList')
|
|
||||||
return r.get("gameList")
|
return r.get("gameList")
|
||||||
|
|
||||||
@append_docstring(monitor_docstring("add"))
|
@append_docstring(monitor_docstring("add"))
|
||||||
|
@ -1769,11 +1747,8 @@ class UptimeKumaApi(object):
|
||||||
**config,
|
**config,
|
||||||
"incident": r2["incident"],
|
"incident": r2["incident"],
|
||||||
"publicGroupList": r2["publicGroupList"],
|
"publicGroupList": r2["publicGroupList"],
|
||||||
}
|
|
||||||
if parse_version(self.version) >= parse_version("1.19"):
|
|
||||||
data.update({
|
|
||||||
"maintenanceList": r2["maintenanceList"]
|
"maintenanceList": r2["maintenanceList"]
|
||||||
})
|
}
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def add_status_page(self, slug: str, title: str) -> dict:
|
def add_status_page(self, slug: str, title: str) -> dict:
|
||||||
|
@ -1878,7 +1853,6 @@ class UptimeKumaApi(object):
|
||||||
"""
|
"""
|
||||||
status_page = self.get_status_page(slug)
|
status_page = self.get_status_page(slug)
|
||||||
status_page.pop("incident")
|
status_page.pop("incident")
|
||||||
if parse_version(self.version) >= parse_version("1.19"):
|
|
||||||
status_page.pop("maintenanceList")
|
status_page.pop("maintenanceList")
|
||||||
status_page.update(kwargs)
|
status_page.update(kwargs)
|
||||||
data = _build_status_page_data(**status_page)
|
data = _build_status_page_data(**status_page)
|
||||||
|
@ -2237,7 +2211,6 @@ class UptimeKumaApi(object):
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
# TODO: endless call if only ping monitors used
|
|
||||||
return self._get_event_data(Event.CERT_INFO)
|
return self._get_event_data(Event.CERT_INFO)
|
||||||
|
|
||||||
# uptime
|
# uptime
|
||||||
|
@ -2576,12 +2549,9 @@ class UptimeKumaApi(object):
|
||||||
"steamAPIKey": steamAPIKey,
|
"steamAPIKey": steamAPIKey,
|
||||||
"dnsCache": dnsCache,
|
"dnsCache": dnsCache,
|
||||||
"tlsExpiryNotifyDays": tlsExpiryNotifyDays,
|
"tlsExpiryNotifyDays": tlsExpiryNotifyDays,
|
||||||
"disableAuth": disableAuth
|
"disableAuth": disableAuth,
|
||||||
}
|
|
||||||
if parse_version(self.version) >= parse_version("1.18"):
|
|
||||||
data.update({
|
|
||||||
"trustProxy": trustProxy
|
"trustProxy": trustProxy
|
||||||
})
|
}
|
||||||
return self._call('setSettings', (data, password))
|
return self._call('setSettings', (data, password))
|
||||||
|
|
||||||
def change_password(self, old_password: str, new_password: str) -> dict:
|
def change_password(self, old_password: str, new_password: str) -> dict:
|
||||||
|
|
Loading…
Reference in a new issue