修改 WanIpPoor 关键子与添加新关键字 IPlist
This commit is contained in:
@@ -246,10 +246,27 @@ WanVpn
|
||||
${data} Set Variable "opAction":"add","returnData":1
|
||||
${dict}= Evaluate eval ('{${data}}')
|
||||
${data2} set to dictionary ${dict} list=${wanvpnlist}
|
||||
[Return] ${data2}
|
||||
${json} json.Dumps ${data2} ensure_ascii=False
|
||||
[Return] ${json}
|
||||
|
||||
IP_list
|
||||
[Arguments] ${Iplist}
|
||||
${list} Create List
|
||||
FOR ${k} ${v} IN ENUMERATE @{Iplist}
|
||||
Append To List ${list} ${v}
|
||||
END
|
||||
${list2} Set Variable ${list}[2]
|
||||
${list3} Set Variable ${list}[3]
|
||||
${link_id} evaluate int(${Iplist}[${list2}])
|
||||
${src_mac} evaluate int(${Iplist}[${list3}])
|
||||
${list_info} Create Dictionary ${list}[2]=${link_id} ${list}[3]=${src_mac}
|
||||
${Ip_list} Create Dictionary ip=${Iplist}[ip] relative_location=${Iplist}[relative_location] link_info=${list_info}
|
||||
log 123213213213213123
|
||||
log ${Ip_list}
|
||||
# log ${link_info}
|
||||
[Return] ${Ip_list}
|
||||
WanNatIpPood
|
||||
[Arguments] ${must_parameter} ${wan_nat_ip_iplist}
|
||||
[Arguments] ${must_parameter} ${wan_nat_ip_iplist}
|
||||
# 编写iplist json格式
|
||||
${wan_nat_ip_iplist} Create Dictionary profileId=${must_parameter}[profileId] profileName=${must_parameter}[profileName] ipList=${wan_nat_ip_iplist} isValid=1
|
||||
#编写二层list内地格式
|
||||
@@ -261,4 +278,40 @@ WanNatIpPood
|
||||
${wan_nat_ip_pood_data} Create Dictionary opAction=${opAction} returnData=1 list=${wan_nat_ip_list}
|
||||
# 返回请求json
|
||||
log ${wan_nat_ip_pood_data}
|
||||
[Return] ${wan_nat_ip_pood_data}
|
||||
${json} json.Dumps ${wan_nat_ip_pood_data} ensure_ascii=False
|
||||
log ${json}
|
||||
[Return] ${json}
|
||||
|
||||
PacketCapture
|
||||
[Arguments] ${PacketCapturedata}
|
||||
# 编写iplist json格式
|
||||
log ${PacketCapturedata}
|
||||
# 替换指定键值对的值为 int
|
||||
${addrType} evaluate int(${PacketCapturedata}[addrType])
|
||||
${protocol} evaluate int(${PacketCapturedata}[protocol])
|
||||
${captureDuration} evaluate int(${PacketCapturedata}[captureDuration])
|
||||
Set To Dictionary ${PacketCapturedata}#
|
||||
... policyId=${PacketCapturedata}[policyId]
|
||||
... policyName=${PacketCapturedata}[policyName]
|
||||
... addrType=${PacketCapturedata}[addrType]
|
||||
... protocol=${PacketCapturedata}[protocol]
|
||||
... clientIp=${PacketCapturedata}[clientIp]
|
||||
... clientPort=${PacketCapturedata}[clientPort]
|
||||
... serverIp=${PacketCapturedata}[serverIp]
|
||||
... serverPort=${PacketCapturedata}[serverPort]
|
||||
... maxPacket=${PacketCapturedata}[maxPacket]
|
||||
... captureDuration=${PacketCapturedata}[captureDuration]
|
||||
log 111111111111111111111111111111111111111111111111111111111
|
||||
log ${PacketCapturedata}
|
||||
${wan_nat_ip_iplist} Create Dictionary profileId=${must_parameter}[profileId] profileName=${must_parameter}[profileName] ipList=${wan_nat_ip_iplist} isValid=1
|
||||
#编写二层list内地格式
|
||||
${wan_nat_ip_list} Create List ${wan_nat_ip_iplist}
|
||||
# 判断sjon是用于修改还是新增
|
||||
${opAction} run keyword if '${must_parameter}[profileId]'=="" Set Variable add
|
||||
... ELSE Set Variable update
|
||||
#编写最外面的格式
|
||||
${wan_nat_ip_pood_data} Create Dictionary opAction=${opAction} returnData=1 policyList=${wan_nat_ip_list}
|
||||
# 返回请求json
|
||||
log ${wan_nat_ip_pood_data}
|
||||
${json} json.Dumps ${wan_nat_ip_pood_data} ensure_ascii=False
|
||||
[Return] ${json}
|
||||
Reference in New Issue
Block a user