@@ -43,6 +43,24 @@ with HyperpingClient(api_key="sk_...") as client:
4343 client.resolve_incident(incident.uuid, " All systems operational" )
4444```
4545
46+ ## Async Client
47+
48+ An async-first client is available for use with ` asyncio ` and ` anyio ` -based frameworks:
49+
50+ ``` python
51+ from hyperping import AsyncHyperpingClient
52+
53+ async def main ():
54+ async with AsyncHyperpingClient(api_key = " sk_..." ) as client:
55+ monitors = await client.list_monitors()
56+ for m in monitors:
57+ print (f " { m.name} : { ' down' if m.down else ' up' } " )
58+
59+ outage = await client.acknowledge_outage(" out_uuid" , message = " On it" )
60+ ```
61+
62+ The async client supports all the same resources, retry behaviour, and circuit breaker as the sync client. Use ` RetryConfig ` and ` CircuitBreakerConfig ` in exactly the same way.
63+
4664## Authentication
4765
4866Pass your API key directly or via environment variable:
@@ -103,7 +121,8 @@ in_maint = client.is_monitor_in_maintenance("mon_uuid")
103121### Outages
104122
105123``` python
106- outages = client.list_outages()
124+ outages = client.list_outages() # auto-fetches all pages
125+ outages = client.list_outages(page = 0 ) # single page
107126client.acknowledge_outage(" out_uuid" , message = " On it" )
108127client.resolve_outage(" out_uuid" , message = " Fixed" )
109128client.escalate_outage(" out_uuid" )
@@ -112,18 +131,31 @@ client.escalate_outage("out_uuid")
112131### Status Pages
113132
114133``` python
115- pages = client.list_status_pages(search = " prod" )
134+ pages = client.list_status_pages(search = " prod" ) # auto-fetches all pages
135+ pages = client.list_status_pages(page = 0 ) # single page
116136page = client.get_status_page(" sp_uuid" )
117137created = client.create_status_page(StatusPageCreate(name = " Prod" , subdomain = " prod-status" ))
118138client.update_status_page(" sp_uuid" , StatusPageUpdate(name = " Production Status" ))
119139client.delete_status_page(" sp_uuid" )
120140
121141# Subscribers
122- subs = client.list_subscribers(" sp_uuid" )
142+ subs = client.list_subscribers(" sp_uuid" ) # auto-fetches all pages
123143sub = client.add_subscriber(" sp_uuid" , " user@example.com" )
124144client.remove_subscriber(" sp_uuid" , sub.id)
125145```
126146
147+ ### Healthchecks
148+
149+ ``` python
150+ checks = client.list_healthchecks()
151+ check = client.get_healthcheck(" hc_uuid" )
152+ created = client.create_healthcheck(HealthcheckCreate(name = " Nightly Job" , period = 86400 , grace = 3600 ))
153+ client.update_healthcheck(" hc_uuid" , HealthcheckUpdate(grace = 7200 ))
154+ client.pause_healthcheck(" hc_uuid" )
155+ client.resume_healthcheck(" hc_uuid" )
156+ client.delete_healthcheck(" hc_uuid" )
157+ ```
158+
127159## Error Handling
128160
129161``` python
0 commit comments