Queries the list of stacks.

Description

In this example, the list of stacks that are deployed 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 ListStacks

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

PageSize Long No 10

The number of entries to return on each page.

Maximum value: 50.

Default value: 10.

ParentStackId String No 4a6c9851-3b0f-4f5f-b4ca-a14bf691****

The ID of the parent stack.

RegionId String Yes cn-hangzhou

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

PageNumber Long No 1

The number of the page to return.

Pages start from page 1.

Default value: 1.

ShowNestedStack Boolean No true

Specifies whether to return nested stacks. Default value: false. Valid values:

  • true
  • false
    Note If you specify the ParentStackId parameter, you must set the ShowNestedStack parameter to true.
StackId String No 4a6c9851-3b0f-4f5f-b4ca-a14bf691****

The ID of the stack. You can specify this parameter to query only the stack ID. If you need to query details of the stack, call the GetStack operation.

ResourceGroupId String No rg-acfmxazb4ph6aiy****

The ID of the resource group.

For more information about resource groups, see Resource groups.

Status.N String No CREATE_COMPLETE

The status of the stack. Valid values:

  • CREATE_IN_PROGRESS: The stack is being created.
  • CREATE_FAILED: The stack fails to be created.
  • CREATE_COMPLETE: The stack is created.
  • UPDATE_IN_PROGRESS: The stack is being updated.
  • UPDATE_FAILED: The stack fails to be updated.
  • UPDATE_COMPLETE: The stack is updated.
  • DELETE_IN_PROGRESS: The stack is being deleted.
  • DELETE_FAILED: The stack fails to be deleted.
  • CREATE_ROLLBACK_IN_PROGRESS: The stack is being rolled back after the stack fails to be created.
  • CREATE_ROLLBACK_FAILED: The stack fails to be rolled back after the stack fails to be created.
  • CREATE_ROLLBACK_COMPLETE: The stack is rolled back after the stack fails to be created.
  • ROLLBACK_IN_PROGRESS: The stack is being rolled back.
  • ROLLBACK_FAILED: The stack fails to be rolled back.
  • ROLLBACK_COMPLETE: The stack is rolled back.
  • CHECK_IN_PROGRESS: The stack is being validated.
  • CHECK_FAILED: The stack fails 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 by importing resources.
  • IMPORT_CREATE_FAILED: The stack fails to be created by importing resources.
  • IMPORT_CREATE_COMPLETE: The stack is created by importing resources.
  • IMPORT_CREATE_ROLLBACK_IN_PROGRESS: The stack is being rolled back after the stack fails to be created by importing resources.
  • IMPORT_CREATE_ROLLBACK_FAILED: The stack fails to be rolled back after the stack fails to be created by importing resources.
  • IMPORT_CREATE_ROLLBACK_COMPLETE: The stack is rolled back after the stack fails to be created by importing resources.
  • IMPORT_UPDATE_IN_PROGRESS: The stack is being updated by importing resources.
  • IMPORT_UPDATE_FAILED: The stack fails to be updated by importing resources.
  • IMPORT_UPDATE_COMPLETE: The stack is updated by importing resources.
  • IMPORT_UPDATE_ROLLBACK_IN_PROGRESS: The stack is being rolled back after the stack fails to be updated by importing resources.
  • IMPORT_UPDATE_ROLLBACK_FAILED: The stack fails to be rolled back after the stack fails to be updated by importing resources.
  • IMPORT_UPDATE_ROLLBACK_COMPLETE: The stack is rolled back after the stack fails to be updated by importing resources.
StackName.N String No MyStack

The name of stack N.

The name can be up to 255 characters in length, and can contain digits, letters, hyphens (-), and underscores (_). The name must start with a digit or letter. You can use wildcard characters (∗) for fuzzy search.

Valid values of N: 1 to 5.

Tag.N.Key String No usage

The key of tag N of the stack.

Valid values of N: 1 to 20.

Tag.N.Value String No test

The value of tag N of the stack.

Valid values of N: 1 to 20.

StackIds.N String No 4a6c9851-3b0f-4f5f-b4ca-a14bf691****

The ID of stack N.

You can specify one or more IDs to query multiple stacks at the same time.

Valid values of N: 1 to 10.

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

Response parameters

Parameter Type Example Description
TotalCount Integer 1

The total number of stacks.

PageSize Integer 10

The number of entries returned per page.

Maximum value: 50.

Default value: 10.

RequestId String B288A0BE-D927-4888-B0F7-B35EF84B6E6F

The ID of the request.

PageNumber Integer 1

The page number of the returned page.

Stacks Array of Stack

The list of stacks.

Status String CREATE_COMPLETE

The status of the stack.

UpdateTime String 2019-08-01T04:07:39

The time when the stack was updated. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.

DriftDetectionTime String 2020-02-27T07:47:47

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

StatusReason String Stack successfully created

The reason why the stack is in a specific state.

CreateTime String 2019-08-01T04:07:39

The time when the stack was created. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.

DisableRollback Boolean false

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

  • true: Rollback is disabled when the stack fails to be created.
  • false: Rollback is enabled when the stack fails to be created.
Tags Array of Tag

The tags of the stack.

Key String usage

The tag key of the stack.

Value String test

The tag value of the stack.

StackName String MyStack

The name of the stack.

TimeoutInMinutes Integer 10

The timeout period that is specified to create the stack. Unit: minutes.

RegionId String cn-hangzhou

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

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

The ID of the parent stack.

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

The ID of the stack.

StackDriftStatus String IN_SYNC

The status of the stack on which the last drift successful detection was performed. Valid values:

  • DRIFTED: Drift detection is being performed on the stack.
  • NOT_CHECKED: No successful drift detection is performed on the stack.
  • IN_SYNC: The stack is being synchronized.
StackType String ROS

The stack type. Valid values:

  • ROS: The stack is created by using a Resource Orchestration Service (ROS) template.
  • Terraform: The stack is created by using a Terraform template.
ResourceGroupId String rg-acfmxazb4ph6aiy****

The ID of the resource group.

Examples

Sample requests

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

Sample success responses

XML format

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

<ListStacksResponse>
	<Stacks>
		<StackId>4a6c9851-3b0f-4f5f-b4ca-a14bf691****</StackId>
		<ParentStackId>4a6c9851-3b0f-4f5f-b4ca-a14bf692****</ParentStackId>
		<StackName>MyStack</StackName>
		<RegionId>cn-hangzhou</RegionId>
        <ResourceGroupId>rg-acfmxazb4ph6aiy****</ResourceGroupId>
		<DisableRollback>false</DisableRollback>
		<CreateTime>2019-08-01T04:07:39</CreateTime>
		<Status>CREATE_COMPLETE</Status>
		<StatusReason>Stack successfully created</StatusReason>
		<Tags>
			<Value>test</Value>
			<Key>usage</Key>
		</Tags>
		<TimeoutInMinutes>10</TimeoutInMinutes>
		<UpdatedTime>2019-08-01T04:07:39</UpdatedTime>
		<DriftDetectionTime>2020-02-27T07:47:47</DriftDetectionTime>
		<StackDriftStatus>IN_SYNC</StackDriftStatus>
		<StackType>ROS</StackType>
	</Stacks>
	<PageNumber>1</PageNumber>
	<PageSize>10</PageSize>
	<TotalCount>1</TotalCount>
	<RequestId>B288A0BE-D927-4888-B0F7-B35EF84B6E6F</RequestId>
</ListStacksResponse>

JSON format

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

{
  "Stacks" : [ {
    "StackId" : "4a6c9851-3b0f-4f5f-b4ca-a14bf691****",
    "ParentStackId" : "4a6c9851-3b0f-4f5f-b4ca-a14bf692****",
    "StackName" : "MyStack",
    "RegionId" : "cn-hangzhou",
    "ResourceGroupId" : "rg-acfmxazb4ph6aiy****",
    "DisableRollback" : false,
    "CreateTime" : "2019-08-01T04:07:39",
    "Status" : "CREATE_COMPLETE",
    "StatusReason" : "Stack successfully created",
    "Tags" : [ {
      "Value" : "test",
      "Key" : "usage"
    } ],
    "TimeoutInMinutes" : 10,
    "UpdatedTime" : "2019-08-01T04:07:39",
    "DriftDetectionTime" : "2020-02-27T07:47:47",
    "StackDriftStatus" : "IN_SYNC",
    "StackType" : "ROS"
  } ],
  "PageNumber" : 1,
  "PageSize" : 10,
  "TotalCount" : 1,
  "RequestId" : "B288A0BE-D927-4888-B0F7-B35EF84B6E6F"
}

Error codes

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