Skip to content

Entities

An entity is a concrete instance of a blueprint — a specific database, API, worker, or any infrastructure component you want to track. Entities carry field values, a current health status, and a full history of state transitions.

Anatomy of an entity

Field Type Description
slug string URL-safe identifier, unique per blueprint
name string Human-readable label
blueprint_id UUID The blueprint this entity belongs to
current_status enum up, degraded, down, unknown
status_changed_at timestamp When the status last changed
fields array Key-value pairs matching the blueprint's field defs

Creating an entity

# Simple
wnp entities create api --slug payments-api --name "Payments API"

# With custom fields
wnp entities create api \
  --slug payments-api \
  --name "Payments API" \
  --field team=platform \
  --field repo_url=https://github.com/acme/payments
curl -X POST https://api.wanepia.com/v1/blueprints/api/entities \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "slug": "payments-api",
    "name": "Payments API",
    "fields": {
      "team": "platform",
      "repo_url": "https://github.com/acme/payments"
    }
  }'

Listing entities

wnp entities list api
SLUG          NAME           STATUS   CREATED
payments-api  Payments API   up       2024-01-15 09:23
auth-api      Auth API       down     2024-01-10 14:01

GET /v1/blueprints/{blueprint_slug}/entities

Updating an entity

wnp entities update api payments-api \
  --name "Payments API v2" \
  --field team=payments
curl -X PUT https://api.wanepia.com/v1/blueprints/api/entities/payments-api \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "Payments API v2", "fields": {"team": "payments"}}'

Deleting an entity

wnp entities delete api payments-api

Warning

Deleting an entity also deletes all its checks and check results. State transitions are preserved in the audit log.

Status lifecycle

Entities start at unknown. As checks run, status evolves automatically:

unknown → up         (first successful check)
up      → degraded   (threshold consecutive failures, not yet fully down)
up      → down       (threshold failures, no degraded intermediate)
down    → up         (recovery)

See State Machine for the full transition rules.

Viewing state history

wnp checks transitions <check-id>
TRANSITION         REASON                 WHEN
up → down          3 consecutive fails    2024-01-20 03:17
unknown → up       first success          2024-01-15 09:24