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 2022-11-21 03:29:01

wesney.silva@nava.com.br
Member
Registered: 2022-11-21
Posts: 4

Create Network device using API

Guys,

I'm trying to create network devices through API, but it always returns that the type of device I'm registering does not exist. Has anyone done this task before and could you share an example please?

Offline

#2 2022-11-21 12:39:22

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

Re: Create Network device using API

Please provide the API request you are trying to make.


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

#3 2022-11-21 14:20:15

wesney.silva@nava.com.br
Member
Registered: 2022-11-21
Posts: 4

Re: Create Network device using API

special variables:
function variables:
body: '{"input": {  "name": "xxx" }}'
headers: {'user-agent': 'glpi-sdk-python-0.4.0', 'Accept-Encoding': 'gzip, deflate', 'accept': 'application/json', 'Connection': 'keep-alive', 'Session-Token': 'xxxx', 'App-Token': 'xxxxxx', 'Content-Length': '40'}
hooks: {'response': []}
method: 'POST'
path_url: '/apirest.php/networkequipament'
url: 'https://a{dot}b{dot}c/apirest.php/networkequipament'
_body_position: None
_cookies: <RequestsCookieJar[]>
_encode_files: <function RequestEncodingMixin._encode_files at 0x0000021B8F702AC0>
_encode_params: <function RequestEncodingMixin._encode_params at 0x0000021B8F702A20>
_get_idna_encoded_host: <function PreparedRequest._get_idna_encoded_host at 0x0000021B8F7031A0>

Offline

#4 2022-11-21 14:23:51

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

Re: Create Network device using API

The item type must be "NetworkEquipment" to exactly match the internal class name used for network equipment assets.


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

#5 2022-11-21 15:57:41

wesney.silva@nava.com.br
Member
Registered: 2022-11-21
Posts: 4

Re: Create Network device using API

Thanks so much

Offline

Board footer

Powered by FluxBB