All Products
Search
Document Center

Resource Management:ListMultiAccountResourceGroups

Last Updated:Jun 21, 2024

Queries the resource groups within the management account or a member of a resource directory by using the management account of the resource directory or a delegated administrator account of Resource Center.

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
resourcecenter:SearchMultiAccountResourcesRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
MaxResultsintegerNo

The maximum number of entries to return on each page.

Maximum value: 100. Default value: 10.

20
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results.

AAAAAS2Nboi3t4xGrdlG5/Ks/Q1xPG9jzviYEuZydevXIkgF
AccountIdstringYes

The ID of the management account or member of the resource directory.

1394339739****
ResourceGroupIdsarrayNo

The IDs of resource groups.

stringNo

The ID of a resource group.

rg-acfmzawhxxc****

Response parameters

ParameterTypeDescriptionExample
object

The returned result.

NextTokenstring

The pagination token that is used in the next request to retrieve a new page of results.

AAAAAU5VsT9R1adMTuz9GzginZ3Y+7Y/5JATS+6q5GK9kT75
ResourceGroupsobject []

The information about the resource groups.

DisplayNamestring

The display name of the resource group.

group1
Statusstring

The status of the resource group. Valid values:

  • Creating: The resource group is being created.
  • OK: The resource group is created.
  • PendingDelete: The resource group is waiting to be deleted.
OK
AccountIdstring

The ID of the management account or member of the resource directory.

1394339739****
Namestring

The unique identifier of the resource group.

my-project
CreateDatestring

The time when the resource group was created.

2021-06-30T09:20:08Z
Idstring

The ID of the resource group.

rg-acfmzawhxxc****
RequestIdstring

The ID of the request.

0FF0A66E-781F-51EE-9531-928F197558F2

Examples

Sample success responses

JSONformat

{
  "NextToken": "AAAAAU5VsT9R1adMTuz9GzginZ3Y+7Y/5JATS+6q5GK9kT75",
  "ResourceGroups": [
    {
      "DisplayName": "group1",
      "Status": "OK",
      "AccountId": "1394339739****",
      "Name": "my-project",
      "CreateDate": "2021-06-30T09:20:08Z",
      "Id": "rg-acfmzawhxxc****"
    }
  ],
  "RequestId": "0FF0A66E-781F-51EE-9531-928F197558F2"
}

Error codes

HTTP status codeError codeError messageDescription
400NoPermissionYou are not authorized to perform this operation.You are not authorized to perform the operation.
400InvalidParameter.MaxResultsThe specified parameter MaxResults is not valid.The MaxResults parameter is invalid.
400MultiAccountServiceNotEnabledMulti account ResourceCenter service is not enabled.The Resource Meta Center (RMC) service is not activated.
404NotExists.ResourceDirectoryThe resource directory for the account is not enabled.No resource directory is enabled for the account.
404NotExists.ResourceGroupThe specified ResourceGroup does not exist.The specified resource group does not exist.
409NoPermission.ResourceDirectory.MemberAccountResourceDirectory Member Account is not authorized to perform this operation.You are not allowed to use a member of a resource directory to perform this operation. Use the management account of the resource directory to perform the operation.
409InvalidParameter.AccountIdThe specified parameter AccountId is not valid.The AccountId parameter is invalid.
409InvalidParameter.ResourceGroupIdThe specified parameter ResourceGroupId is not valid.The ResourceGroupId parameter is invalid.

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

Change history

Change timeSummary of changesOperation
2023-05-05The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
    delete Error Codes: 404
    delete Error Codes: 409