CreateSnatEntry
Description
Call the CreateSnatEntry interface to add SNAT entries to the SNAT list.
Request Method
POST
Request Path
/apsara/route/Vpc/CreateSnatEntry
Request Parameters Common Parameters
Name | Location | Type | Required | Sample value | Description |
---|---|---|---|---|---|
SourceVSwitchId | BODY | string | No | vsw-bp1nhx2s9ui5o**** | ID of switch requiring public network access. |
SnatEntryName | BODY | string | No | SnatEntry-1 | The name of the SNAT entry. 2 to 128 characters in length, which must start with a letter or Chinese, but cannot start with http:// or https://. |
SourceCIDR | BODY | string | No | 10.1.1.0/24 | The CIDR block of the switch or ECS instance. Switch granularity: Specify the network segment of the switch (for example, 192.168.1.0/24). When the ECS instance under the switch initiates an Internet access request, the NAT gateway will provide SNAT service (proxy Internet service) for it. If SnatIp only specifies one public network IP, the ECS instance uses the specified public network IP to access the Internet; if SnatIp specifies multiple public IP addresses, the ECS instance randomly uses the public IP address in SnatIp to access the Internet. ECS granularity: Specify the address of the ECS instance (for example, 192.168.1.0/32). When the ECS instance initiates an Internet access request, the NAT gateway will provide SNAT service (proxy Internet service) for it. If SnatIp only specifies one public network IP, the ECS instance uses the specified public network IP to access the Internet; if SnatIp specifies multiple public IP addresses, the ECS instance randomly uses the public IP address in SnatIp to access the Internet. this parameter and SourceVSwtichId parameters are mutually exclusive, can't be at the same time. If SourceVSwitchId is specified, the SourceCIDR parameter cannot be specified. If SourceCIDR parameter is specified, the SourceVSwitchId parameter cannot be specified. |
regionId | BODY | string | Yes | No sample value for this parameter. | region id |
RegionId | BODY | string | Yes | cn-qingdao-env17-d01 | the region ID of the NAT gateway. you can obtain the region by calling DescribeRegions interface ID. |
SnatIp | BODY | string | Yes | 47.XX.XX.98 | public network IP address, separated by commas. |
ClientToken | BODY | string | No | 02fb3da4-130e-11e9-8e44-001**** | Ensure request idempotence. Generate a parameter value from your client to ensure that the parameter value is unique between different requests. ClientToken only supports ASCII characters and cannot exceed 64 characters. |
version | BODY | string | No | 2016-01-01 | version of api |
SnatTableId | BODY | string | Yes | stb-bp190wu8io1vgev**** | SNAT table ID. |
Return data
Name | Type | Sample value | Description |
---|---|---|---|
RequestID | string | 1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC | Request id |
Example
Successful Response example
{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}
Failed Response example
{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}
}