Queries a list of stack groups in an Alibaba Cloud region.
Operation description
In this example, the list of stack groups that are in the ACTIVE state and deployed in the China (Hangzhou) region is queried.
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 |
---|---|---|---|---|
ros:ListStackGroups | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the stack group. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
Status | string | No | The state of the stack group. If you do not specify this parameter, the stack groups in all states in the specified region are queried. Valid values:
| ACTIVE |
PageSize | long | No | The number of entries to return on each page.
| 10 |
PageNumber | long | No | The number of the page to return.
| 1 |
ResourceGroupId | string | No | The ID of the resource group. If you do not specify this parameter, the stack groups in all the resource groups are queried. Note
To obtain the resource group ID, go to the Resource Group page in the Resource Management console. For more information, see View the basic information about a resource group.
| rg-acfmzawhxxcj**** |
Tags | array<object> | No | The tags that are added to the stack group. | |
object | No | |||
Key | string | Yes | The key of the tag that is added to the stack group. Note
Tags is optional. If you specify Tags, you must specify Tags.N.Key.
| usage |
Value | string | No | The value of the tag that is added to the stack group. | test |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSON
format
{
"StackGroups": [
{
"StackGroupId": "fd0ddef9-9540-4b42-a464-94f77835****",
"Status": "ACTIVE",
"DriftDetectionTime": "2020-02-27T07:47:47",
"Description": "My Stack Group",
"StackGroupDriftStatus": "IN_SYNC",
"StackGroupName": "MyStackGroup",
"Tags": [
{
"Key": "usage1",
"Value": "test1"
}
],
"ResourceGroupId": "rg-acfmzawhxxcj****",
"PermissionModel": "SELF_MANAGED",
"AutoDeployment": {
"Enabled": true,
"RetainStacksOnAccountRemoval": true
}
}
],
"TotalCount": 1,
"RequestId": "14A07460-EBE7-47CA-9757-12CC4761D47A",
"PageSize": 10,
"PageNumber": 1
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-05-10 | The response structure of the API has changed | View Change Details |