You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2023-05-17 22:18:01

ak
Member
Registered: 2023-05-17
Posts: 1

adding components to computer using api

Hello,

I have a problem regarding the use of the GLPI API.

I can successfully add a new computer to the GLPI system using HTTP requests (endpoint: /computer), and I can also add a new processor (endpoint: /processor).

GLPI uses a separate table in the SQL database to associate these components.

Is there an API endpoint or any other way to connect components to a computer via the API?

Offline

#2 2023-05-18 13:19:06

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,813
Website

Re: adding components to computer using api

You can use "/Item_DeviceProcessor" and manually include the "itemtype": "Computer" and "items_id": ID properties.
You can also access them from "/Computer/ID/Item_DeviceProcessor" which can get just the ones associated with the specified computer.
However, if you try adding a processor from that endpoint too, you still need to manually add the itemtype and items_id properties. It isn't smart enough to automatically set them.


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

Board footer

Powered by FluxBB