All Products
Search
Document Center

Resource Orchestration Service:ListStacks

Last Updated:Jun 17, 2026

Queries the list of stacks.

Operation description

Operation description

This topic provides an example of how to query the list of stacks in the China (Hangzhou) region.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ros:ListStacks

get

*Stack

acs:ros:{#regionId}:{#accountId}:stack/*

None None

Request parameters

Parameter

Type

Required

Description

Example

PageSize

integer

No

The number of entries per page when paging is used.

Maximum value: 50.

Default value: 10.

10

ParentStackId

string

No

The ID of the parent stack.

4a6c9851-3b0f-4f5f-b4ca-a14bf691****

RegionId

string

Yes

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

cn-hangzhou

PageNumber

integer

No

The page number of the stack list.

Start value: 1.

Default value: 1.

1

ShowNestedStack

boolean

No

Specifies whether to list nested stacks. Valid values:

  • true

  • false (default)

Note

If ParentStackId is specified, this value is set to true.

true

StackId

string

No

The stack ID. If you do not need detailed stack information, you can specify this parameter instead of calling the GetStack operation.

4a6c9851-3b0f-4f5f-b4ca-a14bf691****

Status

array

No

The stack status.

CREATE_COMPLETE

string

No

The stack status. Valid values:

  • CREATE_IN_PROGRESS: The stack is being created.

  • CREATE_FAILED: The stack failed to be created.

  • CREATE_COMPLETE: The stack is created.

  • UPDATE_IN_PROGRESS: The stack is being updated.

  • UPDATE_FAILED: The stack failed to be updated.

  • UPDATE_COMPLETE: The stack is updated.

  • DELETE_IN_PROGRESS: The stack is being deleted.

  • DELETE_FAILED: The stack failed to be deleted.

  • CREATE_ROLLBACK_IN_PROGRESS: The stack is being rolled back after a creation failure.

  • CREATE_ROLLBACK_FAILED: The stack failed to be rolled back after a creation failure.

  • CREATE_ROLLBACK_COMPLETE: The stack is rolled back after a creation failure.

  • ROLLBACK_IN_PROGRESS: The stack is being rolled back.

  • ROLLBACK_FAILED: The stack failed to be rolled back.

  • ROLLBACK_COMPLETE: The stack is rolled back.

  • CHECK_IN_PROGRESS: The stack is being validated.

  • CHECK_FAILED: The stack failed to be validated.

  • CHECK_COMPLETE: The stack is validated.

  • REVIEW_IN_PROGRESS: The stack is being reviewed.

  • IMPORT_CREATE_IN_PROGRESS: The stack is being created through resource import.

  • IMPORT_CREATE_FAILED: The stack failed to be created through resource import.

  • IMPORT_CREATE_COMPLETE: The stack is created through resource import.

  • IMPORT_CREATE_ROLLBACK_IN_PROGRESS: The stack is being rolled back after a creation failure through resource import.

  • IMPORT_CREATE_ROLLBACK_FAILED: The stack failed to be rolled back after a creation failure through resource import.

  • IMPORT_CREATE_ROLLBACK_COMPLETE: The stack is rolled back after a creation failure through resource import.

  • IMPORT_UPDATE_IN_PROGRESS: The stack is being updated through resource import.

  • IMPORT_UPDATE_FAILED: The stack failed to be updated through resource import.

  • IMPORT_UPDATE_COMPLETE: The stack is updated through resource import.

  • IMPORT_UPDATE_ROLLBACK_IN_PROGRESS: The stack is being rolled back after an update failure through resource import.

  • IMPORT_UPDATE_ROLLBACK_FAILED: The stack failed to be rolled back after an update failure through resource import.

  • IMPORT_UPDATE_ROLLBACK_COMPLETE: The stack is rolled back after an update failure through resource import.

CREATE_COMPLETE

StackName

array

No

The stack name.

MyStack

string

No

The stack name.
The name can be up to 255 characters in length and must start with a digit or letter. It can contain digits, letters, hyphens (-), and underscores (_). Asterisks (*) can be used for fuzzy match.

Valid values of N: 1 to 5.

MyStack

Tag

array<object>

No

The tags of the stack.

object

No

Key

string

No

The tag key of the stack.
Valid values of N: 1 to 20.

usage

Value

string

No

The tag value of the stack.
Valid values of N: 1 to 20.

test

ResourceGroupId

string

No

The resource group ID.
For more information about resource groups, see What is a resource group?.

rg-acfmxazb4ph6aiy****

StackIds

array

No

The list of stack IDs.

string

No

The stack ID. You can specify multiple stack IDs to query the details of multiple stacks at a time. Valid values of N: 1 to 10.

4a6c9851-3b0f-4f5f-b4ca-a14bf691****

StartTime

string

No

The beginning of the time range for filtering by creation time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC+0.

2023-04-01T15:10:00Z

EndTime

string

No

The end of the time range for filtering by creation time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC+0.

2023-04-01T15:16:00Z

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

Response elements

Element

Type

Description

Example

object

TotalCount

integer

The total number of stacks.

2

PageSize

integer

The number of entries per page in paging Settings.

Maximum value: 50.

Default value: 10.

10

RequestId

string

The request ID.

FBAC80B4-9C27-529D-BC9C-4155FA5CD7A7

PageNumber

integer

The page number of the stack list.

1

Stacks

array<object>

The list of stacks.

array<object>

Status

string

The stack status.

CREATE_COMPLETE

UpdateTime

string

The time when the stack was last updated. The time is displayed in UTC+0 in the ISO 8601 standard format without the Z suffix. Format: YYYY-MM-DDThh:mm:ss.

2022-03-10T07:44:36

DriftDetectionTime

string

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

2022-03-10T06:46:36

StatusReason

string

The reason why the stack is in its current status.

Stack CREATE completed successfully

CreateTime

string

The time when the stack was created. The time is displayed in UTC+0 in the ISO 8601 standard format without the Z suffix. Format: YYYY-MM-DDThh:mm:ss.

2022-03-10T06:44:36

DisableRollback

boolean

Indicates whether rollback is disabled when the stack fails to be created. Valid values:

  • true: Rollback is disabled.

  • false (default): Rollback is enabled.

false

Tags

array<object>

The tags of the stack.

object

Key

string

The tag key of the stack.

acs:rm:rgId

Value

string

The tag value of the stack.

rg-aek2frunvw7****

StackName

string

The stack name.

MyStack

TimeoutInMinutes

integer

The timeout period for creating the stack. Unit: minutes. Valid values: 10, 20, 60, 120, and 1440.

This information is generated based on call logs and may be incomplete. Verify the information.

60

RegionId

string

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

cn-hangzhou

ParentStackId

string

The ID of the parent stack.

4a6c9851-3b0f-4f5f-b4ca-a14bf692****

StackId

string

The stack ID.

67805444-a605-45ee-a57f-83908ff6****

StackDriftStatus

string

The drift status of the stack in the most recent successful drift detection. Valid values:

  • DRIFTED: The stack has drifted.

  • NOT_CHECKED: No successful drift detection has been performed on the stack.

  • IN_SYNC: The stack is in sync.

IN_SYNC

StackType

string

The stack type. Valid values:

  • ROS: The stack uses an ROS template.

  • Terraform: The stack uses a Terraform template.

ROS

ResourceGroupId

string

The resource group ID.

rg-aek2frunvw7****

ServiceManaged

boolean

Indicates whether the stack is a managed stack. Valid values:

  • true: The stack is a managed stack.

  • false: The stack is not a managed stack.

false

ServiceName

string

The service name to which the managed stack belongs.

ACVS

OperationInfo

object

The supplementary information that is returned when an error occurs during a stack operation.

Note

This response property is returned only in specific cases and contains at least one sub-property. For example, an error occurs when another cloud service API is called.

Code

string

The error code.

DependencyViolation

Message

string

The error message.

There is still instance(s) in the specified security group.

RequestId

string

The ID of the request that is initiated to call the API operation of another Alibaba Cloud service.

071D6166-3F6B-5C7B-A1F0-0113FBB643A8

Action

string

The name of the API operation that belongs to another Alibaba Cloud service.

DeleteSecurityGroup

ResourceType

string

The type of the resource on which the operation error occurred.

ALIYUN::ECS::SecurityGroup

LogicalResourceId

string

The logical ID of the resource on which the operation error occurred.

EcsSecurityGroup

DeletionProtection

string

Indicates whether deletion protection is enabled for the stack. Valid values:

  • Enabled: Deletion protection is enabled.

  • Disabled: Deletion protection is disabled. You can delete the stack by using the console or by calling the DeleteStack operation.

Note

The deletion protection mechanism of a nested stack is the same as that of the root stack.

Valid values:

  • Enabled :

    Enabled

  • Disabled :

    Disabled

Disabled

Examples

Success response

JSON format

{
  "TotalCount": 2,
  "PageSize": 10,
  "RequestId": "FBAC80B4-9C27-529D-BC9C-4155FA5CD7A7",
  "PageNumber": 1,
  "Stacks": [
    {
      "Status": "CREATE_COMPLETE",
      "UpdateTime": "2022-03-10T07:44:36",
      "DriftDetectionTime": "2022-03-10T06:46:36",
      "StatusReason": "Stack CREATE completed successfully",
      "CreateTime": "2022-03-10T06:44:36",
      "DisableRollback": false,
      "Tags": [
        {
          "Key": "acs:rm:rgId",
          "Value": "rg-aek2frunvw7****"
        }
      ],
      "StackName": "MyStack",
      "TimeoutInMinutes": 60,
      "RegionId": "cn-hangzhou",
      "ParentStackId": "4a6c9851-3b0f-4f5f-b4ca-a14bf692****",
      "StackId": "67805444-a605-45ee-a57f-83908ff6****",
      "StackDriftStatus": "IN_SYNC",
      "StackType": "ROS",
      "ResourceGroupId": "rg-aek2frunvw7****",
      "ServiceManaged": false,
      "ServiceName": "ACVS",
      "OperationInfo": {
        "Code": "DependencyViolation",
        "Message": "There is still instance(s) in the specified security group.",
        "RequestId": "071D6166-3F6B-5C7B-A1F0-0113FBB643A8",
        "Action": "DeleteSecurityGroup",
        "ResourceType": "ALIYUN::ECS::SecurityGroup",
        "LogicalResourceId": "EcsSecurityGroup"
      },
      "DeletionProtection": "Disabled"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.