Queries the resources in a specified stack.
This topic provides an example on how to query the resources in a specified stack.
In this example, the resources in the stack whose ID is 4a6c9851-3b0f-4f5f-b4ca-a14bf691****
in the China (Hangzhou) region are queried.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ListStackResources |
The operation that you want to perform. Set the value to ListStackResources. |
StackId | String | Yes | 4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
The ID of the stack. |
RegionId | String | Yes | cn-hangzhou |
The ID of the region to which the stack belongs. You can call the DescribeRegions operation to query the most recent region list. |
For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | B288A0BE-D927-4888-B0F7-B35EF84B6E6 |
The ID of the request. |
Resources | Array of Resource |
Details about resources. |
|
Status | String | UPDATE_COMPLETE |
The status of the resource. Valid values:
|
LogicalResourceId | String | dummy |
The logical ID of the resource. The logical ID is the resource name that is defined in the template. |
UpdateTime | String | 2019-08-01T06:01:29 |
The time when the resource was updated. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC. |
StackId | String | 4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
The ID of the stack. |
PhysicalResourceId | String | d04af923-e6b7-4272-aeaa-47ec9777**** |
The physical ID of the resource. |
DriftDetectionTime | String | 2020-02-27T07:47:47 |
The most recent point in time when a successful drift detection operation was performed. |
ResourceType | String | ALIYUN::ROS::Stack |
The type of the resource. |
ResourceDriftStatus | String | IN_SYNC |
The drift status of the resource in the most recent successful drift detection. Valid values:
|
StatusReason | String | state changed |
The reason why the resource is in a specific state. |
CreateTime | String | 2019-08-01T06:01:23 |
The time when the resource was created. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC. |
StackName | String | test-describe-resource |
The name of the stack. 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. |
Examples
Sample requests
https://ros.aliyuncs.com/?Action=ListStackResources
&RegionId=cn-hangzhou
&StackId=4a6c9851-3b0f-4f5f-b4ca-a14bf691****
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ListStackResourcesResponse>
<RequestId>B288A0BE-D927-4888-B0F7-B35EF84B6E6</RequestId>
<Resources>
<Status>UPDATE_COMPLETE</Status>
<LogicalResourceId>dummy</LogicalResourceId>
<UpdateTime>2019-08-01T06:01:29</UpdateTime>
<StackId>4a6c9851-3b0f-4f5f-b4ca-a14bf691****</StackId>
<PhysicalResourceId>d04af923-e6b7-4272-aeaa-47ec9777****</PhysicalResourceId>
<DriftDetectionTime>2020-02-27T07:47:47</DriftDetectionTime>
<ResourceType>ALIYUN::ROS::Stack</ResourceType>
<ResourceDriftStatus>IN_SYNC</ResourceDriftStatus>
<StatusReason>state changed</StatusReason>
<CreateTime>2019-08-01T06:01:23</CreateTime>
<StackName>test-describe-resource</StackName>
</Resources>
</ListStackResourcesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "B288A0BE-D927-4888-B0F7-B35EF84B6E6",
"Resources" : [ {
"Status" : "UPDATE_COMPLETE",
"LogicalResourceId" : "dummy",
"UpdateTime" : "2019-08-01T06:01:29",
"StackId" : "4a6c9851-3b0f-4f5f-b4ca-a14bf691****",
"PhysicalResourceId" : "d04af923-e6b7-4272-aeaa-47ec9777****",
"DriftDetectionTime" : "2020-02-27T07:47:47",
"ResourceType" : "ALIYUN::ROS::Stack",
"ResourceDriftStatus" : "IN_SYNC",
"StatusReason" : "state changed",
"CreateTime" : "2019-08-01T06:01:23",
"StackName" : "test-describe-resource"
} ]
}
Error codes
For a list of error codes, visit the API Error Center.
Error code |
Error message |
HTTP status code |
Description |
---|---|---|---|
StackNotFound |
The Stack ({name}) could not be found. |
404 |
The error message returned because the specified stack does not exist. name indicates the name or ID of the stack. |