All Products
Search
Document Center

Resource Orchestration Service:GetStack

Last Updated:Apr 10, 2024

Queries the information about a stack in Resource Orchestration Service (ROS).

Operation description

In this example, the information about a stack whose ID is c754d2a4-28f1-46df-b557-9586173a**** in the China (Hangzhou) region is queried.

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:GetStackREAD
  • stack
    acs:ros:{#regionId}:{#accountId}:stack/{#stackId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
StackIdstringYes

The stack ID.

c754d2a4-28f1-46df-b557-9586173a****
RegionIdstringYes

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

cn-hangzhou
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests.
The token can be up to 64 characters in length.
For more information, see Ensure idempotence.

123e4567-e89b-12d3-a456-42665544****
OutputOptionstringNo

Specifies whether to return Outputs. Valid values:

  • Enabled (default)
  • Disabled
Note The Outputs parameter requires a long period of time to calculate. If you do not require Outputs of the stack, we recommend that you set OutputOption to Disabled to improve the response speed of the GetStack operation.
Disabled
ShowResourceProgressstringNo

Specifies whether to return information about ResourceProgress. Valid values:

  • Disabled (default): does not return information about ResourceProgress.
  • PercentageOnly: returns StackOperationProgress and StackActionProgress of ResourceProgress.
Note ROS and Terraform stacks are supported. Creation, resumed creation, update, deletion, import, and rollback operations on stacks are supported.
  • EnabledIfCreateStack (not recommend): returns *Count and InProgressResourceDetails of ResourceProgress only during a stack creation operation.
Note During a creation operation, a stack is in one of the following states: CREATE_IN_PROGRESS, CREATE_COMPLETE, CREATE_FAILED, CREATE_ROLLBACK_IN_PROGRESS, CREATE_ROLLBACK_COMPLETE, and CREATE_ROLLBACK_FAILED.
Disabled
LogOptionstringNo

The option for returning logs. Valid values:

  • None: does not return logs.
  • Stack (default): returns the logs of the stack.
  • Resource: returns the logs of resources in the stack.
  • All: returns all logs.
Stack

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

Response parameters

ParameterTypeDescriptionExample
object
Statusstring

The state of the stack. Valid values:

  • CREATE_IN_PROGRESS: The stack is being created.
  • CREATE_FAILED: The stack failed to be created.
  • CREATE_COMPLETE: The stack is created.
  • UPDATE_IN_PROGRESS: The stack is being updated.
  • UPDATE_FAILED: The stack failed to be updated.
  • UPDATE_COMPLETE: The stack is updated.
  • DELETE_IN_PROGRESS: The stack is being deleted.
  • DELETE_FAILED: The stack failed to be deleted.
  • CREATE_ROLLBACK_IN_PROGRESS: The resources are being rolled back after the stack failed to be created.
  • CREATE_ROLLBACK_FAILED: The resources failed to be rolled back after the stack failed to be created.
  • CREATE_ROLLBACK_COMPLETE: The resources are rolled back after the stack failed to be created.
  • ROLLBACK_IN_PROGRESS: The resources of the stack are being rolled back.
  • ROLLBACK_FAILED: The resources of the stack failed to be rolled back.
  • ROLLBACK_COMPLETE: The resources of the stack are rolled back.
  • CHECK_IN_PROGRESS: The stack is being validated.
  • CHECK_FAILED: The stack failed to be validated.
  • CHECK_COMPLETE: The stack is validated.
  • REVIEW_IN_PROGRESS: The stack is being reviewed.
  • IMPORT_CREATE_IN_PROGRESS: The stack is being created by using imported resources.
  • IMPORT_CREATE_FAILED: The stack failed to be created by using imported resources.
  • IMPORT_CREATE_COMPLETE: The stack is created by using imported resources.
  • IMPORT_CREATE_ROLLBACK_IN_PROGRESS: The resources are being rolled back after the stack failed to be created by using imported resources.
  • IMPORT_CREATE_ROLLBACK_FAILED: The resources failed to be rolled back after the stack failed to be created by using imported resources.
  • IMPORT_CREATE_ROLLBACK_COMPLETE: The resources are rolled back after the stack failed to be created by using imported resources.
  • IMPORT_UPDATE_IN_PROGRESS: The stack is being updated by using imported resources.
  • IMPORT_UPDATE_FAILED: The stack failed to be updated by using imported resources.
  • IMPORT_UPDATE_COMPLETE: The stack is updated by using imported resources.
  • IMPORT_UPDATE_ROLLBACK_IN_PROGRESS: The resources are being rolled back after the stack failed to be updated by using imported resources.
  • IMPORT_UPDATE_ROLLBACK_FAILED: The resources failed to be rolled back after the stack failed to be updated by using imported resources.
  • IMPORT_UPDATE_ROLLBACK_COMPLETE: The resources are rolled back after the stack failed to be updated by using imported resources.
CREATE_COMPLETE
Descriptionstring

The description of the stack.

Create a VPC.
Parametersobject []

The parameters of the stack.

ParameterKeystring

The parameter name.

ALIYUN::Region
ParameterValuestring

The parameter value.

cn-hangzhou
RequestIdstring

The request ID.

B288A0BE-D927-4888-B0F7-B35EF84B6E6F
StatusReasonstring

The reason why the stack is in its current state.

Stack CREATE completed successfully
ParentStackIdstring

The ID of the parent stack.

4a6c9851-3b0f-4f5f-b4ca-a14bf692****
CreateTimestring

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

2020-09-16T08:21:40
DeletionProtectionstring

Indicates whether deletion protection is enabled for the stack. Valid values:

  • Enabled: Deletion protection is enabled for the stack.
  • Disabled: Deletion protection is disabled for the stack. You can delete the stack by using the ROS console or by calling the DeleteStack operation.
Note Deletion protection of a nested stack is the same as deletion protection of its root stack.
Disabled
RootStackIdstring

The ID of the root stack. This parameter is returned if the specified stack is a nested stack.

4a6c9851-3b0f-4f5f-b4ca-a14bf692****
TemplateDescriptionstring

The description of the template.

Create a VPC.
StackTypestring

The stack type. Valid values:

  • ROS: ROS stack. The stack is created by using a ROS template.
  • Terraform: Terraform stack. The stack is created by using a Terraform template.
ROS
RamRoleNamestring

The name of the Resource Access Management (RAM) role. ROS assumes the RAM role to create the stack and uses the credentials of the role to call the APIs of Alibaba Cloud services.
ROS assumes the RAM role to perform operations on the stack. If you have permissions to perform operations on the stack, ROS assumes the RAM role even if you do not have permissions to use the RAM role. You must make sure that permissions are granted to the RAM role based on the principle of least privilege.
If this parameter is not specified, ROS uses the existing role that is associated with the stack. If no roles are available, ROS uses a temporary credential that is generated from the credentials of your account.
The RAM role name can be up to 64 characters in length.

test-role
UpdateTimestring

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

2020-09-17T08:21:40
Outputsobject []

The outputs of the stack.

object

The output of the stack.

Note This parameter is returned if OutputOption is set to Enabled.
[{"Description": "VPC ID","OutputKey": "VpcId","OutputValue": "vpc-bp1m6fww66xbntjyc****"}]
DriftDetectionTimestring

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

2020-09-16T09:21:40
RegionIdstring

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

cn-hangzhou
StackDriftStatusstring

The state of the stack on which the most recent successful drift detection was performed. Valid values:

  • DRIFTED: The stack has drifted.
  • NOT_CHECKED: No successful drift detection is performed on the stack.
  • IN_SYNC: The stack is being synchronized.
IN_SYNC
NotificationURLsarray

The callback URLs for receiving stack events.

string

The callback URL for receiving stack events.

["http://127.XX.XX.1:8080/x", "http://127.0.XX.XX:8080/y"]
DisableRollbackboolean

Indicates whether rollback is disabled when the stack fails to be created. Valid values:

  • true
  • false (default)
false
StackNamestring

The stack name.
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.

MyStack
Tagsobject []

The tags of the stack.

Keystring

The tag key of the stack.

usage
Valuestring

The tag value of the stack.

test
TimeoutInMinutesinteger

The timeout period for creating the stack. Unit: minutes.

10
StackIdstring

The stack ID.

c754d2a4-28f1-46df-b557-9586173a****
ResourceGroupIdstring

The ID of the resource group.

rg-acfmxazb4ph6aiy****
ResourceProgressobject

The resource creation progress.

TotalResourceCountinteger

The total number of resources.

Note This parameter is returned only if ShowResourceProgress is set to EnabledIfCreateStack.
2
SuccessResourceCountinteger

The number of resources that are created.

Note This parameter is returned only if ShowResourceProgress is set to EnabledIfCreateStack.
1
FailedResourceCountinteger

The number of resources that failed to be created.

Note This parameter is returned only if ShowResourceProgress is set to EnabledIfCreateStack.
0
InProgressResourceCountinteger

The number of resources that are being created.

Note This parameter is returned only if ShowResourceProgress is set to EnabledIfCreateStack.
1
PendingResourceCountinteger

The number of resources to be created.

Note This parameter is returned only if ShowResourceProgress is set to EnabledIfCreateStack.
0
InProgressResourceDetailsobject []

The progress details of resources that are being created.

Note This parameter is returned only if ShowResourceProgress is set to EnabledIfCreateStack.
ResourceNamestring

The resource name.

WaitCondition
ResourceTypestring

The resource type.

ALIYUN::ROS::WaitCondition
ProgressValuefloat

The current progress value of the resource.

5
ProgressTargetValuefloat

The desired progress value of the resource.

10
StackOperationProgressfloat

The overall creation progress of the stack, in percentage. Valid values: 0 to 100.

The value progressively increases from 0 to 100 during a stack creation operation. If the stack is created, the value reaches 100. If the stack fails to be created, a rollback is started for the stack resources, and the value progressively decreases. The value decreases to 0 when the stack resources are rolled back. This parameter indicates only the overall creation progress, regardless of whether during a stack creation or rollback operation.

Note This parameter is returned only if ShowResourceProgress is set to PercentageOnly.
100
StackActionProgressfloat

The creation or rollback progress of the stack, in percentage. Valid values: 0 to 100.

The value progressively increases from 0 to 100 during a stack creation operation. If the stack is created, the value reaches 100. If the stack fails to be created, a rollback is started for the stack resources, and the value progressively increases from the percentage of the remaining progress (100 - Progress value generated when the stack fails to be created). The value increases to 100 when the stack resources are rolled back. This parameter indicates the creation progress during a stack creation operation and indicates the rollback progress during a stack rollback operation.

Note This parameter is returned only if ShowResourceProgress is set to PercentageOnly.
100
Logobject

The log of the stack.

TerraformLogsobject []

The logs generated when the Terraform stack is run. This parameter is returned only for a Terraform stack. This parameter is returned if LogOption is left empty or set to Stack or All.

Note This parameter is not returned for a running stack. The logs are generated from the most recent operation on the stack, such as the creation, resumed creation, update, or deletion operation.
Commandstring

The name of the Terraform command that is run. Valid values:

  • apply
  • plan
  • destroy
  • version

For more information about Terraform commands, see Basic CLI Features.

apply
Streamstring

The output stream. Valid values:

  • stdout: standard output stream
  • stderr: standard error stream
stdout
Contentstring

The content of the output stream that is returned after the command is run.

Apply complete! Resources: 42 added, 0 changed, 0 destroyed.
ResourceLogsobject []

The logs of resources in the stack. This parameter is returned if LogOption is set to Resource or All.

Note The logs are returned only for resources of specific types, such as the ALIYUN::ROS::ResourceCleaner type.
ResourceNamestring

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

MyResourceCleaner
Logsobject []

All the logs that are associated with the resources.

Keysarray

The keywords of a resource log.

string

The keyword of a resource log.

ResourceDetails
Contentstring

The content of a resource log.

[]
TemplateIdstring

The template ID. This parameter is returned only if the current stack template is a custom template or shared template.

If the template is a shared template, the value of this parameter is the same as the value of TemplateARN.

a52f81be-496f-4e1c-a286-8852ab54****
TemplateVersionstring

The version of the template. This parameter is returned only if the current stack template is a custom template or shared template.

If the template is a shared template, this parameter is returned only if VersionOption is set to AllVersions.

Valid values: v1 to v100.

v1
TemplateScratchIdstring

The ID of the resource scenario. This parameter is returned only if the current template of the stack is generated from a resource scenario.

ts-7f7a704cf71c49a6****
TemplateURLstring

The URL of the file that contains the template body. This parameter is returned only if the current template of the stack is from a URL. The URL can point to a template that is located on an HTTP or HTTPS web server or in an Object Storage Service (OSS) bucket.

oss://ros/template/demo
Interfacestring

The description of the console user interface (UI).

{}
ServiceManagedboolean

Indicates whether the stack is a managed stack. Valid values:

  • true
  • false
false
ServiceNamestring

The name of the service to which the managed stack belongs.

ACVS
OperationInfoobject

The supplementary information that is returned if an error occurs on a stack operation.

Note This parameter is returned together with at least one sub-parameter and only under specific conditions. For example, the supplementary information is returned when an API operation of another Alibaba Cloud service fails to be called.
Codestring

The error code.

DependencyViolation
Messagestring

The error message.

There is still instance(s) in the specified security group.
RequestIdstring

The ID of the request that is initiated to call the API operation of another Alibaba Cloud service.

071D6166-3F6B-5C7B-A1F0-0113FBB643A8
Actionstring

The name of the API operation that belongs to another Alibaba Cloud service.

DeleteSecurityGroup
ResourceTypestring

The type of the resource on which the operation error occurs.

ALIYUN::ECS::SecurityGroup
LogicalResourceIdstring

The logical ID of the resource on which the operation error occurs.

EcsSecurityGroup
OrderIdsarray

The order IDs. This parameter is returned only if you configured manual payment when you created a subscription stack.

string

The order ID.

2161413696****
CheckedStackResourceCountinteger

The number of resources on which drift detection was performed.

Note This parameter is returned only if the most recent drift detection on the stack was successful.
1
NotCheckedStackResourceCountinteger

The number of resources on which drift detection was not performed.

Note This parameter is returned only if the most recent drift detection on the stack was successful.
1

Examples

Sample success responses

JSONformat

{
  "Status": "CREATE_COMPLETE",
  "Description": "Create a VPC.",
  "Parameters": [
    {
      "ParameterKey": "ALIYUN::Region",
      "ParameterValue": "cn-hangzhou"
    }
  ],
  "RequestId": "B288A0BE-D927-4888-B0F7-B35EF84B6E6F",
  "StatusReason": "Stack CREATE completed successfully",
  "ParentStackId": "4a6c9851-3b0f-4f5f-b4ca-a14bf692****",
  "CreateTime": "2020-09-16T08:21:40",
  "DeletionProtection": "Disabled",
  "RootStackId": "4a6c9851-3b0f-4f5f-b4ca-a14bf692****",
  "TemplateDescription": "Create a VPC.",
  "StackType": "ROS",
  "RamRoleName": "test-role",
  "UpdateTime": "2020-09-17T08:21:40",
  "Outputs": [
    [
      {
        "Description": "VPC ID",
        "OutputKey": "VpcId",
        "OutputValue": "vpc-bp1m6fww66xbntjyc****"
      }
    ]
  ],
  "DriftDetectionTime": "2020-09-16T09:21:40",
  "RegionId": "cn-hangzhou",
  "StackDriftStatus": "IN_SYNC",
  "NotificationURLs": [
    "[\"http://127.XX.XX.1:8080/x\", \"http://127.0.XX.XX:8080/y\"]"
  ],
  "DisableRollback": false,
  "StackName": "MyStack",
  "Tags": [
    {
      "Key": "usage",
      "Value": "test"
    }
  ],
  "TimeoutInMinutes": 10,
  "StackId": "c754d2a4-28f1-46df-b557-9586173a****",
  "ResourceGroupId": "rg-acfmxazb4ph6aiy****",
  "ResourceProgress": {
    "TotalResourceCount": 2,
    "SuccessResourceCount": 1,
    "FailedResourceCount": 0,
    "InProgressResourceCount": 1,
    "PendingResourceCount": 0,
    "InProgressResourceDetails": [
      {
        "ResourceName": "WaitCondition",
        "ResourceType": "ALIYUN::ROS::WaitCondition",
        "ProgressValue": 5,
        "ProgressTargetValue": 10
      }
    ],
    "StackOperationProgress": 100,
    "StackActionProgress": 100
  },
  "Log": {
    "TerraformLogs": [
      {
        "Command": "apply",
        "Stream": "stdout",
        "Content": "Apply complete! Resources: 42 added, 0 changed, 0 destroyed."
      }
    ],
    "ResourceLogs": [
      {
        "ResourceName": "MyResourceCleaner",
        "Logs": [
          {
            "Keys": [
              "ResourceDetails"
            ],
            "Content": "[]"
          }
        ]
      }
    ]
  },
  "TemplateId": "a52f81be-496f-4e1c-a286-8852ab54****",
  "TemplateVersion": "v1",
  "TemplateScratchId": "ts-7f7a704cf71c49a6****",
  "TemplateURL": "oss://ros/template/demo",
  "Interface": "{}",
  "ServiceManaged": false,
  "ServiceName": "ACVS",
  "OperationInfo": {
    "Code": "DependencyViolation",
    "Message": "There is still instance(s) in the specified security group.",
    "RequestId": "071D6166-3F6B-5C7B-A1F0-0113FBB643A8",
    "Action": "DeleteSecurityGroup",
    "ResourceType": "ALIYUN::ECS::SecurityGroup",
    "LogicalResourceId": "EcsSecurityGroup"
  },
  "OrderIds": [
    "2161413696****"
  ],
  "CheckedStackResourceCount": 1,
  "NotCheckedStackResourceCount": 1,
  "RollbackFailedRootReason": "Resource UPDATE failed: Exception: resources.FailToCreate: FailToCreate: reason"
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-02-29The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.
2023-08-11The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.
2023-07-13The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.
2023-07-13The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.
2023-05-18The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.
2022-02-22The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.