Queries the compliance evaluation results of member accounts monitored by a compliance package in an account group.

The sample request in this topic shows you how to query the compliance evaluation results of member accounts monitored by the cp-541e626622af0087**** compliance package in the ca-04b3fd170e340007**** account group. The return result shows that two member accounts are monitored by the compliance package and they are both evaluated as 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 GetAggregateAccountComplianceByPack

The that you want to perform. Set the value to GetAggregateAccountComplianceByPack.

CompliancePackId String Yes cp-541e626622af0087****

The ID of the compliance package.

For more 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 more 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 6EC7AED1-172F-42AE-9C12-295BC2ADB751

The ID of the request.

AccountComplianceResult Object

The compliance evaluation results of member accounts monitored by the compliance package.

CompliancePackId String cp-541e626622af0087****

The ID of the compliance package.

NonCompliantCount Integer 0

The number of non-compliant member accounts.

TotalCount Integer 2

The total number of monitored member accounts.

AccountCompliances Array of AccountCompliances

The information about the compliance evaluation result of member account.

ComplianceType String COMPLIANT

The compliance evaluation result. Valid values:

  • COMPLIANT: The resources of the member accounts are evaluated as compliant.
  • NON_COMPLIANT: The resources of the member account are evaluated as non-compliant.
  • NOT_APPLICABLE: The rules do not apply to the resources of the member account.
  • INSUFFICIENT_DATA: No resource data is available.
AccountId Long 100931896542****

The ID of the member account in the account group.

AccountName String Alice

The name of the member account in the account group.

Examples

Sample requests

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

Sample success responses

XML format

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

<GetAggregateAccountComplianceByPackResponse>
	<RequestId>6EC7AED1-172F-42AE-9C12-295BC2ADB751</RequestId>
	<AccountComplianceResult>
		<CompliancePackId>cp-541e626622af0087****</CompliancePackId>
		<TotalCount>2</TotalCount>
		<NonCompliantCount>0</NonCompliantCount>
		<AccountCompliances>
			<AccountId>100931896542****</AccountId>
			<ComplianceType>COMPLIANT</ComplianceType>
			<AccountName>Alice</AccountName>
		</AccountCompliances>
		<AccountCompliances>
			<AccountId>171322098523****</AccountId>
			<ComplianceType>COMPLIANT</ComplianceType>
			<AccountName>Jim</AccountName>
		</AccountCompliances>
	</AccountComplianceResult>
</GetAggregateAccountComplianceByPackResponse>

JSON format

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

{
  "RequestId" : "6EC7AED1-172F-42AE-9C12-295BC2ADB751",
  "AccountComplianceResult" : {
    "CompliancePackId" : "cp-541e626622af0087****",
    "TotalCount" : 2,
    "NonCompliantCount" : 0,
    "AccountCompliances" : [ {
      "AccountId" : "100931896542****",
      "ComplianceType" : "COMPLIANT",
      "AccountName" : "Alice"
    }, {
      "AccountId" : "171322098523****",
      "ComplianceType" : "COMPLIANT",
      "AccountName" : "Jim"
    } ]
  }
}

Error codes

HTTP status code Error code Error message Description
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.
400 Invalid.CompliancePackId.Value The specified CompliancePackId does not exist. The error message returned because the specified compliance package ID does not exist.
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.