Quantcast
Channel: THWACK: All Content - Orion SDK
Viewing all articles
Browse latest Browse all 2677

Unsupported operand type(s) for +: 'dict' and 'str'

$
0
0

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


Viewing all articles
Browse latest Browse all 2677

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>