云服务器内容精选

  • 响应示例 返回状态码为200:创建成功,响应体参考NatResponse。 HTTP/1.1 200 OK Date: Sun,11 May 2025 10:00:00 GMT Server: example-server Content-Type: application/json;charset=UTF-8 Content-Length: 250 Connection: keep-alive { "errcode" : "0", "errmsg" : "", "success" : [ { "vpnId" : "00000000-0000-0000-0000-000000000000", "siteId" : "00000000-0000-0000-0000-000000000000", "deviceId" : "00000000-0000-0000-0000-000000000000", "policyId" : "00000000-0000-0000-0000-000000000000", "policyName" : "test name", "globalStartAddress" : "192.168.1.1", "globalEndAddress" : "192.168.1.2", "insideStartAddress" : "192.168.1.1", "insideEndAddress" : "192.168.1.2", "globalSourcePort" : "1", "globalEndPort" : "2", "insideSourcePort" : "1", "insideEndPort" : "2", "protocol" : "6", "reverse" : true, "interfaceId" : "00000000-0000-0000-0000-000000000000", "interfaceName" : "GE0/0/0" } ], "fail" : [ { "errcode" : "0x00c8000c", "errmsg" : "The parameter is invalid.", "errparam" : "["policyName"]", "data" : { "vpnId" : "00000000-0000-0000-0000-000000000000", "siteId" : "00000000-0000-0000-0000-000000000000", "deviceId" : "00000000-0000-0000-0000-000000000000", "policyId" : "00000000-0000-0000-0000-000000000000", "policyName" : "test name", "globalStartAddress" : "192.168.1.1", "globalEndAddress" : "192.168.1.2", "insideStartAddress" : "192.168.1.1", "insideEndAddress" : "192.168.1.2", "globalSourcePort" : "1", "globalEndPort" : "2", "insideSourcePort" : "1", "insideEndPort" : "2", "protocol" : "6", "reverse" : true, "interfaceId" : "00000000-0000-0000-0000-000000000000", "interfaceName" : "GE0/0/0" } } ] }
  • 请求参数 表1 body参数列表 参数名称 必选 类型 参数值域 默认值 参数说明 参数示例 body 是 REFERENCE 详细请参见表2。 NAT Server策略信息。 - 表2 NatServerInfos对象的参数列表 参数名称 必选 类型 参数值域 默认值 参数说明 参数示例 natServerInfos 否 ARRAY_REFERENCE 0-64个列表项,详细请参见表3。 NAT Server的详细信息。 - 表3 NatServerInfo对象的参数列表 参数名称 必选 类型 参数值域 默认值 参数说明 参数示例 vpnId 否 string 0~36个字符。 - VPN业务ID,创建时必填。 Overlay,填写WAN虚拟网络ID; Underlay,填写“UnderlayId”。 "00000000-0000-0000-0000-000000000000" siteId 否 string 0~64个字符。 - 站点ID,创建时必填。 "00000000-0000-0000-0000-000000000000" deviceId 否 string 0~64个字符。 - 设备ID,创建时必填。 "00000000-0000-0000-0000-000000000000" policyId 否 string 0~64个字符。 - 策略ID,创建时不需要填写,修改时必填。 "00000000-0000-0000-0000-000000000000" policyName 否 string 0~64个字符。 - 策略名称,创建时必填。 "test name" globalStartAddress 否 string 0~20个字符。 - 服务器映射的公网起始地址,修改场景需要指定。 "192.168.1.1" globalEndAddress 否 string 0~20个字符。 - 服务器映射的公网结束地址,修改场景需要指定。 "192.168.1.2" insideStartAddress 否 string 0~20个字符。 - 服务器映射的私网起始地址,修改场景需要指定。 "192.168.1.1" insideEndAddress 否 string 0~20个字符。 - 服务器映射的私网结束地址,修改场景需要指定。 "192.168.1.2" globalSourcePort 否 int32 [0-65535] - 公网起始端口,修改场景需要指定。 "1" globalEndPort 否 int32 [0-65535] - 公网结束端口,修改场景需要指定。 "2" insideSourcePort 否 int32 [0-65535] - 私网起始端口,修改场景需要指定。 "1" insideEndPort 否 int32 [0-65535] - 私网结束端口,修改场景需要指定。 "2" protocol 否 string 满足正则表达1|6|17|41|47|50|51|132。 - 报文协议类型,包括1(ICMP)、6(TCP)、17(UDP)、41(IPv6)、47(GRE)、50(ESP)、51(AH)、132(SCTP)。 "6" reverse 否 boolean true false true 创建反向server-map。默认值为true。 true interfaceId 否 string 0~64个字符。 - 接口id,Overlay 目的NAT SASE场景不支持配置接口ID。 "00000000-0000-0000-0000-000000000000" interfaceName 否 string 0~64个字符。 - 接口名称,Overlay 目的NAT SASE场景不支持配置接口名称。 "GE0/0/0"
  • 请求示例 HTTP的示例 POST /controller/campus/v1/sdwan/policy/traffic/nat/natserver HTTP/1.1 Host: 192.168.1.125:18002 Content-Type: application/json Accept: application/json Accept-Language: en-US X-AC CES S-TOKEN: x-yyyyyy { "natServerInfos" : [ { "vpnId" : "00000000-0000-0000-0000-000000000000", "siteId" : "00000000-0000-0000-0000-000000000000", "deviceId" : "00000000-0000-0000-0000-000000000000", "policyId" : "00000000-0000-0000-0000-000000000000", "policyName" : "test name", "globalStartAddress" : "192.168.1.1", "globalEndAddress" : "192.168.1.2", "insideStartAddress" : "192.168.1.1", "insideEndAddress" : "192.168.1.2", "globalSourcePort" : "1", "globalEndPort" : "2", "insideSourcePort" : "1", "insideEndPort" : "2", "protocol" : "6", "reverse" : true, "interfaceId" : "00000000-0000-0000-0000-000000000000", "interfaceName" : "GE0/0/0" } ] }
  • 响应示例 返回状态码为200:删除成功,响应体参考NatServerResponse。 HTTP/1.1 200 OK Date: Sun,11 May 2025 10:00:00 GMT Server: example-server Content-Type: application/json;charset=UTF-8 Content-Length: 250 Connection: keep-alive { "errcode" : "0", "errmsg" : "", "success" : [ { "vpnId" : "00000000-0000-0000-0000-000000000000", "siteId" : "00000000-0000-0000-0000-000000000000", "deviceId" : "00000000-0000-0000-0000-000000000000", "policyId" : "00000000-0000-0000-0000-000000000000", "policyName" : "test name", "globalStartAddress" : "192.168.1.1", "globalEndAddress" : "192.168.1.2", "insideStartAddress" : "192.168.1.1", "insideEndAddress" : "192.168.1.2", "globalSourcePort" : "1", "globalEndPort" : "2", "insideSourcePort" : "1", "insideEndPort" : "2", "protocol" : "6", "reverse" : true, "interfaceId" : "00000000-0000-0000-0000-000000000000", "interfaceName" : "GE0/0/0" } ], "fail" : [ { "errcode" : "0x00c8000c", "errmsg" : "The parameter is invalid.", "errparam" : "["policyName"]", "data" : { "vpnId" : "00000000-0000-0000-0000-000000000000", "siteId" : "00000000-0000-0000-0000-000000000000", "deviceId" : "00000000-0000-0000-0000-000000000000", "policyId" : "00000000-0000-0000-0000-000000000000", "policyName" : "test name", "globalStartAddress" : "192.168.1.1", "globalEndAddress" : "192.168.1.2", "insideStartAddress" : "192.168.1.1", "insideEndAddress" : "192.168.1.2", "globalSourcePort" : "1", "globalEndPort" : "2", "insideSourcePort" : "1", "insideEndPort" : "2", "protocol" : "6", "reverse" : true, "interfaceId" : "00000000-0000-0000-0000-000000000000", "interfaceName" : "GE0/0/0" } } ] } 返回状态码为400:请求参数错误,无响应体。 HTTP/1.1 400 Bad Request Date: Sun,11 May 2025 10:00:00 GMT Server: example-server Content-Type: application/json;charset=UTF-8 Content-Length: 250 Connection: keep-alive 返回状态码为500:内部错误,无响应体。 HTTP/1.1 500 Internal Server Error Date: Sun,11 May 2025 10:00:00 GMT Server: example-server Content-Type: application/json;charset=UTF-8 Content-Length: 250 Connection: keep-alive
  • 请求示例 HTTP的示例 POST /controller/campus/v1/sdwan/policy/traffic/nat/natserver/batch-delete HTTP/1.1 Host: 192.168.1.125:18002 Content-Type: application/json Accept: application/json Accept-Language: en-US X-ACCESS-TOKEN: x-yyyyyy { "vpnId" : "00000000-0000-0000-0000-000000000000", "siteId" : "00000000-0000-0000-0000-000000000000", "policyIds" : ["00000000-0000-0000-0000-000000000000","00000000-0000-0000-0000-000000000001"] }
  • 响应示例 返回状态码为200:更新成功,响应体参考NatResponse。 HTTP/1.1 200 OK Date: Sun,11 May 2025 10:00:00 GMT Server: example-server Content-Type: application/json;charset=UTF-8 Content-Length: 250 Connection: keep-alive { "errcode" : "0", "errmsg" : "", "success" : [ { "vpnId" : "00000000-0000-0000-0000-000000000000", "siteId" : "00000000-0000-0000-0000-000000000000", "deviceId" : "00000000-0000-0000-0000-000000000000", "policyId" : "00000000-0000-0000-0000-000000000000", "policyName" : "test name", "globalStartAddress" : "192.168.1.1", "globalEndAddress" : "192.168.1.2", "insideStartAddress" : "192.168.1.1", "insideEndAddress" : "192.168.1.2", "globalSourcePort" : "1", "globalEndPort" : "2", "insideSourcePort" : "1", "insideEndPort" : "2", "protocol" : "6", "reverse" : true, "interfaceId" : "00000000-0000-0000-0000-000000000000", "interfaceName" : "GE0/0/0" } ], "fail" : [ { "errcode" : "0x00c8000c", "errmsg" : "The parameter is invalid.", "errparam" : "["policyName"]", "data" : { "vpnId" : "00000000-0000-0000-0000-000000000000", "siteId" : "00000000-0000-0000-0000-000000000000", "deviceId" : "00000000-0000-0000-0000-000000000000", "policyId" : "00000000-0000-0000-0000-000000000000", "policyName" : "test name", "globalStartAddress" : "192.168.1.1", "globalEndAddress" : "192.168.1.2", "insideStartAddress" : "192.168.1.1", "insideEndAddress" : "192.168.1.2", "globalSourcePort" : "1", "globalEndPort" : "2", "insideSourcePort" : "1", "insideEndPort" : "2", "protocol" : "6", "reverse" : true, "interfaceId" : "00000000-0000-0000-0000-000000000000", "interfaceName" : "GE0/0/0" } } ] }
  • 请求示例 HTTP的示例 PUT /controller/campus/v1/sdwan/policy/traffic/nat/natserver HTTP/1.1 Host: 192.168.1.125:18002 Content-Type: application/json Accept: application/json Accept-Language: en-US X-ACCESS-TOKEN: x-yyyyyy { "natServerInfos" : [ { "vpnId" : "00000000-0000-0000-0000-000000000000", "siteId" : "00000000-0000-0000-0000-000000000000", "deviceId" : "00000000-0000-0000-0000-000000000000", "policyId" : "00000000-0000-0000-0000-000000000000", "policyName" : "test name", "globalStartAddress" : "192.168.1.1", "globalEndAddress" : "192.168.1.2", "insideStartAddress" : "192.168.1.1", "insideEndAddress" : "192.168.1.2", "globalSourcePort" : "1", "globalEndPort" : "2", "insideSourcePort" : "1", "insideEndPort" : "2", "protocol" : "6", "reverse" : true, "interfaceId" : "00000000-0000-0000-0000-000000000000", "interfaceName" : "GE0/0/0" } ] }
提示

您即将访问非华为云网站,请注意账号财产安全