调用ModifySnatEntry接口修改指定的SNAT条目。
接口说明
ModifySnatEntry 接口属于异步接口,即系统会先返回一个请求 ID,但 SNAT 条目并未修改完成,系统后台的修改任务仍在进行。您可以调用 DescribeSnatTableEntries 查询 SNAT 条目的状态:
-
当 SNAT 条目处于 Pending 状态时,表示 SNAT 条目正在修改中,在该状态下,您只能执行查询操作,不能执行其他操作。
-
当 SNAT 条目处于 Available 状态时,表示 SNAT 条目修改完成。
如果 SNAT 表中有 SNAT 条目的状态为 Pending 时,无法修改该 SNAT 表中的 SNAT 条目。
ModifySnatEntry 接口在同一个 SNAT 条目实例下不支持并发修改指定的 SNAT 条目。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
vpc:ModifySnatEntry |
update |
*SnatTable
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RegionId |
string |
是 |
NAT 网关所在的地域 ID。 您可以通过调用 DescribeRegions 接口获取地域 ID。 |
cn-hangzhou |
| SnatTableId |
string |
是 |
SNAT 条目所在的 SNAT 表的 ID。 |
stb-8vbczigrhop8x5u3t**** |
| SnatEntryId |
string |
是 |
要修改的 SNAT 条目的 ID。 |
snat-bp1vcgcf8tm0plqcg**** |
| SnatIp |
string |
否 |
说明
指定多个 EIP 配置 SNAT IP 地址池时,业务连接会通过哈希算法分配到多个 EIP,由于每个连接的流量不同,可能会出现多 EIP 业务流量不均匀的情况,建议您将每个 EIP 都加入到同一个共享带宽中以避免单 EIP 带宽达到上限导致业务受损。
|
47.98.XX.XX |
| SnatEntryName |
string |
否 |
SNAT 条目的名称。 长度为 2~128 个字符,必须以字母或中文开头,但不能以 |
SnatEntry-1 |
| ClientToken |
string |
否 |
客户端 Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。 说明
若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 可能不一样。 |
02fb3da4-130e-11e9-8e44-001**** |
| EipAffinity |
integer |
否 |
是否打开 IP 亲和性。取值:
说明
打开 IP 亲和性开关后,如果 SNAT 条目绑定多个 EIP 或 NAT IP,同一个客户端将使用相同的 EIP 或 NAT IP 进行访问,否则客户端将从绑定的 EIP 或 NAT IP 中随机选取进行访问。 |
1 |
| NetworkInterfaceId |
string |
否 |
弹性网卡 ID。 说明
会将弹性网卡的 IPv4 地址集作为 SNAT 地址。 |
eni-gw8g131ef2dnbu3k**** |
| DryRun |
boolean |
否 |
是否只预检此次请求,取值:
|
false |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回的响应体。 |
||
| RequestId |
string |
请求 ID。 |
2315DEB7-5E92-423A-91F7-4C1EC9AD**** |
示例
正常返回示例
JSON格式
{
"RequestId": "2315DEB7-5E92-423A-91F7-4C1EC9AD****"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidSnatIp.Malformed | The specified SnatIp is not a valid IP address. | |
| 400 | Forbidden.SourceVSwitchId.Duplicated | The specified SourceCIDRis duplicated. | |
| 400 | Forbidden.IpUsedInForwardTable | The specified SnatIp already used in forward table | |
| 400 | OperationUnsupported.EipForSnatPool | The Eip cannot support snat pool | |
| 400 | InvalidParameter.Name.Malformed | The specified Name is not valid. | |
| 400 | IncorretSnatEntryStatus | The Specified SnatEntry is not stable status, can not operation | |
| 400 | EIP_NOT_IN_GATEWAY | The Eip not in nat gateway | |
| 400 | InvalidParameter.SnatIp | Error public ip must in same bandwidth package. | |
| 400 | QuotaExceeded.SnatIp | Public ip number exceeds quota. | |
| 400 | InvalidSnatEntryId.NotFound | Specified SNAT entry does not exist. | |
| 400 | IncorrectStatus.SnatEntry | The Specified SnatEntry is not stable status, can not operation | The specified SNAT entries are not in a stable state and cannot be operated. |
| 400 | OperationFailed.CanNotUseEipInDnat | Operation failed because the eip can not used by forward entry. | |
| 400 | OperationUnsupported.EipNatGWCheck | Operation unsupported because the relation check of eip and nat gateway is failed. | |
| 400 | ResourceNotFound.SnatEntry | Specified SNAT entry does not exist. | |
| 400 | IncorrectStatus.NatIp | Specified NatIp does not exist. | |
| 400 | OperationFailed.CanNotUseNatIpInDnat | Operation failed because the NatIp can not used by forward entry. | |
| 400 | IncorrectStatus.NATGW | NATGW status is invalid. | NAT网关的状态不正确。 |
| 400 | OperationUnsupported.EipInBinding | Create snat entry with eip in associating status is unsupported. | 创建snat不可以使用绑定中的eip |
| 400 | OperationUnsupported.EipNatBWPCheck | The EIP is not associated with a NAT service plan. | 当前EIP不属于NAT带宽包。 |
| 400 | IllegalParam.NetworkInterfaceId | The param of NetworkInterfaceId is illegal. | NetworkInterfaceId参数不合法。 |
| 400 | OperationFailed.SnatIpPoolBwpRules | The operation failed because the IP in Snat entryl was added to multiple NAT bandwidth packets. | 操作失败, 因为Snat规则IP地址池中的IP被添加到多个NAT带宽包. |
| 400 | OperationFailed.SnatIpPoolCbwpRules | The operation failed because the SNAT rule IPs are added to multi bandwidth packages. | 操作失败, 因为SNAT规则IP地址池被添加到多个带宽包. |
| 400 | OperationFailed.SnatIpsTooMany | The maximum number of IP addresses is exceeded in the SNAT pool. | snat pool中的ip过多. |
| 400 | OperationFailed.SnatIpsCheck | The operation fails because some IPs address in the SNAT entry are not added to common bandwidth packet. | 操作失败, 因为Snat规则IP地址池中存在IP地址未添加共享带宽包. |
| 404 | InvalidRegionId.NotFound | The specified RegionId does not exist in our records. | |
| 404 | InvalidSnatTableId.NotFound | Specified SNAT table does not exist. | |
| 404 | InvalidSnatEntryId.NotFound | Specified SNAT entry does not exist. | |
| 404 | InvalidSnatIp.NotFound | Specified SnatIp does not found on the NAT Gateway | |
| 404 | ResourceNotFound.NatIp | Specified NatIp does not found on the NAT Gateway |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。