调用ListStackResourceDrifts接口查询资源栈的资源偏差详情。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ListStackResourceDrifts |
要执行的操作,取值:ListStackResourceDrifts。 |
RegionId | String | 是 | cn-hangzhou |
资源栈所属的地域ID。您可以调用DescribeRegions查看最新的阿里云地域列表。 |
StackId | String | 是 | 4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
资源栈ID。 |
MaxResults | Long | 否 | 50 |
使用NextToken方式查询时,每次最多返回的结果数。 取值范围:1~100。 默认值:50。 |
ResourceDriftStatus.N | RepeatList | 否 | MODIFIED |
资源偏差状态。取值:
|
NextToken | String | 否 | AAAAAdDWBF2****w== |
查询凭证(Token),取值为上一次API调用返回的NextToken参数值。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
NextToken | String | AAAAAdDWBF2****w== |
本次调用返回的查询凭证值。 |
RequestId | String | B288A0BE-D927-4888-B0F7-B35EF84B6E6F |
请求ID。 |
ResourceDrifts | Array |
资源偏差。 |
|
ActualProperties | String | {"ScalingRuleName": "test1"} |
实际的资源属性,以JSON格式表示。 |
DriftDetectionTime | String | 2020-02-27T07:47:47 |
资源偏差检测时间。 |
ExpectedProperties | String | {"ScalingRuleName": "test2"} |
模板中定义的资源属性,以JSON格式表示。 |
LogicalResourceId | String | ScalingRule |
资源逻辑ID,即模板中资源的名称。 |
PhysicalResourceId | String | asr-2ze4zzc3kf9yz1kd**** |
资源物理ID,即实际资源ID。 |
PropertyDifferences | Array |
资源属性偏差。 |
|
ActualValue | String | test1 |
资源属性的实际取值。 |
DifferenceType | String | NOT_EQUAL |
资源属性的偏差类型。取值:
|
ExpectedValue | String | test2 |
资源属性模板定义值。 |
PropertyPath | String | /ScalingRuleName |
资源属性的路径。 |
ResourceDriftStatus | String | MODIFIED |
资源偏差状态。取值:
|
ResourceType | String | ALIYUN::ESS::ScalingRule |
资源类型。 |
StackId | String | 4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
资源栈ID。 |
示例
请求示例
http(s)://ros.aliyuncs.com/?Action=ListStackResourceDrifts
&RegionId=cn-hangzhou
&StackId=4a6c9851-3b0f-4f5f-b4ca-a14bf691****
&<公共请求参数>
正常返回示例
XML
格式
<ListStackResourceDriftsResponse>
<NextToken>AAAAAdDWBF2****w==</NextToken>
<ResourceDrifts>
<ActualProperties>{"ScalingRuleName": "test1"}</ActualProperties>
<DriftDetectionTime>2020-02-27T07:47:47</DriftDetectionTime>
<ExpectedProperties>{"ScalingRuleName": "test2"}</ExpectedProperties>
<LogicalResourceId>ScalingRule</LogicalResourceId>
<PhysicalResourceId>asr-2ze4zzc3kf9yz1kd****</PhysicalResourceId>
<PropertyDifferences>
<ActualValue>test1</ActualValue>
<DifferenceType>NOT_EQUAL</DifferenceType>
<ExpectedValue>test2</ExpectedValue>
<PropertyPath>/ScalingRuleName</PropertyPath>
</PropertyDifferences>
<ResourceDriftStatus>MODIFIED</ResourceDriftStatus>
<ResourceType>ALIYUN::ESS::ScalingRule</ResourceType>
<StackId>4a6c9851-3b0f-4f5f-b4ca-a14bf691****</StackId>
</ResourceDrifts>
<RequestId>8625BB3E-2950-4F3E-A713-5458DB5CD874</RequestId>
</ListStackResourceDriftsResponse>
JSON
格式
{
"NextToken": "AAAAAdDWBF2****w==",
"ResourceDrifts": [
{
"ActualProperties": "{\"ScalingRuleName\": \"test1\"}",
"DriftDetectionTime": "2020-02-27T07:47:47",
"ExpectedProperties": "{\"ScalingRuleName\": \"test2\"}",
"LogicalResourceId": "ScalingRule",
"PhysicalResourceId": "asr-2ze4zzc3kf9yz1kd****",
"PropertyDifferences": [
{
"ActualValue": "test1",
"DifferenceType": "NOT_EQUAL",
"ExpectedValue": "test2",
"PropertyPath": "/ScalingRuleName"
}
],
"ResourceDriftStatus": "MODIFIED",
"ResourceType": "ALIYUN::ESS::ScalingRule",
"StackId": "4a6c9851-3b0f-4f5f-b4ca-a14bf691****"
}
],
"RequestId": "8625BB3E-2950-4F3E-A713-5458DB5CD874"
}
错误码
访问错误中心查看更多错误码。
HttpCode |
错误码 |
错误信息 |
描述 |
---|---|---|---|
400 |
StackDriftDetectionExpired |
The stack drift detection of next token is expired, a new stack drift detection ({ID}) has already completed, please query from the very beginning again. |
NextToken对应的偏差检测ID已经失效了,因为一个新的偏差检测已经完成,请重新进行查询。ID为偏差检测的ID。 |
400 |
StackDriftDetectionNotAvailable |
There is no complete drift detection for stack ({ID}). |
资源栈没有成功完成过的偏差。ID为资源栈ID。 |
404 |
StackNotFound |
The Stack ({name}) could not be found. |
资源栈不存在。name为资源栈名称或ID。 |