All Products
Search
Document Center

Cloud Config:DescribeCompliance

Last Updated:Jul 02, 2025

Queries the statistics of compliance evaluation results.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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.
OperationAccess levelResource typeCondition keyAssociated operation
config:DescribeComplianceget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ResourceTypestringNo

The type of the resource.

If you query compliance evaluation results by resource, you must specify the ResourceType and ResourceId parameters.

ACS::ECS::Instance
ResourceIdstringNo

The ID of the resource.

If you query compliance evaluation results by resource, you must specify the ResourceType and ResourceId parameters.

i-bp151g9tpto890zr****
ComplianceTypestringNo

The compliance evaluation result of the resource. Valid values:

  • COMPLIANT: The resource is evaluated to be compliant.
  • NON_COMPLIANT: The resource is evaluated to be non-compliant.
  • NOT_APPLICABLE: The rule does not apply to the resource.
  • INSUFFICIENT_DATA: The resource data is insufficient.
COMPLIANT
ConfigRuleIdstringNo

The ID of the rule.

If you query compliance evaluation results by resource, you must specify the ConfigRuleId, ResourceType, and ResourceId parameters. Otherwise, the ConfigRuleId parameter becomes invalid.

cr-12b398b633820012****
MultiAccountbooleanNo

This parameter is scheduled to be removed before 00:00:00, June 30, 2021. Account group-related APIs will be provided as an alternative before 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related APIs after 00:00:00, May 30, 2021. For more information, see Account groups.

false
MemberIdlongNo

This parameter is scheduled to be removed before 00:00:00, June 30, 2021. Account group-related APIs will be provided as an alternative before 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related APIs after 00:00:00, May 30, 2021. For more information, see Account groups.

1234567

Response parameters

ParameterTypeDescriptionExample
object
ComplianceResultobject

The statistics of compliance evaluations.

Compliancesarray<object>

The compliance evaluation results based on compliance types.

Compliancesobject
ComplianceTypestring

The compliance evaluation result of the resource. Valid values:

  • COMPLIANT: The resource is evaluated to be compliant.
  • NON_COMPLIANT: The resource is evaluated to be non-compliant.
  • NOT_APPLICABLE: The rule does not apply to the resource.
  • INSUFFICIENT_DATA: The resource data is insufficient.
COMPLIANT
Countinteger

The number of compliance evaluations with the corresponding result.

  • This parameter returns the total number of evaluated resources if you set the ResourceId parameter in the request.
  • This parameter returns the total number of triggered rules if you set the ConfigRuleId parameter in the request.
13
TotalCountlong

The total number of compliance evaluations.

  • This parameter returns the total number of evaluated resources if you set the ResourceId parameter in the request.
  • This parameter returns the total number of triggered rules if you set the ConfigRuleId parameter in the request.
13
RequestIdstring

The ID of the request.

17306AB1-34E0-468F-BD7B-68D8AEAB754F

Examples

Sample success responses

JSONformat

{
  "ComplianceResult": {
    "Compliances": [
      {
        "ComplianceType": "COMPLIANT",
        "Count": 13
      }
    ],
    "TotalCount": 13
  },
  "RequestId": "17306AB1-34E0-468F-BD7B-68D8AEAB754F"
}

Error codes

HTTP status codeError codeError messageDescription
404AccountNotExistedYour 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.