Queries the details of a stack instance that is deployed in a stack group within a specified account in a specified region.
In this example, the details of a stack instance that is deployed in the China (Beijing)
region within the 151266687691∗∗∗∗
account is queried. The stack instance is deployed in a stack group named MyStackGroup
that is granted self-managed permissions and deployed in the China (Hangzhou) region.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | GetStackInstance |
The operation that you want to perform. Set the value to GetStackInstance. |
RegionId | String | Yes | cn-hangzhou |
The region ID of the stack group. You can call the DescribeRegions operation to query the most recent region list. |
StackGroupName | String | Yes | MyStackGroup |
The name of the stack group. The name must be unique within a region. 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. |
StackInstanceAccountId | String | Yes | 151266687691**** |
The ID of the account to which the stack instance belongs.
Note For more information about the account, see Overview.
|
StackInstanceRegionId | String | Yes | cn-beijing |
The region ID of the stack instance. |
For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | B8A6B693-82C8-419D-8796-DE99EC33CFF9 |
The ID of the request. |
StackInstance | Object |
The details of the stack instance. |
|
Status | String | CURRENT |
The status of the stack instance. Valid values:
|
StackGroupId | String | fd0ddef9-9540-4b42-a464-94f77835**** |
The ID of the stack group. |
StackId | String | 35ad60e3-6a92-42d8-8812-f0700d45**** |
The ID of the stack that corresponds to the stack instance. Note This parameter is returned only when the stack instance is in the CURRENT state.
|
DriftDetectionTime | String | 2020-02-27T07:47:47 |
The time when the last drift detection is performed on the stack group. Note This parameter is returned only when the drift detection is performed on the stack
group.
|
StackDriftStatus | String | IN_SYNC |
The status of the last drift detection that is performed on the stack group. Valid values:
Note This parameter is returned only when the drift detection is performed on the stack
group.
|
StatusReason | String | User initiated stop |
The reason why the stack instance is in the OUTDATED state. Note This parameter is returned only when the stack instance is in the OUTDATED state.
|
ParameterOverrides | Array of ParameterOverride |
The list of the override parameters. |
|
ParameterKey | String | Amount |
The key of override parameter N. |
ParameterValue | String | 1 |
The value of override parameter N. |
StackGroupName | String | MyStackGroup |
The name of the stack group. |
AccountId | String | 151266687691**** |
The ID of the account to which the stack instance belongs. |
RegionId | String | cn-beijing |
The region ID of the stack instance. |
RdFolderId | String | fd-4PvlVLOL8v |
The folder ID of the resource directory. Note This parameter is returned only when the stack group is granted service-managed permissions.
|
Examples
Sample requests
http(s)://ros.aliyuncs.com/?Action=GetStackInstance
&RegionId=cn-hangzhou
&StackGroupName=MyStackGroup
&StackInstanceAccountId=151266687691****
&StackInstanceRegionId=cn-beijing
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<GetStackInstanceResponse>
<RequestId>B8A6B693-82C8-419D-8796-DE99EC33CFF9</RequestId>
<StackInstance>
<Status>OUTDATED</Status>
<AccountId>151266687691****</AccountId>
<StatusReason>Cancelled since failure tolerance has exceeded</StatusReason>
<StackGroupName>MyStackGroup</StackGroupName>
<StackGroupId>fd0ddef9-9540-4b42-a464-94f77835****</StackGroupId>
<RegionId>cn-beijing</RegionId>
</StackInstance>
</GetStackInstanceResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "B8A6B693-82C8-419D-8796-DE99EC33CFF9",
"StackInstance" : {
"Status" : "OUTDATED",
"AccountId" : "151266687691****",
"StatusReason" : "Cancelled since failure tolerance has exceeded",
"ParameterOverrides" : [ ],
"StackGroupName" : "MyStackGroup",
"StackGroupId" : "fd0ddef9-9540-4b42-a464-94f77835****",
"RegionId" : "cn-beijing"
}
}
Error codes
For a list of error codes, visit the API Error Center.
Error code |
Error message |
HTTP status code |
Description |
---|---|---|---|
InvalidParameter |
The specified parameter {name} is invalid, {reason}. |
400 |
The error message returned because the specified parameter is invalid. name indicates the parameter key. reason indicates the reason for the error. |
StackGroupNotFound |
The StackGroup ({name}) could not be found. |
404 |
The error message returned because the specified stack group does not exist. name indicates the name of the stack group. |
StackInstanceNotFound |
The StackInstance could not be found. |
404 |
The error message returned because the specified stack instance does not exist. |