创建VPN
所有文档

          私有网络 VPC

          创建VPN

          描述

          创建VPN

          请求结构

              POST /v{version}/vpn?clientToken={clientToken} HTTP/1.1
              Host: bcc.bj.baidubce.com
              Authorization: authorization string
               {
                  "vpcId": vpcId,
                  "vpnName": vpnName,
                  "description": description,
                  "eip": eip,
                  "billing": {
                      "paymentTiming": paymentTiming,
                      "reservation": {
                          "reservationLength": reservationLength,
                          "reservationTimeUnit": reservationTimeUnit
                      }
                  }
               } 

          请求头域

          除公共头域外,无其它特殊头域。

          请求参数

          参数名称 类型 是否必需 参数位置 描述
          version String URL参数 API版本号
          clientToken String Query参数 幂等性Token,是一个长度不超过64位的ASCII字符串,详见ClientToken幂等性
          vpcId String Request Body参数 所属vpc的id
          vpnName String Request Body参数 VPN的名称,大小写字母、数字以及-_/.特殊字符,必须以字母开头,长度1-65
          description String Request Body参数 VPN的描述
          eip String Request Body参数 vpn绑定的eip
          billing Billing Request Body参数 计费信息,支持预付费和后付费方式

          返回头域

          除公共头域,无其它特殊头域。

          返回参数

          参数名称 类型 描述
          vpnId String VPN的id

          请求示例

          预付费

              POST /v1/vpn?clientToken=1849ef6b-f73c-4f5d-b88b-259ca47af849 HTTP/1.1
              Host: bcc.bj.baidubce.com
              Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
              {
                  "vpcId": "vpc-IyWRtII7",
                  "vpnName": "vpnName",
                  "description": "description",
                  "eip": "",
                  "billing":{
                      "reservation":{
                          "reservationLength":1,
                          "reservationTimeUnit":"month"
                      },
                      "paymentTiming":"Prepaid"
                  }
               } 

          后付费

              POST /v1/vpn?clientToken=1849ef6b-f73c-4f5d-b88b-259ca47af849 HTTP/1.1
              Host: bcc.bj.baidubce.com
              Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
              {
                  "vpcId": "vpc-IyWRtII7",
                  "vpnName": "vpnName",
                  "description": "description",
                  "eip": "",
                  "billing":{
                      "paymentTiming":"Postpaid"
                  }
               } 

          返回示例

              HTTP/1.1 200 OK
              x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
              Date: Thu, 16 Mar 2017 06:29:48 GMT
              Content-Type: application/json;charset=UTF-8
              Server: BWS
               {
                  "vpnId": "vpn-ku4cxya6nisq"
               } 
          上一篇
          释放VPN
          下一篇
          对等连接相关接口