get-role
dci get-role <id>
Returns a single role by ID. Preset roles are visible to every customer; a custom role is returned only to the customer that owns it. A service account of a parent tenant can read a descendant tenant's role by setting X-Tenant-Id to that tenant's customer ID.
id— The unique ID of the role.
Output
OK - Role 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 |
|---|---|---|
role | object | Definition and permissions assigned to a role. |
role.id | string | The unique ID of the role. |
role.name | string | The name of the role. |
role.type | string | The type of the role (preset or custom). |
role.description | string | The description of the role. |
role.customer | string | The customer ID if this is a custom role. |
role.permissions | array of string | List of permission IDs assigned to the role. |
role.childTenantEligible | boolean | Whether the owning tenant made this role available as a child tenant role. |
Raw JSON schema
{
"type": "object",
"description": "Response returned when reading a single role.",
"properties": {
"role": {
"type": "object",
"description": "Definition and permissions assigned to a role.",
"properties": {
"id": {
"type": "string",
"description": "The unique ID of the role."
},
"name": {
"type": "string",
"description": "The name of the role."
},
"type": {
"type": "string",
"description": "The type of the role (preset or custom)."
},
"description": {
"type": "string",
"description": "The description of the role."
},
"customer": {
"type": "string",
"description": "The customer ID if this is a custom role."
},
"permissions": {
"type": "array",
"description": "List of permission IDs assigned to the role.",
"items": {
"type": "string"
}
},
"childTenantEligible": {
"type": "boolean",
"description": "Whether the owning tenant made this role available as a child tenant role."
}
}
}
}
}
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 to exit code mapping
| HTTP status | Exit code | Error code | Meaning |
|---|---|---|---|
| 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. |
| 500 | 40 | API_SERVER_ERROR | The API failed to process the request. Retryable; contact DoiT support if it persists. |
Related
- create-role — Create role
- delete-role — Delete role
- list-roles — List roles
- update-role — Update role
- API reference: GET /iam/v1/roles/{id}
Aliases: getrole