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.
Operation description
For more information about common request parameters, see Common parameters.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ros:ListStackResources | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
StackId | string | Yes | The ID of the region to which the stack belongs. You can call the DescribeRegions operation to query the most recent region list. | 4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
RegionId | string | Yes | The ID of the request. | cn-hangzhou |
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. |
Response parameters
The operation that you want to perform. Set the value to ListStackResources.
Examples
Sample success responses
JSON
format
{
"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",
"ModuleInfo": {
"LogicalIdHierarchy": "moduleA/moduleB",
"TypeHierarchy": "MODULE::ROS::Parent::Example/MODULE::ROS::Child::Example"
}
}
]
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-05-10 | The response structure of the API has changed | View Change Details |