All Products
Search
Document Center

Resource Orchestration Service:GetStackDriftDetectionStatus

Last Updated:Sep 12, 2024

Queries the drift detection status of a stack.

Operation description

In this topic, the status of a drift detection operation whose ID is a7044f0d-6f2e-4128-a307-4524ef88**** is queried. The operation is performed in the China (Hangzhou) region.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ros:GetStackDriftDetectionStatusget
  • stack
    acs:ros:{#regionId}:{#accountId}:stack/{#stackId}
    none
none

Request syntax

POST /V2/GetStackDriftDetectionStatus

GET /V2/GetStackDriftDetectionStatus

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the stack to be detected for drift.

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
DriftDetectionIdstringYes

The ID of the drift detection operation.

You can call the ListStackResourceDrifts operation to obtain the ID of the drift detection operation.

a7044f0d-6f2e-4128-a307-4524ef88****

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

B288A0BE-D927-4888-B0F7-B35EF84B6E6F
DriftDetectionTimestring

The time when the stack drift detection operation was initiated.

2020-02-27T07:47:47
DriftDetectionStatusReasonstring

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

Detect stack drift successfully
DriftedStackResourceCountinteger

The total number of stack resources that have drifted.

1
StackDriftStatusstring

The drift status of the stack. 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 have drifted.
  • NOT_CHECKED: Resource Orchestration Service (ROS) has not checked whether the actual configuration of the resource 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 also has a status of IN_SYNC.
DRIFTED
DriftDetectionStatusstring

The drift detection status. Valid values:

  • DETECTION_COMPLETE: The drift detection operation has been completed for all resources that support drift detection in the stack.
  • 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.
DETECTION_COMPLETE
StackIdstring

The ID of the stack.

4a6c9851-3b0f-4f5f-b4ca-a14bf691****
DriftDetectionIdstring

The ID of the drift detection operation.

a7044f0d-6f2e-4128-a307-4524ef88****
HTTP status codeError codeError messageDescription
404StackDriftDetectionNotFoundThe stack drift detection ({ID}) could not be found.The error message returned because the drift detection does not exist. ID indicates the ID of the drift detection operation.

Examples

Sample success responses

JSONformat

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

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history