Can get a single device enrollment status

This commit is contained in:
2024-07-03 22:05:19 +02:00
parent e97ef6fe45
commit 8674d25512
7 changed files with 91 additions and 8 deletions

View File

@ -17,6 +17,20 @@ def get_root_ca() -> str:
return res.text
def device_enrollment_status() -> str:
"""
Get current device enrollment status
"""
res = requests.get(
f"{args.secure_origin}/devices_api/mgmt/enrollment_status?id={args.dev_id}",
verify=args.root_ca_path,
)
if res.status_code < 200 or res.status_code > 299:
print(res.text)
raise Exception(f"Failed to check enrollment with status {res.status_code}")
return res.json()["status"]
def device_info():
"""
Get device information to return with enrollment and sync requests