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

OrionSDK - Node Interface URI not working

$
0
0

I'm trying to read and eventually update node interface custom properties via Python and the OrionSDK. From my understanding according to SolarWinds' very own URI documentation, the interface URI should be swis://abcdef/Orion/Orion.Nodes/NodeID=1/Interfaces/. However, when attempting to read this URI, I keep getting an HTTP error that appears to say that the URI doesn't exist. Here's the Python code I'm working with:

 

======================================================================================

import requests

from orionsdk import SwisClient

 

def main():

  requests.packages.urllib3.disable_warnings()

 

  server = 'NPM_SERVER
   username = 'ADMIN_USER'
   password = 'ADMIN_PASS'

   swis = SwisClient(server, username, password)

   print("Custom Property Update Test:")

  results = swis.query(

   "SELECT Uri FROM Orion.Nodes WHERE NodeID=@id",
   id=3007
   )

  uri = results['results'][0]['Uri']

  obj = swis.read(uri + "/Interfaces")

 

   print(obj)

 

if __name__ =="__main__":

  main()

======================================================================================

 

And here's the error I'm getting:

 

requests.exceptions.HTTPError: 400 Client Error: Invalid key properties specified for entity Orion.NPM.Interfaces.

Parameter name: filter for url: https://NPM_SERVER:17778/SolarWinds/InformationService/v3/Json/swis:/NPM_SERVER/Orion/Orion.Nodes/NodeID=3007/Interfaces

 

 

 

As mentioned previously, all I'm trying to do at this point is print out the interfaces on the node and, eventually, set those interface custom properties. Any help and guidance to start this process would be great. Thank you!


Viewing all articles
Browse latest Browse all 2677

Trending Articles



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