Skip to content

Commit 74a579e

Browse files
docs: add async client, healthchecks, pagination to README and CHANGELOG; bump to v1.1.0
1 parent 921e5a4 commit 74a579e

4 files changed

Lines changed: 62 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.0] - 2026-04-09
9+
10+
### Added
11+
12+
- **`AsyncHyperpingClient`** — full async counterpart to `HyperpingClient`. All resources
13+
(monitors, incidents, maintenance, outages, status pages, healthchecks) are available via
14+
`await`. Retry logic uses `asyncio.sleep`; circuit breaker and `RetryConfig` are shared with
15+
the sync client. Exported from `hyperping` top-level.
16+
- **`HealthchecksMixin`** — full CRUD for push-based cron/heartbeat monitoring:
17+
`list_healthchecks`, `get_healthcheck`, `create_healthcheck`, `update_healthcheck`,
18+
`delete_healthcheck`, `pause_healthcheck`, `resume_healthcheck`. `Healthcheck`,
19+
`HealthcheckCreate`, `HealthcheckUpdate` models exported from `hyperping`.
20+
- **Pagination** on `list_outages`, `list_status_pages`, `list_subscribers`. Pass
21+
`page=None` (default) to auto-fetch all pages via `hasNextPage`; pass an explicit
22+
`int` to retrieve a single page. `status` and `outage_type` filter params added to
23+
`list_outages`.
24+
- **Typed `OutageAction`** return type for `acknowledge_outage`, `resolve_outage`,
25+
`escalate_outage`, `unacknowledge_outage` (was `dict[str, Any]`).
26+
- **`_internals.py`** — shared `RETRY_AFTER_MAX`, `DEFAULT_USER_AGENT`, `sanitize_for_log`
27+
used by both sync and async clients (eliminates private cross-module imports).
28+
- **`_monitor_constants.py`** — shared `VALID_PERIODS`, `MONITOR_WRITABLE_FIELDS`
29+
constants used by both sync and async monitor mixins.
30+
- **`collect_all_pages` / `collect_all_pages_async`** helpers in `_utils.py` for
31+
transparent multi-page result aggregation.
32+
833
## [1.0.0] - 2026-04-05
934

1035
First stable release. The public API is production-ready and covered by semver

README.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

4866
Pass 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
107126
client.acknowledge_outage("out_uuid", message="On it")
108127
client.resolve_outage("out_uuid", message="Fixed")
109128
client.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
116136
page = client.get_status_page("sp_uuid")
117137
created = client.create_status_page(StatusPageCreate(name="Prod", subdomain="prod-status"))
118138
client.update_status_page("sp_uuid", StatusPageUpdate(name="Production Status"))
119139
client.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
123143
sub = client.add_subscriber("sp_uuid", "user@example.com")
124144
client.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

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "hyperping"
7-
version = "1.0.1"
7+
version = "1.1.0"
88
description = "Python SDK for the Hyperping uptime monitoring and incident management API"
99
readme = {file = "README.md", content-type = "text/markdown"}
1010
license = {text = "MIT"}

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)