Updated UpdateUser to UpdateItemUser and added a parameter to set itemType
Some checks failed
Build python package / Build (push) Has been cancelled

This commit is contained in:
2026-03-18 20:22:56 +01:00
parent 11b2b61aac
commit 02bee714b5

View File

@@ -207,15 +207,15 @@ class GLPIAPI:
uri = f"{self.Server}/apirest.php/Computer/"
return requests.put(uri, headers=self.Headers, json=body)
def UpdateUser(self, deviceid, username):
def UpdateItemUser(self, itemID, itemType, username):
body = {
"input" : {
"id" : deviceid,
"id" : itemID,
"users_id" : username
}
}
uri = f"{self.Server}/apirest.php/Computer/"
uri = f"{self.Server}/apirest.php/itemType/"
return requests.put(uri, headers=self.Headers, json=body)
def SetCustomField(self, itemType, containerName, containerID, itemId, fieldName, data):