Queries the summary of compliance evaluation results by rule risk level.

This topic provides an example of how to query the summary of compliance evaluation results by rule risk level. The return result shows four rules that are specified with the high risk level. One of them detects non-compliant resources, and the resources evaluated by the remaining three are all compliant.

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 GetConfigRuleSummaryByRiskLevel

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

For information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
RequestId String A3CED98C-DE65-46AC-B2D2-04A4A9AB5B36

The ID of the request.

ConfigRuleSummaries Array of Data

The summary of compliance evaluation results by rule risk level.

RiskLevel Integer 1

The risk level of the resources that are not compliant with the rules. Valid values:

  • 1: high risk level.
  • 2: medium risk level.
  • 3: low risk level.
CompliantCount Integer 3

The number of rules against which specific resources are evaluated as compliant.

NonCompliantCount Integer 1

The number of rules against which specific resources are evaluated as non-compliant.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetConfigRuleSummaryByRiskLevel
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetConfigRuleSummaryByRiskLevelResponse>
    <RequestId>A3CED98C-DE65-46AC-B2D2-04A4A9AB5B36</RequestId>
    <ConfigRuleSummaries>
        <RiskLevel>1</RiskLevel>
        <CompliantCount>3</CompliantCount>
        <NonCompliantCount>1</NonCompliantCount>
    </ConfigRuleSummaries>
</GetConfigRuleSummaryByRiskLevelResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "A3CED98C-DE65-46AC-B2D2-04A4A9AB5B36",
  "ConfigRuleSummaries" : [ {
    "RiskLevel" : 1,
    "CompliantCount" : 3,
    "NonCompliantCount" : 1
  } ]
}

Error codes

HTTP status code Error code Error message Description
503 ServiceUnavailable The request has failed due to a temporary failure of the server. The error message returned because the service is unavailable.

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