This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dongxiaoyan-tsg-autotest/01-TestCase/tsg_bfapi/api_log/LogStatistics-hijack_srcip_location.robot

104 lines
4.8 KiB
Plaintext
Raw Permalink Normal View History

2020-05-06 10:08:06 +08:00
*** Settings ***
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
Resource ../../../03-Variable/BifangApiVariable.txt
2020-05-06 10:08:06 +08:00
Library DateTime
*** Test Cases ***
Statistics-hijack_srcip_location-00001
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable hijack_srcip_location
#请求地址 例如:/${version}/report/domain/recommend
${url} set variable /${version}/report/hijack_srcip_location
2020-05-06 10:08:06 +08:00
#开始时间格式Y-M-D h:i:s
2020-05-26 19:54:19 +08:00
${startTime} set variable 2020-04-26 16:40:01
2020-05-06 10:08:06 +08:00
#结束时间格式Y-M-D h:i:s
2020-05-26 19:54:19 +08:00
${endTime} set variable 2020-05-26 10:57:47
2020-05-06 10:08:06 +08:00
#策略ID
${policy_id} set variable 0
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_id=${policy_id}
Statistics-hijack_srcip_location-00002
#最近一小时
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable hijack_srcip_location
#请求地址 例如:/${version}/report/domain/recommend
${url} set variable /${version}/report/hijack_srcip_location
2020-05-06 10:08:06 +08:00
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -01:00:00
${startTime} Get Substring ${startTime} \ -4
#策略ID
${policy_id} set variable 0
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_id=${policy_id}
Statistics-hijack_srcip_location-00003
#最近一天
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable hijack_srcip_location
#请求地址 例如:/${version}/report/domain/recommend
${url} set variable /${version}/report/hijack_srcip_location
2020-05-06 10:08:06 +08:00
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#结束时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -1 days
${startTime} Get Substring ${startTime} \ -4
#策略ID
${policy_id} set variable 0
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_id=${policy_id}
Statistics-hijack_srcip_location-00004
#最近一周
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable hijack_srcip_location
#请求地址 例如:/${version}/report/domain/recommend
${url} set variable /${version}/report/hijack_srcip_location
2020-05-06 10:08:06 +08:00
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -7 days
${startTime} Get Substring ${startTime} \ -4
#策略ID
${policy_id} set variable 0
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_id=${policy_id}
Statistics-hijack_srcip_location-00005
#最近一个月30天
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable hijack_srcip_location
#请求地址 例如:/${version}/report/domain/recommend
${url} set variable /${version}/report/hijack_srcip_location
2020-05-06 10:08:06 +08:00
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -30 days
${startTime} Get Substring ${startTime} \ -4
#策略ID
${policy_id} set variable 0
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_id=${policy_id}
Statistics-hijack_srcip_location-00006
#最近一年365天
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable hijack_srcip_location
#请求地址 例如:/${version}/report/domain/recommend
${url} set variable /${version}/report/hijack_srcip_location
2020-05-06 10:08:06 +08:00
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -365 days
${startTime} Get Substring ${startTime} \ -4
#策略ID
${policy_id} set variable 0
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_id=${policy_id}