Merge branch 'main' into dev
This commit is contained in:
@ -82,6 +82,17 @@ class GLPIAPI:
|
||||
}
|
||||
uri = f"{self.Server}/apirest.php/Computer/"
|
||||
return requests.put(uri, headers=self.Headers, json=body)
|
||||
|
||||
def UpdateUser(self, deviceid, username):
|
||||
|
||||
body = {
|
||||
"input" : {
|
||||
"id" : deviceid,
|
||||
"users_id" : username
|
||||
}
|
||||
}
|
||||
uri = f"{self.Server}/apirest.php/Computer/"
|
||||
return requests.put(uri, headers=self.Headers, json=body)
|
||||
|
||||
def CreateInventoryForAirwatchDevice(self, device, deviceName, apps=None):
|
||||
platforms = {
|
||||
|
||||
@ -168,7 +168,10 @@ class AirwatchUser:
|
||||
self.Group = user["Group"]
|
||||
self.GroupId = user["LocationGroupId"]
|
||||
self.OrgUuid = user["OrganizationGroupUuid"]
|
||||
self.DeviceCount = int(user["EnrolledDevicesCount"])
|
||||
if(user["EnrolledDevicesCount"] != ''):
|
||||
self.DeviceCount = int(user["EnrolledDevicesCount"])
|
||||
else:
|
||||
self.DeviceCount = 0
|
||||
|
||||
class AirwatchDevice:
|
||||
|
||||
@ -182,8 +185,12 @@ class AirwatchDevice:
|
||||
self.GroupId = device["LocationGroupId"]["Id"]["Value"]
|
||||
self.Group = device["LocationGroupName"]
|
||||
self.GroupUuid = device["LocationGroupId"]["Uuid"]
|
||||
self.UserId = device["UserId"]["Id"]["Value"]
|
||||
self.User = device["UserName"]
|
||||
if(device["UserId"].get("Id") != None):
|
||||
self.UserId = device["UserId"]["Id"]["Value"]
|
||||
self.User = device["UserName"]
|
||||
else:
|
||||
self.UserId = None
|
||||
self.User = None
|
||||
self.UserEmail = device["UserEmailAddress"]
|
||||
self.PlatformId = device["PlatformId"]["Id"]["Value"]
|
||||
self.Platform = device["Platform"]
|
||||
|
||||
Reference in New Issue
Block a user