Ports zu logischen Ports zuweisen - API
-
Hallo,
ich benötige Hilfestellung bei der Zuweisung von Ports zu einem logischen Port über die API. Irgendwie möchte mir das nicht gelingen. Weise ich die Ports manuell übers Web zu, funktioniert alles wie erwartet.
Lasse ich mir die manuell zugewiesenen Ports über die API ausgeben bekomme ich folgenden Datensatz:{ "jsonrpc": "2.0", "result": [ { "id": "6", "objID": "4111", "title": "Po1", "net": null, "mac": "aa:bb:cc:dd:ee:ff", "port_type": null, "ports": [ { "id": 1964, "title": "Te1/0/1", "type": "C__CMDB__SUBCAT__NETWORK_PORT" }, { "id": 1965, "title": "Te1/0/2", "type": "C__CMDB__SUBCAT__NETWORK_PORT" } ], "parent": [ ], "standard": null, "active": { "value": "1", "title": "Yes" }, "addresses": [ ], "assigned_connector": [ ], "description": "..." } ], "id": null }Meine Versuche die Ports dann über die API zuzuweisen scheitern allerdings allesamt und entfernen einfach die manuell zugewiesenen Ports. Die Auflistung der API_properties liefert zu den logischen Ports aktuell die folgende Beschreibung:
Logische Ports (C__CMDB__SUBCAT__NETWORK_INTERFACE_L)Feldname Key Datentyp Referenz Optional Bezeichnung title text Ja Netz(e) net int Ja MAC mac text Ja Typ port_type int isys_netx_ifacel_type__id Ja Zuweisung ports int Ja Eltern-Port parent int isys_catg_log_port_list__id Ja Standard standard int isys_netp_ifacel_standard__id Ja Aktiv active int Ja Hostadresse addresses int Ja Verbunden mit Anschluss assigned_connector int Ja Beschreibung description text_area Ja Mein Ansatz sieht aktuell so aus:
{ "jsonrpc": "2.0", "method": "cmdb.category.update", "params": { "apikey": "XYZ", "objID": "4111", "category": "C__CMDB__SUBCAT__NETWORK_INTERFACE_L", "data": { "id": "6", "ports": [ { "id": 1964 }, { "id": 1965 } ] } } }Das ganze mit und ohne " beim id Wert.
Kann mich jemand in die richtige Richtung schubsen?Grüße
Simon -
Ich würde mal
{ "jsonrpc": "2.0", "method": "cmdb.category.update", "params": { "apikey": "XYZ", "objID": "4111", "category": "C__CMDB__SUBCAT__NETWORK_INTERFACE_L", "data": { "id": "6", "ports": [1964, 1965] } } }versuchen
-
Danke, funktioniert.
Ich wusste ich habe da einen Denkfehler.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login