导入导出功能自动化,对象txt格式导入导出,策略txt和json格式导入,txt格式导出
This commit is contained in:
703
01-TestCase/tsg_bfapi/policy_object/ExportAndImport.robot
Normal file
703
01-TestCase/tsg_bfapi/policy_object/ExportAndImport.robot
Normal file
@@ -0,0 +1,703 @@
|
||||
*** Settings ***
|
||||
Test Teardown DeletePolicyAndGroupObject ${policyIds} ${objectIds}
|
||||
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Resource ../../../03-Variable/ApplicationID.txt
|
||||
Library json5
|
||||
Library DateTime
|
||||
Library String
|
||||
Library BuiltIn
|
||||
Library ../../../04-CustomLibrary/Library/fileOperations.py
|
||||
|
||||
*** Variables ***
|
||||
@{policyIds} ${EMPTY}
|
||||
${objectIds} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Object-Import-v1-ip_smallAccount
|
||||
[Tags] A small amount of IP
|
||||
Comment 导入ip
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles ip01.txt ip ${EMPTY} ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=${objectType}
|
||||
log pssssssssssssssssssssssssssssssssssssssssssssssssssss
|
||||
log ${response}
|
||||
${objectIds} Create List ${response['data']['list'][0]['objectId']}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-ip_reachLimit
|
||||
[Tags] reachLimit IP
|
||||
Comment 导入ip
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles ip_99968.txt ip ${EMPTY} ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=${objectType}
|
||||
log pssssssssssssssssssssssssssssssssssssssssssssssssssss
|
||||
log ${response}
|
||||
${objectIds} Create List ${response['data']['list'][0]['objectId']}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-ip_overLimit
|
||||
[Tags] OverLimit IP with 2 emptyLines
|
||||
Comment 导入ip
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Create List
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles ip_100001.txt ip ${EMPTY} ${EMPTY}
|
||||
log pssssssssssssssssssssssssssssssssssssssssssssssssssss
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-url_smallAccount
|
||||
[Tags] A small amount of url
|
||||
Comment 导入url
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles url_example2.txt url ${EMPTY} ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=${objectType}
|
||||
log pssssssssssssssssssssssssssssssssssssssssssssssssssss
|
||||
log ${response}
|
||||
${objectIds} Create List ${response['data']['list'][0]['objectId']}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-url_reachLimit
|
||||
[Tags] reachLimit url
|
||||
Comment 导入url
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles url_1000000.txt url ${EMPTY} ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=${objectType}
|
||||
log pssssssssssssssssssssssssssssssssssssssssssssssssssss
|
||||
log ${response}
|
||||
${objectIds} Create List ${response['data']['list'][0]['objectId']}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-url_overLimit
|
||||
[Tags] OverLimit url with 2 emptyLines
|
||||
Comment 导入url
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Create List
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles url_1000001.txt url ${EMPTY} ${EMPTY}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-fqdn
|
||||
[Tags] A small amount of fqdn
|
||||
Comment 导入fqdn
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles fqdn_example.txt fqdn ${EMPTY} ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=${objectType}
|
||||
log pssssssssssssssssssssssssssssssssssssssssssssssssssss
|
||||
log ${response}
|
||||
${objectIds} Create List ${response['data']['list'][0]['objectId']}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-fqdn_reachLimit
|
||||
[Tags] reachLimit fqdn
|
||||
Comment 导入fqdn
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles fqdn_100000.txt fqdn ${EMPTY} ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=${objectType}
|
||||
log pssssssssssssssssssssssssssssssssssssssssssssssssssss
|
||||
log ${response}
|
||||
${objectIds} Create List ${response['data']['list'][0]['objectId']}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-fqdn_overLimit
|
||||
[Tags] OverLimit fqdn with 2 emptyLines
|
||||
Comment 导入fqdn
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Create List
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles fqdn_100009.txt fqdn ${EMPTY} ${EMPTY}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-subid
|
||||
[Tags] A small amount of subid
|
||||
Comment 导入subid
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles subid_example.txt subscriberid ${EMPTY} ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=${objectType}
|
||||
log pssssssssssssssssssssssssssssssssssssssssssssssssssss
|
||||
log ${response}
|
||||
${objectIds} Create List ${response['data']['list'][0]['objectId']}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-subid_reachLimit
|
||||
[Tags] reachLimit subid
|
||||
Comment 导入subid
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles subid_10w.txt subscriberid ${EMPTY} ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=${objectType}
|
||||
log pssssssssssssssssssssssssssssssssssssssssssssssssssss
|
||||
log ${response}
|
||||
${objectIds} Create List ${response['data']['list'][0]['objectId']}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-subid_overLimit
|
||||
[Tags] OverLimit subid with 2 emptyLines
|
||||
Comment 导入subid
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Create List
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles subid_100001.txt subscriberid ${EMPTY} ${EMPTY}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-httpsig
|
||||
[Tags] A small amount of http_signature
|
||||
Comment 导入http_signature
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles httpsig_example.txt http_signature ${EMPTY} ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=${objectType}
|
||||
log pssssssssssssssssssssssssssssssssssssssssssssssssssss
|
||||
log ${response}
|
||||
${objectIds} Create List ${response['data']['list'][0]['objectId']}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-_httpsig_reachLimit
|
||||
[Tags] reachLimit http_signature
|
||||
Comment 导入http_signature
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles httpsig10w.txt http_signature ${EMPTY} ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=${objectType}
|
||||
log pssssssssssssssssssssssssssssssssssssssssssssssssssss
|
||||
log ${response}
|
||||
${objectIds} Create List ${response['data']['list'][0]['objectId']}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-httpsig_overLimit
|
||||
[Tags] OverLimit http_signature with 2 emptyLines
|
||||
Comment 导入http_signature
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Create List
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles httpsig_100001.txt http_signature ${EMPTY} ${EMPTY}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-keywords
|
||||
[Tags] A small amount of keywords
|
||||
Comment 导入keywords
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles keyword_example.txt keywords ${EMPTY} ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=${objectType}
|
||||
log pssssssssssssssssssssssssssssssssssssssssssssssssssss
|
||||
log ${response}
|
||||
${objectIds} Create List ${response['data']['list'][0]['objectId']}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-keywords_reachLimit
|
||||
[Tags] reachLimit keywords
|
||||
Comment 导入ip
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles keyword_10w.txt keywords ${EMPTY} ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=${objectType}
|
||||
log pssssssssssssssssssssssssssssssssssssssssssssssssssss
|
||||
log ${response}
|
||||
${objectIds} Create List ${response['data']['list'][0]['objectId']}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-keywords_overLimit
|
||||
[Tags] OverLimit keywords with 2 emptyLines
|
||||
Comment 导入keywords
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Create List
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles keyword_100001.txt keywords ${EMPTY} ${EMPTY}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-accounts
|
||||
[Tags] A small amount of accounts
|
||||
Comment 导入account
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles account_example.txt account ${EMPTY} ${EMPTY}
|
||||
log ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=${objectType}
|
||||
log pssssssssssssssssssssssssssssssssssssssssssssssssssss
|
||||
log ${response}
|
||||
${objectIds} Create List ${response['data']['list'][0]['objectId']}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-account_reachLimit
|
||||
[Tags] reachLimit account
|
||||
Comment 导入account
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles account10w.txt account ${EMPTY} ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=${objectType}
|
||||
log pssssssssssssssssssssssssssssssssssssssssssssssssssss
|
||||
log ${response}
|
||||
${objectIds} Create List ${response['data']['list'][0]['objectId']}
|
||||
sleep 5
|
||||
|
||||
Object-Import-v1-account_overLimit
|
||||
[Tags] OverLimit account with 2 emptyLines
|
||||
Comment 导入account
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${objectIds} Create List
|
||||
log ${objectIds}
|
||||
${rescode} ${objectType} ${importRes} ImportObject uploadFiles account100001.txt account ${EMPTY} ${EMPTY}
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-chooseId_ip
|
||||
[Tags] export chooseId ip
|
||||
Comment 导 出ip
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportObject ip endpoint 110788,110753 ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/ip_chooseID.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-choosePage_ip
|
||||
[Tags] export choosePage ip
|
||||
Comment 导 出ip
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=ip&objectSubType=endpoint
|
||||
@{exportIds} Create List ${EMPTY}
|
||||
FOR ${n} IN RANGE 4
|
||||
log ${n+1}
|
||||
Insert Into List ${exportIds} ${n+1} ${response['data']['list'][${n}]['objectId']}
|
||||
END
|
||||
Remove From List ${exportIds} 0
|
||||
log ${exportIds}
|
||||
${exportIds1} Set Variable ${EMPTY}
|
||||
:FOR ${element} IN @{exportIds}
|
||||
\ log ${element}
|
||||
\ ${exportIds1} Catenate SEPARATOR=, ${element} ${exportIds1}
|
||||
${exportIds1}= Get Substring ${exportIds1} 0 -1
|
||||
${response} ExportObject ip endpoint ${exportIds1} ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/ip_choosePage.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-all_ip
|
||||
[Tags] export all ip
|
||||
Comment 导 出ip
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportObject ip endpoint ${EMPTY} ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/ip_all.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-chooseId_fqdn
|
||||
[Tags] export chooseId fqdn
|
||||
Comment 导 出fqdn
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportObject fqdn ${EMPTY} 110873 ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/fqdn_chooseId.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-choosePage_fqdn
|
||||
[Tags] export choosePage fqdn
|
||||
Comment 导 出fqdn
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=fqdn
|
||||
@{exportIds} Create List ${EMPTY}
|
||||
FOR ${n} IN RANGE 1
|
||||
log ${n+1}
|
||||
Insert Into List ${exportIds} ${n+1} ${response['data']['list'][${n}]['objectId']}
|
||||
END
|
||||
Remove From List ${exportIds} 0
|
||||
log ${exportIds}
|
||||
${exportIds1} Set Variable ${EMPTY}
|
||||
:FOR ${element} IN @{exportIds}
|
||||
\ log ${element}
|
||||
\ ${exportIds1} Catenate SEPARATOR=, ${element} ${exportIds1}
|
||||
${exportIds1}= Get Substring ${exportIds1} 0 -1
|
||||
${response} ExportObject fqdn ${EMPTY} ${exportIds1} ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/fqdn_choosePage.txt
|
||||
sleep 5
|
||||
|
||||
|
||||
Object-Export-v1-all_fqdn
|
||||
[Tags] export all fqdn
|
||||
Comment 导 出fqdn
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportObject fqdn ${EMPTY} ${EMPTY} ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/fqdn_all.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-chooseId_subid
|
||||
[Tags] export chooseId subid
|
||||
Comment 导 出subid
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportObject subscriberid ${EMPTY} 110874 ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/subid_chooseID.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-choosePage_subid
|
||||
[Tags] export choosePage subid
|
||||
Comment 导 出subid
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=subscriberid
|
||||
@{exportIds} Create List ${EMPTY}
|
||||
FOR ${n} IN RANGE 1
|
||||
log ${n+1}
|
||||
Insert Into List ${exportIds} ${n+1} ${response['data']['list'][${n}]['objectId']}
|
||||
END
|
||||
Remove From List ${exportIds} 0
|
||||
log ${exportIds}
|
||||
${exportIds1} Set Variable ${EMPTY}
|
||||
:FOR ${element} IN @{exportIds}
|
||||
\ log ${element}
|
||||
\ ${exportIds1} Catenate SEPARATOR=, ${element} ${exportIds1}
|
||||
${exportIds1}= Get Substring ${exportIds1} 0 -1
|
||||
${response} ExportObject subscriberid ${EMPTY} ${exportIds1} ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/subid_choosePage.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-all_subid
|
||||
[Tags] export all subid
|
||||
Comment 导 出subid
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportObject subscriberid ${EMPTY} ${EMPTY} ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/subid_all.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-chooseId_http_signature
|
||||
[Tags] export chooseId http_signature
|
||||
Comment 导 出http_signature
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportObject http_signature ${EMPTY} 110760 ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/httpsig_chooseID.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-choosePage_http_signature
|
||||
[Tags] export choosePage http_signature
|
||||
Comment 导 出http_signature
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=http_signature
|
||||
@{exportIds} Create List ${EMPTY}
|
||||
FOR ${n} IN RANGE 1
|
||||
log ${n+1}
|
||||
Insert Into List ${exportIds} ${n+1} ${response['data']['list'][${n}]['objectId']}
|
||||
END
|
||||
Remove From List ${exportIds} 0
|
||||
log ${exportIds}
|
||||
${exportIds1} Set Variable ${EMPTY}
|
||||
:FOR ${element} IN @{exportIds}
|
||||
\ log ${element}
|
||||
\ ${exportIds1} Catenate SEPARATOR=, ${element} ${exportIds1}
|
||||
${exportIds1}= Get Substring ${exportIds1} 0 -1
|
||||
${response} ExportObject http_signature ${EMPTY} ${exportIds1} ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/http_signature_choosePage.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-all_http_signature
|
||||
[Tags] export all http_signature
|
||||
Comment 导 出http_signature
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportObject http_signature ${EMPTY} ${EMPTY} ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/httpsig_all.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-keywords
|
||||
[Tags] export chooseId Keywords
|
||||
Comment 导 出Keywords
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportObject Keywords ${EMPTY} 110762 ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/keyword_chooseID.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-choosePage_Keywords
|
||||
[Tags] export choosePage Keywords
|
||||
Comment 导 出Keywords
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=Keywords
|
||||
@{exportIds} Create List ${EMPTY}
|
||||
FOR ${n} IN RANGE 1
|
||||
log ${n+1}
|
||||
Insert Into List ${exportIds} ${n+1} ${response['data']['list'][${n}]['objectId']}
|
||||
END
|
||||
Remove From List ${exportIds} 0
|
||||
log ${exportIds}
|
||||
${exportIds1} Set Variable ${EMPTY}
|
||||
:FOR ${element} IN @{exportIds}
|
||||
\ log ${element}
|
||||
\ ${exportIds1} Catenate SEPARATOR=, ${element} ${exportIds1}
|
||||
${exportIds1}= Get Substring ${exportIds1} 0 -1
|
||||
${response} ExportObject Keywords ${EMPTY} ${exportIds1} ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/Keywords_choosePage.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-keywords
|
||||
[Tags] export all Keywords
|
||||
Comment 导 出Keywords
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportObject Keywords ${EMPTY} ${EMPTY} ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/keyword_all.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-urls
|
||||
[Tags] export chooseId URLs
|
||||
Comment 导 出URLs
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportObject url ${EMPTY} 110875 ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/url_chooseID.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-choosePage_url
|
||||
[Tags] export choosePage url
|
||||
Comment 导 出Keywords
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=url
|
||||
@{exportIds} Create List ${EMPTY}
|
||||
FOR ${n} IN RANGE 1
|
||||
log ${n+1}
|
||||
Insert Into List ${exportIds} ${n+1} ${response['data']['list'][${n}]['objectId']}
|
||||
END
|
||||
Remove From List ${exportIds} 0
|
||||
log ${exportIds}
|
||||
${exportIds1} Set Variable ${EMPTY}
|
||||
:FOR ${element} IN @{exportIds}
|
||||
\ log ${element}
|
||||
\ ${exportIds1} Catenate SEPARATOR=, ${element} ${exportIds1}
|
||||
${exportIds1}= Get Substring ${exportIds1} 0 -1
|
||||
${response} ExportObject url ${EMPTY} ${exportIds1} ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/url_choosePage.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-urls
|
||||
[Tags] export all URLs
|
||||
Comment 导 出URLs
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportObject url ${EMPTY} ${EMPTY} ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/url_all.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-accounts
|
||||
[Tags] export chooseId accounts
|
||||
Comment 导 出Accounts
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportObject account ${EMPTY} 110876 ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/account_chooseID.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-choosePage_account
|
||||
[Tags] export choosePage account
|
||||
Comment 导 出account
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${rescode} ${response} QueryObject ?pageSize=20&pageNo=1&isExclusion=0&isInitialize=0&objectType=account
|
||||
@{exportIds} Create List ${EMPTY}
|
||||
FOR ${n} IN RANGE 1
|
||||
log ${n+1}
|
||||
Insert Into List ${exportIds} ${n+1} ${response['data']['list'][${n}]['objectId']}
|
||||
END
|
||||
Remove From List ${exportIds} 0
|
||||
log ${exportIds}
|
||||
${exportIds1} Set Variable ${EMPTY}
|
||||
:FOR ${element} IN @{exportIds}
|
||||
\ log ${element}
|
||||
\ ${exportIds1} Catenate SEPARATOR=, ${element} ${exportIds1}
|
||||
${exportIds1}= Get Substring ${exportIds1} 0 -1
|
||||
${response} ExportObject account ${EMPTY} ${exportIds1} ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/account_choosePage.txt
|
||||
sleep 5
|
||||
|
||||
Object-Export-v1-all_accounts
|
||||
[Tags] export all accounts
|
||||
Comment 导 出Accounts
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportObject account ${EMPTY} ${EMPTY} ${EMPTY}
|
||||
WriteBinary ${response} ${path}/downloads/account_all.txt
|
||||
sleep 5
|
||||
|
||||
Policy-Import-v2-tsg_security_littleData_json
|
||||
[Tags] export littleData tsg_security
|
||||
Comment export littleData tsg_security
|
||||
${objectIds} Create List
|
||||
${rescode} ImportPolicy uploadFiles security_7ge.json tsg_security
|
||||
${rescode} ${response} QueryPolicy ?pageSize=20&pageNo=1&policyType=tsg_security&policyName=
|
||||
@{policyIds} Create List ${EMPTY}
|
||||
FOR ${n} IN RANGE 3
|
||||
log ${n+1}
|
||||
Insert Into List ${policyIds} ${n+1} ${response['data']['list'][${n+1}]['policyId']}
|
||||
END
|
||||
Remove From List ${policyIds} 0
|
||||
log ${policyIds}
|
||||
${length}= Get Length ${policyIds}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":${policyIds}}
|
||||
log ${policyIds}
|
||||
sleep 5
|
||||
|
||||
|
||||
Policy-Import-v2-little_Data_tsg_security_txt
|
||||
[Tags] export littleData tsg_security
|
||||
Comment 导入安全策略txt
|
||||
${objectIds} Create List
|
||||
${rescode} ImportPolicy uploadFiles security_7ge.txt tsg_security
|
||||
${rescode} ${response} QueryPolicy ?pageSize=20&pageNo=1&policyType=tsg_security&policyName=
|
||||
@{policyIds} Create List ${EMPTY}
|
||||
FOR ${n} IN RANGE 3
|
||||
log ${n+1}
|
||||
Insert Into List ${policyIds} ${n+1} ${response['data']['list'][${n+1}]['policyId']}
|
||||
END
|
||||
Remove From List ${policyIds} 0
|
||||
log ${policyIds}
|
||||
${length}= Get Length ${policyIds}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":${policyIds}}
|
||||
log ${policyIds}
|
||||
sleep 5
|
||||
|
||||
Policy-Import-v2-pxy_manipulation_littleData_json
|
||||
[Tags] export littleData pxy_manipulation
|
||||
Comment 导入代理策略json
|
||||
${objectIds} Create List
|
||||
${rescode} ${totalNum} ImportPolicy uploadFiles pxy.json pxy_manipulation
|
||||
${rescode} ${response} QueryPolicy ?pageSize=${totalNum}&pageNo=1&policyType=pxy_manipulation&policyName=
|
||||
@{policyIds} Create List ${EMPTY}
|
||||
FOR ${n} IN RANGE 1
|
||||
log ${n+1}
|
||||
Insert Into List ${policyIds} ${n+1} ${response['data']['list'][${n}]['policyId']}
|
||||
END
|
||||
Remove From List ${policyIds} 0
|
||||
log ${policyIds}
|
||||
${length}= Get Length ${policyIds}
|
||||
${policyIds} Create List {"policyType":"pxy_manipulation","policyIds":${policyIds}}
|
||||
log ${policyIds}
|
||||
sleep 5
|
||||
|
||||
Policy-Import-v2-pxy_manipulation_littleData_txt
|
||||
[Tags] export littleData pxy_manipulation
|
||||
Comment 导入代理策略txt
|
||||
${objectIds} Create List
|
||||
${rescode} ${totalNum} ImportPolicy uploadFiles pxy.txt pxy_manipulation
|
||||
${rescode} ${response} QueryPolicy ?pageSize=${totalNum}&pageNo=1&policyType=pxy_manipulation&policyName=
|
||||
@{policyIds} Create List ${EMPTY}
|
||||
FOR ${n} IN RANGE ${totalNum}
|
||||
log ${n+1}
|
||||
Insert Into List ${policyIds} ${n+1} ${response['data']['list'][${n+1}]['policyId']}
|
||||
END
|
||||
Remove From List ${policyIds} 0
|
||||
log ${policyIds}
|
||||
${length}= Get Length ${policyIds}
|
||||
${policyIds} Create List {"policyType":"pxy_manipulation","policyIds":${policyIds}}
|
||||
log ${policyIds}
|
||||
sleep 5
|
||||
|
||||
Policy-Export-v1-chooseId_tsg_security
|
||||
[Tags] export chooseId tsg_security
|
||||
Comment 导 出安全json
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportPolicy tsg_security 961350,961351 ${EMPTY}
|
||||
WriteFile downloads security_id.json ${response}
|
||||
sleep 5
|
||||
|
||||
Policy-Export-v1-choosePage_tsg_security
|
||||
[Tags] export choosePage tsg_security
|
||||
Comment 导 出安全json
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${rescode} ${response} QueryPolicy ?pageSize=4&pageNo=1&policyType=tsg_security&policyName=
|
||||
@{exportIds} Create List ${EMPTY}
|
||||
FOR ${n} IN RANGE 4
|
||||
log ${n+1}
|
||||
Insert Into List ${exportIds} ${n+1} ${response['data']['list'][${n+1}]['policyId']}
|
||||
END
|
||||
Remove From List ${exportIds} 0
|
||||
log ${exportIds}
|
||||
${exportIds1} Set Variable ${EMPTY}
|
||||
:FOR ${element} IN @{exportIds}
|
||||
\ log ${element}
|
||||
\ ${exportIds1} Catenate SEPARATOR=, ${element} ${exportIds1}
|
||||
${exportIds1}= Get Substring ${exportIds1} 0 -1
|
||||
${response} ExportPolicy tsg_security ${exportIds1} ${EMPTY}
|
||||
WriteFile downloads security_page.json ${response}
|
||||
sleep 5
|
||||
|
||||
Policy-Export-v1-all_tsg_security
|
||||
Comment 导 出安全json
|
||||
[Tags] export all tsg_security
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportPolicy tsg_security ${EMPTY} ${EMPTY}
|
||||
WriteFile downloads security_all.json ${response}
|
||||
sleep 5
|
||||
|
||||
Policy-Export-v1-chooseId_pxy_manipulation
|
||||
Comment 导 出代理json
|
||||
[Tags] export chooseId pxy_manipulation
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportPolicy pxy_manipulation 961403,961404 ${EMPTY}
|
||||
WriteFile downloads proxy_id.json ${response}
|
||||
sleep 5
|
||||
|
||||
Policy-Export-v1-choosePage_pxy_manipulation
|
||||
[Tags] export choosePage pxy_manipulation
|
||||
Comment 导 出代理json
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${rescode} ${response} QueryPolicy ?pageSize=4&pageNo=1&policyType=pxy_manipulation&policyName=
|
||||
@{exportIds} Create List ${EMPTY}
|
||||
FOR ${n} IN RANGE 4
|
||||
log ${n+1}
|
||||
Insert Into List ${exportIds} ${n+1} ${response['data']['list'][${n}]['policyId']}
|
||||
END
|
||||
Remove From List ${exportIds} 0
|
||||
log ${exportIds}
|
||||
${exportIds1} Set Variable ${EMPTY}
|
||||
:FOR ${element} IN @{exportIds}
|
||||
\ log ${element}
|
||||
\ ${exportIds1} Catenate SEPARATOR=, ${element} ${exportIds1}
|
||||
${exportIds1}= Get Substring ${exportIds1} 0 -1
|
||||
${response} ExportPolicy pxy_manipulation ${exportIds1} ${EMPTY}
|
||||
WriteFile downloads proxy_page.json ${response}
|
||||
sleep 5
|
||||
|
||||
Policy-Export-v1-all_pxy_manipulation
|
||||
Comment 导 出代理json
|
||||
[Tags] export all pxy_manipulation
|
||||
${objectIds} Create List
|
||||
${policyIds} Set Variable ${EMPTY}
|
||||
${response} ExportPolicy pxy_manipulation ${EMPTY} ${EMPTY}
|
||||
WriteFile downloads proxy_all.json ${response}
|
||||
sleep 5
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user