import requests from requests.auth import HTTPBasicAuth from schemas.log_alert import OpenobserveQuery def get_log(): url = 'http://192.168.1.7:5080/api/default/_search' username = 'njcxx0822@163.com' password = '19940822Cxx' response = requests.post( url, headers={ 'accept': 'application/json', 'Content-Type': 'application/json' }, json={ "query": OpenobserveQuery( start_time=1760773184953420, end_time=1760773189953431 ).model_dump() }, auth=HTTPBasicAuth(username, password) ) print(response)