虚拟专用网络 VPN-示例二:创建对端网关:操作步骤

时间:2024-04-19 17:53:23

操作步骤

  1. 创建对端网关。
    1. 发送“POST https://{endpoint}/v5/{project_id}/customer-gateways”,project_id为项目ID。
    2. 在Request Header中增加“X-Auth-Token”。
    3. 在Request Body中传入参数如下。
      {
          "customer_gateway": {
              "name": "cgw-3ebf",
              "id_type": "ip",
              "id_value": "10.***.***.21"
          }
      }
    4. 查看请求响应结果。
      • 请求成功时,响应参数如下,id就是对端网关的ID。
         1
         2
         3
         4
         5
         6
         7
         8
         9
        10
        11
        {
            "customer_gateway": {
                "id": "03c0aa3d-demo-a8df-va86-9d82473765d4",
                "name": "cgw-3ebf",
                "id_type": "ip",
                "id_value": "10.***.***.21",
                "created_at": "2021-12-21T16:49:28.108+08:00",
                "updated_at": "2021-12-21T16:49:28.108+08:00"
            },
            "request_id": "e55783ba-5cc8-40c1-ad81-12cce6f773d2"
        }
        
  2. 查询对端网关详情。
    1. 发送“GET https://{endpoint}/v5/{project_id}/customer-gateways/{customer_gateway_id}”,project_id为项目ID。
    2. 在Request Header中增加“X-Auth-Token”。
    3. 查看请求响应结果。
      • 请求成功时,响应参数如下,id就是对端网关的ID。
         1
         2
         3
         4
         5
         6
         7
         8
         9
        10
        11
        {
            "customer_gateway": {
                "id": "03c0aa3d-demo-a8df-va86-9d82473765d4",
                "name": "cgw-3ebf",
                "id_type": "ip",
                "id_value": "10.***.***.21",
                "created_at": "2021-12-21T16:49:28.108+08:00",
                "updated_at": "2021-12-21T16:49:28.108+08:00"
            },
            "request_id": "8cf476c4-c3d4-4516-bfbc-01e2473e549b"
        }
        
support.huaweicloud.com/api-vpn/vpn_api_0041.html