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/predefine_stat/PolicyHitCountTrendQuery.robot

24 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

*** Settings ***
Library OperatingSystem
Library DateTime
Library String
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Library E:/Program Files (x86)/Python37-32/Lib/site-packages/GetTimeLibrary/GetTime.py
*** Test Cases ***
PolicyHitCountTrendQuery-001
#通过策略查询接口得到policy的id安全策略
${response} BaseGetRequestOK /v2/policy/compile pageSize=20&pageNo=1&policyType=tsg_security&policyName=
${policy_id} Set Variable ${response}[data][list][1][policyId]
#结束时间格式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
#通过policy的id查询策略命中计数趋势
${response1} BaseGetRequestOK /v1/report/policyevent/hit/trend policyId=77703&startTime=${startTime}&endTime=${endTime}&logType=security_event_hits_log