Skip to main content

update-resource-permission

dci update-resource-permission resourceType resourceId

Updates the permissions associated with the specified Cloud Analytics resource. Supports Allocations, Alerts, Budgets, and Reports.

Request

Content-Type: application/json

Schema

{
"type": "object",
"properties": {
"permissions": {
"type": "array",
"items": {
"type": "object",
"description": "A single user's permission entry for a resource.",
"properties": {
"user": {
"type": "string",
"description": "The email address of the user to whom the role is assigned."
},
"role": {
"type": "string",
"description": "The role assigned to the user, defining their level of access to the resource.",
"enum": [
"owner",
"editor",
"viewer"
]
}
}
}
},
"public": {
"type": "string",
"description": "The type of permissions granted to all users in the organization for this resource.",
"enum": [
"editor",
"viewer"
],
"nullable": true
}
}
}

Output

OK - Resource permissions configuration updated.

By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.

FieldTypeDescription
idstringResource ID.
namestringResource name.
descriptionstringResource description.
createTimeinteger (int64)The time when this resource was created, in milliseconds since the epoch.
updateTimeinteger (int64)The time when this resource was last updated, in milliseconds since the epoch.
permissionsarray of object
permissions[].userstringThe email address of the user to whom the role is assigned.
permissions[].rolestringThe role assigned to the user, defining their level of access to the resource. One of: "owner", "editor", "viewer".
publicstringType of permissions users in the entire organization have for this resource One of: "editor", "viewer".
Raw JSON schema
{
"type": "object",
"description": "Permissions and metadata for a resource returned by the sharing API.",
"properties": {
"id": {
"type": "string",
"description": "Resource ID."
},
"name": {
"type": "string",
"description": "Resource name."
},
"description": {
"type": "string",
"description": "Resource description."
},
"createTime": {
"type": "integer",
"description": "The time when this resource was created, in milliseconds since the epoch.",
"format": "int64"
},
"updateTime": {
"type": "integer",
"description": "The time when this resource was last updated, in milliseconds since the epoch.",
"format": "int64"
},
"permissions": {
"type": "array",
"items": {
"type": "object",
"description": "A single user's permission entry for a resource.",
"properties": {
"user": {
"type": "string",
"description": "The email address of the user to whom the role is assigned."
},
"role": {
"type": "string",
"description": "The role assigned to the user, defining their level of access to the resource.",
"enum": [
"owner",
"editor",
"viewer"
]
}
}
}
},
"public": {
"type": "string",
"description": "Type of permissions users in the entire organization have for this resource",
"enum": [
"editor",
"viewer"
],
"nullable": true
}
}
}

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.
50040API_SERVER_ERRORThe API failed to process the request. Retryable; contact DoiT support if it persists.

Aliases: updateresourcepermission