Queries the compliance evaluation results of resources based on a rule in an account group.
Operation description
This topic provides an example on how to query the compliance evaluation results of resources based on the cr-888f626622af00ae****
rule in the ca-d1e3326622af00cb****
account group. The returned result indicates that the Bucket-test
resource is evaluated as NON_COMPLIANT
by using the rule. The resource is an Object Storage Service (OSS) bucket.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
config:ListAggregateConfigRuleEvaluationResults | List |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ComplianceType | string | No | The compliance evaluation result of the resource. Valid values:
| NON_COMPLIANT |
NextToken | string | No | The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of | IWBjqMYSy0is7zSMGu16**** |
MaxResults | integer | No | The maximum number of entries to return in a request. Valid values: 1 to 100. | 10 |
ConfigRuleId | string | No | The rule ID. For more information about how to query the ID of a rule, see ListAggregateConfigRules . | cr-888f626622af00ae**** |
AggregatorId | string | Yes | The ID of the account group. For more information about how to obtain the ID of an account group, see ListAggregators . | ca-b1e6626622af00cb**** |
CompliancePackId | string | No | The ID of the compliance package. For more information about how to obtain the ID of a compliance package, see ListAggregateCompliancePacks . | cp-f1e3326622af00cb**** |
Regions | string | No | The ID of the region whose resources you want to evaluate. Separate multiple region IDs with commas (,). | cn-shanghai |
ResourceTypes | string | No | The type of the resources that you want to evaluate. Separate multiple resource types with commas (,). | ACS::ECS::Instance |
ResourceGroupIds | string | No | The ID of the resource group whose resources you want to evaluate. Separate multiple resource group IDs with commas (,). | rg-aek2cqyzvuj**** |
ResourceAccountId | long | No | Member accountId to which the resource to be queried belongs. | 100931896542**** |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "A6662516-D056-4325-B6A7-CD3E89C97C39",
"EvaluationResults": {
"NextToken": "IWBjqMYSy0is7zSMGu16****",
"MaxResults": 10,
"EvaluationResultList": [
{
"RiskLevel": 1,
"ComplianceType": "NON_COMPLIANT",
"ResultRecordedTimestamp": 1624869013065,
"Annotation": "{\\\"configuration\\\":\\\"LRS\\\",\\\"desiredValue\\\":\\\"ZRS\\\",\\\"operator\\\":\\\"StringEquals\\\",\\\"property\\\":\\\"$.DataRedundancyType\\\"}",
"ConfigRuleInvokedTimestamp": 1624869012713,
"InvokingEventMessageType": "ScheduledNotification",
"EvaluationResultIdentifier": {
"OrderingTimestamp": 1624869012713,
"EvaluationResultQualifier": {
"ResourceOwnerId": 0,
"ConfigRuleArn": "acs:config::100931896542****:rule/cr-888f626622af00ae****",
"ResourceType": "ACS::OSS::Bucket",
"ConfigRuleName": "test-rule-name",
"ResourceId": "Bucket-test",
"ConfigRuleId": "cr-888f626622af00ae****",
"ResourceName": "Bucket-test",
"RegionId": "cn-hangzhou",
"CompliancePackId": "cr-7263fd26622af00bc****",
"IgnoreDate": "2022-06-01"
}
},
"RemediationEnabled": false
}
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | NoPermission | You are not authorized to perform this operation. | You are not authorized to perform this operation. |
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 | CloudConfigServiceRoleNotExisted | The CloudConfigServiceRole does not exist. | The CloudConfig service role does not exist. |
404 | AccountNotExisted | Your account does not exist. | The specified 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. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2023-04-12 | The Error code has changed. The request parameters of the API has changed | see changesets | ||||||||||||
|