All Products
Search
Document Center

Resource Management:ListTargetAttachmentsForControlPolicy

Last Updated:Feb 28, 2025

Queries the objects to which a specific control policy is attached.

Operation description

In this example, the folders or member accounts to which the control policy cp-jExXAqIYkwHN**** is attached are queried. The returned result shows that the control policy is attached to the folder fd-ZDNPiT****.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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:ListTargetAttachmentsForControlPolicylist
*ControlPolicy
acs:resourcemanager:*:{#accountId}:policy/controlpolicy/{#PolicyId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
PolicyIdstringYes

The ID of the control policy.

cp-jExXAqIYkwHN****
PageNumberintegerNo

The number of the page to return.

Pages start from page 1. Default value: 1.

1
PageSizeintegerNo

The number of entries to return on each page.

Valid values: 1 to 100. Default value: 10.

10

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

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

B32BD3D6-1089-41F3-8E70-E0079BC7D760
PageNumberinteger

The page number of the returned page.

1
PageSizeinteger

The number of entries returned per page.

10
TotalCountinteger

The total number of objects to which the control policy is attached.

1
TargetAttachmentsarray<object>

The list of objects to which the control policy is attached.

TargetAttachmentobject
TargetIdstring

The ID of the object.

fd-ZDNPiT****
TargetNamestring

The name of the object.

Dev_Department
AttachDatestring

The time when the control policy was attached to the object.

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

The type of the object. Valid values:

  • Root: Root folder
  • Folder: child folder of the Root folder
  • Account: member account
Folder

Examples

Sample success responses

JSONformat

{
  "RequestId": "B32BD3D6-1089-41F3-8E70-E0079BC7D760",
  "PageNumber": 1,
  "PageSize": 10,
  "TotalCount": 1,
  "TargetAttachments": {
    "TargetAttachment": [
      {
        "TargetId": "fd-ZDNPiT****",
        "TargetName": "Dev_Department",
        "AttachDate": "2021-03-19T02:56:24Z",
        "TargetType": "Folder"
      }
    ]
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history