2022-09-07 21:32:33 -07:00
|
|
|
from app.notify_client import NotifyAdminAPIClient, cache
|
2022-08-05 00:25:03 -07:00
|
|
|
|
2016-11-30 17:01:44 +00:00
|
|
|
|
|
|
|
|
class StatusApiClient(NotifyAdminAPIClient):
|
2016-01-29 14:41:07 +00:00
|
|
|
def get_status(self, *params):
|
2023-11-28 17:33:17 -05:00
|
|
|
return self.get(*params, url="/_status")
|
2018-10-26 15:39:32 +01:00
|
|
|
|
2023-08-25 09:12:23 -07:00
|
|
|
@cache.set("live-service-and-organization-counts", ttl_in_seconds=3600)
|
2023-07-12 12:09:44 -04:00
|
|
|
def get_count_of_live_services_and_organizations(self):
|
2023-08-25 09:12:23 -07:00
|
|
|
return self.get(url="/_status/live-service-and-organization-counts")
|
2019-04-10 17:20:51 +01:00
|
|
|
|
2023-08-25 09:12:23 -07:00
|
|
|
@cache.set("live-service-and-organization-counts", ttl_in_seconds=3600)
|
2023-07-12 12:09:44 -04:00
|
|
|
def get_count_of_live_services_and_organizations_cached(self):
|
2023-08-25 09:12:23 -07:00
|
|
|
return self.get(url="/_status/live-service-and-organization-counts")
|
2022-09-07 21:32:33 -07:00
|
|
|
|
2018-10-26 15:39:32 +01:00
|
|
|
|
|
|
|
|
status_api_client = StatusApiClient()
|