Record that a component depends on another
const url = 'https://example.com/api/v1/components/codec-1/dependencies';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"kind":"power","outlet":"3","upstream":"pdu-1"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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).
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Name of the dependent component, or a dotted address (e.g. boi.17c.415a.$comp.display-1)
Name of the dependent component, or a dotted address (e.g. boi.17c.415a.$comp.display-1)
Request Bodyrequired
Section titled “ Request Bodyrequired ”object
A URL to the JSON Schema for this object.
How it depends: power, host or path
The upstream’s outlet that feeds this component: required on a power edge, refused on any other
Name or uuid of the component this one depends on, or a dotted address
Responses
Section titled “ Responses ”Created
object
A URL to the JSON Schema for this object.
Name of the dependent component, the one that goes down with the upstream
The dependent component’s uuid
When the edge was recorded
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)
The upstream’s outlet that feeds the component; set on a power edge only
Name of the component it depends on
The upstream component’s uuid
Example
{ "$schema": "/api/v1/schemas/ComponentDependencyBody.json", "kind": "power"}default
Section titled “ default ”Error
object
A URL to the JSON Schema for this object.
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
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"}