You can call this operation to query information about a resource in a specific stack.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | GetStackResource |
The operation that you want to perform. Set the value to GetStackResource. |
LogicalResourceId | String | Yes | WebServer |
The logical ID of the resource as defined in the template. |
RegionId | String | Yes | cn-hangzhou |
The region ID of the stack. You can call the DescribeRegions operation to query the most recent region list. |
StackId | String | Yes | 4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
The ID of the stack. |
ClientToken | String | No | 123e4567-e89b-12d3-a456-42665544**** |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can be up to 64 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). For more information, see How to ensure idempotence. |
ShowResourceAttributes | Boolean | No | true |
Specifies whether to query resource attributes. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Status | String | CREATE_COMPLETE |
The status of the resource. Valid values:
|
Description | String | no description |
The description of the resource. |
LogicalResourceId | String | WebServer |
The logical ID of the resource as defined in the template. |
StackId | String | efdf5c10-96a5-4fd7-ab89-68e7baa2**** |
The ID of the stack. |
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 (_). It must start with a digit or letter. |
StatusReason | String | state changed |
The reason that the resource is in its current status. |
PhysicalResourceId | String | d04af923-e6b7-4272-aeaa-47ec9777**** |
The physical ID of the resource. |
ResourceType | String | ALIYUN::ROS::WaitConditionHandle |
The type of the resource. |
CreateTime | String | 2019-08-01T06:01:23 |
The time when the task was created. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC. |
Metadata | Map | {"key": "value"} |
The metadata. |
UpdateTime | String | 2019-08-01T06:01:29 |
The time when the stack was last updated. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC. |
ResourceAttributes | List | [ { "ResourceAttributeValue":"curl -Uri \"http://100.100.XX.XX/waitcondition?stackname=test-describe-resource&stackid=efdf5c10-96a5-4fd7-ab89-68e7baa2****&resource=WaitConditionHandle&expire=156468****&signature=991d910a901a89db6580d74233119960c004****\" -Method Post -Headers @{\"Content-Type\"=\"application/json\"; \"Accept\"=\"application/json\"; \"x-acs-region-id\"=\"cn-beijing\"}", "ResourceAttributeKey":"PowerShellCurlCli" } ] |
The list of resource attributes. |
RequestId | String | B288A0BE-D927-4888-B0F7-B35EF84B6E6 |
The ID of the request. |
DriftDetectionTime | String | 2020-02-27T07:47:47 |
The time when the last successful drift detection operation was initiated. |
ResourceDriftStatus | String | IN_SYNC |
The drift status of the resource in the last successful drift detection. Valid values:
|
Examples
Sample requests
http(s)://ros.aliyuncs.com/? Action=GetStackResource
&RegionId=cn-hangzhou
&StackId=4a6c9851-3b0f-4f5f-b4ca-a14bf691****
&LogicalResourceId=WebServer
&<Common request parameters>
Sample success responses
XML
format
<GetStackResourceResponse>
<CreateTime>2019-08-01T06:01:23</CreateTime>
<Description></Description>
<LogicalResourceId>WaitConditionHandle</LogicalResourceId>
<Metadata></Metadata>
<PhysicalResourceId></PhysicalResourceId>
<RequestId>B288A0BE-D927-4888-B0F7-B35EF84B6E6F</RequestId>
<ResourceAttributes>
<ResourceAttributeKey>CurlCli</ResourceAttributeKey>
<ResourceAttributeValue>curl -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'x-acs-region-id: cn-beijing' http://100.100.XX.XX/waitcondition?stackname=test-describe-resource\&stackid=efdf5c10-96a5-4fd7-ab89-68e7baa2****\&resource=WaitConditionHandle\&expire=156468****\&signature=991d910a901a89db6580d74233119960c004****</ResourceAttributeValue>
</ResourceAttributes>
<ResourceAttributes>
<ResourceAttributeKey>WindowsCurlCli</ResourceAttributeKey>
<ResourceAttributeValue>curl -i -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "x-acs-region-id: cn-beijing" "http://100.100.XX.XX/waitcondition?stackname=test-describe-resource&stackid=efdf5c10-96a5-4fd7-ab89-68e7baa2****&resource=WaitConditionHandle&expire=156468****&signature=991d910a901a89db6580d74233119960c004****"</ResourceAttributeValue>
</ResourceAttributes>
<ResourceAttributes>
<ResourceAttributeKey>PowerShellCurlCli</ResourceAttributeKey>
<ResourceAttributeValue>curl -Uri "http://100.100.XX.XX/waitcondition?stackname=test-describe-resource&stackid=efdf5c10-96a5-4fd7-ab89-68e7baa2****&resource=WaitConditionHandle&expire=156468****&signature=991d910a901a89db6580d74233119960c004****" -Method Post -Headers @{"Content-Type"="application/json"; "Accept"="application/json"; "x-acs-region-id"="cn-beijing"}</ResourceAttributeValue>
</ResourceAttributes>
<ResourceType>ALIYUN::ROS::WaitConditionHandle</ResourceType>
<StackId>efdf5c10-96a5-4fd7-ab89-68e7baa2****</StackId>
<StackName>test-describe-resource</StackName>
<Status>UPDATE_COMPLETE</Status>
<StatusReason>state changed</StatusReason>
<UpdateTime>2019-08-01T06:01:29</UpdateTime>
<DriftDetectionTime>2020-02-27T07:47:47</DriftDetectionTime>
<ResourceDriftStatus>IN_SYNC</ResourceDriftStatus>
</GetStackResourceResponse>
JSON
format
{
"CreateTime": "2019-08-01T06:01:23",
"Description": "",
"LogicalResourceId": "WaitConditionHandle",
"Metadata": {},
"PhysicalResourceId": "",
"RequestId": "B288A0BE-D927-4888-B0F7-B35EF84B6E6F",
"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://100.100.XX.XX/waitcondition?stackname=test-describe-resource\\&stackid=efdf5c10-96a5-4fd7-ab89-68e7baa2****\\&resource=WaitConditionHandle\\&expire=156468****\\&signature=991d910a901a89db6580d74233119960c004****"
},
{
"ResourceAttributeKey": "WindowsCurlCli",
"ResourceAttributeValue": "curl -i -X POST -H \"Content-Type: application/json\" -H \"Accept: application/json\" -H \"x-acs-region-id: cn-beijing\" \"http://100.100.XX.XX/waitcondition?stackname=test-describe-resource&stackid=efdf5c10-96a5-4fd7-ab89-68e7baa2****&resource=WaitConditionHandle&expire=156468****&signature=991d910a901a89db6580d74233119960c004****\""
},
{
"ResourceAttributeKey": "PowerShellCurlCli",
"ResourceAttributeValue": "curl -Uri \"http://100.100.XX.XX/waitcondition?stackname=test-describe-resource&stackid=efdf5c10-96a5-4fd7-ab89-68e7baa2****&resource=WaitConditionHandle&expire=156468****&signature=991d910a901a89db6580d74233119960c004****\" -Method Post -Headers @{\"Content-Type\"=\"application/json\"; \"Accept\"=\"application/json\"; \"x-acs-region-id\"=\"cn-beijing\"}"
}
],
"ResourceType": "ALIYUN::ROS::WaitConditionHandle",
"StackId": "efdf5c10-96a5-4fd7-ab89-68e7baa2****",
"StackName": "test-describe-resource",
"Status": "UPDATE_COMPLETE",
"StatusReason": "state changed",
"UpdateTime": "2019-08-01T06:01:29",
"DriftDetectionTime": "2020-02-27T07:47:47",
"ResourceDriftStatus": "IN_SYNC"
}
Error codes
For a list of error codes, visit the API Error Center.
HTTP status code |
Error code |
Error message |
Description |
---|---|---|---|
404 |
ResourceNotFound |
The Resource ({name}) could not be found in Stack {stack}. |
The error message returned because the specified resource does not exist in the stack. name indicates the resource name, and stack indicates the name or ID of the stack. |
404 |
StackNotFound |
The Stack ({name}) could not be found. |
The error message returned because the specified stack does not exist. name indicates the name or ID of the stack. |