All Products
Search
Document Center

Resource Orchestration Service:GetStackResource

Last Updated:Sep 12, 2024

For more information about common request parameters, see \[Common parameters]\(~~131957~~).

Operation description

Http status codeError codeError messageDescription
404ResourceNotFoundThe 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. stack indicates the stack name or ID.
404StackNotFoundThe Stack ({name}) could not be found.The error message returned because the stack does not exist. name indicates the name or ID of the stack.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
ros:GetStackResourceget
  • stack
    acs:ros:{#regionId}:{#accountId}:stack/{#stackId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
StackIdstringYes

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****
ClientTokenstringNo

Specifies whether to query the resource properties. Valid values:

  • true
  • false
123e4567-e89b-12d3-a456-42665544****
RegionIdstringYes

The logical ID of the resource defined in the template.

cn-hangzhou
ShowResourceAttributesbooleanNo

The name of resource property N that you want to query.

true
LogicalResourceIdstringYes

The name of resource property N that you want to query.

Note Maximum value of N: 20.
WebServer
ResourceAttributesarrayNo

The status of the resource. Valid values:

  • CREATE_COMPLETE
  • CREATE_FAILED
  • CREATE_IN_PROGRESS
  • UPDATE_IN_PROGRESS
  • UPDATE_FAILED
  • UPDATE_COMPLETE
  • DELETE_IN_PROGRESS
  • DELETE_FAILED
  • CHECK_IN_PROGRESS
  • CHECK_FAILED
  • CHECK_COMPLETE
  • IMPORT_IN_PROGRESS
  • IMPORT_FAILED
  • IMPORT_COMPLETE
stringNo

The description of the resource.

InstanceId

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

Response parameters

ParameterTypeDescriptionExample
object
Statusstring

The ID of the request.

CREATE_COMPLETE
Descriptionstring

The reason why the resource is in its current state.

no description
RequestIdstring

The physical ID of the resource.

B288A0BE-D927-4888-B0F7-B35EF84B6E6
StatusReasonstring

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.

state changed
PhysicalResourceIdstring

The metadata.

d04af923-e6b7-4272-aeaa-47ec9777****
CreateTimestring

The resource type.

2019-08-01T06:01:23
Metadataobject

The list of the resource properties.

{"key": "value"}
ResourceTypestring

The logical ID of the resource defined in the template.

ALIYUN::ROS::WaitConditionHandle
ResourceAttributesarray<object>

The status of the resource in the last successful drift detection. Valid values:

  • DELETED: The actual configuration of the resource differs from its expected template configuration because the resource is deleted.
  • MODIFIED: The actual configuration of the resource differs from its expected template configuration.
  • NOT_CHECKED: ROS has not checked whether the actual configuration of the resource differs from its expected template configuration.
  • IN_SYNC: The actual configuration of the resource matches its expected template configuration.
object
[{"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****"}]
LogicalResourceIdstring

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.

WebServer
ResourceDriftStatusstring

The time when the last successful drift detection was performed on the stack.

IN_SYNC
UpdateTimestring

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.

2019-08-01T06:01:29
DriftDetectionTimestring

The ID of the stack.

2020-02-27T07:47:47
StackNamestring

The name of the stack.

test-describe-resource
StackIdstring

The ID of the stack.

efdf5c10-96a5-4fd7-ab89-68e7baa2****
ModuleInfoobject

The information about the modules from which the resource is created. This parameter is returned only if the resource is created from modules.

LogicalIdHierarchystring

The concatenated logical IDs of one or more modules that contain the resource. The modules are listed from the outermost layer and separated by forward slashes (/).

In the following example, the resource is created from Module B nested within Parent Module A:

moduleA/moduleB

moduleA/moduleB
TypeHierarchystring

The concatenated types of one or more modules that contain the resource. The module types are listed from the outermost layer and separated by forward slashes (/).

In the following example, the resource is created from a module of the MODULE::ROS::Child::Example type that is nested within a parent module of the MODULE::ROS::Parent::Example type:

MODULE::ROS::Parent::Example/MODULE::ROS::Child::Example

MODULE::ROS::Parent::Example/MODULE::ROS::Child::Example

The ID of the stack.

Examples

Sample success responses

JSONformat

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

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-05-10The response structure of the API has changedView Change Details