Skip to content

Record that a component depends on another

POST
/components/{name}/dependencies
curl --request POST \
--url https://example.com/api/v1/components/codec-1/dependencies \
--header 'Content-Type: application/json' \
--data '{ "kind": "power", "outlet": "3", "upstream": "pdu-1" }'

Records that this component depends on the upstream: power (fed from the named outlet of the upstream; the outlet is required on this kind and refused on the others), host (hosted by the upstream, so a reboot of the upstream holds this component’s endpoints too) or path (reached through the upstream, so while the upstream’s gate is closed on this component’s outpost its in-band endpoints are held with an upstream reason naming it). A component never depends on itself, one edge of a kind joins a pair once (a 409 for the second), and an edge whose upstream already depends on this component through edges of the same kind would close a cycle and is a 422. The edge is a fact about the dependent: gated by component:update on it (a dependent the caller reads but cannot write is a 403), with the upstream resolved in the caller’s component:read (outside it, a non-disclosing 404).

name
required

Name of the dependent component, or a dotted address (e.g. boi.17c.415a.$comp.display-1)

string

Name of the dependent component, or a dotted address (e.g. boi.17c.415a.$comp.display-1)

Media type application/json
object
$schema

A URL to the JSON Schema for this object.

string format: uri
kind
required

How it depends: power, host or path

string
Allowed values: power host path
outlet

The upstream’s outlet that feeds this component: required on a power edge, refused on any other

string
<= 64 characters
upstream
required

Name or uuid of the component this one depends on, or a dotted address

string
>= 1 characters

Created

Media type application/json
object
$schema

A URL to the JSON Schema for this object.

string format: uri
component
required

Name of the dependent component, the one that goes down with the upstream

string
component_id
required

The dependent component’s uuid

string
created_at
required

When the edge was recorded

string format: date-time
kind
required

How it depends: power (fed from an outlet of the upstream, a PDU), host (hosted by the upstream, a codec and the peripheral it reboots, a chassis and its line card) or path (reached through the upstream, a gateway)

string
Allowed values: power host path
outlet

The upstream’s outlet that feeds the component; set on a power edge only

string
upstream
required

Name of the component it depends on

string
upstream_id
required

The upstream component’s uuid

string

Example

{
"$schema": "/api/v1/schemas/ComponentDependencyBody.json",
"kind": "power"
}

Error

Media type application/problem+json
object
$schema

A URL to the JSON Schema for this object.

string format: uri
detail

A human-readable explanation specific to this occurrence of the problem.

string
errors

Optional list of individual error details

Array<object> | null
object
location

Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’

string
message

Error message text

string
value

The value at the given location

instance

A URI reference that identifies the specific occurrence of the problem.

string format: uri
status

HTTP status code

integer format: int64
title

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

string
type

A URI reference to human-readable documentation for the error.

string format: uri
default: about:blank

Example

{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}