You can call this operation to query the drift detection status of a stack.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetStackDriftDetectionStatus

The operation that you want to perform. Set the value to GetStackDriftDetectionStatus.

DriftDetectionId String Yes a7044f0d-6f2e-4128-a307-4524ef88****

The drift detection ID.

RegionId String Yes cn-hangzhou

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

Response parameters

Parameter Type Example Description
DriftDetectionId String a7044f0d-6f2e-4128-a307-4524ef88****

The drift detection ID.

DriftDetectionStatus String DETECTION_COMPLETE

The drift detection status. Valid values:

  • DETECTION_COMPLETE: The drift detection operation has been completed for all resources in the stack that support drift detection.
  • DETECTION_FAILED: The stack drift detection operation has failed for at least one resource in the stack.
  • DETECTION_IN_PROGRESS: The stack drift detection operation is in progress.
DriftDetectionStatusReason String Detect stack drift successfully

The reason that the stack drift detection operation has its current status.

DriftDetectionTime String 2020-02-27T07:47:47

The time at which the stack drift detection operation was initiated.

DriftedStackResourceCount Integer 1

The total number of stack resources that have drifted.

RequestId String B288A0BE-D927-4888-B0F7-B35EF84B6E6F

The ID of the request.

StackDriftStatus String DRIFTED

The stack drift status. Valid values:

  • DRIFTED: The actual configuration of the stack differs, or has drifted, from its expected template configuration. A stack is considered to have drifted if one or more of its resources has drifted.
  • NOT_CHECKED: Resource Orchestration Service (ROS) has not checked whether the actual configuration of the stack differs from its expected template configuration.
  • IN_SYNC: The current configuration of each supported resource matches its expected template configuration. A stack with no resources that support drift detection will also have a status of IN_SYNC.
StackId String 4a6c9851-3b0f-4f5f-b4ca-a14bf691****

The ID of the stack.

Examples

Sample requests

http(s)://ros.aliyuncs.com/? Action=GetStackDriftDetectionStatus
&DriftDetectionId=a7044f0d-6f2e-4128-a307-4524ef88****
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

<GetStackDriftDetectionStatusResponse>
      <DriftDetectionId>a7044f0d-6f2e-4128-a307-4524ef88****</DriftDetectionId>
      <DriftDetectionStatus>DETECTION_COMPLETE</DriftDetectionStatus>
      <DriftDetectionStatusReason>Detect stack drift successfully</DriftDetectionStatusReason>
      <DriftDetectionTime>2020-02-27T07:47:47</DriftDetectionTime>
      <DriftedStackResourceCount>1</DriftedStackResourceCount>
      <StackDriftStatus>DRIFTED</StackDriftStatus>
      <StackId>4a6c9851-3b0f-4f5f-b4ca-a14bf691****</StackId>
</GetStackDriftDetectionStatusResponse>

JSON format

{
    "DriftDetectionId": "a7044f0d-6f2e-4128-a307-4524ef88****",
    "DriftDetectionStatus": "DETECTION_COMPLETE",
    "DriftDetectionStatusReason": "Detect stack drift successfully",
    "DriftDetectionTime": "2020-02-27T07:47:47",
    "DriftedStackResourceCount": 1,
    "StackDriftStatus": "DRIFTED",
    "StackId": "4a6c9851-3b0f-4f5f-b4ca-a14bf691****"
}

Error codes

For a list of error codes, visit the API Error Center.

For more information about errors common to all operations, see Common errors.

HTTP status code

Error code

Error message

Description

404

StackDriftDetectionNotFound

The stack drift detection ({ID}) could not be found.

The error message returned because there is no drift detection by the specified ID. ID indicates the drift detection ID.