SNAT
Snat 对象内容
{
"Name": "luodan-online-vpc-SNAT", # 公网snat名字
"VpcId": "f7f6fb3f-bd5c-4b4d-acb6-e2355af4f1ee",# 子网所属vpcId
"Spec": "XS", # snat规格,微型:XS,标准型:S,中型:M,大型:L
超大型:XL,
"PayType":"PrePay", # snat实例 付费类型,PostPaid 后付费
PrePay: 预付费
"Period": 1, # 预付费实例的预付费时长,
单位:月,限定值:1-9,12,24
后付费PostPaid实例此字段为 1
"TerminateMethod":"PERSIST", # 预付费PrePay实例到期策略,支持PERSIST (到期转按量) ,DELETE(到期删除),后付费PostPaid实例此字段为空""
"Id": "22116cb0-7590-4693-961a-abd0480efa10", # snatId
"NetworkChargeType": "FLOW" # snat流量收费类型
FLOW,按流量计费,按量实例支持该类型
BANDWIDTH,按带宽计费,包年包月实例支持此类型
目前未开放PeakBandwidthDaily 日峰值带宽
"InternetBandwidth": 44 # Snat网关带宽,按量实例与规格最大带宽相同,包年包月实例与用户创建时选择的带宽相同
"Status: "Active" # 状态 Active正常,Unavailable,不可用欠费停服,Disabled 禁用
"Ips": "115.238.116.181,115.238.116.180", #SNAT上的对外公网ip
"CreateAt": "2017-08-11T03:46:28Z",# 创建时间,UTC时间
"UpdateAt": "2017-12-12T10:23:30Z", # 更新时间,UTC时间
"GatewayType": "internet", # 网关类型
"Azs": "cn-east-1b" # 网关生效可用区
}
1. 创建Snat CreateSnatGateway
接口方法:POST
请求示例:
https://open.cn-east-1.163yun.com/vpc?Version=2017-11-30&Action=CreateSnatGateway
-d'{
"VpcId": "a007fc18-2b71-4aa7-b50f-c1becbdf1e7a",
"Spec": "S",
"PayType": "PostPaid",
"NetworkChargeType": "FLOW",
"Name": "MyVPC-SNAT",
"Azs": [
"cn-east-1b"
]
}'
请求参数:
参数 | 是否必填 | 说明 |
---|---|---|
VpcId | 必选 | 网络id |
Spec | 必选 | snat规格,微型:XS,标准型:S,中型:M,大型:L,超大型:XL |
PayType | 必选 | 付费类型,PostPaid 后付费/PrePay: 预付费 |
Period | 可选 | 当PayType为 PrePay的时候必选,Period的可选范围为1-9,12,24 |
NetworkChargeType | 必选 | 网络资源计费类型 目前预付费实例仅支持BANDWIDTH,后付费实例仅支持FLOW |
InternetBandwidth | 可选 | snat网关带宽 目前仅预付费实例支持该带宽值配置,不能超过该规格的最大带宽,按量实例将默认该值为规格的最大带宽 |
AutoRenewPeriod | 可选 | 自动续订参数,该值目前不开放,和交互保持一致默认为0. |
TerminateMethod | 可选 | 包年包月到期策略,该值目前不开放,和交互保持一致默认为PERSIST |
OrderId | 可选 | 订单Id,如果不传的话将会代用户下单,传的话将会检验订单有效性 |
Azs | 可选 | 网关生效可用区 ,如果不传,默认所有vpc可用区都生效 |
Name | 可选 | 公网Snat名字。2-64位字母、数字、下划线或中划线组成,以字母开头 。如果不传,默认生成名字 |
响应示例:
{
"SnatGateway": {
"Id": "f114d99e-5f56-426e-bae9-34b0bdcbcef0",
"VpcId": "a007fc18-2b71-4aa7-b50f-c1becbdf1e7a",
"Spec": "S",
"PayType": "PostPaid",
"Period": 1,
"NetworkChargeType": "FLOW",
"InternetBandwidth": 100,
"Ips": "59.111.149.248,59.111.149.247",
"Name": "MyVPC-SNAT",
"Status": "Active",
"TerminateMethod": "",
"CreateAt": "2018-11-22T02:43:38Z",
"UpdateAt": "2018-11-22T02:43:38Z",
"GatewayType": "internet",
"Azs": "cn-east-1b"
},
"OrderId": "fc181122104338638169",
"RequestId": "1aac5a2b-383e-464f-853a-84bcf48da783"
}
2. 删除Snat DeleteSnatGateway
接口方法:GET
请求示例:
https://open.cn-east-1.163yun.com/vpc?Version=2017-11-30&Action=DeleteSnatGateway&Id=f114d99e-5f56-426e-bae9-34b0bdcbcef0
参数说明:
参数 | 是否必填 | 说明 |
---|---|---|
Id | 必选 | 要删除的网关的ID |
响应示例:
{
"SnatGateway": {
"Id": "f114d99e-5f56-426e-bae9-34b0bdcbcef0",
"VpcId": "a007fc18-2b71-4aa7-b50f-c1becbdf1e7a",
"Spec": "S",
"PayType": "PostPaid",
"Period": 1,
"NetworkChargeType": "FLOW",
"InternetBandwidth": 100,
"Ips": "59.111.149.248,59.111.149.247",
"Name": "MyVPC-SNAT",
"Status": "Active",
"TerminateMethod": "",
"CreateAt": "2018-11-22T02:43:38Z",
"UpdateAt": "2018-11-22T02:43:38Z",
"GatewayType": "internet",
"Azs": "cn-east-1b"
},
"RequestId": "4020660d-2f86-46ea-bec8-369a5bc577d8"
}
3. 获取单个Snat详情 GetSnatGateway
接口方法:GET
请求示例:
https://open.cn-east-1.163yun.com/vpc?Version=2017-11-30&Action=GetSnatGateway&Id=ab90f243-07dd-423f-a6bb-83e7b3391645
参数说明:
参数 | 是否必填 | 说明 |
---|---|---|
Id | 必选 | 网关的id |
响应示例:
{
"SnatGateway": {
"Id": "ab90f243-07dd-423f-a6bb-83e7b3391645",
"VpcId": "a007fc18-2b71-4aa7-b50f-c1becbdf1e7a",
"Spec": "S",
"PayType": "PostPaid",
"Period": 1,
"NetworkChargeType": "FLOW",
"InternetBandwidth": 100,
"Ips": "59.111.149.254,59.111.149.26",
"Name": "MyVPC-SNAT",
"Status": "Active",
"TerminateMethod": "",
"CreateAt": "2018-11-22T03:28:15Z",
"UpdateAt": "2018-11-22T03:28:15Z",
"GatewayType": "internet",
"Azs": "cn-east-1b"
},
"RequestId": "7c9fe963-24e1-4de4-bdd9-a90bb003f4d1"
}
4. 获取该用户当前Region的Snat列表ListSnatGateway
接口方法:GET
请求示例:
https://open.cn-east-1.163yun.com/vpc?Version=2017-11-30&Action=ListSnatGateway&Limit=5&Offset=1&VpcId=a007fc18-2b71-4aa7-b50f-c1becbdf1e7a
参数说明:
参数 | 是否必填 | 说明 |
---|---|---|
Limit | 可选 | 返回个数,不填默认20 |
Offset | 可选 | 总偏移量,不填默认0 |
VpcId | 可选 | 填写此参数时只返回此VPC的SNAT网关Id |
响应示例:
{
"SnatGateways": [],
"Count": 1,
"Offset": 1,
"RequestId": "a02588a1-f4e7-4ff4-ae03-3e0bf23e214d",
"Limit": 5
}
5. 变更snat ChangeSnatGateway
接口方法:POST
请求示例:
https://open.cn-east-1.163yun.com/vpc?Version=2017-11-30&Action=ChangeSnatGateway
-d'{
"Id": "ab90f243-07dd-423f-a6bb-83e7b3391645",
"Spec": "XS"
}'
请求参数:
参数 | 是否必填 | 说明 |
---|---|---|
Id | 必选 | snat的id |
Spec | 必选 | 变更计费类型后,SNAT网关的规格,有微型:XS,标准型:S,中型:M,大型:L,超大型:XL,若不填则默认当前规格 |
PayType | 可选 | 目前只支持包年包月PrePay,只在按量转包年包月的时候传,其余按量升配与包年包月升配的时候,不能传该参数 |
Period | 可选 | 购买周期,如果PayType为PrePay的话必传 合法取值为1-9,12,24 |
NetworkChargeType | 可选 | 网络收费类型,当前仅支持 BANDWIDTH,按量转包年包月(即PayType为PrePay时必传) |
InternetBandwidth | 可选 | 实例实际想使用的带宽,按量转包年包月(即PayType为PrePay),以及包年包月升配时必传,大小不超过该Spec的最大带宽 |
TerminateMethod | 可选 | 预付费PrePay实例到期策略,默认PERSIST (到期转按量),DELETE(到期删除) |
AutoRenewPeriod | 可选 | 自动续订时长,默认为0 |
OrderId | 可选 | 转包年包月同时变配的订单id |
请求举例:
按量实例变更规格(可以升配也可以降配)
{
"Id": "f7f6fb3f-bd5c-4b4d-acb6-e2355af4f1ee",
"Spec": "XS"
”OrderId":"fc2342343544345834095"
}
包年包月实例变更SNAT实例的规格(只能升配,即规格和使用带宽只能向上涨,选择了一个更大的规格,带宽也不能调小,可以保持当前规格,但是只调大带宽)
{
"Id":"f7f6fb3f-bd5c-4b4d-acb6-e2355af4f1ee",
"Spec": "XS"
"InternetBandwidth":30
”OrderId":"fc2342343544345834095"
}
按量实例转包年包月实例,同时变更SNAT实例的规格(可以升配也可以降配)
{
"Id": "f7f6fb3f-bd5c-4b4d-acb6-e2355af4f1ee",
"Spec": "XS" # 转包年包月后的规格,即使规格未变此参数也需要传。
"PayType":"PrePay",
"Period": 1 ,
"NetworkChargeType":"BANDWIDTH" # 当前仅支持 BANDWIDTH
"InternetBandwidth":30,
”OrderId":"fc2342343544345834095" 【可选】转包年包月同时变配的订单id
}
响应示例:
{
"SnatGateway": {
"Id": "ab90f243-07dd-423f-a6bb-83e7b3391645",
"VpcId": "a007fc18-2b71-4aa7-b50f-c1becbdf1e7a",
"Spec": "XS",
"PayType": "PostPaid",
"Period": 1,
"NetworkChargeType": "FLOW",
"InternetBandwidth": 10,
"Ips": "59.111.149.254,59.111.149.26",
"Name": "MyVPC-SNAT",
"Status": "Active",
"TerminateMethod": "",
"CreateAt": "2018-11-22T03:28:15Z",
"UpdateAt": "2018-11-22T06:42:39Z",
"GatewayType": "internet",
"Azs": "cn-east-1b"
},
"OrderId": "fc181122144239231238",
"RequestId": "e9be6132-237d-4376-884f-20f88add7fd0"
}
6. 修改单个snat SetSnatGateway
接口方法:POST
请求示例:
https://open.cn-east-1.163yun.com/vpc?Version=2017-11-30&Action=SetSnatGateway
-d'{
"Id": "a007fc18-2b71-4aa7-b50f-c1becbdf1e7a",
"Name": "test-name"
}'
请求参数:
参数 | 是否必填 | 说明 |
---|---|---|
Id | 必选 | 网关的id |
Name | 可选 | 网关名称。2-64位字母、数字、下划线或中划线组成,以字母开头 。如果不传,则不修改名称 |
响应示例:
{
"SnatGateway": {
"Id": "a007fc18-2b71-4aa7-b50f-c1becbdf1e7a",
"VpcId": "a007fc18-2b71-4aa7-b50f-c1becbdf1e7a",
"Spec": "S",
"PayType": "PostPaid",
"Period": 1,
"NetworkChargeType": "FLOW",
"InternetBandwidth": 100,
"Ips": "59.111.149.254,59.111.149.26",
"Name": "test-name",
"Status": "Active",
"TerminateMethod": "",
"CreateAt": "2018-11-22T03:28:15Z",
"UpdateAt": "2018-11-22T03:28:15Z",
"GatewayType": "internet",
"Azs": "cn-east-1b"
},
"RequestId": "7c9fe963-24e1-4de4-bdd9-a90bb003f4d1"
}