调用UpdateAggregateCompliancePack接口修改指定账号组内的合规包信息。
本文将提供一个示例,将账号组ca-f632626622af0079****
内合规包cp-fdc8626622af00f9****
中托管规则eip-bandwidth-limit
的参数值修改为20
。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | UpdateAggregateCompliancePack | 要执行的操作,取值:UpdateAggregateCompliancePack。 |
CompliancePackId | String | 是 | cp-fdc8626622af00f9**** | 合规包ID。 关于如何获取合规包ID,请参见ListAggregateCompliancePacks。 |
Description | String | 否 | 基于等保2.0三级标准,提供持续检测合规性的建议模板,帮助您提前自检并修复问题,以便快速通过正式检测。 | 合规包描述。 关于如何获取合规包描述,请参见ListAggregateCompliancePacks。 |
RiskLevel | Integer | 否 | 1 | 合规包的风险等级。取值:
|
ConfigRules | Array | 否 | 合规包中的规则列表。 当您修改合规包时,如果规则列表为空,则保持原有规则列表不变;如果规则列表不为空,则使用新规则替换原有规则列表中的规则。 |
|
ManagedRuleIdentifier | String | 否 | eip-bandwidth-limit | 托管规则标识。配置审计根据托管规则标识自动创建规则,并将该规则加入到当前合规包中。
|
ConfigRuleParameters | Array | 否 | 规则参数信息。 |
|
ParameterName | String | 否 | bandwidth | 规则参数名称。 参数 |
ParameterValue | String | 否 | 20 | 规则参数值。 参数 |
ConfigRuleId | String | 否 | cr-e918626622af000f**** | 规则ID。配置审计将已有规则加入到当前合规包中。
|
ConfigRuleName | String | 否 | 检测闲置弹性公网IP | 规则名称。 |
Description | String | 否 | 弹性公网已绑定到ECS或者NAT实例,非闲置状态,视为“合规”。 | 规则描述。 |
RiskLevel | Integer | 否 | 1 | 规则风险等级。取值:
|
ClientToken | String | 否 | 1594295238-f9361358-5843-4294-8d30-b5183fac**** | 保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。 |
AggregatorId | String | 是 | ca-f632626622af0079**** | 账号组ID。 关于如何获取账号组ID,请参见ListAggregators。 |
CompliancePackName | String | 否 | 等保三级预检合规包 | 合规包名称。 关于如何获取合规包名称,请参见ListAggregateCompliancePacks。 |
RegionIdsScope | String | 否 | cn-hangzhou | 合规包仅对指定地域ID中的资源生效。多个地域ID之间用半角逗号(,)分隔。 |
ExcludeResourceIdsScope | String | 否 | eip-8vbf3x310fn56ijfd**** | 合规包对指定资源ID无效,即不对该资源执行评估。多个资源ID之间用半角逗号(,)分隔。 |
ResourceGroupIdsScope | String | 否 | rg-aekzc7r7rhx**** | 合规包仅对指定资源组ID中的资源生效。多个资源组ID之间用半角逗号(,)分隔。 |
TagKeyScope | String | 否 | ECS | 合规包仅对绑定指定标签键的资源生效。 |
TagValueScope | String | 否 | test | 合规包仅对绑定指定标签键值对的资源生效。 说明 TagValueScope需结合TagKeyScope一起使用。 |
关于公共请求参数的详情,请参见公共参数。
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
CompliancePackId | String | ca-f632626622af0079**** | 合规包ID。 |
RequestId | String | 6EC7AED1-172F-42AE-9C12-295BC2ADB751 | 请求ID。 |
示例
请求示例
http(s)://[Endpoint]/?Action=UpdateAggregateCompliancePack
&CompliancePackId=cp-fdc8626622af00f9****
&ConfigRules=[{"ManagedRuleIdentifier":"eip-bandwidth-limit","ConfigRuleParameters":[{"ParameterName":"bandwidth","ParameterValue":"20"}]
&AggregatorId=ca-f632626622af0079****
&<公共请求参数>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<UpdateAggregateCompliancePackResponse>
<CompliancePackId>ca-f632626622af0079****</CompliancePackId>
<RequestId>6EC7AED1-172F-42AE-9C12-295BC2ADB751</RequestId>
</UpdateAggregateCompliancePackResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"CompliancePackId" : "ca-f632626622af0079****",
"RequestId" : "6EC7AED1-172F-42AE-9C12-295BC2ADB751"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | Invalid.AggregatorId.Value | The specified AggregatorId is invalid. | 账号组ID不存在或无权限使用该账号组。 |
400 | Invalid.CompliancePackId.Value | The specified CompliancePackId does not exist. | 合规包ID不存在。 |
400 | CompliancePackExceedMaxCount | The maximum number of compliance pack is exceeded. | 合规包不能超过5个。 |
400 | Invalid.ConfigRules.Empty | You must specify ConfigRules. | 合规包中规则不能为空。 |
400 | Invalid.ConfigRules.Value | The specified ConfigRules is invalid. | 合规包规则中参数输入错误。 |
400 | ConfigRuleExceedMaxRuleCount | The maximum number of config rules is exceeded. | 超过最大的规则创建条数。 |
400 | CompliancePackAlreadyPending | The compliance pack has a pending operation and cannot be updated. | 如果合规包状态非“正常”,不能被更新。 |
400 | CompliancePackExists | The compliance pack already exists. | 合规包名称重复。 |
403 | AggregatorMemberNoPermission | The aggregator member is not authorized to perform the operation. | 账号组内的成员账号无权限执行此操作。 |
404 | AccountNotExisted | Your account does not exist. | 您的账号不存在。 |
503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | 服务不可用。 |
访问错误中心查看更多错误码。