You are not logged in.
Pages: 1
Hello together,
my GLPI Agent Proxy runs and save the computer as a json file in a directory.
I want to manually with python update this computer which link i had to use ?
I am successfully login the api.
Here the beginning of my json file
----------------------------------
{
"action": "inventory",
"content": {
"accesslog": {
"logdate": "2023-12-07 08:34:34"
},
"antivirus": [
{
"base_version": "1.4
---------------------------------------------
Here my python code.
with open(self.directory_path + "/" + file_name, "r") as file:
json_computer = json.load(file)
json_data = {
'input' : json_computer
}
response = requests.post(self.link_server + "Computer", headers=self.headers, json=json_data)
if response.status_code == 201:
print("Data sent successfully.")
print(f"Error: {response.status_code} - {response.text}")
else:
print(f"Error: {response.status_code} - {response.text}")
------------------------------
I get the error 200 ? but my computer issent up to date
lg Joachim
Offline
You cannot update computer data through the API using the GLPI Agent inventory file.
Inventory files must be submitted to "/front/inventory.php".
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Thank you very much for the reply.
okay is there a another method to update the inventory over a another method to update with the local inventory file of the proxy ?
Thank you very much.
Offline
Pages: 1