Hello Thwack Community,
I'm looking for how to update the caption of an entity (nodes, interfaces, and volumnes, etc) via the API. Preferably in Python, but am also interesting is seeing how to do the same via PowerShell. I'm assuming I can do it via a SQL update, but am looking to see if it's possible via an API entity/verb first.
I came across this: orionsdk-python/custom_property_update.py at master · solarwinds/orionsdk-python · GitHub , but wasn't able to figure out how to get to the caption from there.
I tried the following:
def main(): swis = SwisClient(swis_npm_server, swis_username, swis_password) # variables I import from another file uriResults = swis.query("SELECT Uri FROM Orion.Nodes WHERE NodeID = '136'") uri = uriResults['results'][0]['Uri'] print(uri) swis.update(uri + '/Nodes', Caption='newcaption') obj = swis.read(uri + '/Nodes') print(obj)
Lines 1 - 5 work, but I'm doing something wrong with the 'swis.update'. I assume that it's the "'/Nodes'" and that this property doesn't exist.
Any insights?