Posts
-
Python API - Create server object with relations?
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!!!