Queries the list of stacks.
Description
This topic provides an example on how to query the list of stacks. In this example, the stacks that are deployed in the China (Hangzhou) region are queried.
Debugging
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:
|
StackId | String | No | 4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
The ID of the stack. If you want to query the basic information about the stack, you can use this parameter and do not need to call the GetStack operation. |
Status.N | String | No | CREATE_COMPLETE |
The state N of the stack. Valid values:
|
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 the wildcard character (∗) 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. |
ResourceGroupId | String | No | rg-acfmxazb4ph6aiy**** |
The ID of the resource group. For more information about resource groups, see the "Resource Group" section of the What is Resource Management? topic. |
StackIds.N | String | No | 4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
The ID of stack N. You can specify one or more IDs to query one or more 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 | 2 |
The total number of stacks. |
PageSize | Integer | 10 |
The number of entries returned per page. Maximum value: 50. Default value: 10. |
RequestId | String | FBAC80B4-9C27-529D-BC9C-4155FA5CD7A7 |
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 state of the stack. |
UpdateTime | String | 2022-03-10T07:44:36 |
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 | 2022-03-10T06:46:36 |
The time when the last successful drift detection was performed on the stack. |
StatusReason | String | Stack CREATE completed successfully |
The reason why the stack is in its current state. |
CreateTime | String | 2022-03-10T06:44:36 |
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:
|
Tags | Array of Tag |
The tags of the stack. |
|
Key | String | acs:rm:rgId |
The tag key of the stack. |
Value | String | rg-aek2frunvw7**** |
The tag value of the stack. |
StackName | String | MyStack |
The name of the stack. |
TimeoutInMinutes | Integer | 60 |
The timeout period that is allowed 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 | 67805444-a605-45ee-a57f-83908ff6**** |
The ID of the stack. |
StackDriftStatus | String | IN_SYNC |
The state of the stack on which the last successful drift detection was performed. Valid values:
|
StackType | String | ROS |
The type of the stack. Valid values:
|
ResourceGroupId | String | rg-aek2frunvw7**** |
The ID of the resource group. |
ServiceManaged | Boolean | false |
Indicates whether the stack is a managed stack. Valid values:
|
ServiceName | String | ACVS |
The name of the service to which the managed stack belongs. |
OperationInfo | Object |
The supplementary information that is returned when an operation fails to be performed on the stack. Note This parameter is returned if an operation fails to be performed on the stack. The
system returns at least one sub-property. Example: An error occurred when the API
operation of another Alibaba Cloud service was called.
|
|
Code | String | DependencyViolation |
The error code. |
Message | String | There is still instance(s) in the specified security group. |
The error message. |
RequestId | String | 071D6166-3F6B-5C7B-A1F0-0113FBB643A8 |
The ID of the request that is initiated to call the API operation of another Alibaba Cloud service. |
Action | String | DeleteSecurityGroup |
The name of the API operation that belongs to another Alibaba Cloud service. |
ResourceType | String | ALIYUN::ECS::SecurityGroup |
The type of the resource on which an operation fails to be performed. |
LogicalResourceId | String | EcsSecurityGroup |
The logical ID of the resource on which an operation fails to be performed. |
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>
<TotalCount>2</TotalCount>
<PageSize>10</PageSize>
<RequestId>FBAC80B4-9C27-529D-BC9C-4155FA5CD7A7</RequestId>
<PageNumber>1</PageNumber>
<Stacks>
<Status>CREATE_COMPLETE</Status>
<UpdateTime>2022-03-10T07:44:36</UpdateTime>
<DriftDetectionTime>2022-03-10T06:46:36</DriftDetectionTime>
<StatusReason>Stack CREATE completed successfully</StatusReason>
<CreateTime>2022-03-10T06:44:36</CreateTime>
<DisableRollback>false</DisableRollback>
<Tags>
<Key>acs:rm:rgId</Key>
<Value>rg-aek2frunvw7****</Value>
</Tags>
<StackName>MyStack</StackName>
<TimeoutInMinutes>60</TimeoutInMinutes>
<RegionId>cn-hangzhou</RegionId>
<ParentStackId>4a6c9851-3b0f-4f5f-b4ca-a14bf692****</ParentStackId>
<StackId>67805444-a605-45ee-a57f-83908ff6****</StackId>
<StackDriftStatus>IN_SYNC</StackDriftStatus>
<StackType>ROS</StackType>
<ResourceGroupId>rg-aek2frunvw7****</ResourceGroupId>
<ServiceManaged>false</ServiceManaged>
<ServiceName>ACVS</ServiceName>
<OperationInfo>
<Code>DependencyViolation</Code>
<Message>There is still instance(s) in the specified security group.</Message>
<RequestId>071D6166-3F6B-5C7B-A1F0-0113FBB643A8</RequestId>
<Action>DeleteSecurityGroup</Action>
<ResourceType>ALIYUN::ECS::SecurityGroup</ResourceType>
<LogicalResourceId>EcsSecurityGroup</LogicalResourceId>
</OperationInfo>
</Stacks>
</ListStacksResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"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"
}
}
}
Error codes
For a list of error codes, see Service error codes.