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

ModifySnatEntryAttributes

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

首次发布时间2021.12.28 08:28:52

调用 ModifySnatEntryAttributes 接口,修改SNAT规则的名称、关联的公网IP。

调用说明

  • 修改SNAT规则中的公网IP,将导致原有的SNAT连接断开,需要云服务器实例重新发起请求,建立连接,请谨慎操作。
  • 以下可选参数如不配置,则保持原有配置。

调试

请求参数

参数名称
类型
是否必选
示例值
描述
ActionStringModifySnatEntryAttributes要执行的操作,取值:ModifySnatEntryAttributes。
VersionString2020-04-01API的版本信息,当前版本为:2020-04-01。
SnatEntryIdStringsnat-fgeb3efghxs****SNAT规则的ID。

SnatEntryName

String

snat-01

SNAT规则的名称。

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

EipId

String

eip-dukg5oxruwg****,eip-dukg5oxruwi****

SNAT规则关联的公网IP,多个公网IP的ID之间用英文逗号分隔。
您可以调用 DescribeEipAddresses 接口,查询公网IP的ID。

  • 传入单个IP,SNAT规则将关联该公网IP,业务连接都通过该公网IP访问公网。
  • 传入多个公网IP,SNAT规则将关联多个公网IP,业务连接通过对其五元组哈希算法后分配到的公网IP访问公网。

说明

当SNAT规则关联多个公网IP时,建议将公网IP加入共享带宽包,避免业务因其中的单个公网IP带宽达到上限而导致流量丢包。

返回数据

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

请求示例

GET /?Action=ModifySnatEntryAttributes&Version=2020-04-01&SnatEntryId=snat-2fedi096gdiww59gp680r****&EipId=eip-2feaac9wtccn459gp67qe**** HTTP/1.1
Host: open.volcengineapi.com
Service: natgateway
Region: cn-beijing

返回示例

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

错误码

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

HttpCode
错误码
错误信息
描述
400InvalidEip.InstanceMismatchThe specified elastic ip and instance mismatch.指定的公网IP和实例不匹配。
400InvalidNatGateway.InvalidStatusThe specified NAT gateway is not in the correct status for the request.指定的NAT网关所处的状态无法响应该请求。
400LimitExceeded.EipsPerSnatEntryYou've reached the limit on the number of EIPs per snat entry.已达到每条SNAT规则支持关联公网IP的数量上限。
404InvalidSnatEntry.NotFoundThe specified SNAT entry does not exist.指定的SNAT规则不存在。
404InvalidEip.NotFoundThe specified EIP does not exist.指定的公网IP不存在。
409InvalidSnatEntry.EipConflictThe specified EIP conflicts with that of another EIP in the snat entry.SNAT规则中的公网IP冲突。
412InvalidNatGateway.ExpiredThe specified NatGateway has expired.指定的NAT网关实例已到期。