Community
    • Categories
    • Recent
    • Popular
    • Users
    • Search
    • Register
    • Login

    Ports zu logischen Ports zuweisen - API

    Scheduled Pinned Locked Moved Betrieb
    3 Posts 2 Posters 524 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      daffodil
      last edited by daffodil

      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

      i-doit 1.10.1 open

      F 1 Reply Last reply Reply Quote 0
      • F Offline
        franknagel @daffodil
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • D Offline
          daffodil
          last edited by

          Danke, funktioniert.
          Ich wusste ich habe da einen Denkfehler.

          i-doit 1.10.1 open

          1 Reply Last reply Reply Quote 0
          • First post
            Last post