Highlighted
Super Contributor.. Super Contributor..
Super Contributor..
978 views

Unable to run getnodes using NodeBean SOAP API

Jump to solution

Hi All,

I am trying to get a node information by passing the node name or the ipaddress. I tried to connect using following SOAP API https://localhost/NodeBeanService/NodeBean

The above URL provides all nodes but I want to filter for one node and the results should display that.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:node="http://node.sdk.nms.ov.hp.com/">
<soapenv:Header/>
<soapenv:Body>
<node:getNodes>
<arg0>
<!--Optional:-->
<condition>
<!--Optional:-->
<condition/>
<!--Optional:-->
<constraint>
<!--Optional:-->
<condition/>
<!--Optional:-->
<constraint/>
<!--Optional:-->
<expression>
<!--Optional:-->
<condition/>
<!--Optional:-->
<constraint/>
<!--Optional:-->
<expression/>
<!--Optional:-->
<operator>?</operator>
<!--Zero or more repetitions:-->
<subFilters/>
</expression>
<!--Optional:-->
<name>?</name>
<!--Optional:-->
<value>?</value>
</constraint>
<!--Optional:-->
<expression>
<!--Optional:-->
<condition/>
<!--Optional:-->
<constraint>
<!--Optional:-->
<condition/>
<!--Optional:-->
<constraint/>
<!--Optional:-->
<expression/>
<!--Optional:-->
<name>?</name>
<!--Optional:-->
<value>?</value>
</constraint>
<!--Optional:-->
<expression/>
<!--Optional:-->
<operator>?</operator>
<!--Zero or more repetitions:-->
<subFilters/>
</expression>
<!--Optional:-->
<name>?</name>
<!--Optional:-->
<operator>?</operator>
<!--Optional:-->
<value>?</value>
</condition>
<!--Optional:-->
<constraint>
<!--Optional:-->
<condition>
<!--Optional:-->
<condition/>
<!--Optional:-->
<constraint/>
<!--Optional:-->
<expression>
<!--Optional:-->
<condition/>
<!--Optional:-->
<constraint/>
<!--Optional:-->
<expression/>
<!--Optional:-->
<operator>?</operator>
<!--Zero or more repetitions:-->
<subFilters/>
</expression>
<!--Optional:-->
<name>?</name>
<!--Optional:-->
<operator>?</operator>
<!--Optional:-->
<value>?</value>
</condition>
<!--Optional:-->
<constraint/>
<!--Optional:-->
<expression>
<!--Optional:-->
<condition>
<!--Optional:-->
<condition/>
<!--Optional:-->
<constraint/>
<!--Optional:-->
<expression/>
<!--Optional:-->
<name>?</name>
<!--Optional:-->
<operator>?</operator>
<!--Optional:-->
<value>?</value>
</condition>
<!--Optional:-->
<constraint/>
<!--Optional:-->
<expression/>
<!--Optional:-->
<operator>?</operator>
<!--Zero or more repetitions:-->
<subFilters/>
</expression>
<!--Optional:-->
<name>?</name>
<!--Optional:-->
<value>?</value>
</constraint>
<!--Optional:-->
<expression>
<!--Optional:-->
<condition>
<!--Optional:-->
<condition/>
<!--Optional:-->
<constraint>
<!--Optional:-->
<condition/>
<!--Optional:-->
<constraint/>
<!--Optional:-->
<expression/>
<!--Optional:-->
<name>?</name>
<!--Optional:-->
<value>?</value>
</constraint>
<!--Optional:-->
<expression/>
<!--Optional:-->
<name>?</name>
<!--Optional:-->
<operator>?</operator>
<!--Optional:-->
<value>?</value>
</condition>
<!--Optional:-->
<constraint>
<!--Optional:-->
<condition>
<!--Optional:-->
<condition/>
<!--Optional:-->
<constraint/>
<!--Optional:-->
<expression/>
<!--Optional:-->
<name>?</name>
<!--Optional:-->
<operator>?</operator>
<!--Optional:-->
<value>?</value>
</condition>
<!--Optional:-->
<constraint/>
<!--Optional:-->
<expression/>
<!--Optional:-->
<name>?</name>
<!--Optional:-->
<value>?</value>
</constraint>
<!--Optional:-->
<expression/>
<!--Optional:-->
<operator>?</operator>
<!--Zero or more repetitions:-->
<subFilters/>
</expression>
</arg0>
</node:getNodes>
</soapenv:Body>
</soapenv:Envelope>

Regards,

Naresh

0 Likes
1 Solution

Accepted Solutions
Highlighted
Honored Contributor.
Honored Contributor.

Re: Unable to run getnodes using NodeBean SOAP API

Jump to solution

Hi Naresh,

Please try following soap web service getNodes code:

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

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:node="http://node.sdk.nms.ov.hp.com/">
<soapenv:Header/>
<soapenv:Body>
      <node:getNodes>
       <arg0 xsi:type="ns3:expression" xmlns:ns3="http://filter.sdk.nms.ov.hp.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <operator>AND</operator>

        <subFilters xsi:type="ns3:constraint">
           <name>maxObjects</name><value>4</value>
        </subFilters>
        <subFilters xsi:type="ns3:constraint">
           <name>offset</name>
           <value>3</value>
       </subFilters>
     </arg0>
  </node:getNodes>
</soapenv:Body>
</soapenv:Envelope>

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

 

It used offset = 3 and maxObjects =  4. So it will get back with you totally 4 nodes for them details(where my nnmi had 10 managed nodes in total)..

You can change it accordingly with offset = 400 and maxObjects =  500 in your code. You will get expected 500 nodes instead of 1000 objects response.

Hope this can help.

If more help needed, pls log a support case.

Many thanks

Chen

View solution in original post

11 Replies
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: Unable to run getnodes using NodeBean SOAP API

Jump to solution

I tried to execute the nodebean and it gives only 1000 nodes not complete list. How to extract all nodes in NNMi using getNodes SOAP API.

 Regards,

Naresh

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: Unable to run getnodes using NodeBean SOAP API

Jump to solution

Hi All,

Please some one help me on this.

I am trying to get the SNMP version used to monitor a device using NNMi.

Regards.

Naresh

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: Unable to run getnodes using NodeBean SOAP API

Jump to solution

Hi Every one,

After going through the devtoolkit document, I saw a parameter named maxObjects which has a default value of 1000 and I want to increase the value to 10000. How to apply that filter using SOAP API. Please help.

Regards,

Naresh

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: Unable to run getnodes using NodeBean SOAP API

Jump to solution

I tried to use below SOAP API XML but it still retrieves 1000 entries even though I mentioned to get 10 records. Not sure what the issue is.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:node="http://node.sdk.nms.ov.hp.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <node:getNodes>
         <arg0>
         <constraint>
<condition>
            <name>maxObjects</name>
            <value>10</value>
            </condition>>
         </constraint>

         </arg0>
      </node:getNodes>
   </soapenv:Body>
</soapenv:Envelope>

Please help me.

Regards,

Naresh

 

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: Unable to run getnodes using NodeBean SOAP API

Jump to solution

Please, someone, help me I am stuck and cannot proceed further.

Regards,

Naresh

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Unable to run getnodes using NodeBean SOAP API

Jump to solution

Hi Naresh,

Can you pls log a support case with the details for this? 

Do you have support case id available?

Many thanks

Chen

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Unable to run getnodes using NodeBean SOAP API

Jump to solution

Hi Naresh,

Please try following soap web service getNodes code:

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

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:node="http://node.sdk.nms.ov.hp.com/">
<soapenv:Header/>
<soapenv:Body>
      <node:getNodes>
       <arg0 xsi:type="ns3:expression" xmlns:ns3="http://filter.sdk.nms.ov.hp.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <operator>AND</operator>

        <subFilters xsi:type="ns3:constraint">
           <name>maxObjects</name><value>4</value>
        </subFilters>
        <subFilters xsi:type="ns3:constraint">
           <name>offset</name>
           <value>3</value>
       </subFilters>
     </arg0>
  </node:getNodes>
</soapenv:Body>
</soapenv:Envelope>

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

 

It used offset = 3 and maxObjects =  4. So it will get back with you totally 4 nodes for them details(where my nnmi had 10 managed nodes in total)..

You can change it accordingly with offset = 400 and maxObjects =  500 in your code. You will get expected 500 nodes instead of 1000 objects response.

Hope this can help.

If more help needed, pls log a support case.

Many thanks

Chen

View solution in original post

Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: Unable to run getnodes using NodeBean SOAP API

Jump to solution

Hi Chen,

It worked but I want to know what is the use of offset = 3  value. Could you please let me know.

Regards,

Naresh

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Unable to run getnodes using NodeBean SOAP API

Jump to solution

Hi Naresh,

Good to hear it is working.

>>offset: this constraint is an integer index value that tells NNMi where to start when retrieving a
batch of inventory objects. This constraint is used to iterate through a large set of inventory objects
with multiple WS-I get* calls (see example below).

>>maxObjects: this constraint is an integer that tells NNMi how many objects to retrieve in each
get* call. When retrieving a large set of inventory objects with a WS-I get* call, it is best to retrieve the large set in
many small batches rather than making a single large get call that has the potential to timeout. The offset
and maxObjects constraints permit these small, iterative batch calls. For example, suppose a WS-I client
wanted to retrieve the entire set of nodes in the NNMi inventory; further suppose that NNMi contained
4,523 nodes in the inventory. Attempting to retrieve all 4,523 nodes in a single NodeBean.getNodes() call
would likely lead to a timeout. A smarter approach is to retrieve the objects by looping through smaller calls
to NodeBean.getNodes(). Each call to getNodes() would include the offset and maxObjects constraints
to control which batch of nodes were returned. The series of WS calls would look like this:
getNodes() call 1: offset = 0, maxObjects = 500
getNodes() call 2: offset = 500, maxObjects = 500
getNodes() call 3: offset = 1000, maxObjects = 500
getNodes() call 4: offset = 1500, maxObjects = 500
getNodes() call 5: offset = 2000, maxObjects = 500
…..
getNodes() call 10: offset = 4500, maxObjects = 500
Assuming that the rest of the filter matches all 4,523 nodes in the inventory, calls 1 through 9 will return
500 nodes each. Call 10 will return the remaining 23 nodes (offset value 4500-4522; 4522 rather than
4523 because we began with offset=0, not offset=1).

The client code making the sequence of calls keeps making calls until the returned result set contains fewer
objects than the value assigned to maxObjects. In other words, if NNMi returns the maxObjects number
of inventory objects, then it is supposed that NNM has more objects to retrieve. 500 objects per call tends
to be a nice batch size for WS-I get* calls to the NNMi SDK..

Hope this can help.

Chen

 

 

Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: Unable to run getnodes using NodeBean SOAP API

Jump to solution

Thanks a lot, Chen you explanation clear my query.

Thank you very much.

Regards,

Naresh

Highlighted
Honored Contributor.
Honored Contributor.

Re: Unable to run getnodes using NodeBean SOAP API

Jump to solution

Hi Naresh,

You are very welcome! 

Chen

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.