fix:(v1版本接口分隔符)引用对象使用变量分隔符
feat:(策略对象)1.策略对象相关性查询;2.App ID对象树查询;
This commit is contained in:
@@ -593,7 +593,15 @@ Policy-Statistics-v1-00035
|
|||||||
Comment 策略统计
|
Comment 策略统计
|
||||||
${objectIds} Set Variable ${EMPTY}
|
${objectIds} Set Variable ${EMPTY}
|
||||||
${response} StatisticsPolicies
|
${response} StatisticsPolicies
|
||||||
Policy-ProtocolFields-v1-00035
|
Policy-ProtocolFields-v1-00036
|
||||||
Comment 策略对象生效协议字段查询
|
Comment 策略对象生效协议字段查询
|
||||||
${objectIds} Set Variable ${EMPTY}
|
${objectIds} Set Variable ${EMPTY}
|
||||||
${response} PolicProtocolFields tsg_security ${EMPTY} ip
|
${response} PolicProtocolFields tsg_security ${EMPTY} ip
|
||||||
|
Object-Reference-v1-00037
|
||||||
|
Comment 策略对象生效协议字段查询
|
||||||
|
${objectIds} Set Variable ${EMPTY}
|
||||||
|
${response} ObjectReference 174
|
||||||
|
Object-AppIDTree-v1-00038
|
||||||
|
Comment 策略对象生效协议字段查询
|
||||||
|
${objectIds} Set Variable ${EMPTY}
|
||||||
|
${response} AppIdTreeSearch 174
|
||||||
@@ -199,4 +199,20 @@ PolicProtocolFields
|
|||||||
${response} BaseFormRequest ${objectUrl}/protocolFields ${parmStr} ${version}
|
${response} BaseFormRequest ${objectUrl}/protocolFields ${parmStr} ${version}
|
||||||
${rescode} Set Variable ${response['code']}
|
${rescode} Set Variable ${response['code']}
|
||||||
Should Be Equal As Strings ${rescode} 200
|
Should Be Equal As Strings ${rescode} 200
|
||||||
|
[Return] ${response['data']}
|
||||||
|
ObjectReference
|
||||||
|
[Documentation]
|
||||||
|
... 策略对象相关性查询
|
||||||
|
[Arguments] ${objectId}
|
||||||
|
${response} BaseFormRequest ${objectUrl}/reference objectId=${objectId} ${version}
|
||||||
|
${rescode} Set Variable ${response['code']}
|
||||||
|
Should Be Equal As Strings ${rescode} 200
|
||||||
|
[Return] ${response['data']}
|
||||||
|
AppIdTreeSearch
|
||||||
|
[Documentation]
|
||||||
|
... App ID对象树查询
|
||||||
|
[Arguments] ${referenceObjectId}
|
||||||
|
${response} BaseFormRequest ${objectUrl}/appId/tree referenceObjectId=${referenceObjectId} ${version}
|
||||||
|
${rescode} Set Variable ${response['code']}
|
||||||
|
Should Be Equal As Strings ${rescode} 200
|
||||||
[Return] ${response['data']}
|
[Return] ${response['data']}
|
||||||
@@ -4,7 +4,15 @@ Library Collections
|
|||||||
Resource ../../03-Variable/BifangApiVariable.txt
|
Resource ../../03-Variable/BifangApiVariable.txt
|
||||||
Resource ../../03-Variable/PolicyObjectDefault.txt
|
Resource ../../03-Variable/PolicyObjectDefault.txt
|
||||||
Resource ../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
Resource ../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||||
|
*** Variables ***
|
||||||
|
#arraySplitor:数组元素之间的分隔符
|
||||||
|
${arraySplitor} ,
|
||||||
|
#protocolFiledSplitor:protocolFiled之间的分隔符
|
||||||
|
${protocolFiledSplitor} &
|
||||||
|
#objectIdSplitor:objectId之间的分隔符
|
||||||
|
${objectIdSplitor} :
|
||||||
|
#idFiledSplitor: objectId和protocolFiled之间的分隔符
|
||||||
|
${idFiledSplitor} |
|
||||||
*** Keywords ***
|
*** Keywords ***
|
||||||
# ... 特殊参数说明:
|
# ... 特殊参数说明:
|
||||||
# ... effectiveRange=Nursurtan|Transtelecom&Astel,Almaty&Nursurtan,|Astel&Transtelecom
|
# ... effectiveRange=Nursurtan|Transtelecom&Astel,Almaty&Nursurtan,|Astel&Transtelecom
|
||||||
@@ -243,12 +251,12 @@ AnalysisReferenceObject
|
|||||||
# 解析引用对象
|
# 解析引用对象
|
||||||
[Arguments] ${referenceObject}
|
[Arguments] ${referenceObject}
|
||||||
${objList} Create List
|
${objList} Create List
|
||||||
${list} Evaluate re.split('[,]', '${referenceObject}') re
|
${list} Evaluate re.split('[${arraySplitor}]', '${referenceObject}') re
|
||||||
FOR ${var} IN @{list}
|
FOR ${var} IN @{list}
|
||||||
${emptyList} Create List
|
${emptyList} Create List
|
||||||
${emptyObj} Create Dictionary
|
${emptyObj} Create Dictionary
|
||||||
${key} Evaluate '${var}'[0:'${var}'.find('|')]
|
${key} Evaluate '${var}'[0:'${var}'.find('${idFiledSplitor}')]
|
||||||
${values} Evaluate '${var}'['${var}'.find('|')+1:]
|
${values} Evaluate '${var}'['${var}'.find('${idFiledSplitor}')+1:]
|
||||||
${valueList} InnerForEach ${values}
|
${valueList} InnerForEach ${values}
|
||||||
${key} Run Keyword If '${key}'.isdigit() Evaluate int('${key}')
|
${key} Run Keyword If '${key}'.isdigit() Evaluate int('${key}')
|
||||||
... ELSE Set Variable ${key}
|
... ELSE Set Variable ${key}
|
||||||
@@ -262,7 +270,7 @@ InnerForEach
|
|||||||
# 循环嵌套
|
# 循环嵌套
|
||||||
[Arguments] ${values}
|
[Arguments] ${values}
|
||||||
${emptyList} Create List
|
${emptyList} Create List
|
||||||
${list} Evaluate re.split('[&]', '${values}') re
|
${list} Evaluate re.split('[${protocolFiledSplitor}]', '${values}') re
|
||||||
FOR ${var} IN @{list}
|
FOR ${var} IN @{list}
|
||||||
Append To List ${emptyList} ${var}
|
Append To List ${emptyList} ${var}
|
||||||
END
|
END
|
||||||
|
|||||||
Reference in New Issue
Block a user