All Products
Search
Document Center

Resource Orchestration Service:ListStackInstances

Last Updated:Feb 22, 2024

Queries the list of stack instances that are associated with a stack group in an Alibaba Cloud region.

Operation description

In this example, the list of stack instances that are associated with a stack group named MyStackGroup is queried. The stack group is granted self-managed permissions and deployed in the China (Hangzhou) region.

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:ListStackInstancesLIST
  • All Resources
    *
    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
StackGroupNamestringYes

The name of the stack group. The name must be unique within a region.
The name can be up to 255 characters in length, and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

MyStackGroup
StackInstanceAccountIdstringNo

The ID of the destination account to which the stack belongs.

  • If the stack group is granted self-managed permissions, the stack belongs to an Alibaba Cloud account.
  • If the stack group is granted service-managed permissions, the stack belongs to a member in a resource directory.
Note For more information about the destination account, see Overview .
156552876021****
StackInstanceRegionIdstringNo

The region ID of the stack.

cn-beijing
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

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

Response parameters

ParameterTypeDescriptionExample
object
TotalCountinteger

The total number of stacks.

1
RequestIdstring

The request ID.

85DE34BD-7FF9-480F-8C21-556E9DA93ACD
PageSizeinteger

The number of entries returned per page.

1
PageNumberinteger

The page number of the returned page.

1
StackInstancesobject []

The stacks.

Statusstring

The state of the stack.

Valid values:

  • CURRENT: The stack is up-to-date with the stack group.

  • OUTDATED: The stack is not up-to-date with the stack group. Stacks are in the OUTDATED state due to the following possible reasons:

    • When the CreateStackInstances operation is called to create stacks, the stacks fail to be created.
    • When the UpdateStackInstances or UpdateStackGroup operation is called to update stacks, the stacks fail to be updated, or only specific stacks are updated.
    • The creation or update operation is not complete.
CURRENT
StackGroupIdstring

The ID of the stack group.

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

The stack ID.

Note This parameter is returned only if the stack is in the CURRENT state.
35ad60e3-6a92-42d8-8812-f0700d45****
DriftDetectionTimestring

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

Note This parameter is returned only if drift detection is performed on the stack group.
2020-02-27T07:47:47
StackDriftStatusstring

The state of the stack when the last successful drift detection was performed on the stack group.

Valid values:

  • DRIFTED: The stack has drifted.
  • NOT_CHECKED: No successful drift detection is performed on the stack.
  • IN_SYNC: The stack is being synchronized.
Note This parameter is returned only if drift detection is performed on the stack group.
IN_SYNC
StatusReasonstring

The reason why the stack instance is in the OUTDATED state.

Note This parameter is returned only if the stack instance is in the OUTDATED state.
User initiated stop
StackGroupNamestring

The name of the stack group.

MyStackGroup
AccountIdstring

The ID of the destination account to which the stack belongs.

156552876021****
RegionIdstring

The region ID of the stack.

cn-beijing
RdFolderIdstring

The ID of the folder in the resource directory.

Note This parameter is returned only if the stack group is granted service-managed permissions.
fd-4PvlVLOL8v

Examples

Sample success responses

JSONformat

{
  "TotalCount": 1,
  "RequestId": "85DE34BD-7FF9-480F-8C21-556E9DA93ACD",
  "PageSize": 1,
  "PageNumber": 1,
  "StackInstances": [
    {
      "Status": "CURRENT",
      "StackGroupId": "fd0ddef9-9540-4b42-a464-94f77835****",
      "StackId": "35ad60e3-6a92-42d8-8812-f0700d45****",
      "DriftDetectionTime": "2020-02-27T07:47:47",
      "StackDriftStatus": "IN_SYNC",
      "StatusReason": "User initiated stop",
      "StackGroupName": "MyStackGroup",
      "AccountId": "156552876021****",
      "RegionId": "cn-beijing",
      "RdFolderId": "fd-4PvlVLOL8v"
    }
  ]
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history