Skip to content

Entity Relations

Relations let you express dependencies and structural relationships between entities. They power dependency graphs — useful for blast-radius analysis ("if this DB goes down, which APIs are affected?") and topology views.

Relation types

Type Meaning
depends_on Source entity depends on the target to function
parent_of Source is a logical parent or container of the target
calls Source calls / invokes the target (RPC, HTTP, queue)
related_to Generic association with no directional implication

Creating relations

wnp relations add \
  --from <entity-id> \
  --to <entity-id> \
  --type depends_on
curl -X POST https://api.wanepia.com/v1/relations \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "from_entity_id": "...",
    "to_entity_id": "...",
    "relation_type": "depends_on"
  }'

Listing relations

wnp relations list
ID         FROM       TYPE         TO
a1b2c3d4   payments   depends_on   postgres-main
e5f6g7h8   payments   calls        notification-svc

Removing a relation

wnp relations rm <relation-id>

Example: mapping a typical backend stack

payments-api  ──depends_on──►  postgres-primary
payments-api  ──depends_on──►  redis-cache
payments-api  ──calls──────►   notification-service
payments-api  ──calls──────►   fraud-service
notification-service  ──depends_on──►  sendgrid (third-party)

With this graph in place, when postgres-primary goes down you can immediately see that payments-api is in the blast radius.