I am currently testing the capability of OrionSDK. Now, I got an issue updating a custom property to number of nodes..
import requests
from orionsdk import SwisClient
defmain():
npm_server = '<ipaddress>'
username = 'admin'
password = '********'
swis = SwisClient(npm_server, username, password)
print("Custom Property Update Test:")
results = swis.query("SELECT N.Uri FROM Orion.Nodes N INNER JOIN Orion.NodesCustomProperties AS I ON N.NodeID = I.NodeID WHERE I.Department=@department", department='IT') # set valid NodeID!
#print(results)
for key in (results['results']):
print("{Uri}".format(**key))
#uri = "[{Uri}]"
swis.update(key + '/CustomProperties', Department='Accounting')
obj = swis.read(key + '/CustomProperties')
print(obj.format(**key))
requests.packages.urllib3.disable_warnings()
if__name__ == '__main__':
main()
-------------------
Hoping to receive feedback