You are not logged in.
Hello,
I managed to add Computers to GLPI via the API now I had the question if I can add an Operatingsystem while adding the PC`s.
I found some post about sql and found that this link xxx/apirest.php/Computer/1/OperatingSystem outputs the systems but I dont think I am any closer to finding the solution.
Some help please .
Kind regards
SomeDude
Offline
Tried this
{"input":
{
"name": "TESTTET0",
"itemtype": "Computer",
"operatingsystems_id": "1",
"links": [{
"rel": "OperatingSystem",
"href": "pathtoglpi/apirest.php/OperatingsSystem/1"
}]
}
}
also without the links and also with "Operatingsystems_id": "Windows 11" and with "operatingsystems_id": 1
Offline
That is not the correct URL or JSON body to associate a Computer and OS. In GLPI, Operating System is a standalone item with just a name, comment, and creation/modification dates. Item_OperatingSystem is the actual link between assets and OS.
POST /apirest.php/Item_OperatingSystem
Body:
{
"input": {
"itemtype": "Computer",
"items_id": 1,
"operatingsystems_id": 1
}
}
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
Offline