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

    Lesen / setzen von Werten in Dropdown Menus via API

    Scheduled Pinned Locked Moved Entwicklung
    3 Posts 2 Posters 437 Views 2 Watching
    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.
    • U Offline
      uhe
      last edited by

      Hallo,

      wie kann man Werte in in Dropdown Menus vorgegeben sind lesen bzw. per API Call setzen?
      Ein konkretes Beispiel wäre bei anlegen eines neuen Switches in der Kategorie "Model" das Feld "Manufacturer". Hier versuche ich im Demo Portal HP als Hersteller auszuwählen, aber egal was ich versuche, hinterher wird "Not specified" angezeigt.

      Der letzte API Call den ich versucht habe wäre dieser hier:

      {
          "id": 1,
          "version": "2.0",
          "method": "cmdb.object.create",
          "params": {
              "apikey": "c1ia5q",
              "language": "de",
              "type": "C__OBJTYPE__SWITCH",
              "title": "Access_1",
              "cmdb_status": 6,
              "description": "The Switch to be",
              "categories": {
                  "C__CATG__FORMFACTOR": [
                      {
                          "formfactor": "C__FORMFACTOR_TYPE__19INCH",
                          "rackunits": "1"
                      }
                  ],
                  "C__CATG__MODEL": [
                      {
                          "manufacturer": [
                              {
                                  "id": "3"
                              }
                          ],
                          "serial": "1234c00ffee"
                      }
                  ]
              }
          }
      }
      

      Die ID 3 habe ich mir per Webentwickler Tools im Browser aus dem Menu geholt, da ich keine andere Möglichkeit gefunden habe das Menu per API auszulesen.

      Viele Grüße

      MartinVM 1 Reply Last reply Reply Quote 0
      • MartinVM Offline
        MartinV @uhe
        last edited by

        @uhe
        Die Dropdowns heißen in i-doit Dialoge. Zum Lesen von Dialog-Informationen dient die API-Funktion cmdb.dialog.read; Einträge hinzufügen kannst Du mit cmdb.dialog.create.

        U 1 Reply Last reply Reply Quote 0
        • U Offline
          uhe @MartinV
          last edited by

          @MartinV danke! Damit gehts erstmal weiter 🙂

          Mir ist dabei allerdings aufgefallen das ich die Position im Rack nicht so setzen kann wie es beim auslesen angezeigt wird.

          Z.B. mit:

          'C__CATG__LOCATION': [
              {
                  'pos': {
                      'visually_from': 32,
                      'visually_to': 33
                  }
              }
          ]
          

          Egal was ich versuche, das Gerät wird immer in RU47 also ganz oben eingesetzt.
          Ist das ein Bug oder muß man das anders setzen als es beim auslesen angezeigt wird?

          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