You can call this operation to query information about a resource in a specific stack.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetStackResource

The operation that you want to perform. Set the value to GetStackResource.

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-a14bf691f2ff

The ID of the stack.

LogicalResourceId String Yes WebServer

The logical resource ID defined in the template.

ShowResourceAttributes Boolean No true

Specifies whether to query resource attributes.

ClientToken String No 123e4567-e89b-12d3-a456-426655440000

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. It can only contain letters, digits, hyphens (-), and underscores (_) and can not exceed 64 characters in length. For more information, see How to ensure idempotence.

Response parameters

Parameter Type Example Description
Status String CREATE_COMPLETE

The status of the resource. Valid values:

  • CREATE_COMPLETE
  • CREATE_FAILED
  • CREATE_IN_PROGRESS
  • DELETE_FAILED
  • DELETE_IN_PROGRESS
  • ROLLBACK_COMPLETE
  • ROLLBACK_FAILED
  • ROLLBACK_IN_PROGRESS
Description String no Description

The description of the resource.

LogicalResourceId String WebServer

The logical resource ID defined in the template.

StackId String cn-hangzhou

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

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 task 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 {"RequestId":"87F54B2B-AEF0-4C33-A72A-3F8856A575E9","TemplateBody":{"Parameters":{"CidrBlock":{"Type":"String"}},"ROSTemplateFormatVersion":"2015-09-01","Resources":{"Vpc":{"Properties":{"CidrBlock":{"Ref":"CidrBlock"}},"Type":"ALIYUN::ECS::VPC"}}}} {"ResourceAttributeKey": "CurlCli", "ResourceAttributeValue": "curl www.aliyun.com "}

The list of resource attributes.

RequestId String B288A0BE-D927-4888-B0F7-B35EF84B6E6

The ID of the request.

Examples

Sample requests


http(s)://ros.aliyuncs.com/? Action=GetStackResource
&RegionId=cn-hangzhou
&StackId=4a6c9851-3b0f-4f5f-b4ca-a14bf691f2ff
&LogicalResourceId=WebServer
&<Common request parameters>

Sample success responses

XML format

<GetStackResourceResponse>
       <CreateTime type="string">2019-08-01T06:01:23</CreateTime>
       <Description type="string"></Description>
       <LogicalResourceId type="string">WaitConditionHandle</LogicalResourceId>
       <Metadata class="object"></Metadata>
       <PhysicalResourceId type="string"></PhysicalResourceId>
       <RequestId type="string">B288A0BE-D927-4888-B0F7-B35EF84B6E6F</RequestId>
       <ResourceAttributes class="array">
              <ResourceAttribute class="object">
                     <ResourceAttributeKey type="string">CurlCli</ResourceAttributeKey>
                     <ResourceAttributeValue type="string">curl -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'x-acs-region-id: cn-beijing' http://100.100.100.110/waitcondition?stackname=test-describe-resource\&amp;stackid=efdf5c10-96a5-4fd7-ab89-68e7baa2e0d5\&amp;resource=WaitConditionHandle\&amp;expire=1564682564\&amp;signature=991d910a901a89db6580d74233119960c004de55</ResourceAttributeValue>
              </ResourceAttribute>
              <ResourceAttribute class="object">
                     <ResourceAttributeKey type="string">WindowsCurlCli</ResourceAttributeKey>
                     <ResourceAttributeValue type="string">curl -i -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "x-acs-region-id: cn-beijing" "http://100.100.100.110/waitcondition?stackname=test-describe-resource&amp;stackid=efdf5c10-96a5-4fd7-ab89-68e7baa2e0d5&amp;resource=WaitConditionHandle&amp;expire=1564682564&amp;signature=991d910a901a89db6580d74233119960c004de55"</ResourceAttributeValue>
              </ResourceAttribute>
              <ResourceAttribute class="object">
                     <ResourceAttributeKey type="string">PowerShellCurlCli</ResourceAttributeKey>
                     <ResourceAttributeValue type="string">curl -Uri "http://100.100.100.110/waitcondition?stackname=test-describe-resource&amp;stackid=efdf5c10-96a5-4fd7-ab89-68e7baa2e0d5&amp;resource=WaitConditionHandle&amp;expire=1564682564&amp;signature=991d910a901a89db6580d74233119960c004de55" -Method Post -Headers @{"Content-Type"="application/json"; "Accept"="application/json"; "x-acs-region-id"="cn-beijing"}</ResourceAttributeValue>
              </ResourceAttribute>
       </ResourceAttributes>
       <ResourceType type="string">ALIYUN::ROS::WaitConditionHandle</ResourceType>
       <StackId type="string">efdf5c10-96a5-4fd7-ab89-68e7baa2e0d5</StackId>
       <StackName type="string">test-describe-resource</StackName>
       <Status type="string">UPDATE_COMPLETE</Status>
       <StatusReason type="string">state changed</StatusReason>
       <UpdateTime type="string">2019-08-01T06:01:29</UpdateTime>
</GetStackResourceResponse>

JSON format

{
	"LogicalResourceId":"WaitConditionHandle",
	"Description":"",
	"StackId":"efdf5c10-96a5-4fd7-ab89-68e7baa2e0d5",
	"UpdateTime":"2019-08-01T06:01:29",
	"StackName":"test-describe-resource",
	"PhysicalResourceId":"",
	"Status":"UPDATE_COMPLETE",
	"StatusReason":"state changed",
	"ResourceType":"ALIYUN::ROS::WaitConditionHandle",
	"CreateTime":"2019-08-01T06:01:23",
	"RequestId":"B288A0BE-D927-4888-B0F7-B35EF84B6E6F",
	"Metadata":{},
	"ResourceAttributes":[
		{
			"ResourceAttributeValue":"curl -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'x-acs-region-id: cn-beijing' http://100.100.100.110/waitcondition?stackname=test-describe-resource\\&stackid=efdf5c10-96a5-4fd7-ab89-68e7baa2e0d5\\&resource=WaitConditionHandle\\&expire=1564682564\\&signature=991d910a901a89db6580d74233119960c004de55",
			"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.100.110/waitcondition?stackname=test-describe-resource&stackid=efdf5c10-96a5-4fd7-ab89-68e7baa2e0d5&resource=WaitConditionHandle&expire=1564682564&signature=991d910a901a89db6580d74233119960c004de55\"",
			"ResourceAttributeKey":"WindowsCurlCli"
		},
		{
			"ResourceAttributeValue":"curl -Uri \"http://100.100.100.110/waitcondition?stackname=test-describe-resource&stackid=efdf5c10-96a5-4fd7-ab89-68e7baa2e0d5&resource=WaitConditionHandle&expire=1564682564&signature=991d910a901a89db6580d74233119960c004de55\" -Method Post -Headers @{\"Content-Type\"=\"application/json\"; \"Accept\"=\"application/json\"; \"x-acs-region-id\"=\"cn-beijing\"}",
			"ResourceAttributeKey":"PowerShellCurlCli"
		}
	]
}

Error codes

For a list of error codes, visit the API Error Center.

For more information about errors common to all operations, see Common errors.

Error code

Error message

HTTP status code

Description

ResourceNotFound

The Resource ({name}) could not be found in Stack {stack}.

404

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.

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.