ListStackResources

Updated at:

Queries the resources of a specified stack.

Operation description

This topic provides an example on how to query the resources of a stack whose ID is 4a6c9851-3b0f-4f5f-b4ca-a14bf691**** in the China (Hangzhou) region.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ros:ListStackResources

get

*stack

acs:ros:{#regionId}:{#accountId}:stack/{#stackId}

None None

Request parameters

Parameter

Type

Required

Description

Example

StackId

string

Yes

The ID of the stack.

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

RegionId

string

Yes

The region ID of the stack. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

For more information about common request parameters, see Common parameters.

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

B288A0BE-D927-4888-B0F7-B35EF84B6E6

Resources

array<object>

The list of resource objects.

array<object>

Status

string

The status of the resource. Valid values:

  • INIT_COMPLETE: The resource is pending creation.

  • CREATE_COMPLETE: The resource is created.

  • CREATE_FAILED: The resource fails to be created.

  • CREATE_IN_PROGRESS: The resource is being created.

  • UPDATE_IN_PROGRESS: The resource is being updated.

  • UPDATE_FAILED: The resource fails to be updated.

  • UPDATE_COMPLETE: The resource is updated.

  • DELETE_IN_PROGRESS: The resource is being deleted.

  • DELETE_FAILED: The resource fails to be deleted.

  • DELETE_COMPLETE: The resource is deleted.

  • CHECK_IN_PROGRESS: The resource is being checked.

  • CHECK_FAILED: The resource fails to be checked.

  • CHECK_COMPLETE: The resource is checked.

  • IMPORT_IN_PROGRESS: The resource import is in progress.

  • IMPORT_FAILED: The resource import failed.

  • IMPORT_COMPLETE: The resource import is complete.

UPDATE_COMPLETE

LogicalResourceId

string

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

dummy

UpdateTime

string

The update time. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. It is in UTC+0 without the trailing Z.

2019-08-01T06:01:29

StackId

string

The ID of the stack.

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

PhysicalResourceId

string

The physical ID of the resource, which is the actual resource ID.

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

DriftDetectionTime

string

The time when the drift detection was performed on the resource during the last successful drift detection of the stack. The time is in the YYYY-MM-DDThh:mm:ss format.

2020-02-27T07:47:47

ResourceType

string

The resource type.

ALIYUN::ROS::Stack

ResourceDriftStatus

string

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

  • DELETED: The resource differs from its expected template configuration because the resource has been deleted.

  • MODIFIED: The resource differs from its expected template configuration.

  • NOT_CHECKED: Resource Orchestration Service (ROS) has not checked whether the resource differs from its expected template configuration.

  • IN_SYNC: The current configuration of the resource matches its expected template configuration.

IN_SYNC

StatusReason

string

The reason for the resource status.

state changed

CreateTime

string

The creation time. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. It is in UTC+0 without the trailing Z.

2019-08-01T06:01:23

StackName

string

The name of the stack.
The name can be up to 255 characters in length, and must start with a digit or a letter. It can contain digits, letters, hyphens (-), and underscores (_).

test-describe-resource

ModuleInfo

object

The information about the module from which the resource originates. This field 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 /.

In the following example, the resource is created from moduleB, which is nested in the parent module moduleA.

moduleA/moduleB

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

In the following example, the resource is created from a module of the MODULE::ROS::Child::Example type, which is nested in 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

Examples

Success response

JSON format

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

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.