*** Settings *** Library Collections Library RequestsLibrary Resource ../../variable/common_variable.txt #Resource functional_keywords.robot Resource ../policys/policy.robot Resource ../objects/object.robot Resource ../objects/application.robot Resource common.robot *** Variables *** ${policyUrl} /policy/compile *** Keywords *** DeletePolicyAndObjectAndOther [Documentation] delete :policy object category app signature profile ... [Arguments] ${policyIds}=${EMPTY} ${objectIds}=${EMPTY} ${categoryIds}=${EMPTY} ${profiledId}=${EMPTY} ${appIds}=${EMPTY} ${signatureId}=${EMPTY} #Run Keyword If "${policyIds}"=="${EMPTY}" log no policyIds to del #... ELSE DeletePoliciebyList ${policyIds} Run Keyword If "${createPolicyIds}"=="${EMPTY}" log no policyIds to del ... ELSE DeletePoliciebyList ${createPolicyIds} #Run Keyword If "${objectIds}"=="${EMPTY}" log no objectIds to del #... ELSE DeleteObjectByIds ${objectIds} Run Keyword If "${createObjectIds}"=="${EMPTY}" log no objectIds to del ... ELSE DeleteObjectByIds ${createObjectIds} Run Keyword If "${categoryIds}"=="${EMPTY}" log no categoryIds to del ... ELSE DeleteCategoryByIds ${categoryIds} #删除文件 Run Keyword If "${profiledId}"=="${EMPTY}" log no profiledId to del ... ELSE DeleteProfileByIds ${url} ${profiledId} Run Keyword If "${appids}"=="${EMPTY}" log no appids to del ... ELSE DeleteApplicationByIds ${appids} Run Keyword If "${signatureId}"=="${EMPTY}" log no signatureId to del ... ELSE DeleteSignatureByIds ${signatureId} DeletePolicyAndGroupObject [Documentation] delete :policy object ... policyList [Arguments] ${policyList}=${EMPTY} ${objectIds}=${EMPTY} Run Keyword If "${policyList}"=="${EMPTY}" log no policyList to del ... ELSE DeletePoliciebyList ${policyList} Run Keyword If "${objectIds}"=="${EMPTY}" log no objectIds to del ... ELSE DeleteObjectByIds ${objectIds} DeletePolicyAndObject [Arguments] ${policyids} ${objectids} ${categoriesId}=null ${objectId1} Create List [${objectids}] ${categoryId1} Create List [${categoriesId}] DeletePolicyAndGroupObject1 ${policyIds} ${objectId1} ${categoryId1} DeletePolicyAndGroupObject1 [Arguments] ${policyids} ${objectids} ${categoriesId} #引用此关键字,${objectids}参数必须是双层列表,eg:['[1]','[2,3]','[4,5,6,7]'] #删除策略和对象 log toDeletePolicy_DeletePolicyAndObject ${listlenth}= Get Length ${policyids} Run Keyword If "${listlenth}"=="0" log no Policys to del ... ELSE DeletePoliciebyList ${policyids} #删除对象 Run Keyword If "${objectids}"=="${EMPTY}" log no Objects to del ... ELSE IF ${objectids}==['[]'] log no Objects to del ... ELSE DeleteGroupObjects ${objectids} log ${categoriesId} Run Keyword If "${categoriesId}"=="${EMPTY}" or ${categoriesId}==['[null]'] or ${categoriesId}==['[]'] log no Categories to del ... ELSE DeleteGroupCategories ${categoriesId}