Queries the statistics of compliance evaluations based on compliance types.

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

ParameterTypeRequiredExampleDescription
ActionStringYesDescribeCompliance

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

ResourceTypeStringNoACS::ECS::Instance

The resource type.

If you query compliance evaluation results by resource, you must specify the ResourceType and ResourceId parameters.

ResourceIdStringNoi-bp151g9tpto890zr****

The resource ID.

If you query compliance evaluation results by resource, you must specify the ResourceType and ResourceId parameters.

ComplianceTypeStringNoCOMPLIANT

The compliance evaluation result of the resource. Valid values:

  • COMPLIANT: The resource is evaluated as compliant.
  • NON_COMPLIANT: The resource is evaluated as non-compliant.
  • NOT_APPLICABLE: The rule does not apply to the resource.
  • INSUFFICIENT_DATA: The resource data is insufficient.
ConfigRuleIdStringNocr-12b398b633820012****

The rule ID.

If you query compliance evaluation results by resource, you must specify the ConfigRuleId, ResourceType, and ResourceId parameters. Otherwise, the ConfigRuleId parameter becomes invalid.

MultiAccountBooleanNofalse

This parameter is unavailable since 00:00:00 on June 30, 2021. Account group-related operations are provided as an alternative after 00:00:00 on May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related operations after 00:00:00 on May 30, 2021. For information about account groups, see Overview.

MemberIdLongNo100931896542****

This parameter is unavailable since 00:00:00 on June 30, 2021. Account group-related operations are provided as an alternative after 00:00:00 on May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related operations after 00:00:00 on May 30, 2021. For information about account groups, see Overview.

Response parameters

ParameterTypeExampleDescription
ComplianceResultObject

The statistics of compliance evaluations.

TotalCountLong12

The total number of compliance evaluations.

  • This parameter returns the total number of evaluated resources if you set the ResourceId parameter in the request.
  • This parameter returns the total number of triggered rules if you set the ConfigRuleId parameter in the request.
CompliancesArray of Compliances

The compliance evaluation results based on compliance types.

ComplianceTypeStringCOMPLIANT

The compliance evaluation result of the resource. Valid values:

  • COMPLIANT: The resource is evaluated as compliant.
  • NON_COMPLIANT: The resource is evaluated as non-compliant.
  • NOT_APPLICABLE: The rule does not apply to the resource.
  • INSUFFICIENT_DATA: No resource data is available.
CountInteger12

The number of compliance evaluations with the corresponding result.

  • This parameter returns the total number of evaluated resources if you set the ResourceId parameter in the request.
  • This parameter returns the total number of triggered rules if you set the ConfigRuleId parameter in the request.
RequestIdString17306AB1-34E0-468F-BD7B-68D8AEAB754F

The request ID.

Examples

Sample requests

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

Sample success responses

XML format

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

<DescribeComplianceResponse>
    <ComplianceResult>
        <TotalCount>1</TotalCount>
        <Compliances>
            <ComplianceType>COMPLIANT</ComplianceType>
            <Count>1</Count>
        </Compliances>
    </ComplianceResult>
    <RequestId>17306AB1-34E0-468F-BD7B-68D8AEAB754F</RequestId>
</DescribeComplianceResponse>

JSON format

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

{
  "ComplianceResult" : {
    "TotalCount" : 1,
    "Compliances" : [ {
      "ComplianceType" : "COMPLIANT",
      "Count" : 1
    } ]
  },
  "RequestId" : "17306AB1-34E0-468F-BD7B-68D8AEAB754F"
}

Error codes

HTTP status codeError codeError messageDescription
404AccountNotExistedYour account does not exist.Your account does not exist.
503ServiceUnavailableThe request has failed due to a temporary failure of the server.The service is unavailable.

For a list of error codes, see Service error codes.