All Products
Search
Document Center

Cloud Config:ListConfigRuleEvaluationResults

Last Updated:Jul 02, 2024

Queries the compliance evaluation results of resources based on a rule.

Operation description

This topic provides an example on how to query the compliance evaluation result of resources based on a rule whose ID is cr-cac56457e0d900d3****. The returned result indicates that the i-hp3e4kvhzqn2s11t**** resource is evaluated as NON_COMPLIANT by using the rule. The resource is an Elastic Compute Service (ECS) instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ComplianceTypestringNo

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 resources.
  • INSUFFICIENT_DATA: No data is available.
  • IGNORED: The resource is ignored during compliance evaluation.
NON_COMPLIANT
NextTokenstringNo

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 NextToken.

IWBjqMYSy0is7zSMGu16****
MaxResultsintegerNo

The maximum number of entries to return for a single request. Valid values: 1 to 100.

10
ConfigRuleIdstringNo

The rule ID.

You can call the ListConfigRules operation to obtain the rule ID.

cr-cac56457e0d900d3****
CompliancePackIdstringNo

The ID of the compliance package.

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

cp-f1e3326622af00cb****
RegionsstringNo

The ID of the region where the resources that you want to evaluate reside. Separate multiple region IDs with commas (,).

cn-shanghai
ResourceTypesstringNo

The type of the resources that you want to evaluate. Separate multiple resource types with commas (,).

ACS::ECS::Instane
ResourceGroupIdsstringNo

The ID of the resource group to which the resources that you want to evaluate belong. Separate multiple resource group IDs with commas (,).

rg-aek2indxn3g****

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

2A4A33BD-8186-4D60-91B9-42174EED75B5
EvaluationResultsobject

The compliance evaluation results returned.

NextTokenstring

A pagination token. It can be used in the next request to retrieve a new page of results.

IWBjqMYSy0is7zSMGu16****
MaxResultsinteger

The maximum number of entries returned per page.

10
EvaluationResultListarray<object>

The details of the compliance evaluation result.

object
RiskLevelinteger

The risk level of the resources that do not comply with the rule. Valid values:

  • 1: high
  • 2: medium
  • 3: low
1
ComplianceTypestring

The compliance evaluation result of the resource. Valid values:

  • COMPLIANT: The resources are evaluated as compliant.
  • NON_COMPLIANT: The resources are evaluated as non-compliant.
  • NOT_APPLICABLE: The rule does not apply to the resources.
  • INSUFFICIENT_DATA: No data is available.
  • IGNORED: The resource is ignored during compliance evaluation.
NON_COMPLIANT
ResultRecordedTimestamplong

The timestamp when the compliance evaluation result was recorded. Unit: milliseconds.

1622802307150
Annotationstring

The annotation to the resource that is evaluated as non-compliant. The following section describe the parameters that can be returned:

  • configuration: the current resource configuration that is evaluated as non-compliant.
  • desiredValue: the expected resource configuration that is evaluated as compliant.
  • operator: the operator that compares the current configuration with the expected configuration of the resource.
  • property: the JSON path of the current configuration in the resource property struct.
  • reason: the reason why the resource is evaluated as non-compliant.
{\"configuration\":\"\",\"desiredValue\":\"\",\"operator\":\"IsNotStringEmpty\",\"property\":\"$.KeyPairName\",\"reason\":\"No property contains.\"}
ConfigRuleInvokedTimestamplong

The timestamp when the rule was triggered for the compliance evaluation. Unit: milliseconds.

1622802307081
InvokingEventMessageTypestring

The trigger type of the rule. Valid values:

  • ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
  • ScheduledNotification: The rule is periodically triggered.
ConfigurationItemChangeNotification
EvaluationResultIdentifierobject

The identifying information about the compliance evaluation result.

OrderingTimestamplong

The timestamp when the compliance evaluation was performed. Unit: milliseconds.

1622802307081
EvaluationResultQualifierobject

The information about the evaluated resource in the compliance evaluation result.

ResourceOwnerIdlong

The ID of the Alibaba Cloud account to which the resource belongs.

120886317861****
ConfigRuleArnstring

The ARN of the rule.

acs:config::120886317861****:rule/cr-cac56457e0d900d3****
ResourceTypestring

The type of the resource that is monitored by Cloud Config.

ACS::ECS::Instance
ConfigRuleNamestring

The rule name.

test-rule-name
ResourceIdstring

The resource ID.

i-hp3e4kvhzqn2s11t****
ConfigRuleIdstring

The rule ID.

cr-cac56457e0d900d3****
ResourceNamestring

The resource name.

iZuf6j91r34rnwawoox****
RegionIdstring

The ID of the region in which your resources reside.

cn-hangzhou
CompliancePackIdstring

The ID of the compliance package to which the rule belongs.

cp-bcc33457e0d900d5****
IgnoreDatestring

The date on which the system automatically re-evaluates the ignored incompliant resources.

Note If the value of this parameter is left empty, the system does not automatically re-evaluate the ignored incompliant resources. You must manually re-evaluate the ignored incompliant resources.
2022-06-01
RemediationEnabledboolean

Indicates whether the remediation template is enabled. Valid values:

  • true: The remediation template is enabled.
  • false: The remediation template is disabled.
false

Examples

Sample success responses

JSONformat

{
  "RequestId": "2A4A33BD-8186-4D60-91B9-42174EED75B5",
  "EvaluationResults": {
    "NextToken": "IWBjqMYSy0is7zSMGu16****",
    "MaxResults": 10,
    "EvaluationResultList": [
      {
        "RiskLevel": 1,
        "ComplianceType": "NON_COMPLIANT",
        "ResultRecordedTimestamp": 1622802307150,
        "Annotation": "{\\\"configuration\\\":\\\"\\\",\\\"desiredValue\\\":\\\"\\\",\\\"operator\\\":\\\"IsNotStringEmpty\\\",\\\"property\\\":\\\"$.KeyPairName\\\",\\\"reason\\\":\\\"No property contains.\\\"}",
        "ConfigRuleInvokedTimestamp": 1622802307081,
        "InvokingEventMessageType": "ConfigurationItemChangeNotification",
        "EvaluationResultIdentifier": {
          "OrderingTimestamp": 1622802307081,
          "EvaluationResultQualifier": {
            "ResourceOwnerId": 0,
            "ConfigRuleArn": "acs:config::120886317861****:rule/cr-cac56457e0d900d3****",
            "ResourceType": "ACS::ECS::Instance",
            "ConfigRuleName": "test-rule-name",
            "ResourceId": "i-hp3e4kvhzqn2s11t****",
            "ConfigRuleId": "cr-cac56457e0d900d3****",
            "ResourceName": "iZuf6j91r34rnwawoox****",
            "RegionId": "cn-hangzhou",
            "CompliancePackId": "cp-bcc33457e0d900d5****",
            "IgnoreDate": "2022-06-01"
          }
        },
        "RemediationEnabled": false
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400NoPermissionYou are not authorized to perform this operation.You are not authorized to perform this operation.
404CloudConfigServiceRoleNotExistedThe CloudConfigServiceRole does not exist.The CloudConfig service role does not exist.
404AccountNotExistedYour account does not exist.The specified account does not exist.
503ServiceUnavailableThe 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.