This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

How Do I Change Caption (Node/Interface/Volume) Via API

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?