All Products
Search
Document Center

Resource Orchestration Service:ListStackGroups

Last Updated:Sep 12, 2024

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

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
ros:ListStackGroupsget
  • StackGroup
    acs:ros:{#regionId}:{#accountId}:stackgroup/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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

cn-hangzhou
StatusstringNo

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
  • DELETED
ACTIVE
PageSizelongNo

The number of entries to return on each page.

  • Valid values: 1 to 50.
  • Default value: 10.
10
PageNumberlongNo

The number of the page to return.

  • Pages start from page 1.
  • Default value: 1.
1
ResourceGroupIdstringNo

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****
Tagsarray<object>No

The tags that are added to the stack group.

objectNo
KeystringYes

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
ValuestringNo

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

ParameterTypeDescriptionExample
object
StackGroupsarray<object>

The stack groups.

object
StackGroupIdstring

The ID of the stack group.

fd0ddef9-9540-4b42-a464-94f77835****
Statusstring

The state of the stack group.

Valid values:

  • ACTIVE
  • DELETED
ACTIVE
DriftDetectionTimestring

The time when the most recent successful drift detection was performed on the stack group.

2020-02-27T07:47:47
Descriptionstring

The description of the stack group.

My Stack Group
StackGroupDriftStatusstring

The drift state of the stack group on which the most recent successful drift detection was performed.

Valid values:

  • DRIFTED: The stack group has drifted.
  • NOT_CHECKED: No drift detection is performed on the stack group.
  • IN_SYNC: No drifts are detected on the stack group.
IN_SYNC
StackGroupNamestring

The name of the stack group.

MyStackGroup
Tagsarray<object>

The tags that are added to the stack group.

object
Keystring

The key of the tag that is added to the stack group.

usage1
Valuestring

The value of the tag that is added to the stack group.

test1
ResourceGroupIdstring

The ID of the resource group.

rg-acfmzawhxxcj****
PermissionModelstring

The permission model of the stack group.

Valid values:

  • SELF_MANAGED
  • SERVICE_MANAGED
Note For more information about the permission models of stack groups, see Overview .
SELF_MANAGED
AutoDeploymentobject

The information about automatic deployment settings.

Enabledboolean

Indicates whether automatic deployment is enabled.

Valid values:

  • true: Automatic deployment is enabled. If you add a member to the folder to which the stack group belongs after automatic deployment is enabled, Resource Orchestration Service (ROS) automatically adds the stack instances in the stack group to the specified region of the member. If you delete the member from the folder, ROS automatically deletes the stack instances in the stack group from the specified region of the member.
  • false: Automatic deployment is disabled. After you disable automatic deployment, the stack instances remain unchanged when you change the member in the folder.
true
RetainStacksOnAccountRemovalboolean

Indicates whether the stacks within a member are retained when you delete the member from the folder.

Valid values:

  • true
  • false
Note This parameter is returned only if Enabled is set to true.
true
TotalCountinteger

The total number of stack groups.

1
RequestIdstring

The request ID.

14A07460-EBE7-47CA-9757-12CC4761D47A
PageSizeinteger

The number of entries returned per page.

10
PageNumberinteger

The page number of the returned page.

1

Examples

Sample success responses

JSONformat

{
  "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 timeSummary of changesOperation
2024-05-10The response structure of the API has changedView Change Details