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

    Python API - Create server object with relations?

    Scheduled Pinned Locked Moved Entwicklung
    2 Posts 2 Posters 255 Views 1 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.
    • Aaron RuddickA Offline
      Aaron Ruddick
      last edited by

      Hi,

      I am new to the product and trying to test it out and pull down some of my data via Salt.

      Is there a way to combine the two requests below? So I can create the object and give it a version in the same request:

      test2 = api.request("cmdb.object.create",{
      "type": "C__OBJTYPE__APPLICATION",
      "title": software,

                      "apikey": "xxxxx"
                  })
      

      test3 = api.request("cmdb.category.create", {
      "category": "C__CATG__VERSION",
      "objID": test2[id],
      "data": {
      "title": version
      },
      "apikey": "xxxxxx"
      })

      #######################

      test2 = api.request("cmdb.object.create",{
      "type": "C__OBJTYPE__APPLICATION",
      "title": software,

                      "apikey": "xxxxx",
                      "categories":{
                            "version": {.....}
                            "Other stuff": {.....}
                         }
                  })
      

      Thank you!!!

      1 Reply Last reply Reply Quote 0
      • Philipp HörselmannP Offline
        Philipp Hörselmann
        last edited by

        Hey @Aaron-Ruddick
        unfortunately nobody answered yet...
        Do you still facing this issue or did you already solve this?

        Best
        Phil

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