Queries the compliance evaluation results based on rules in a compliance package in an account group.

The sample request in this topic shows you how to query the compliance evaluation results based on rules in the cp-541e626622af0087**** compliance package that is created for the ca-04b3fd170e340007**** account group. The return result shows a total of one rule. No resources are evaluated as non-compliant based on the rule.

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 GetAggregateConfigRuleComplianceByPack

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

CompliancePackId String Yes cp-541e626622af0087****

The ID of the compliance package.

For information about how to obtain the ID of a compliance package, see ListAggregateCompliancePacks.

AggregatorId String Yes ca-04b3fd170e340007****

The ID of the account group.

For information about how to obtain the ID of an account group, see ListAggregators.

For information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
RequestId String C6B0C0A8-3245-48F1-AEAB-BC1A446E99D0

The ID of the request.

ConfigRuleComplianceResult Object

The compliance evaluation results that are returned by rules in the compliance package.

CompliancePackId String cp-541e626622af0087****

The ID of the compliance package.

NonCompliantCount Integer 0

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

ConfigRuleCompliances Array of ConfigRuleCompliances

The information about rules in the compliance package.

ComplianceType String COMPLIANT

The compliance evaluation result returned by the rule. Valid values:

  • COMPLIANT: The relevant resources are evaluated as compliant.
  • NON_COMPLIANT: The relevant resources are evaluated as non-compliant.
  • NOT_APPLICABLE: The rule does not apply to your resources.
  • INSUFFICIENT_DATA: No resource data is available.
ConfigRuleName String eip-bandwidth-limit

The name of the rule.

ConfigRuleId String cr-fdc8626622af00f9****

The ID of the rule.

TotalCount Integer 1

The total number of rules in the compliance package.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetAggregateConfigRuleComplianceByPack
&CompliancePackId=cp-541e626622af0087****
&AggregatorId=ca-04b3fd170e340007****
&Common request parameters

Sample success responses

XML format

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

<GetAggregateConfigRuleComplianceByPackResponse>
    <RequestId>C6B0C0A8-3245-48F1-AEAB-BC1A446E99D0</RequestId>
    <ConfigRuleComplianceResult>
        <CompliancePackId>cp-541e626622af0087****</CompliancePackId>
        <ConfigRuleCompliances>
            <ConfigRuleId>cr-fdc8626622af00f9****</ConfigRuleId>
            <ComplianceType>COMPLIANT</ComplianceType>
            <ConfigRuleName>eip-bandwidth-limit</ConfigRuleName>
        </ConfigRuleCompliances>
        <TotalCount>1</TotalCount>
        <NonCompliantCount>0</NonCompliantCount>
    </ConfigRuleComplianceResult>
</GetAggregateConfigRuleComplianceByPackResponse>

JSON format

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

{
  "RequestId" : "C6B0C0A8-3245-48F1-AEAB-BC1A446E99D0",
  "ConfigRuleComplianceResult" : {
    "CompliancePackId" : "cp-541e626622af0087****",
    "ConfigRuleCompliances" : [ {
      "ConfigRuleId" : "cr-fdc8626622af00f9****",
      "ComplianceType" : "COMPLIANT",
      "ConfigRuleName": "eip-bandwidth-limit"
    } ],
    "TotalCount" : 1,
    "NonCompliantCount" : 0
  }
}

Error codes

HTTP status code Error code Error message Description
400 Invalid.CompliancePackId.Value The specified CompliancePackId does not exist. The error message returned because the specified compliance package ID does not exist.
400 Invalid.AggregatorId.Value The specified AggregatorId is invalid. The error message returned because the specified account group ID does not exist or you are not authorized to use the account group.
404 AccountNotExisted Your account does not exist. The error message returned because your account does not exist.
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.