All Products
Search
Document Center

Resource Orchestration Service:ListStacks

Last Updated:Apr 25, 2024

Queries a list of stacks.

Operation description

This topic provides an example on how to query a list of stacks. In this example, the 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.

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

Request parameters

ParameterTypeRequiredDescriptionExample
PageSizelongNo

The number of entries per page.

Maximum value: 50.

Default value: 10.

10
ParentStackIdstringNo

The ID of the parent stack.

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

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

cn-hangzhou
PageNumberlongNo

The page number.

Pages start from page 1.

Default value: 1.

1
ShowNestedStackbooleanNo

Specifies whether to return nested stacks. Valid values:

  • true
  • false (default)
Note If you specify ParentStackId, you must set ShowNestedStack to true.
true
StackIdstringNo

The stack ID. You can specify this parameter to query only the stack ID. If you want to query the detailed information about the stack, call the GetStack operation.

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

The status of the stack.

stringNo

The state 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 resources are being rolled back after the stack fails to be created.
  • CREATE_ROLLBACK_FAILED: The resources fail to be rolled back after the stack fails to be created.
  • CREATE_ROLLBACK_COMPLETE: The resources are rolled back after the stack fails to be created.
  • ROLLBACK_IN_PROGRESS: The resources of the stack are being rolled back.
  • ROLLBACK_FAILED: The resources of the stack fail to be rolled back.
  • ROLLBACK_COMPLETE: The resources of the stack are 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 using imported resources.
  • IMPORT_CREATE_FAILED: The stack fails to be created by using imported resources.
  • IMPORT_CREATE_COMPLETE: The stack is created by using imported resources.
  • IMPORT_CREATE_ROLLBACK_IN_PROGRESS: The resources are being rolled back after the stack fails to be created by using imported resources.
  • IMPORT_CREATE_ROLLBACK_FAILED: The resources fail to be rolled back after the stack fails to be created by using imported resources.
  • IMPORT_CREATE_ROLLBACK_COMPLETE: The resources are rolled back after the stack fails to be created by using imported resources.
  • IMPORT_UPDATE_IN_PROGRESS: The stack is being updated by using imported resources.
  • IMPORT_UPDATE_FAILED: The stack fails to be updated by using imported resources.
  • IMPORT_UPDATE_COMPLETE: The stack is updated by using imported resources.
  • IMPORT_UPDATE_ROLLBACK_IN_PROGRESS: The resources are being rolled back after the stack fails to be updated by using imported resources.
  • IMPORT_UPDATE_ROLLBACK_FAILED: The resources fail to be rolled back after the stack fails to be updated by using imported resources.
  • IMPORT_UPDATE_ROLLBACK_COMPLETE: The resources are rolled back after the stack fails to be updated by using imported resources.
CREATE_COMPLETE
StackNamearrayNo

The names of the stacks.

stringNo

The name of stack N.
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. You can use the wildcard character (*) for fuzzy search.

Valid values of N: 1 to 5.

MyStack
Tagobject []No

The tags of the stack.

KeystringNo

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

usage
ValuestringNo

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

test
ResourceGroupIdstringNo

The ID of the resource group.
For more information about resource groups, see the "Resource Group" section of the What is Resource Management? topic.

rg-acfmxazb4ph6aiy****
StackIdsarrayNo

The IDs of the stacks.

stringNo

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.

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

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

2023-04-01T15:10:00Z
EndTimestringNo

The end of the time range during which data was queried. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2023-04-01T15:16:00Z

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

Response parameters

ParameterTypeDescriptionExample
object
TotalCountinteger

The total number of stacks.

2
PageSizeinteger

The number of entries per page.

Maximum value: 50.

Default value: 10.

10
RequestIdstring

The request ID.

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

The page number.

1
Stacksobject []

Details of the stacks.

Statusstring

The state of the stack.

CREATE_COMPLETE
UpdateTimestring

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.

2022-03-10T07:44:36
DriftDetectionTimestring

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

2022-03-10T06:46:36
StatusReasonstring

The reason why the stack is in its current state.

Stack CREATE completed successfully
CreateTimestring

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.

2022-03-10T06:44:36
DisableRollbackboolean

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

  • true
  • false (default)
false
Tagsobject []

The tags of the stack.

Keystring

The tag key of the stack.

acs:rm:rgId
Valuestring

The tag value of the stack.

rg-aek2frunvw7****
StackNamestring

The stack name.

MyStack
TimeoutInMinutesinteger

The timeout period for creating the stack. Unit: minutes.

60
RegionIdstring

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

cn-hangzhou
ParentStackIdstring

The ID of the parent stack.

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

The stack ID.

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

The state of the stack on which the most recent successful drift detection was performed. 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.
IN_SYNC
StackTypestring

The stack type. Valid values:

  • ROS: ROS stack. The stack is created by using a ROS template.
  • Terraform: Terraform stack. The stack is created by using a Terraform template.
ROS
ResourceGroupIdstring

The ID of the resource group.

rg-aek2frunvw7****
ServiceManagedboolean

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

  • true
  • false
false
ServiceNamestring

The name of the service to which the managed stack belongs.

ACVS
OperationInfoobject

The supplementary information that is returned if an error occurs on a stack operation.

Note This parameter is returned only under specific conditions, and is returned together with at least one sub-parameter. For example, an error occurred when an API operation of another Alibaba Cloud service was called.
Codestring

The error code.

DependencyViolation
Messagestring

The error message.

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

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

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

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

DeleteSecurityGroup
ResourceTypestring

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

ALIYUN::ECS::SecurityGroup
LogicalResourceIdstring

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

EcsSecurityGroup
DeletionProtectionstring

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

  • Enabled: Deletion protection is enabled for the stack.
  • Disabled: Deletion protection is disabled for the stack. In this case, you can delete the stack by using the console or calling the DeleteStack operation.
Note Deletion protection of a nested stack is the same as that of its root stack.
Disabled

Examples

Sample success responses

JSONformat

{
  "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

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

Change history

Change timeSummary of changesOperation
2023-08-11The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.
2023-04-13The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: StartTime
    Added Input Parameters: EndTime
2022-02-22The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.