Updated SetDocumentToDevice to SetDocumentToItem and added a parameter to set itemType
This commit is contained in:
@@ -160,12 +160,12 @@ class GLPIAPI:
|
||||
files = {file: fileData}
|
||||
return requests.post(self.Server+"/apirest.php/Document/", headers=headers, data=data, files=files)
|
||||
|
||||
def SetDocumentToDevice(self, deviceID, documentID):
|
||||
def SetDocumentToItem(self, itemID, itemType, documentID):
|
||||
body = {
|
||||
"input": {
|
||||
"documents_id": documentID,
|
||||
"items_id": deviceID,
|
||||
"itemtype": "Computer"
|
||||
"items_id": itemID,
|
||||
"itemtype": itemType
|
||||
}
|
||||
}
|
||||
return requests.post(self.Server+"/apirest.php/Document/"+str(documentID)+"/Document_Item", headers=self.Headers, json=body)
|
||||
|
||||
Reference in New Issue
Block a user