feat:(日志服务)支持日志总数查询
This commit is contained in:
@@ -521,21 +521,25 @@ Policy-log-v1-00026
|
|||||||
${objectIds} Set Variable ${EMPTY}
|
${objectIds} Set Variable ${EMPTY}
|
||||||
Comment 查询schema
|
Comment 查询schema
|
||||||
${schema_query} ${schema_type} ${default_columns} ${fields} GetLogSchema security_event_log
|
${schema_query} ${schema_type} ${default_columns} ${fields} GetLogSchema security_event_log
|
||||||
Comment 处理schema,构造查询条件
|
Comment 处理schema,构造查询条件
|
||||||
${queryFieldList} Create List
|
|
||||||
FOR ${field} IN @{fields}
|
|
||||||
log ${field}
|
|
||||||
${return} ${doc} Run Keyword And Ignore Error Get From Dictionary ${field} doc
|
|
||||||
Continue For Loop If "${return}"=="FAIL"
|
|
||||||
${return} ${allow_query} Run Keyword And Ignore Error Get From Dictionary ${doc} allow_query
|
|
||||||
Continue For Loop If "${allow_query}"=="false" or "${return}"=="FAIL"
|
|
||||||
${fieldDict} Create Dictionary name=${field['name']} type=${field['type']}
|
|
||||||
Append To List ${queryFieldList} ${fieldDict}
|
|
||||||
END
|
|
||||||
${params} Create Dictionary pageSize=${10} logType=security_event_log
|
${params} Create Dictionary pageSize=${10} logType=security_event_log
|
||||||
... start_common_recv_time=2020-06-01 00:00:00
|
... start_common_recv_time=2020-06-01 00:00:00
|
||||||
... end_common_recv_time=2020-06-24 00:00:00
|
... end_common_recv_time=2020-06-24 00:00:00
|
||||||
... fields=common_log_id|long,http_url|string,common_client_ip|string,common_client_port|int,common_server_ip|string,common_server_port|int
|
... fields=common_log_id|long,http_url|string,common_client_ip|string,common_client_port|int,common_server_ip|string,common_server_port|int
|
||||||
... conditions=common_server_port|int|in|${80}^${8080}
|
... conditions=common_server_port|int|in|${80}^${8080}
|
||||||
... orderBy=common_server_ip|true
|
... orderBy=common_server_ip|true
|
||||||
${resData} QueryLogList ${params}
|
... common_log_ids=162273027957354498
|
||||||
|
${resData} QueryLogs ${params} list
|
||||||
|
Policy-log-v1-00027
|
||||||
|
${objectIds} Set Variable ${EMPTY}
|
||||||
|
Comment 查询schema
|
||||||
|
${schema_query} ${schema_type} ${default_columns} ${fields} GetLogSchema security_event_log
|
||||||
|
Comment 处理schema,构造查询条件
|
||||||
|
${params} Create Dictionary pageSize=${10} logType=security_event_log
|
||||||
|
... start_common_recv_time=2020-06-01 00:00:00
|
||||||
|
... end_common_recv_time=2020-06-24 00:00:00
|
||||||
|
... fields=common_log_id|long,http_url|string,common_client_ip|string,common_client_port|int,common_server_ip|string,common_server_port|int
|
||||||
|
... conditions=common_server_port|int|in|${80}^${8080}
|
||||||
|
... orderBy=common_server_ip|true
|
||||||
|
... common_log_ids=162273027957354498
|
||||||
|
${resData} QueryLogs ${params} count
|
||||||
@@ -22,7 +22,7 @@ GetLogSchema
|
|||||||
${schema_type} Get From Dictionary ${resData['doc']} schema_type
|
${schema_type} Get From Dictionary ${resData['doc']} schema_type
|
||||||
${default_columns} Get From Dictionary ${resData['doc']} default_columns
|
${default_columns} Get From Dictionary ${resData['doc']} default_columns
|
||||||
[Return] ${schema_query} ${schema_type} ${default_columns} ${resData['fields']}
|
[Return] ${schema_query} ${schema_type} ${default_columns} ${resData['fields']}
|
||||||
QueryLogList
|
QueryLogs
|
||||||
[Documentation]
|
[Documentation]
|
||||||
... 日志列表查询
|
... 日志列表查询
|
||||||
... params字典列表
|
... params字典列表
|
||||||
@@ -31,7 +31,7 @@ QueryLogList
|
|||||||
... fields=name1|type,name2|type
|
... fields=name1|type,name2|type
|
||||||
... conditions=field1|type|symbol|value1^value2,field2|type|symbol|value3^value4
|
... conditions=field1|type|symbol|value1^value2,field2|type|symbol|value3^value4
|
||||||
... value1^value2是使用^分隔的字符串解析后为[value1,value2]格式的数组
|
... value1^value2是使用^分隔的字符串解析后为[value1,value2]格式的数组
|
||||||
[Arguments] ${params}
|
[Arguments] ${params} ${path}
|
||||||
Should Not Be Empty ${params}
|
Should Not Be Empty ${params}
|
||||||
${return} ${pageSize} Run Keyword And Ignore Error Get From Dictionary ${params} pageSize
|
${return} ${pageSize} Run Keyword And Ignore Error Get From Dictionary ${params} pageSize
|
||||||
Run Keyword If "${return}"=="PASS" and "${pageSize}"=="${EMPTY}" Remove From Dictionary ${params} pageSize
|
Run Keyword If "${return}"=="PASS" and "${pageSize}"=="${EMPTY}" Remove From Dictionary ${params} pageSize
|
||||||
@@ -42,14 +42,16 @@ QueryLogList
|
|||||||
#处理排序
|
#处理排序
|
||||||
${return} ${orderBy} Run Keyword And Ignore Error Get From Dictionary ${params} orderBy
|
${return} ${orderBy} Run Keyword And Ignore Error Get From Dictionary ${params} orderBy
|
||||||
${orderBy} Run Keyword If "${return}"=="FAIL" or "${orderBy}"=="${EMPTY}" Create List
|
${orderBy} Run Keyword If "${return}"=="FAIL" or "${orderBy}"=="${EMPTY}" Create List
|
||||||
... ELSE ManageOrderBy ${orderBy}
|
... ELSE IF "${path}"=="list" ManageOrderBy ${orderBy} ELSE IF "${path}"=="count"
|
||||||
Set To Dictionary ${params} orderBy=${orderBy}
|
... Set Variable ${orderBy}
|
||||||
|
Run Keyword If "${path}"=="list" Set To Dictionary ${params} orderBy=${orderBy}
|
||||||
${fields} Get From Dictionary ${params} fields
|
Run Keyword If "${path}"=="count" Remove From Dictionary ${params} orderBy
|
||||||
Should Not Be Empty ${fields}
|
${return} ${fields} Run Keyword And Ignore Error Get From Dictionary ${params} fields
|
||||||
${fields} ManageFields ${fields}
|
Run Keyword If "${path}"=="list" Should Not Be Empty ${fields}
|
||||||
Set To Dictionary ${params} fields=${fields}
|
${fields} Run Keyword If "${path}"=="list" ManageFields ${fields}
|
||||||
|
... ELSE Create List
|
||||||
|
Run Keyword If "${path}"=="list" Set To Dictionary ${params} fields=${fields}
|
||||||
|
Run Keyword If "${path}"=="count" Remove From Dictionary ${params} fields
|
||||||
${start_common_recv_time} Get From Dictionary ${params} start_common_recv_time
|
${start_common_recv_time} Get From Dictionary ${params} start_common_recv_time
|
||||||
Should Not Be Empty ${start_common_recv_time}
|
Should Not Be Empty ${start_common_recv_time}
|
||||||
${end_common_recv_time} Get From Dictionary ${params} end_common_recv_time
|
${end_common_recv_time} Get From Dictionary ${params} end_common_recv_time
|
||||||
@@ -62,7 +64,7 @@ QueryLogList
|
|||||||
... ELSE Create List
|
... ELSE Create List
|
||||||
Set To Dictionary ${params} conditions=${conditions}
|
Set To Dictionary ${params} conditions=${conditions}
|
||||||
${bodyJson} json.Dumps ${params} ensure_ascii=False
|
${bodyJson} json.Dumps ${params} ensure_ascii=False
|
||||||
${response} BasePostRequestForV2 ${logUrl}/list ${bodyJson} ${version}
|
${response} BasePostRequestForV2 ${logUrl}/${path} ${bodyJson} ${version}
|
||||||
${rescode} Set Variable ${response['code']}
|
${rescode} Set Variable ${response['code']}
|
||||||
Should Be Equal As Integers ${rescode} 200
|
Should Be Equal As Integers ${rescode} 200
|
||||||
${resData} Set Variable ${response['data']}
|
${resData} Set Variable ${response['data']}
|
||||||
|
|||||||
Reference in New Issue
Block a user