Queries the information of a stack.
This topic provides an example on how to query the information of the stack whose
ID is c754d2a4-28f1-46df-b557-9586173a****
and that is deployed in the China (Hangzhou) region.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | GetStack |
The operation that you want to perform. Set the value to GetStack. |
StackId | String | Yes | c754d2a4-28f1-46df-b557-9586173a**** |
The ID of the stack. |
RegionId | String | Yes | cn-hangzhou |
The region ID of the stack. You can call the DescribeRegions operation to query the most recent region list. |
ClientToken | String | No | 123e4567-e89b-12d3-a456-42665544**** |
The client token that is used to ensure the idempotence of the request. This value is generated by the client and is globally unique. The token can be up to 64 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). For more information, see How to ensure idempotence. |
OutputOption | String | No | Disabled |
Specifies whether to return the list of output parameters. Valid values:
|
ShowResourceProgress | String | No | Disabled |
Specifies whether to show the resource creation progress. Valid values:
|
For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Status | String | CREATE_COMPLETE |
The state of the stack. Valid values:
|
Description | String | my stack description |
The description of the stack. |
Parameters | Array of Parameter |
The parameters of the stack. |
|
ParameterKey | String | InstanceType |
The key of parameter N. |
ParameterValue | String | ecs.cm4.6xlarge |
The value of parameter N. |
RequestId | String | B288A0BE-D927-4888-B0F7-B35EF84B6E6F |
The ID of the request. |
StatusReason | String | Stack CREATE completed successfully |
The reason why the stack is in its current state. |
ParentStackId | String | 4a6c9851-3b0f-4f5f-b4ca-a14bf692**** |
The ID of the parent stack. |
CreateTime | String | 2020-10-14T01:55:01 |
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. |
DeletionProtection | String | Disabled |
Specifies whether to enable deletion protection on the stack. Default value: Disabled. Valid values:
Note The deletion protection property of a nested stack is the same as that of its root
stack.
|
RootStackId | String | 4a6c9851-3b0f-4f5f-b4ca-a14bf692**** |
The ID of the root stack. This parameter is returned if the specified stack is a nested stack. |
TemplateDescription | String | Create an ECS instance |
The description of the template. |
StackType | String | ROS |
The type of the stack. Valid values:
|
RamRoleName | String | test-role |
The name of the RAM role. ROS assumes the RAM role to create the stack and uses the credential 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 but you do not have permissions to use the RAM role, ROS still uses the RAM role. Follow the principle of least privilege when granting permissions to the role. If you do not specify this parameter, ROS uses the existing role that is associated with the stack. If no roles are available for ROS to assume, ROS uses a temporary credential that is generated from the credentials of your account. The name of the RAM role can be up to 64 bytes in length. |
UpdateTime | String | 2020-11-14T01:55:01 |
The time when the stack was last updated. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC. |
Outputs | Array of Object | [{"Description": "Instance ID","OutputKey": "InstanceId","OutputValue": "i-a****"}] |
The list of output parameters of the stack. Note This parameter is returned when OutputOption is set to Enabled.
|
DriftDetectionTime | String | 2021-02-27T07:47:47 |
The time when the most recent successful drift detection operation was initiated. |
RegionId | String | cn-hangzhou |
The region ID of the stack. You can call the DescribeRegions operation to query the most recent region list. |
StackDriftStatus | String | IN_SYNC |
The drift status of the stack in the last successful drift detection. Valid values:
|
NotificationURLs | Array of String | ["http://127.XX.XX.1:8080/x", "http://127.0.XX.XX:8080/y"] |
The callback URLs for receiving stack events. |
DisableRollback | Boolean | false |
Indicates whether rollback is disabled when the stack fails to be created. Default value: false. Valid values:
|
StackName | String | MyStack |
The name of the stack. 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. |
Tags | Array of Tag |
The tags of the stack. |
|
Key | String | usage |
The key of tag N of the stack. |
Value | String | test |
The value of tag N of the stack. |
TimeoutInMinutes | Integer | 10 |
The timeout period that is specified for the stack creation request. Unit: minutes. |
StackId | String | c754d2a4-28f1-46df-b557-9586173a**** |
The ID of the stack. |
ResourceGroupId | String | rg-acfmxazb4ph6aiy**** |
The ID of the resource group. |
ResourceProgress | Object |
The resource creation process. |
|
TotalResourceCount | Integer | 2 |
The total number of resources. |
SuccessResourceCount | Integer | 1 |
The number of resources that were processed. |
FailedResourceCount | Integer | 0 |
The number of resources that failed to be processed. |
InProgressResourceCount | Integer | 1 |
The number of resources that are being processed. |
PendingResourceCount | Integer | 0 |
The number of resources to be processed. |
InProgressResourceDetails | Array of InProgressResourceDetail |
The progress details of resources that are being processed. |
|
ResourceName | String | WaitCondition |
The name of the resource. |
ResourceType | String | ALIYUN::ROS::WaitCondition |
The type of the resource. |
ProgressValue | Float | 5 |
The current progress value of the resource. |
ProgressTargetValue | Float | 10 |
The desired progress value of the resource. |
Log | Object |
The logs of the stack. |
|
TerraformLogs | Array of TerraformLog |
The logs of the Terraform stack. This parameter is returned only when the stack is a Terraform stack. Note This parameter is not returned for a running stack. This parameter contains the logs
of the last creation, re-creation, update, or deletion operation on the stack.
|
|
Command | String | apply |
The name of the Terraform command. Valid values:
For more information about the Terraform commands, see Basic CLI Features. |
Stream | String | stdout |
The output stream. Valid values:
|
Content | String | Apply complete! Resources: 42 added, 0 changed, 0 destroyed. |
The content of the output stream. |
TemplateId | String | a52f81be-496f-4e1c-a286-8852ab54**** |
The ID of the template. This parameter is returned only when the template currently used by the stack is a custom template or a shared template. If the template is a shared template, the value of this parameter is the same as that of the TemplateARN parameter. |
TemplateVersion | String | v1 |
The version of the template. This parameter is returned only when the template currently used by the stack is a custom template or a shared template. If the stack is a shared template, this parameter is returned only when the VersionOption parameter is set to AllVersions. Valid values: v1 to v100. |
TemplateScratchId | String | ts-7f7a704cf71c49a6**** |
The ID of the scenario. This parameter is returned only when the template currently used by the stack is from a scenario. |
TemplateURL | String | oss://ros/template/demo |
The URL of the file that contains the template body. This parameter is returned only when the template currently used by the stack is from a URL, including the URL of an HTTP or HTTPS web server or an Alibaba Cloud Object Storage Service (OSS) bucket. |
Examples
Sample requests
http(s)://ros.aliyuncs.com/?Action=GetStack
&StackId=c754d2a4-28f1-46df-b557-9586173a****
&RegionId=cn-hangzhou
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<GetStackResponse>
<Status>CREATE_COMPLETE</Status>
<Description>my stack description</Description>
<Parameters>
<ParameterKey>InstanceType</ParameterKey>
<ParameterValue>ecs.cm4.6xlarge</ParameterValue>
</Parameters>
<RequestId>B288A0BE-D927-4888-B0F7-B35EF84B6E6F</RequestId>
<StatusReason>Stack CREATE completed successfully</StatusReason>
<CreateTime>2020-10-14T01:55:01</CreateTime>
<DeletionProtection>Disabled</DeletionProtection>
<TemplateDescription>Create an ECS instance</TemplateDescription>
<StackType>ROS</StackType>
<RegionId>cn-hangzhou</RegionId>
<DisableRollback>false</DisableRollback>
<StackName>MyStack</StackName>
<Tags>
<Key>usage</Key>
<Value>test</Value>
</Tags>
<TimeoutInMinutes>10</TimeoutInMinutes>
<StackId>c754d2a4-28f1-46df-b557-9586173a****</StackId>
<ResourceGroupId>rg-acfmxazb4ph6aiy****</ResourceGroupId>
</GetStackResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"Status" : "CREATE_COMPLETE",
"Description" : "my stack description",
"Parameters" : [ {
"ParameterKey" : "InstanceType",
"ParameterValue" : "ecs.cm4.6xlarge"
} ],
"RequestId" : "B288A0BE-D927-4888-B0F7-B35EF84B6E6F",
"StatusReason" : "Stack CREATE completed successfully",
"CreateTime" : "2020-10-14T01:55:01",
"DeletionProtection" : "Disabled",
"TemplateDescription" : "Create an ECS instance",
"StackType" : "ROS",
"RegionId" : "cn-hangzhou",
"DisableRollback" : false,
"StackName" : "MyStack",
"Tags" : [ {
"Key" : "usage",
"Value" : "test"
} ],
"TimeoutInMinutes" : 10,
"StackId" : "c754d2a4-28f1-46df-b557-9586173a****",
"ResourceGroupId" : "rg-acfmxazb4ph6aiy****"
}
Error codes
For a list of error codes, visit the API Error Center.
HttpCode |
Error codes |
Error message |
Description |
---|---|---|---|
404 |
StackNotFound |
The Stack ({name}) could not be found. |
The error message returned because the specified stack does not exist. name indicates the stack name or ID. |