查询指定合规包中规则维度合规统计。
接口说明
本文将提供一个示例,查询合规包cp-541e626622af0087****
中规则的合规结果。返回结果显示规则总数为 1 个,不合规规则数为 0 个。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
config:GetConfigRuleComplianceByPack |
get |
*CompliancePack
|
无 | 无 |
请求参数
名称 |
类型 |
必填 |
描述 |
示例值 |
CompliancePackId |
string |
是 |
合规包 ID。 关于如何获取合规包 ID,请参见 ListCompliancePacks 。 |
cp-541e626622af0087**** |
关于公共请求参数的详情,请参见公共参数。
返回参数
名称 |
类型 |
描述 |
示例值 |
object |
无 |
||
RequestId |
string |
请求 ID。 |
6EC7AED1-172F-42AE-9C12-295BC2ADB751 |
ConfigRuleComplianceResult |
object |
合规包中规则的合规结果。 |
|
CompliancePackId |
string |
合规包 ID。 |
cp-541e626622af0087**** |
InsufficientDataCount |
integer |
合规包内的规则进行评估资源时,评估结果包含“无数据”的规则总数。 |
1 |
ConfigRuleCompliances |
array<object> |
合规包中的规则及合规结果列表。 |
|
object |
无 |
||
ComplianceType |
string |
规则合规评估结果。取值:
|
COMPLIANT |
ConfigRuleName |
string |
合规包中的规则名称。 |
The bandwidth of the Elastic IP instance meets the minimum requirements. |
ConfigRuleId |
string |
合规包中的规则 ID。 |
cr-fdc8626622af00f9**** |
TotalCount |
integer |
合规包中的规则总数。 |
1 |
NonCompliantCount |
integer |
不合规规则数。 |
0 |
NotApplicableCount |
integer |
合规包内的规则进行评估资源时,评估结果包含“不适用”的规则总数。 |
1 |
IgnoredCount |
integer |
合规包内的规则进行评估资源时,评估结果包含“已忽略”的规则总数。 |
1 |
CompliantCount |
integer |
合规包内的规则进行评估资源时,评估结果全部为合规的规则总数。 |
0 |
示例
正常返回示例
JSON
格式
{
"RequestId": "6EC7AED1-172F-42AE-9C12-295BC2ADB751",
"ConfigRuleComplianceResult": {
"CompliancePackId": "cp-541e626622af0087****",
"InsufficientDataCount": 1,
"ConfigRuleCompliances": [
{
"ComplianceType": "COMPLIANT",
"ConfigRuleName": "The bandwidth of the Elastic IP instance meets the minimum requirements.",
"ConfigRuleId": "cr-fdc8626622af00f9****"
}
],
"TotalCount": 1,
"NonCompliantCount": 0,
"NotApplicableCount": 1,
"IgnoredCount": 1,
"CompliantCount": 0
}
}
错误码
HTTP status code |
错误码 |
错误信息 |
描述 |
---|---|---|---|
400 | Invalid.CompliancePackId.Value | The specified CompliancePackId does not exist. | 合规包ID不存在。 |
404 | AccountNotExisted | Your account does not exist. | |
503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | 服务不可用。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。