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 2021-07-27 13:40:14

anyqov
Member
Registered: 2019-04-29
Posts: 20

Get information about Fusioninventory NetworkPorts using the API

Hello!
How do I get information from the "glpi_plugin_fusioninventory_networkports" table using the GLPI API?
"http://glpi_address/glpi/apirest.php/NetworkEquipment/1/NetworkPort/" gives information without Fusioninventory.

> SELECT * FROM `glpi_plugin_fusioninventory_networkports` LIMIT 1;
+----+-----------------+-------+---------+------------------+--------------------+--------------+------------+------------+-------------+-------------+----------+------+---------+---------+------------+-------+--------+
| id | networkports_id | ifmtu | ifspeed  |  ifinternalstatus | ifconnectionstatus| iflastchange | ifinoctets  |  ifinerrors  | ifoutoctets  | ifouterrors |  ifstatus  | mac  |  ifdescr |  ifalias  | portduplex | trunk | lastup |
+----+-----------------+-------+---------+------------------+--------------------+--------------+------------+------------+-------------+-------------+----------+------+---------+---------+------------+-------+--------+
|  1 |                    28 |       0 |          0 | NULL                |                        0 | NULL           |              0 |             0 |               0 |               0 | NULL      | NULL | NULL    | NULL    | NULL        |       0 | NULL   |
+----+-----------------+-------+---------+------------------+--------------------+--------------+------------+------------+-------------+-------------+----------+------+---------+---------+------------+-------+--------+


API request http://glpi_address/glpi/apirest.php/NetworkEquipment/1/NetworkPort/:
[
    {
        "id": 28,
        "items_id": 1,
        "itemtype": "NetworkEquipment",
        "entities_id": 0,
        "is_recursive": 0,
        "logical_number": 0,
        "name": "management",
        "instantiation_type": "NetworkPortAggregate",
        "mac": "xx:xx:xx:xx:xx:xx",
        "comment": null,
        "is_deleted": 0,
        "is_dynamic": 0,
        "date_mod": "2021-07-21 20:28:30",
        "date_creation": "2021-04-20 23:46:37",
        "links": [
            {
                "rel": "NetworkEquipment",
                "href": "http://glpi_address/glpi/apirest.php/NetworkEquipment/1"
            },
            {
                "rel": "Entity",
                "href": "http://glpi_address/glpi/apirest.php/Entity/0"
            }
        ]
    },
    ...
]

API request http://glpi_address/glpi/apirest.php/PluginFusioninventoryNetworkPort/28/:
[
    "ERROR_RIGHT_MISSING",
    "You don't have permission to perform this action."
]

Last edited by anyqov (2021-07-27 22:31:50)

Offline

Board footer

Powered by FluxBB