Updated on 2024-12-16 GMT+08:00

Updating an Agency Permission Policy

Function

This API is used to update an agency permission policy.

URI

PUT /v5/{project_id}/agency/{agency_name}/policy

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

For details about how to obtain the project ID, see Obtaining a Project ID.

agency_name

Yes

String

Agency name.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token obtained from IAM. It is a response to the IAM API for obtaining a user token. After a request is processed, the value of X-Subject-Token in the header is the token value.

X-Language

No

String

Request language type. The default value is en-us.

Values:

  • en-us
  • zh-cn
Table 3 Request body parameters

Parameter

Mandatory

Type

Description

unbind_role_names

Yes

Array of strings

Permissions policies to be unbound from an agency.

bind_role_names

Yes

Array of strings

Permissions policies to be bound to an agency.

Response Parameters

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Updating an agency permission policy

https://{endpoint}/v5/054e292c9880d4992f02c0196d3ea468/agency/DRS_AGENTCY/policy

{
  "unbind_role_names" : [ "Tenant Administrator" ],
  "bind_role_names" : [ "DRS FullAccess" ]
}

Example Response

Status code: 200

Success.

{ }

Status Code

Status Code

Description

200

Success.

400

Client error.

500

Server error.

Error Code

For details, see Error Code.