python-krbcontext
python-krbcontext copied to clipboard
How do I use krbcontext to call the api of the spark task and get the execution time of the task?
when I use kerberos,these code need adjust,pls how to do it,Thanks guys。
请求url获取相应的json
async def get_json_from_url(url): async with aiohttp.ClientSession() as session: try: async with session.get(url, timeout=10) as resp: result = await resp.json() return result except Exception as e: print(f"连接报错:{e}") return
start = de_format_gmt_date(start_time) end = de_format_gmt_date(end_time) url = f"http://XXXX:18088/api/v1/applications?minDate={start}&maxDate={end}" resource_list = await get_json_from_url(url)