メインコンテンツへスキップ

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.

FieldTypeDescription
anchorobjectThe anchor resource the traversal started from.
anchor.idstringAnchor resource ID (matches the rid path parameter).
anchor.typestringComponent bucket the anchor lives in. One of: "node", "element", "group".
anchor.namestringHuman-readable resource name.
anchor.serviceTypestringCloud service type when available (e.g. Amazon RDS, GCP Cloud SQL).
directionstringOne of: "downstream", "upstream", "both".
depthstringOne of: "direct", "transitive".
kindstringOne of: "edges", "group_members", "both".
relationsarray of objectResources related to the anchor (capped at 200).
relations[].idstringRelated resource ID.
relations[].typestringComponent bucket the related resource lives in. One of: "node", "element", "group".
relations[].namestringHuman-readable name of the related resource.
relations[].serviceTypestringCloud service type when available.
relations[].relationstringHow 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[].hopsintegerEdge hop count from the anchor. Group-member / group-parent entries are reported as 1.
truncatedbooleanTrue 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 statusExit codeError codeMeaning
40030VALIDATION_ERRORThe arguments or request body were rejected. Review the command's flags and payload.
40110AUTHENTICATION_FAILEDNot signed in, or the API token is invalid. Run dci login or check DCI_API_KEY.
40311PERMISSION_DENIEDThe DoiT user or the active customer context does not have access.
40420RESOURCE_NOT_FOUNDThe requested resource does not exist. Check the identifier argument.

Aliases: getclouddiagramresourcerelationships