2 Replies Latest reply on Feb 9, 2017 4:23 PM by jvb

    Get Node Type in REST API query

    kt617

      Hello, I am using a python script to query the REST API.

       

      I am querying data from the Orion.Nodes table.

       

      Question:

       

      What attribute has the information about the Node "Type"?

       

      I want to know if the node is a Switch, Router, Firewall, Storage Device, etc...

       

      I looked at the data in most of these fields on the Orion.Nodes table but there doesn't seem to be anything that says if it is a "Switch" or "Firewall" etc.

       

      http://solarwinds.github.io/OrionSDK/schema/Orion.Nodes.html

        • Re: Get Node Type in REST API query
          jvb

          Not sure if it is what you are looking for but I believe "Category" is the field...

          Possible values there are

          2 - Server

          1 - Network

          0 - Other

          To get more granular in the description of the device, i.e. Firewall instead of "Network" you might have to assign a custom property to the node.

          I only had a moment to glance at the tables though so I will try to look more closely this evening and add to this later if I find a better answer.

          Edit:

          It may also be NodesData_Category if you are looking via Nodes(View) rather than NodesData

          1 of 1 people found this helpful
            • Re: Get Node Type in REST API query
              jvb

              I think I pretty much verified this... I can't find anywhere that we are categorizing to the level of granularity you are hoping for.

              So, the Custom Property route will give you the results you need but will require some work up front.

              That being said, if you still wanted to group both on the original "Category" field and then on your custom property, you could use a query like this:

              (I created a CP called "CategorySubType" and then filled it with Firewall, Switch, Router... Etc.etc.)

               

              'SELECT Caption, Category, CategorySubType from Orion.Nodes as ND, Orion.NodesCustomProperties as NCP where NCP.CategorySubType = ''Firewall'' and ND.Category = 1 and ND.NodeID = NCP.NodeID'

               

              Hope that helps!

              1 of 1 people found this helpful