Queries stack information.
Operation description
This topic provides an example of how to query the information of a stack whose ID is c754d2a4-28f1-46df-b557-9586173a**** in the China (Hangzhou) region.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ros:GetStack |
get |
*stack
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| StackId |
string |
Yes |
The stack ID. |
c754d2a4-28f1-46df-b557-9586173a**** |
| RegionId |
string |
Yes |
The region ID of the stack. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. The token is generated by the client and must be globally unique. |
123e4567-e89b-12d3-a456-42665544**** |
| OutputOption |
string |
No |
Specifies whether to return the Outputs parameter (the list of stack outputs). Valid values:
Note
Computing Outputs is time-consuming. If you do not need the Outputs information, set OutputOption to Disabled to improve the response speed of the API. |
Disabled |
| ShowResourceProgress |
string |
No |
Specifies whether to return the ResourceProgress parameter (resource processing progress). Valid values:
Note
Both ROS stacks and Terraform stacks are supported. Stack creation (including continued creation), update, deletion, resource import, and corresponding rollback operations are supported.
Note
During stack creation, the stack status is CREATE_IN_PROGRESS, CREATE_COMPLETE, CREATE_FAILED, CREATE_ROLLBACK_IN_PROGRESS, CREATE_ROLLBACK_COMPLETE, or CREATE_ROLLBACK_FAILED. |
Disabled |
| LogOption |
string |
No |
The log option. Valid values:
|
Stack |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Status |
string |
The stack status. Valid values:
|
CREATE_COMPLETE |
| Description |
string |
The description of the stack. |
Create a VPC. |
| Parameters |
array<object> |
The stack parameters. |
|
|
object |
|||
| ParameterKey |
string |
The parameter name. |
ALIYUN::Region |
| ParameterValue |
string |
The parameter value. |
cn-hangzhou |
| RequestId |
string |
The request ID. |
B288A0BE-D927-4888-B0F7-B35EF84B6E6F |
| StatusReason |
string |
The reason why the stack is in its current state. |
Stack CREATE completed successfully |
| ParentStackId |
string |
The parent stack ID. |
4a6c9851-3b0f-4f5f-b4ca-a14bf692**** |
| CreateTime |
string |
The time when the stack was created. The time is displayed in UTC+0 and follows the ISO 8601 standard without the trailing Z. Format: YYYY-MM-DDThh:mm:ss. |
2020-09-16T08:21:40 |
| DeletionProtection |
string |
Indicates whether deletion protection is enabled for the stack. Valid values:
Note
The deletion protection mechanism of a nested stack is the same as that of the root stack. |
Disabled |
| RootStackId |
string |
The root stack ID. This parameter is returned only when the stack is a nested stack. |
4a6c9851-3b0f-4f5f-b4ca-a14bf692**** |
| TemplateDescription |
string |
The template description. |
Create a VPC. |
| StackType |
string |
The stack type. Valid values:
|
ROS |
| RamRoleName |
string |
The RAM role name. Resource Orchestration Service (ROS) assumes this role to create the stack and calls API operations on behalf of the user by using the credentials of the role. |
test-role |
| UpdateTime |
string |
The time when the stack was last updated. The time is displayed in UTC+0 and follows the ISO 8601 standard without the trailing Z. Format: YYYY-MM-DDThh:mm:ss. |
2020-09-17T08:21:40 |
| Outputs |
array<object> |
The list of stack outputs. |
|
|
object |
The list of stack outputs. Note
This parameter is returned only when OutputOption is set to Enabled. |
[{"Description": "VPC ID","OutputKey": "VpcId","OutputValue": "vpc-bp1m6fww66xbntjyc****"}] |
|
| DriftDetectionTime |
string |
The time when the most recent successful drift detection was performed on the stack. |
2020-09-16T09:21:40 |
| RegionId |
string |
The region ID of the stack. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| StackDriftStatus |
string |
The drift status of the stack in the most recent successful drift detection. Valid values:
|
IN_SYNC |
| NotificationURLs |
array |
The callback URLs for receiving stack events. |
|
|
string |
The callback URLs for receiving stack events. |
["http://127.XX.XX.1:8080/x", "http://127.0.XX.XX:8080/y"] |
|
| DisableRollback |
boolean |
Indicates whether rollback is disabled when the stack fails to be created. Valid values:
|
false |
| StackName |
string |
The stack name. |
MyStack |
| Tags |
array<object> |
The tags of the stack. |
|
|
object |
|||
| Key |
string |
The tag key of the stack. |
usage |
| Value |
string |
The tag value of the stack. |
test |
| TimeoutInMinutes |
integer |
The timeout period for creating the stack. Unit: minutes. |
10 |
| StackId |
string |
The stack ID. |
c754d2a4-28f1-46df-b557-9586173a**** |
| ResourceGroupId |
string |
The resource group ID. |
rg-acfmxazb4ph6aiy**** |
| ResourceProgress |
object |
The resource processing progress. |
|
| TotalResourceCount |
integer |
The total number of resources. Note
This parameter is returned only when ShowResourceProgress is set to EnabledIfCreateStack. |
2 |
| SuccessResourceCount |
integer |
The number of resources that are successfully processed. Note
This parameter is returned only when ShowResourceProgress is set to EnabledIfCreateStack. |
1 |
| FailedResourceCount |
integer |
The number of resources that failed to be processed. Note
This parameter is returned only when ShowResourceProgress is set to EnabledIfCreateStack. |
0 |
| InProgressResourceCount |
integer |
The number of resources that are being processed. Note
This parameter is returned only when ShowResourceProgress is set to EnabledIfCreateStack. |
1 |
| PendingResourceCount |
integer |
The number of resources that are pending processing. Note
This parameter is returned only when ShowResourceProgress is set to EnabledIfCreateStack. |
0 |
| InProgressResourceDetails |
array<object> |
The list of progress details for resources that are being processed. Note
This parameter is returned only when ShowResourceProgress is set to EnabledIfCreateStack. |
|
|
object |
The progress details of a resource that is being processed. |
||
| ResourceName |
string |
The resource name. |
WaitCondition |
| ResourceType |
string |
The resource type. |
ALIYUN::ROS::WaitCondition |
| ProgressValue |
number |
The current progress value of the resource. |
5 |
| ProgressTargetValue |
number |
The target progress value of the resource. |
10 |
| StackOperationProgress |
number |
The stack operation progress percentage. Value range: 0 to 100. Example: During stack creation, the value starts from 0 and increases. If the creation succeeds, the value reaches 100. If the creation fails and rollback begins, the value decreases. When the rollback succeeds, the value reaches 0. This parameter indicates the overall progress of the creation operation, regardless of whether the stack status is creating or rolling back. Note
This parameter is returned only when ShowResourceProgress is set to PercentageOnly. |
100 |
| StackActionProgress |
number |
The stack action progress percentage. Value range: 0 to 100. Example: During stack creation, the value starts from 0 and increases. If the creation succeeds, the value reaches 100. If the creation fails and rollback begins, the value starts from another value (100 minus the progress value when the resource creation failed) and increases. When the rollback succeeds, the value reaches 100. During stack creation, this parameter indicates the progress of the creation action. During stack rollback, this parameter indicates the progress of the rollback action. Note
This parameter is returned only when ShowResourceProgress is set to PercentageOnly. |
100 |
| Log |
object |
The stack-related output logs. |
|
| TerraformLogs |
array<object> |
The Terraform output logs. This parameter is returned only for Terraform stacks. This parameter is returned when LogOption is not specified, or when LogOption is set to Stack or All. Note
This parameter is not returned for stacks that are running. This parameter indicates the logs of the most recent operation (creation, continued creation, update, or deletion) on the stack. |
|
|
object |
test |
||
| Command |
string |
The name of the Terraform command executed. Valid values:
For more information about these commands, see Command. |
apply |
| Stream |
string |
The output stream. Valid values:
|
stdout |
| Content |
string |
The content output by the current command to the current output stream. |
Apply complete! Resources: 42 added, 0 changed, 0 destroyed. |
| ResourceLogs |
array<object> |
The resource output logs. This parameter is returned when LogOption is set to Resource or All. Note
Only certain resource types return resource logs, such as |
|
|
array<object> |
test |
||
| ResourceName |
string |
The resource name defined in the template. |
MyResourceCleaner |
| Logs |
array<object> |
All logs associated with the resource. |
|
|
object |
test |
||
| Keys |
array |
The list of keywords for a log associated with the resource. |
|
|
string |
A keyword. |
ResourceDetails |
|
| Content |
string |
The content of a log associated with the resource. |
[] |
| TemplateId |
string |
The template ID. This parameter is returned only when the template used by the stack is a private template or a shared template. If the template is a shared template, the returned value is the same as the TemplateARN of the template. |
a52f81be-496f-4e1c-a286-8852ab54**** |
| TemplateVersion |
string |
The template version. This parameter is returned only when the template used by the stack is a private template or a shared template. If the template is a shared template, this parameter is returned only when VersionOption is set to AllVersions during sharing. Valid values: v1 to v100. |
v1 |
| TemplateScratchId |
string |
The resource scenario ID. This parameter is returned only when the template used by the stack is generated from a resource scenario. |
ts-7f7a704cf71c49a6**** |
| TemplateURL |
string |
The URL of the file that contains the template body. This parameter is returned only when the template used by the stack is from a URL, including a web server (HTTP or HTTPS) or an Alibaba Cloud OSS bucket. |
oss://ros/template/demo |
| Interface |
string |
The interface description. |
{} |
| ServiceManaged |
boolean |
Indicates whether the stack is a managed stack. Valid values:
|
false |
| ServiceName |
string |
The service name to which the managed stack belongs. |
ACVS |
| OperationInfo |
object |
The supplementary information that is returned when an error occurs during a stack operation. Note
This property is returned only in specific cases and contains at least one sub-property. For example, an error occurs when another cloud service API is called. |
|
| Code |
string |
The error code. |
DependencyViolation |
| Message |
string |
The error message. |
There is still instance(s) in the specified security group. |
| RequestId |
string |
The request ID of the API call to another cloud service. |
071D6166-3F6B-5C7B-A1F0-0113FBB643A8 |
| Action |
string |
The name of the API operation called on another cloud service. |
DeleteSecurityGroup |
| ResourceType |
string |
The resource type on which the operation error occurred. |
ALIYUN::ECS::SecurityGroup |
| LogicalResourceId |
string |
The logical ID of the resource on which the operation error occurred. |
EcsSecurityGroup |
| OrderIds |
array |
The list of order IDs. This parameter is returned only when manual payment for subscription orders is configured during stack creation. |
|
|
string |
The order ID. |
2161413696**** |
|
| CheckedStackResourceCount |
integer |
The number of resources on which drift detection has been performed. Note
This parameter is returned only when the most recent drift detection on the stack was successful. |
1 |
| NotCheckedStackResourceCount |
integer |
The number of resources on which drift detection has not been performed. Note
This parameter is returned only when the most recent drift detection on the stack was successful. |
1 |
| RollbackFailedRootReason |
string |
When the stack status is rollback failed, this field displays the root cause of the failure in the previous phase that triggered the rollback. |
Resource UPDATE failed: Exception: resources.FailToCreate: FailToCreate: reason |
Examples
Success response
JSON format
{
"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
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.