testing
This commit is contained in:
@@ -3,7 +3,7 @@ import requests
|
||||
import json
|
||||
import os
|
||||
|
||||
def devicehistory(url):
|
||||
def devicehistory(url, outputjson: bool):
|
||||
endpoint = url + '/v1/getexechistory'
|
||||
print("\n")
|
||||
print("1. Today")
|
||||
@@ -43,7 +43,12 @@ def devicehistory(url):
|
||||
}
|
||||
|
||||
response = requests.request("POST", endpoint, headers=headers, data=payload, verify=False)
|
||||
|
||||
if outputjson == True:
|
||||
return response
|
||||
|
||||
parse_text = json.loads(response.text)
|
||||
|
||||
for block in parse_text['response']['exechistory']:
|
||||
print(f"Command: {block['commandline']}")
|
||||
print(f"Date: {block['datetime']}")
|
||||
|
||||
Reference in New Issue
Block a user