1. 接口描述
本接口(CreateLocalIPTranslationAclRule)用于添加本端 IP 转换 ACL 策略。
接口请求域名:vpc.api.qcloud.com
2. 输入参数
以下请求参数列表仅列出了接口请求参数,正式调用时需要加上公共请求参数,详情请参见 公共请求参数 页面。其中,此接口的 Action 字段为 CreateLocalIPTranslationAclRule。
参数名称 | 必选 | 类型 | 描述 |
vpcId | 是 | String | |
directConnectGatewayId | 是 | String | |
originalIP | 是 | String | 原始 IP(VPC 内 IP)。 |
translationIP | 是 | String | 转换后 IP。 |
aclRules.n | 是 | Array | ACL 策略信息。 |
aclRules.n.protocol | 是 | String | 协议:TCP、UDP 或者 ALL。 |
aclRules.n.sourcePort | 是 | String | 访问的源端口,支持xx-xx范围,不填或者填0或者0-0都表示不限端口。 |
aclRules.n.destinationCidr | 是 | String | 访问的目的 IP,支持 IP、IP 段(CIDR 格式),如果不填写指所有 IP。 |
aclRules.n.destinationPort | 是 | String | 访问的目的端口,支持xx-xx范围,不填或者填0或者0-0都表示不限端口。 |
3. 输出参数
参数名称 | 类型 | 描述 |
code | Int | |
message | String | 模块错误信息描述,与接口相关。 |
4. 错误码表
5. 示例
输入
https://vpc.api.qcloud.com/v2/index.php?Action=CreateLocalIPTranslationAclRule&<公共请求参数>&vpcId=vpc-dfgg190&directConnectGatewayId=dcg-ddf14d&originalIP=10.0.0.5&translationIP=138.0.0.11&aclRules.n.protocol=tcp&aclRules.n.sourcePort=80&aclRules.n.destinationCidr=10.0.0.2/18&aclRules.n.destinationPort=90
输出
{"code":"0","message":""}