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

    API - Net zone anlegen - wo ist der Fehler

    Scheduled Pinned Locked Moved Entwicklung
    2 Posts 1 Posters 368 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.
    • M Offline
      mamawe
      last edited by

      Hallo,

      ich versuche, über das API zu einem bestehenden Layer-3-Netz Zonen hinzuzufügen.

      Wenn ich die Zone im UI anlege, sieht sie im API anschließend so aus:

      {
          "id": "15320",
          "objID": "15314",
          "zone": {
              "id": "15314",
              "title": "routing",
              "sysid": "SYSID_1638197798",
              "type": "C__OBJTYPE__NET_ZONE",
              "type_title": "Net zone"
          },
          "range_from": "10.100.81.252",
          "range_from_long": "174346748",
          "range_to": "10.100.81.254",
          "range_to_long": "174346750",
          "description": "Beschreibung"
      }
      

      Wenn ich versuche eine Zone im API anzulegen, sind "objID" und "zone" immer null. Ich verwende folgenden API-Aufruf:

      {
        "method": "cmdb.category.save",
        "params": {
          "object": 20132,
          "category": "C__CATS__NET_ZONE",
          "data": {
            "objID": "15314",
            "range_from": "10.100.81.242",
            "range_to":   "10.100.81.244",
            "description": "Beschreibung"
          }
        }
      }
      

      Damit bekomme ich folgende Zone:

      {
          "id": "15321",
          "objID": null,
          "zone": null,
          "range_from": "10.100.81.242",
          "range_from_long": "174346748",
          "range_to": "10.100.81.244",
          "range_to_long": "174346750",
          "description": "Beschreibung"
      }
      

      Was mache ich falsch?

      Mit freundlichem Gruß,
      Mathias

      M 1 Reply Last reply Reply Quote 0
      • M Offline
        mamawe @mamawe
        last edited by

        Ich hab es selbst herausbekommen, hat nur ein paar Tage gedauert.

        {
          "method": "cmdb.category.save",
          "params": {
            "object": 20132,
            "category": "C__CATS__NET_ZONE",
            "data": {
              "zone": "15314",
              "range_from": "10.100.81.242",
              "range_to":   "10.100.81.244",
              "description": "Beschreibung"
            }
          }
        }
        

        Das Attribut heißt "zone", nicht "objID"!

        Mit freundlichem Gruß,
        Mathias

        1 Reply Last reply Reply Quote 0

        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
        • First post
          Last post