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

    Python API - Create server object with relations?

    Scheduled Pinned Locked Moved Entwicklung
    2 Posts 2 Posters 353 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

        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