1、添加时间工具关键字
2、调整部分错误
This commit is contained in:
15
02-Keyword/tsg_bfapi/CommonUtil.robot
Normal file
15
02-Keyword/tsg_bfapi/CommonUtil.robot
Normal file
@@ -0,0 +1,15 @@
|
||||
*** Settings ***
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Library DateTime
|
||||
Library String
|
||||
#Library Collections
|
||||
#Library RequestsLibrary
|
||||
|
||||
*** Keywords ***
|
||||
GetLast24HoursStartAndEndTime
|
||||
[Documentation]
|
||||
... 获取当前时间往前一天的开始结束时间,时间格式为:YYY-MM-DD H24:mm:ss
|
||||
${endtime} Get Time
|
||||
${starttime}= Add Time To Date ${endtime} -1 days
|
||||
${starttime} Get Substring ${starttime} 0 19
|
||||
[Return] ${starttime} ${endtime}
|
||||
@@ -244,7 +244,7 @@ Recommend
|
||||
Trend
|
||||
[Arguments] ${url} ${startTime} ${endTime} ${logType} ${policyId}
|
||||
${header} Create Dictionary Content-Type=application/x-www-form-urlencoded Authorization=${token}
|
||||
Create Session api http://${host}:${port}/${version} headers=${header}
|
||||
Create Session api http://${host}:${port} headers=${header}
|
||||
${remoteResponse} Get Request api ${url}?policyId=${policyId}&logType=${logType}&startTime=${startTime}&endTime=${endTime} headers=${header}
|
||||
${response} to json ${remoteResponse.content}
|
||||
Should Be Equal As Strings ${remoteResponse.status_code} 200
|
||||
|
||||
@@ -7,7 +7,7 @@ Resource ../tsg_bfapi/ApiRequest.robot
|
||||
|
||||
*** Keywords ***
|
||||
schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${responsedata} Get-Request /v1/log/schema?logType=active_defence_event_log
|
||||
${responsedata1} Get From Dictionary ${responsedata} data
|
||||
${responsefields} Get From Dictionary ${responsedata1} fields
|
||||
[Return] ${responsedata}
|
||||
|
||||
Reference in New Issue
Block a user