Queries the compliance results of member accounts in a specified compliance package within a specified account group.
Operation description
This topic provides an example on how to query the compliance results of member accounts in the compliance package cp-541e626622af0087**** within the account group ca-04b3fd170e340007****. The return result shows that the total number of member accounts is 2 and the number of non-compliant member accounts is 0.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
config:GetAggregateAccountComplianceByPack |
get |
*AggregateCompliancePack
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| CompliancePackId |
string |
Yes |
The compliance package ID. For information about how to obtain the compliance package ID, see ListAggregateCompliancePacks. |
cp-541e626622af0087**** |
| AggregatorId |
string |
Yes |
The account group ID. For information about how to obtain the account group ID, see ListAggregators. |
ca-04b3fd170e340007**** |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
6EC7AED1-172F-42AE-9C12-295BC2ADB751 |
| AccountComplianceResult |
object |
The compliance results of member accounts in the compliance package. |
|
| CompliancePackId |
string |
The compliance package ID. |
cp-541e626622af0087**** |
| NonCompliantCount |
integer |
The number of non-compliant member accounts. |
0 |
| TotalCount |
integer |
The total number of member accounts. |
2 |
| AccountCompliances |
array<object> |
The compliance results of member accounts. |
|
|
object |
None. |
||
| ComplianceType |
string |
The compliance type. Valid values:
|
COMPLIANT |
| AccountId |
integer |
The ID of one of the member accounts in the account group. |
100931896542**** |
| AccountName |
string |
The name of one of the member accounts in the account group. |
Alice |
Examples
Success response
JSON format
{
"RequestId": "6EC7AED1-172F-42AE-9C12-295BC2ADB751",
"AccountComplianceResult": {
"CompliancePackId": "cp-541e626622af0087****",
"NonCompliantCount": 0,
"TotalCount": 2,
"AccountCompliances": [
{
"ComplianceType": "COMPLIANT",
"AccountId": 0,
"AccountName": "Alice"
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Invalid.AggregatorId.Value | The specified AggregatorId is invalid. | The specified aggregator ID does not exist or you are not authorized to use the aggregator. |
| 400 | Invalid.CompliancePackId.Value | The specified CompliancePackId does not exist. | The specified compliance pack ID does not exist. |
| 404 | AccountNotExisted | Your account does not exist. | |
| 503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | The request has failed due to a temporary failure of the server. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.