You need to enable JavaScript to run this app.
导航

ModifyDnatEntryAttributes

最近更新时间2024.04.18 19:19:47

首次发布时间2022.11.03 08:29:57

调用 ModifyDnatEntryAttributes 接口,修改DNAT规则。

调用说明

以下可选参数如不配置,则保持不变。

调试

请求参数

参数名称
类型
是否必选
示例值
描述
ActionStringModifyDnatEntryAttributes要执行的操作,取值:ModifyDnatEntryAttributes。
VersionString2020-04-01API的版本信息,当前版本为:2020-04-01。
DnatEntryIdStringdnat-342abc3bc3****DNAT规则的ID。

DnatEntryName

String

dnat-01

DNAT规则的名称。

  • 长度限制为1 ~ 128个字符。
  • 需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短划线(-)。
  • 不填默认是DNAT规则的ID。

Protocol

String

tcp

协议类型。

  • tcp:转发TCP协议的报文。
  • udp:转发UDP协议的报文。
InternalIpString192.XX.XX.88向公网提供服务的云服务器实例的私网IP。

InternalPort

String

12

云服务器实例向公网提供服务的端口或端口段。

  • 端口范围为1~65535。
  • 若传入端口段,则起止端口之间用短横线(-)分隔,例如20-25。

ExternalIp

String

12.XX.XX.34

NAT网关已绑定的公网IP。
您可以调用 DescribeEipAddresses 接口,查询公网IP的地址。

ExternalPort

String

34

接收来自公网的请求的端口或端口段。

  • 端口范围为1~65535。
  • InternalPort传入端口段,则ExternalPort也必须传入端口段,且二者的端口数量相同,起止端口之间用短横线(-)分隔,例如私网IP端口传入20-25,公网IP端口传入30-35。

返回数据

参数名称
类型
示例值
描述
RequestIdString2021062415303301022514515207C4****请求ID。

请求示例

GET /?Action=ModifyDnatEntryAttributes&Version=2020-04-01&DnatEntryId=dnat-342abc3bc3****&InternalIp=192.XX.XX.88 HTTP/1.1
Host: open.volcengineapi.com
ServiceName: natgateway
Region: cn-beijing

返回示例

{
    "ResponseMetadata": {
        "RequestId": "2021062415303301022514515207C4****",
        "Action": "ModifyDnatEntryAttributes",
        "Version": "2020-04-01",
        "Service": "natgateway",
        "Region": "cn-beijing"
    },
    "Result":{
        "RequestId": "2021062415303301022514515207C4****"
    }
}

错误码

公共错误码,请参见 公共错误码 。

HttpCode
错误码
错误信息
描述
400InvalidEip.InstanceIdMismatchThe specified elastic ip and instance mismatch.指定的公网IP和实例不匹配。
400InvalidEip.InvalidStatusThe specified elastic ip is not in the correct status for the request. The specified elastic ip is in freeze.指定的弹性公网IP或私有网络所处的状态无法响应该请求。当前弹性公网IP被冻结。
400InvalidIPAddress.MalformedThe specified IP address is malformed.指定的IP不合法。
400InvalidName.MalformedThe specified name is malformed. Ensure the maximum length of name is 128.指定的名称格式不合法。名称长度不能超过128个字符。
400InvalidName.MalformedThe specified name is malformed.指定的名称格式不合法。请修复名称格式后重试。
400InvalidNatGateway.InvalidStatusThe specified NAT gateway is not in the correct status for the request.指定的NAT网关所处的状态无法响应该请求。
400InvalidPort.MalformedThe specified port is malformed. Ensure that you've specified the port in right form and internal port and external port must have the same number of ports.指定的端口不合法。请确保指定的端口格式正确,且私网端口和公网端口数量必须一致。
400InvalidProtocol.MalformedThe specified protocol is malformed.指定的协议不合法。
404InvalidDnatEntry.NotFoundThe specified DNAT entry does not exist.指定的DNAT规则不存在。
404InvalidEip.NotFoundThe specified EIP does not exist.指定的EIP不存在。
404InvalidNatGateway.NotFoundThe specified NAT gateway does not exist.指定的NAT网关不存在。
409InvalidDnatEntry.ConflictThe specified DNAT entry conflicts with that of another DNAT entry in your NAT gateway.指定的DNAT规则与所属NAT网关下另一条规则冲突。
412InvalidNatGateway.ExpiredThe specified NAT gateway has expired.指定的NAT网关已到期。