You can call the GrantPermissions operation to grant a Resource Access Management (RAM) user the permissions to manage Container Service for Kubernetes (ACK) clusters.
Operation description
- Make sure that you have granted the RAM user at least read-only permissions on the desired ACK clusters in the RAM console. Otherwise, the
ErrorRamPolicyConfig
error code is returned. For more information about how to authorize a RAM user by attaching RAM policies, see Create a custom RAM policy. - If you use a RAM user to call this API operation, make sure that the RAM user is authorized to modify the permissions of other RAM users on the desired ACK clusters. Otherwise, the
StatusForbidden
orForbiddenGrantPermissions
error code is returned. For more information, see Use a RAM user to grant RBAC permissions to other RAM users. - This operation overwrites the permissions that have been granted to the specified RAM user. When you call this operation, make sure that the required permissions are included.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
cs:GrantPermission | Write |
|
| none |
Request syntax
POST /permissions/users/{uid}
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
uid | string | Yes | The ID of the RAM user. | 2367**** |
body | object [] | No | The request body. | |
cluster | string | Yes | The ID of the cluster that you want to manage.
| c796c60*** |
is_custom | boolean | No | Specifies whether to perform a custom authorization. To perform a custom authorization, set | false |
role_name | string | Yes | The predefined role name. Valid values:
| ops |
role_type | string | Yes | The authorization type. Valid values:
| cluster |
namespace | string | No | The namespace to which the permissions are scoped. This parameter is required only if you set role_type to namespace. | test |
is_ram_role | boolean | No | Specifies whether the permissions are granted to a RAM role. | false |
Response parameters
Examples
Sample success responses
JSON
format
{}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||
---|---|---|---|---|
2024-01-09 | The internal configuration of the API is changed, but the call is not affected | see changesets | ||
|