All Products
Search
Document Center

Resource Orchestration Service:ListStackResources

Last Updated:Feb 22, 2024

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

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:ListStackResourcesLIST
  • 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****
RegionIdstringYes

The ID of the request.

cn-hangzhou
Error codeError messageHTTP status codeDescription
StackNotFoundThe Stack ({name}) could not be found.404The error message returned because the specified stack does not exist. name indicates the name or ID of the stack.

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

Details about resources.

B288A0BE-D927-4888-B0F7-B35EF84B6E6
Resourcesobject []

The resources.

Statusstring

The state of the resource. Valid values:

  • INIT_COMPLETE: The resource is pending to be created.
  • CREATE_COMPLETE: The resource is created.
  • CREATE_FAILED: The resource failed to be created.
  • CREATE_IN_PROGRESS: The resource is being created.
  • UPDATE_IN_PROGRESS: The resource is being updated.
  • UPDATE_FAILED: The resource failed to be updated.
  • UPDATE_COMPLETE: The resource is updated.
  • DELETE_IN_PROGRESS: The resource is being deleted.
  • DELETE_FAILED: The resource failed to be deleted.
  • DELETE_COMPLETE: The resource is deleted.
  • CHECK_IN_PROGRESS: The resource is being validated.
  • CHECK_FAILED: The resource failed to be validated.
  • CHECK_COMPLETE: The resource is validated.
  • IMPORT_IN_PROGRESS: The resource is being imported.
  • IMPORT_FAILED: The resource failed to be imported.
  • IMPORT_COMPLETE: The resource is imported.
UPDATE_COMPLETE
LogicalResourceIdstring

The logical ID of the resource. The logical ID is the resource name that is defined in the template.

dummy
UpdateTimestring

The time when the resource was updated. The time is displayed in UTC. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format.

2019-08-01T06:01:29
StackIdstring

The stack ID.

4a6c9851-3b0f-4f5f-b4ca-a14bf691****
PhysicalResourceIdstring

The physical ID of the resource.

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

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

2020-02-27T07:47:47
ResourceTypestring

The resource type.

ALIYUN::ROS::Stack
ResourceDriftStatusstring

The drift state of the resource in the most recent 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: Resource Orchestration Service (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.
IN_SYNC
StatusReasonstring

The reason why the resource is in its current state.

state changed
CreateTimestring

The time when the resource was created. The time is displayed in UTC. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format.

2019-08-01T06:01:23
StackNamestring

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 letter.

test-describe-resource
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 operation that you want to perform. Set the value to ListStackResources.

Examples

Sample success responses

JSONformat

{
  "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 timeSummary of changesOperation
2023-05-10The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.