百度智能云

All Product Document

          Virtual Private Cloud

          Create NAT Gateway

          Description

          Create a NAT gateway

          • For EIP, only one EIP can be bound, and for the shared bandwidth, and multiple IP in it can be bound.

          Request Structure

          POST /v{version}/nat?clientToken={clientToken} HTTP/1.1    
          Host: bcc.bj.baidubce.com      
          Authorization: authorization string
          {
          	"name": name,
          	"vpcId": vpcId,
          	"spec":spec,
          	"eips": [eips],
          	"billing": {
          		"paymentTiming": paymentTiming,
          		"reservation": {
          			"reservationLength": reservationLength,
          			"reservationTimeUnit": reservationTimeUnit
          		}
          	}
          }

          Request Header

          There are no other special headers except the public headers.

          Request Parameter

          Parameter name Type Required or not Parameter position Description
          version String Yes URL parameter API version number (the current value is 1)
          clientToken String Yes Query parameter Idempotence Token is an ASCII string with length not exceeding 64 bytes, for details, please see ClientToken Idempotence
          name String Yes RequestBody parameter The name of NAT gateway is composed by upper and lower case letters, numbers, and -_ /. special characters, and must start with letters, with a length of 1-65.
          vpcId String Yes RequestBody parameter ID of VPC
          spec String Yes RequestBody parameter The size of NAT gateway is divided into three kinds: small (supporting binding a maximum of 5 public network IPs), medium (supporting binding a maximum of 10 public network IPs) and large (supporting binding a maximum of 15 public network IPs).
          eips List No RequestBody parameter One public network EIP associated with the NAT gateway or one or more EIPs in the shared bandwidth
          billing Billing Yes RequestBody parameter Billing information

          Return Header

          There are no other special headers except the public headers.

          Return Parameter

          Parameter name Type Description
          natId String ID of created NAT

          Request Example - Prepaid

          POST /v1/nat?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
          Host: bcc.bj.baidubce.com
          ContentType: application/json    
          Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2018-07-05T04:17:29Z/3600/  host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
          
          {
              "name":"nat1",
              "vpcId":"vpc-a4sg6vsfzbra",
              "spec":"small",
              "eips":[
                  "10.107.247.192"
              ],
              "billing":{
                  "reservation":{
                      "reservationLength":1,
                      "reservationTimeUnit":"month"
                  },
                  "paymentTiming":"Prepaid"
              }
          }     

          Request Example - Postpaid

          POST /v1/nat?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
          Host: bcc.bj.baidubce.com
          ContentType: application/json    
          Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2018-07-05T04:17:29Z/3600/    host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
          
          {
              "name":"nat1",
              "vpcId":"vpc-a4sg6vsfzbra",
              "spec":"small",
              "billing":{
                  "paymentTiming":"Postpaid"
              }
          }         

          Return Example

          HTTP/1.1 200 OK
          x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
          Date: Fri, 06 July 2018 07:06:06 GMT
          Content-Type: application/json;charset=UTF-8
          Server: BWS
          
          {
              "natId": "nat-b58rnkn1g98h"
          }
          Previous
          ACL Related Interface
          Next
          Query NAT Gateway List