Healthchecks
Healthchecks verify the availability of a service item or service by making an HTTP request to a configured URL. Results are stored as healthcheck records that can be listed and retrieved. Healthchecks can be triggered on demand at any time.
update and delete are not supported — healthcheck records are immutable once created.
Accessed via client.healthchecks.
Model properties
| Property | Type | Description |
|---|---|---|
id |
int |
Healthcheck record ID |
status |
str |
Result status of the check |
url |
str |
The URL that was checked |
method |
str |
HTTP method used (e.g. GET) |
interval |
int |
Check interval in seconds |
service_id |
int |
Associated service ID |
service_item_id |
int |
Associated service item ID |
created |
datetime |
When this check ran |
modified |
datetime |
Last modified timestamp |
Methods
list(**filters)
Returns a lazy generator of past healthcheck records.
Filters:
| Filter | Type | Description |
|---|---|---|
ordering |
str |
Sort field — prefix with - for descending (e.g. -created) |
for hc in client.healthchecks.list():
print(hc.id, hc.status, hc.created)
# Most recent first
for hc in client.healthchecks.list(ordering="-created"):
print(hc.id, hc.status)
filter(**filters)
Same as list() but returns all results as a list. Accepts the same filters.
results = client.healthchecks.filter(ordering="-created")
print(f"{len(results)} healthcheck records")
get(id)
Retrieves a single healthcheck record by ID.
hc = client.healthchecks.get(10)
print(hc.id)
print(hc.status)
print(hc.url)
print(hc.method)
print(hc.service_id)
print(hc.service_item_id)
print(hc.created)
create(data)
Creates a new healthcheck configuration record. Once created, NetOrca will run this check on the configured schedule.
| Field | Type | Required | Description |
|---|---|---|---|
target_url |
str |
yes | URL to send the healthcheck request to |
service |
int |
no | Service to associate with this check |
authorization |
str |
no | Authorization header value |
verify |
bool |
no | Whether to verify SSL certificates (default: True) |
timeout |
int |
no | Request timeout in seconds |
schedule_crontab |
str |
no | Cron expression for scheduled checks |
schedule_enabled |
bool |
no | Whether scheduled checks are active |
hc = client.healthchecks.create({
"target_url": "https://my-service.internal/health",
"service": 45,
"schedule_crontab": "*/5 * * * *",
"schedule_enabled": True,
"verify": True,
"timeout": 10
})
print(hc.id)
trigger_service_item(service_item_id)
Runs a healthcheck against a specific service item right now and returns the result. This is an active check — it does not just look up a stored record, it initiates the check.
| Parameter | Type | Description |
|---|---|---|
service_item_id |
int |
The service item to check |
trigger_service(service_id)
Runs a healthcheck against all service items belonging to a service and returns the result. Use this to check the health of an entire service at once.
| Parameter | Type | Description |
|---|---|---|
service_id |
int |
The service to check |