Queries the stack groups.

In this example, the stack groups that are in the active state and created in the China (Hangzhou) region are queried.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListStackGroups

The operation that you want to perform. Set the value to ListStackGroups.

RegionId String Yes cn-hangzhou

The region ID of the stack group. You can call the DescribeRegions operation to query the most recent region list.

Status String No ACTIVE

The status of the stack group. If you do not specify this parameter, stack groups in all states in the specified region are queried.

Valid values:

  • ACTIVE
  • DELETED
PageSize Long No 10

The number of entries to return on each page.

  • Valid values: 1 to 50.
  • Default value: 10.
PageNumber Long No 1

The number of the page to return.

  • Pages start from page 1.
  • Default value: 1.
ResourceGroupId String No rg-acfmzawhxxcj****

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 basic information about a resource group.

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

Response parameters

Parameter Type Example Description
StackGroups Array of StackGroup

The details of the stack groups.

StackGroupId String fd0ddef9-9540-4b42-a464-94f77835****

The ID of the stack group.

Status String ACTIVE

The status of the stack group.

Valid values:

  • ACTIVE
  • DELETED
DriftDetectionTime String 2020-02-27T07:47:47

The time when the last drift detection was performed on the stack group.

Description String My Stack Group

The description of the stack group.

StackGroupDriftStatus String IN_SYNC

The drift status of the stack group on which the last drift detection was performed.

Valid values:

  • DRIFTED: The stack group has drifted.
  • NOT_CHECKED: No drift detection is completed on the stack group.
  • IN_SYNC: No drifts are detected on the stack group.
StackGroupName String MyStackGroup

The name of the stack group.

ResourceGroupId String rg-acfmzawhxxcj****

The ID of the resource group.

PermissionModel String SELF_MANAGED

The permission model.

Valid values:

  • SELF_MANAGED: the self-managed permission model
  • SERVICE_MANAGED: the service-managed permission model
Note For more information about the permission models of stack groups, see Overview.
AutoDeployment Object

The information about automatic deployment settings.

Enabled Boolean true

Indicates whether automatic deployment is enabled.

Valid values:

  • true: Automatic deployment is enabled. If a member account is added to the folder to which the stack group belongs after automatic deployment is enabled, the stack group deploys its stack instances in the specified region where the added account is deployed. If the account is deleted from the folder, the stack instances in the specified region are deleted from the stack group.
  • false: Automatic deployment is disabled. After automatic deployment is disabled, the stack instances remain unchanged when the member account in the folder is changed.
RetainStacksOnAccountRemoval Boolean true

Indicates whether stacks in the member account are retained when the member account is deleted from the folder.

Valid values:

  • true: The stacks are retained.
  • false: The stacks are deleted.
Note This parameter is returned only when the Enabled parameter is set to true.
TotalCount Integer 1

The total number of stack groups.

RequestId String 14A07460-EBE7-47CA-9757-12CC4761D47A

The ID of the request.

PageSize Integer 10

The number of entries returned per page.

PageNumber Integer 1

The page number of the returned page.

Examples

Sample requests

http(s)://ros.aliyuncs.com/?Action=ListStackGroups
&RegionId=cn-hangzhou
&Status=ACTIVE
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListStackGroupsResponse>
    <StackGroups>
        <Status>ACTIVE</Status>
        <StackGroupDriftStatus>NOT_CHECKED</StackGroupDriftStatus>
        <AutoDeployment/>
        <ResourceGroupId>rg-acfmzawhxxcj****</ResourceGroupId>
        <PermissionModel>SELF_MANAGED</PermissionModel>
        <StackGroupName>MyStackGroup</StackGroupName>
        <StackGroupId>fd0ddef9-9540-4b42-a464-94f77835****</StackGroupId>
    </StackGroups>
    <TotalCount>1</TotalCount>
    <RequestId>14A07460-EBE7-47CA-9757-12CC4761D47A</RequestId>
    <PageSize>10</PageSize>
    <PageNumber>1</PageNumber>
</ListStackGroupsResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "StackGroups" : [ {
    "Status" : "ACTIVE",
    "StackGroupDriftStatus" : "NOT_CHECKED",
    "AutoDeployment" : { },
    "ResourceGroupId" : "rg-acfmzawhxxcj****",
    "PermissionModel" : "SELF_MANAGED",
    "StackGroupName" : "MyStackGroup",
    "StackGroupId" : "fd0ddef9-9540-4b42-a464-94f77835****"
  } ],
  "TotalCount" : 1,
  "RequestId" : "14A07460-EBE7-47CA-9757-12CC4761D47A",
  "PageSize" : 10,
  "PageNumber" : 1
}

Error codes

For a list of error codes, visit the API Error Center.

Error code

Error message

HTTP status code

Description

InvalidParameter

The specified parameter {name} is invalid, {reason}.

400

The error message returned because the specified parameter is invalid. name indicates the parameter name. reason indicates the reason for the error.