-
步骤二:配置
域名 解析 是否使用华为云DNS进行域名解析? 是,执行2~4。 否,执行5~6。 在“CDN配置”对话框中,单击“配置DNS”。 企业门户后台配置DNS时,执行2个操作:在华为云DNS配置CNAME解析记录、在管理后台绑定加速域名。 图5 配置DNS 在域名解析界面查看DNS是否配置成功。 在企业门户控制台左侧导航栏,单击“域名解析”,进入DNS控制台。 在“公网解析”界面,单击加速域名的一级域名,进入“解析记录”界面。 图6 公网解析 查看是否已存在加速域名的解析记录。 图7 解析记录 在管理后台查看加速域名是否已绑定。 在企业门户控制台,单击“网站设计”,进入管理后台界面。 单击“绑定域名”,在弹出的对话框中,查看加速域名是否已经绑定。 确认加速域名已绑定后,执行7。 在“CDN配置”对话框中,记录“CDN CNAME”值,并且在第三方域名解析平台为加速域名添加CNAME解析记录。 图8 CDN CNAME 在企业门户控制台,单击“网站设计”,进入管理后台界面。单击“绑定域名”,在弹出的对话框中,输入加速域名,单击“确定”。 图9 绑定域名 查看开启CDN前后,网站资源的变化。 在谷歌浏览器中通过域名打开网站,按F12,查看资源分布。开启CDN前,如图10所示,网站资源存储在不同资源节点中。开启CDN后,如图11所示,网站资源存储在同一个资源节点中。 图10 未开启CDN 图11 已开启CDN
-
响应示例 返回状态码为200:批量查询站点列表返回体,响应体参考querySitesOut。 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
{
"data" : [
{
"id" : "ea25fdbf-8dee-4823-bac2-5bfe8e3359ca",
"tenantId" : "ea25fdbf-8dee-4823-bac2-5bfe8e3359ca",
"name" : "site1",
"organizationId" : "671cbc38-38eb-49a5-88c4-d7a35bf5bf11",
"organizationName" : "南京研究所",
"description" : "site1",
"type" : ["AP"],
"latitude" : "50",
"longtitude" : "111",
"longitude" : "111",
"contact" : "David",
"tag" : ["abcd"],
"isolated" : false,
"email" : "xxx@xxx.xxx",
"phone" : "152XXXXXXXX",
"postcode" : "215000",
"address" : "66 JiangYun Road",
"approvalSwitch" : false,
"autoApprovalSwitch" : false,
"autoTopoCheck" : false,
"validityPeriod" : 1,
"siteCode" : "",
"siteCodeExpireTime" : 1686131018523,
"isSiteCodeExpired" : false,
"totalDeviceCount" : 100,
"siteTag" : ""
}
]
} 返回状态码为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
-
响应参数 返回状态码为200:批量查询站点列表返回体,响应体参考querySitesOut。 表3 BatchQuerySitesOut对象的参数列表 参数名称 类型 参数值域 默认值 参数说明 参数示例 data ARRAY_REFERENCE 0-100个列表项,详细请参见表3。 站点信息。 - 返回状态码为400:参数校验异常,无响应体。 详细信息请参见实际响应消息体。 返回状态码为500:服务内部错误,无响应体。 详细信息请参见实际响应消息体。
-
请求示例 HTTP的示例 POST /controller/campus/v3/sites/action/batch-query 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
{
"siteIds" : ["ea25fdbf-8dee-4823-bac2-5bfe8e3359ca"]
}
-
请求示例 HTTP的示例 POST /controller/campus/v3/sites/action/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
{
"ids" : ["ea25fdbf-8dee-4823-bac2-5bfe8e3359ca"]
}
-
响应示例 返回状态码为200:删除站点全部成功,响应体参考BatchDeleteSiteOut。 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" : "Failed to delete the site",
"success" : ["ea25fdbf-8dee-4823-bac2-5bfe8e3359ca"],
"fail" : [
{
"errCode" : "0",
"errMsg" : "The default site can not be deleted.",
"id" : "ea25fdbf-8dee-4823-bac2-5bfe8e3359ca"
}
]
} 返回状态码为207:删除站点部分成功,响应体参考BatchDeleteSiteOut。 HTTP/1.1 207 Multi-Status
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" : "Failed to delete the site",
"success" : ["ea25fdbf-8dee-4823-bac2-5bfe8e3359ca"],
"fail" : [
{
"errCode" : "0",
"errMsg" : "The default site can not be deleted.",
"id" : "ea25fdbf-8dee-4823-bac2-5bfe8e3359ca"
}
]
} 返回状态码为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
{
"errCode" : "0",
"errMsg" : "Failed to delete the site",
"success" : ["ea25fdbf-8dee-4823-bac2-5bfe8e3359ca"],
"fail" : [
{
"errCode" : "0",
"errMsg" : "The default site can not be deleted.",
"id" : "ea25fdbf-8dee-4823-bac2-5bfe8e3359ca"
}
]
} 返回状态码为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
-
响应示例 返回状态码为200:切换注册WAN链路成功,响应体参考SiteManagerLinkChangeResponse。 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" : "",
"data" : {
"siteId" : "a99f794e-b510-438c-a75d-de59f02347eb",
"deviceId" : "a99f794e-b510-438c-a75d-de59f02347aa",
"wanLinkId" : "a99f794e-b510-438c-a75d-de59f02347bb",
"protocol" : "IPv4",
"southAccessRole" : 1,
"accessIpMode" : 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
-
响应参数 返回状态码为200:切换注册WAN链路成功,响应体参考SiteManagerLinkChangeResponse。 表3 SiteManagerLinkChangeResponse对象的参数列表 参数名称 类型 参数值域 默认值 参数说明 参数示例 errcode string - - 错误码。 "0" errmsg string - - 错误信息。 "" data REFERENCE 详细请参见表4。 调用设备切换当前注册AC的WAN链路返回结果。 - 表4 SiteManagerLinkChange对象的参数列表 参数名称 类型 参数值域 默认值 参数说明 参数示例 siteId UUID - - 站点ID,格式为uuid,更新时必填。 "a99f794e-b510-438c-a75d-de59f02347eb" deviceId UUID - - 设备ID,格式为uuid,更新时必填。 "a99f794e-b510-438c-a75d-de59f02347aa" wanLinkId string 0~64个字符。 - 链路ID,格式为uuid,更新时必填。 "a99f794e-b510-438c-a75d-de59f02347bb" protocol string 0~32个字符。 - 注册AC链路的协议:IPv4、IPv6,默认值IPv4。 "IPv4" southAccessRole integer [1-2] 1 南向接入服务,1表示南向接入服务1、2表示南向接入服务2,默认值为1。IPv6不支持使用南向接入服务2。 1 accessIpMode integer [0-1] 0 南向接入IP模式,0表示主用南向IP、1表示备用南向IP,默认值为0。 0 返回状态码为400:校验异常。 详细信息请参见实际响应消息体。 返回状态码为500:内部错误。 详细信息请参见实际响应消息体。
-
请求参数 表1 body参数列表 参数名称 必选 类型 参数值域 默认值 参数说明 参数示例 siteManagerLinkUpdateRequest 是 REFERENCE 详细请参见表2。 入参 - 表2 SiteManagerLinkChange对象的参数列表 参数名称 必选 类型 参数值域 默认值 参数说明 参数示例 siteId 否 UUID - - 站点ID,格式为uuid,更新时必填。 "a99f794e-b510-438c-a75d-de59f02347eb" deviceId 否 UUID - - 设备ID,格式为uuid,更新时必填。 "a99f794e-b510-438c-a75d-de59f02347aa" wanLinkId 否 string 0~64个字符。 - 链路ID,格式为uuid,更新时必填。 "a99f794e-b510-438c-a75d-de59f02347bb" protocol 否 string 0~32个字符。 - 注册AC链路的协议:IPv4、IPv6,默认值IPv4。 "IPv4" southAccessRole 否 integer [1-2] 1 南向接入服务,1表示南向接入服务1、2表示南向接入服务2,默认值为1。IPv6不支持使用南向接入服务2。 1 accessIpMode 否 integer [0-1] 0 南向接入IP模式,0表示主用南向IP、1表示备用南向IP,默认值为0。 0
-
请求示例 HTTP的示例 PUT /controller/campus/v1/sdwan/net/site-manage-link 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
{
"siteId" : "a99f794e-b510-438c-a75d-de59f02347eb",
"deviceId" : "a99f794e-b510-438c-a75d-de59f02347aa",
"wanLinkId" : "a99f794e-b510-438c-a75d-de59f02347bb",
"protocol" : "IPv4",
"southAccessRole" : 1,
"accessIpMode" : 0
}
-
请求示例 HTTP的示例 POST /controller/campus/v1/sdwan/net/sites/action/batch-isolate 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
{
"siteIds" : ["a99f794e-b510-438c-a75d-de59f02347eb"],
"isolated" : true
}
-
响应示例 返回状态码为200:批量隔离站点成功,响应体参考SitesIsolationResponse。 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" : [
""
],
"fail" : [
{
"errcode" : "0",
"errmsg" : "",
"data" : ""
}
]
} 返回状态码为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
-
响应示例 返回状态码为200:删除站点成功,响应体参考deleteSiteOut。 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" : ["ea25fdbf-8dee-4823-bac2-5bfe8e3359ca"],
"fail" : [
{
"errcode" : "0",
"errmsg" : "",
"data" : "ea25fdbf-8dee-4823-bac2-5bfe8e3359ca"
}
]
} 返回状态码为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的示例 DELETE /controller/campus/v3/sites 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
{
"ids" : ["ea25fdbf-8dee-4823-bac2-5bfe8e3359ca"]
}
-
请求示例 HTTP的示例 POST /controller/campus/v1/sdwan/net/sites/action/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
{
"sites" : [
{
"id" : "a99f794e-b510-438c-a75d-de59f02347eb",
"name" : "site1",
"locations" : [
{
"name" : "Beijing",
"address" : "Beijing",
"floor" : "5F",
"postcode" : "100000",
"latitude" : "39.92",
"longitude" : "116.46"
}
],
"devices" : [
{
"deviceId" : "a99f794e-b510-438c-a75d-de59f02347eb",
"locationName" : "nanjing"
}
],
"siteType" : "single-gateway",
"interLink" : {
"type" : "l3-interface",
"enableGre" : false,
"vlanMin" : 4000,
"vlanMax" : 4008,
"extendVlans" : ["1:9"],
"portPairs" : [
{
"device1PortId" : "a99f794e-b510-438c-a75d-de59f02347eb",
"device2PortId" : "a99f794e-b510-438c-a75d-de59f02347eb",
"device1Id" : "a99f794e-b510-438c-a75d-de59f02347eb",
"device1PortType" : "GE",
"device1PortNum" : "0/0/1",
"device1PortAddress" : "192.168.101.1",
"device1PortMask" : 24,
"device2Id" : "a99f794e-b510-438c-a75d-de59f02347eb",
"device2PortType" : "GE",
"device2PortNum" : "0/0/1",
"device2PortAddress" : "192.168.101.1",
"device2PortMask" : 24
}
],
"mtu" : 1500,
"mss" : 1200
},
"role" : ["sd-wan-edge","evpn-rr"],
"controlPoints" : ["a99f794e-b510-438c-a75d-de59f02347eb"],
"timeZone" : "(UTC+08:00)Beijing,Chongqing,Hong Kong,Urumqi",
"enableSummerConfig" : "",
"enableAutoConfig" : true,
"daylightSavingTime" : {
"name" : "Atlantic/Canary",
"offset" : "01:00",
"enableWeekDay" : false,
"startTime" : {
"month" : "Jan",
"time" : "23:59",
"week" : "first",
"weekday" : "Mon",
"day" : 21
},
"stopTime" : {
"month" : "Jan",
"time" : "23:59",
"week" : "first",
"weekday" : "Mon",
"day" : 21
}
},
"contact" : {
"responsiblePerson" : "Jack Lee",
"phoneNumber" : "152xxxxxxxx",
"emails" : ["xxx@xxx.xxx"]
},
"description" : "sdwan Site",
"tag" : "tagHub",
"isolated" : false,
"enhancedMode" : false
}
]
}