功能 #4546
增加核心网热备相关接口
0%
描述
1.基本信息中增加热备相关信息;
2.增加修改、获取热备配置接口;
3.增加热备切换接口;
文件
历史记录
由 钱 伯宁 更新于 16 天 之前
- 指派给 从 钱 伯宁 变更为 马 党旗
获取热备信息配置:
请求: <get-config><target><running/></target><operation>query</operation><hacfg xmlns="http://www.yunzhiruantong.com/yzrt/yzmm/hacfg">{"type":"","extension":"","value":""}</hacfg></get-config>
应答: <data>{"result":"success","data":"{\"DynamicHAFlag\":\"0\",\"NGAPFloatIp\":\"192.168.2.1\",\"GTPUFloatIp\":\"192.168.2.1\"}","code":0}</data>
耗时: 8.8995ms
修改热备信息配置:
请求: <edit-config><target><running/></target><operation>update</operation><hacfg xmlns="http://www.yunzhiruantong.com/yzrt/yzmm/hacfg">{"type":"","extension":"","value":"{\"DynamicHAFlag\":\"1\",\"NGAPFloatIp\":\"192.168.62.201\",\"GTPUFloatIp\":\"192.168.68.201\"}"}</hacfg></edit-config>
应答: <data>{"result":"success","data":"ok","code":0}</data>
耗时: 79.7551ms
主备切换:
请求: <edit-config><target><running/></target><operation>update</operation><ha-manual-switch-cfg xmlns="http://www.yunzhiruantong.com/yzrt/yzmm/ha-manual-switch-cfg">{"type":"","extension":"","value":"{\"IpAddr\":\"192.168.62.15\"}"}</ha-manual-switch-cfg></edit-config>
应答: <data>{"result":"success","data":"ok","code":0}</data>
耗时: 22.3725ms
基本信息新增ha列表信息:
type DeviceInfo struct {
Id string `json:"id"`
Ip string `json:"ip"`
Name string `json:"name"`
System SystemInfo `json:"system"`
Software []Software `json:"software"` //agent,mongodb, msqldb
NgcModules FiveGCModulesInfo `json:"ngcModules"`
ImsModules FiveGCModulesInfo `json:"imsModules"`
InnerVersion uint16 `json:"innerVersion"` //内部版本号
AmfIp string `json:"amfIp"`
HAInfo HAInfo `json:"haInfo"` //HA列表信息
Timezone string `json:"timezone"` //时区
}
type HAInfo struct {
IsHAMaster uint8 `json:"isHAMaster"` //是否为HA主核心网 0:不是HA核心网,1:HA主核心网,2:HA备核心网
HAList []HAInfoList `json:"haList"`
}
type HAInfoList struct {
Ip string `json:"IpAddr"`
DevType string `json:"DeviceType"`
DevStatus string `json:"DevStatus"`
ServiceStat string `json:"ServiceStat"`
Version string `json:"Version"`
}