Queries a resource in a stack.
Operation description
This topic provides an example to show how to query the details of a resource named WebServer in a stack whose ID is 4a6c9851-3b0f-4f5f-b4ca-a14bf691**** in the China (Hangzhou) region.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ros:GetStackResource |
get |
*stack
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| StackId |
string |
Yes |
The stack ID. |
4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
| ClientToken |
string |
No |
Ensures the idempotence of the request. The value is generated by the client and must be globally unique. The value can be up to 64 characters in length and can contain letters, digits, hyphens (-), and underscores (_). For more information, see How to ensure idempotence. |
123e4567-e89b-12d3-a456-42665544**** |
| RegionId |
string |
Yes |
The region ID of the stack. You can call the DescribeRegions operation to query the most recent region list. |
cn-hangzhou |
| ShowResourceAttributes |
boolean |
No |
Specifies whether to query resource attributes. Valid values:
|
true |
| LogicalResourceId |
string |
Yes |
The logical ID of the resource, which is the name of the resource in the template. |
WebServer |
| ResourceAttributes |
array |
No |
Specifies the list of resource output attributes to query. Note
The maximum value of N is 20. |
|
|
string |
No |
Specifies the name of the resource output attribute to query. Note
The maximum value of N is 20. |
InstanceId |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Status |
string |
The resource status. Valid values:
|
CREATE_COMPLETE |
| Description |
string |
The resource description. |
no description |
| RequestId |
string |
The request ID. |
B288A0BE-D927-4888-B0F7-B35EF84B6E6 |
| StatusReason |
string |
The reason for the resource status. |
state changed |
| PhysicalResourceId |
string |
The physical ID of the resource, which is the actual resource ID. |
d04af923-e6b7-4272-aeaa-47ec9777**** |
| CreateTime |
string |
The creation time. The time is displayed in UTC without the Z suffix and follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. |
2019-08-01T06:01:23 |
| Metadata |
object |
The metadata. |
{"key": "value"} |
| ResourceType |
string |
The resource type. |
ALIYUN::ROS::WaitConditionHandle |
| ResourceAttributes |
array<object> |
The list of resource attributes. |
|
|
object |
The list of resource attributes. |
[{"ResourceAttributeKey": "CurlCli","ResourceAttributeValue": "curl -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'x-acs-region-id: cn-beijing' http://192.168.XX.XX/waitcondition?stackname=test-describe-resource\\&stackid=efdf5c10-96a5-4fd7-ab89-68e7baa2****\\&resource=WaitConditionHandle\\&expire=156468****\\&signature=991d910a901a89db6580d74233119960c004****"}] |
|
| LogicalResourceId |
string |
The logical ID of the resource, which is the name of the resource in the template. |
WebServer |
| ResourceDriftStatus |
string |
The drift status of the resource in the most recent successful drift detection of the stack. Valid values:
|
IN_SYNC |
| UpdateTime |
string |
The update time. The time is displayed in UTC without the Z suffix and follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. |
2019-08-01T06:01:29 |
| DriftDetectionTime |
string |
The time when the resource was checked in the most recent successful drift detection of the stack. The time follows the YYYY-MM-DDThh:mm:ss format. |
2020-02-27T07:47:47 |
| StackName |
string |
The stack name. 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 a letter. |
test-describe-resource |
| StackId |
string |
The stack ID. |
efdf5c10-96a5-4fd7-ab89-68e7baa2**** |
| ModuleInfo |
object |
The information about the module from which the resource originates. This parameter is returned only when the resource originates from a module. |
|
| LogicalIdHierarchy |
string |
The concatenated list of logical IDs of one or more modules that contain the resource. The modules are listed starting from the outermost module and separated by forward slashes (/). In the following example, the resource is created from moduleB, which is nested in the parent module moduleA.
|
moduleA/moduleB |
| TypeHierarchy |
string |
The concatenated list of types of one or more modules that contain the resource. The module types are listed starting from the outermost module and separated by forward slashes (/). In the following example, the resource is created from a module of the
|
MODULE::ROS::Parent::Example/MODULE::ROS::Child::Example |
Examples
Success response
JSON format
{
"Status": "CREATE_COMPLETE",
"Description": "no description",
"RequestId": "B288A0BE-D927-4888-B0F7-B35EF84B6E6",
"StatusReason": "state changed",
"PhysicalResourceId": "d04af923-e6b7-4272-aeaa-47ec9777****",
"CreateTime": "2019-08-01T06:01:23",
"Metadata": {
"key": "value"
},
"ResourceType": "ALIYUN::ROS::WaitConditionHandle",
"ResourceAttributes": [
[
{
"ResourceAttributeKey": "CurlCli",
"ResourceAttributeValue": "curl -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'x-acs-region-id: cn-beijing' http://192.168.XX.XX/waitcondition?stackname=test-describe-resource\\&stackid=efdf5c10-96a5-4fd7-ab89-68e7baa2****\\&resource=WaitConditionHandle\\&expire=156468****\\&signature=991d910a901a89db6580d74233119960c004****"
}
]
],
"LogicalResourceId": "WebServer",
"ResourceDriftStatus": "IN_SYNC",
"UpdateTime": "2019-08-01T06:01:29",
"DriftDetectionTime": "2020-02-27T07:47:47",
"StackName": "test-describe-resource",
"StackId": "efdf5c10-96a5-4fd7-ab89-68e7baa2****",
"ModuleInfo": {
"LogicalIdHierarchy": "moduleA/moduleB\n",
"TypeHierarchy": "MODULE::ROS::Parent::Example/MODULE::ROS::Child::Example"
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.