get-cloud-diagram-resource-relationships
dci get-cloud-diagram-resource-relationships id rid [flags]
Walks the diagram graph from the anchor resource and returns related resources.
Edge traversal walks the diagram's link set (same-scheme guard, BFS, cycle-safe);
group traversal walks the group membership set. The result list is capped at 200
relations; truncated is true when the cap is hit. Read-only: does not mutate
diagram state.
Flags
--direction: (string default:"both" enum:"downstream","upstream","both")
--depth: (string default:"direct" enum:"direct","transitive")
--kind: (string default:"edges" enum:"edges","group_members","both")
Output
OK - Related resources returned.
By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.
| Field | Type | Description |
|---|---|---|
anchor | object | The anchor resource the traversal started from. |
anchor.id | string | Anchor resource ID (matches the rid path parameter). |
anchor.type | string | Component bucket the anchor lives in. One of: "node", "element", "group". |
anchor.name | string | Human-readable resource name. |
anchor.serviceType | string | Cloud service type when available (e.g. Amazon RDS, GCP Cloud SQL). |
direction | string | One of: "downstream", "upstream", "both". |
depth | string | One of: "direct", "transitive". |
kind | string | One of: "edges", "group_members", "both". |
relations | array of object | Resources related to the anchor (capped at 200). |
relations[].id | string | Related resource ID. |
relations[].type | string | Component bucket the related resource lives in. One of: "node", "element", "group". |
relations[].name | string | Human-readable name of the related resource. |
relations[].serviceType | string | Cloud service type when available. |
relations[].relation | string | How the resource is related to the anchor. downstream / upstream are edge relations (anchor is the edge origin / destination respectively). group_member means the related resource is contained in the anchor (anchor is a group); group_parent means the related resource is a group that contains the anchor. One of: "downstream", "upstream", "group_member", "group_parent". |
relations[].hops | integer | Edge hop count from the anchor. Group-member / group-parent entries are reported as 1. |
truncated | boolean | True when the relation list was capped at 200 entries. |
Raw JSON schema
{
"type": "object",
"required": [
"anchor",
"direction",
"depth",
"kind",
"relations",
"truncated"
],
"description": "The response payload for the resource relationships endpoint.",
"properties": {
"anchor": {
"type": "object",
"required": [
"id",
"type",
"name"
],
"description": "The anchor resource the traversal started from.",
"properties": {
"id": {
"type": "string",
"description": "Anchor resource ID (matches the `rid` path parameter)."
},
"type": {
"type": "string",
"enum": [
"node",
"element",
"group"
],
"description": "Component bucket the anchor lives in."
},
"name": {
"type": "string",
"description": "Human-readable resource name."
},
"serviceType": {
"type": "string",
"description": "Cloud service type when available (e.g. `Amazon RDS`, `GCP Cloud SQL`)."
}
}
},
"direction": {
"type": "string",
"enum": [
"downstream",
"upstream",
"both"
]
},
"depth": {
"type": "string",
"enum": [
"direct",
"transitive"
]
},
"kind": {
"type": "string",
"enum": [
"edges",
"group_members",
"both"
]
},
"relations": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"type",
"name",
"relation",
"hops"
],
"description": "One related resource returned by the traversal.",
"properties": {
"id": {
"type": "string",
"description": "Related resource ID."
},
"type": {
"type": "string",
"enum": [
"node",
"element",
"group"
],
"description": "Component bucket the related resource lives in."
},
"name": {
"type": "string",
"description": "Human-readable name of the related resource."
},
"serviceType": {
"type": "string",
"description": "Cloud service type when available."
},
"relation": {
"type": "string",
"enum": [
"downstream",
"upstream",
"group_member",
"group_parent"
],
"description": "How the resource is related to the anchor. `downstream` / `upstream` are edge\nrelations (anchor is the edge origin / destination respectively).\n`group_member` means the related resource is contained in the anchor (anchor is\na group); `group_parent` means the related resource is a group that contains\nthe anchor."
},
"hops": {
"type": "integer",
"minimum": 1,
"description": "Edge hop count from the anchor. Group-member / group-parent entries are reported as 1."
}
}
},
"description": "Resources related to the anchor (capped at 200)."
},
"truncated": {
"type": "boolean",
"description": "True when the relation list was capped at 200 entries."
}
}
}
Errors
On failure, dci prints a single error message — with a hint when one is available — and exits with a typed code your scripts can branch on. See Errors and exit codes for the full contract.
| HTTP status | Exit code | Error code | Meaning |
|---|---|---|---|
| 400 | 30 | VALIDATION_ERROR | The arguments or request body were rejected. Review the command's flags and payload. |
| 401 | 10 | AUTHENTICATION_FAILED | Not signed in, or the API token is invalid. Run dci login or check DCI_API_KEY. |
| 403 | 11 | PERMISSION_DENIED | The DoiT user or the active customer context does not have access. |
| 404 | 20 | RESOURCE_NOT_FOUND | The requested resource does not exist. Check the identifier argument. |
Aliases: getclouddiagramresourcerelationships