All Products
Search
Document Center

Resource Management:ListControlPolicyAttachmentsForTarget

Last Updated:Jun 05, 2024

Queries the access control policies that are attached to a folder or member.

Operation description

This topic provides an example on how to call the API operation to query the access control policies that are attached to the folder fd-ZDNPiT****.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
resourcemanager:ListControlPolicyAttachmentsForTargetList
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
TargetIdstringYes

The ID of the object whose access control policies you want to query. Access control policies can be attached to the following objects:

  • Root folder
  • Subfolders of the Root folder
  • Members
fd-ZDNPiT****
LanguagestringNo

The language in which you want to return the descriptions of the access control policies. Valid values:

  • zh-CN (default value): Chinese
  • en: English
  • ja: Japanese
Note This parameter is valid only for system access control policies.
zh-CN

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

C276B600-7B7A-49E8-938C-E16CFA955A82
ControlPolicyAttachmentsobject []

The attached access control policies.

Descriptionstring

The description of the access control policy.

ExampleControlPolicy
EffectScopestring

The effective scope of the access control policy. Valid values:

  • All: The access control policy is in effect for Alibaba Cloud accounts, RAM users, and RAM roles.
  • RAM: The access control policy is in effect only for RAM users and RAM roles.
RAM
PolicyNamestring

The name of the access control policy.

ExampleControlPolicy
PolicyIdstring

The ID of the access control policy.

cp-jExXAqIYkwHN****
AttachDatestring

The time when the access control policy was attached.

2021-03-19T02:56:24Z
PolicyTypestring

The type of the access control policy. Valid values:

  • System: system access control policy
  • Custom: custom access control policy
Custom

Examples

Sample success responses

JSONformat

{
  "RequestId": "C276B600-7B7A-49E8-938C-E16CFA955A82",
  "ControlPolicyAttachments": {
    "ControlPolicyAttachment": [
      {
        "Description": "ExampleControlPolicy",
        "EffectScope": "RAM",
        "PolicyName": "ExampleControlPolicy",
        "PolicyId": "cp-jExXAqIYkwHN****",
        "AttachDate": "2021-03-19T02:56:24Z",
        "PolicyType": "Custom"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
404EntityNotExists.TargetThe specified target does not exist in the resource directory.The specified target does not exist in the resource directory.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history