CreateSnatEntry_专有网络_API文档

插件下载了解更多
VS Code 插件
安装插件之前,确保已安装 VS Code安装插件之前,确保已安装 VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains 插件
安装插件之前,确保已安装 JetBrains IDE安装插件之前,确保已安装 JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

接口说明

本接口可以为增强型公网 NAT 网关和 VPC NAT 网关添加 SNAT 条目,文中出现的 NAT 网关不做具体的区分。

调用本接口添加 SNAT 条目时,请了解以下内容:

  • CreateSnatEntry 接口属于异步接口,即系统会先返回一个 SNAT 条目 ID,但该 SNAT 条目并未添加完成,系统后台的添加任务仍在进行。您可以调用 DescribeSnatTableEntries 查询 SNAT 条目的状态:

    • 当 SNAT 条目处于 Pending 状态时,表示 SNAT 条目正在添加中,在该状态下,您只能执行查询操作,不能执行其他操作。

    • 当 SNAT 条目处于 Available 状态时,表示 SNAT 条目添加完成。

  • SNAT 条目中指定的交换机和 ECS 实例必须在 NAT 网关所属的 VPC 内。

  • 每个交换机和 ECS 实例只能属于一个 SNAT 条目。

  • 如果交换机中存在高可用虚拟 IP 实例,则无法添加 SNAT 条目。

流控信息

当前云产品API请求速率暂未透出。

授权信息

当前云产品暂无权限信息透出。

请求参数

字段名称字段详情
RegionIdstring

NAT 网关所在的地域 ID。 展开详情

示例值:cn-hangzhou枚举值:ap-northeast-2-pop参考取值来源:
    DescribeRegions
SnatTableIdstring

SNAT 表的 ID。

示例值:stb-bp190wu8io1vgev****参考取值来源:
    DescribeSnatTableEntries
SourceVSwitchIdstring

交换机的 ID。展开详情

示例值:vsw-bp1nhx2s9ui5o****
SourceCIDRstring

输入 VPC、交换机或 ECS 实例的网段,还可以输入任意网段。展开详情

示例值:10.1.1.0/24
SnatIpstring

为公网 NAT 网关添加 SNAT 条目时 :展开详情

示例值:47.98.XX.XX
SnatEntryNamestring

SNAT 条目的名称。展开详情

示例值:SnatEntry-1参考取值来源:
    DescribeSnatTableEntries
ClientTokenstring

客户端 Token,用于保证请求的幂等性。展开详情

示例值:02fb3da4-130e-11e9-8e44****
EipAffinityinteger<int32>

是否打开 IP 亲和性。取值:展开详情

示例值:1
NetworkInterfaceIdstring

弹性网卡 ID。展开详情

示例值:eni-gw8g131ef2dnbu3k****参考取值来源:
    DescribeNatGatewayAssociateNetworkInterfaces
DryRunboolean

是否只预检此次请求,取值:展开详情

示例值:false

返回参数

字段名称字段详情
SnatEntryIdstring

SNAT 条目 ID。

示例值:snat-kmd6nv8fy****
RequestIdstring

请求 ID。

示例值:2315DEB7-5E92-423A-91F7-4C1EC9AD****

返回示例

错误码

全局错误码
HTTP 状态码错误码错误信息操作
400
UnsupportedFeature.PrivateLinkEnabled
The feature of PrivateLinkEnabled is not supported.诊断
400
InvalidSourceCIDR.Malformed
SourceCIDR is illegal.诊断
400
NOT_ALLOW_USE_SOURCECIDR_OUTSIDEVPC
The User not in sourcecidr_unlimited_outsidevpc white list. Cannot use SourceCidr outside VpcCidr.诊断
400
NOT_ALLOW_USE_SOURCECIDR_AUTODEFINE
The User not in sourcecidr_unlimited_insidevpc white list. Cannot use SourceCidr auto defined.诊断
400
NOT_ALLOW_USE_SOURCECIDR_CONTAINSZERO
The User not in sourcecidr_unlimited_outsidevpc_containszero white list. Cannot use SourceCidr outside VpcCidr.诊断
400
Forbidden.IpHasBeenUsedInDnat
The snat ip can't be used. Because it has been used in dnat诊断
400
Forbidden.SourceVSwitchId.IncludeHaVip
There is some HaVips under specified VSwitch诊断
400
InvalidSnatIp.Malformed
The specified SnatIp is not a valid IP address.诊断
400
SNAT_IP_POOL_COUNT_TOO_MANY
The Snat pool ip too many.诊断
400
Forbidden.SnatEntryCountLimited
SNAT entry in the specified SNAT table reach its limit.诊断
400
NOT_ALLOW_USE_SOURCECIDR
The User not in nat_scope_unlimited white list. Cannot use SourceCidr param.诊断
400
INVALID_PARAMETER
The parameter invalid.诊断
400
Forbidden.SourceVSwitchId.Duplicated
The specified SourceCIDRis duplicated.诊断
400
Forbidden.IpUsedInForwardTable
The specified SnatIp already used in forward table诊断
400
Forbindden
The specified Instance already bind eip诊断
400
EIP_NOT_SUPPORT_SNAT_POOL
The Eip cannot support snat pool诊断
400
EIP_NOT_IN_GATEWAY
The Eip not in nat gateway诊断
400
OperationUnsupported.CidrConflict
The specified CIDR block conflicts with an existing SNAT entry.诊断
400
OperationUnsupported.EipNatIpCheck
%s诊断
400
OperationUnsupported.EipNatBWPCheck
%s诊断
400
OperationUnsupported.EipNatGWCheck
%s诊断
400
OperationFailed.SnatIpPoolBwpRules
%s诊断
400
OperationFailed.SnatIpsCheck
%s诊断
400
OperationFailed.SnatIpPoolCbwpRules
%s诊断
400
CreateSnatEntry.ParamExclusive.sourceVSwitchIdAndsourceCIDR
%s诊断
400
InvalidNatGatewayId.NotFound
The NatGateway instance not exist.诊断
400
InvalidParameter.Name.Malformed
The specified Name is not valid.诊断
400
InvalidParameter.SnatIp
Ip semgment must be subnet cidr.诊断
400
IncorrectStatus.SnatEntry
%s诊断
400
QuotaExceeded.SnatIp
Public ip number exceeds quota.诊断
400
OperationUnsupported.EipInBinding
Create snat entry with eip in associating status is unsupported.诊断
400
OperationFailed.VSwitchNotInVpc
The specified vswitch and natgateway are not in the same vpc.诊断
400
QuotaExceeded.SnatEntry
SNAT entry in the specified SNAT table reach it?s limit.诊断
400
IncorrectStatus.NatIp
%s诊断
400
IncorrectStatus.NATGW
NATGW status is invalid.诊断
400
IncorrectStatus.VSwitch
The specified vSwitch status is invalid.诊断
400
MissingParam.SnatIp
The input parameter SnatIp that is mandatory for processing this request is not supplied.诊断
400
MissingParam.NetworkInterfaceId
The input parameter NetworkInterfaceId that is mandatory for processing this request is not supplied.诊断
400
ParamExclusive.SnatIpAndNetworkInterfaceId
SnatIp and NetworkInterfaceId is mutually exclusive when create a snat entry for nat.诊断
400
IllegalParam.NetworkInterfaceId
The param of NetworkInterfaceId is illegal.诊断
404
InvalidRegionId.NotFound
The specified RegionId does not exist in our records.诊断
404
InvalidSnatTableId.NotFound
Specified SNAT table does not exist.诊断
404
InvalidVSwitchId.NotFound
The specified virtual switch does not exists.诊断
404
InvalidSnatIp.NotFound
Specified SnatIp does not found on the NAT Gateway诊断
404
ResourceNotFound.NatGateway
The NatGateway instance not exist.诊断
404
ResourceNotFound.NatIp
The NatIp instance not exist.诊断
404
ResourceNotFound.VSwitch
The specified resource of %s is not found.诊断
500
DefaultValidate.Error
validte fail.诊断
500
OperationFailed.CrateSnatEntryTimeOut
Operation failed because create snatEntry timeout.诊断

变更历史

变更时间变更内容概要操作
2024-12-03
新增请求参数DryRun
2024-08-09
变更错误码400
变更请求参数SnatIp
新增请求参数NetworkInterfaceId
2024-01-18
变更错误码404
2023-09-18
变更错误码400
删除返回参数
2023-03-01
新增返回参数
2022-11-07
变更错误码400
2022-07-22
新增请求参数EipAffinity

相关示例

创建NAT网关并配置SNAT规则
2021-11-30