Reply
Highlighted

Wapi for export_data() ?

Authority
Posts: 42
4249     0

Hi ,

 

I'm looking to export all the statistics of DHCP::Nerwork object using wapi.

I know Infoblox papi has similar api export_data()  which supports various objects.

 

Does Wapi have something similar?

Please advise.

 

Nidhi

 

 

Re: Wapi for export_data() ?

Adviser
Posts: 96
4250     0

In WAPI you could do:

 

curl -k -u admin:infoblox -X GET https://192.168.0.12/wapi/v2.6/network?_return_fields=network,dhcp_utilization

 

to get a list of all networks, containing the network (address) and the dhcp utilization. For more fields, just add them to the list. Please double-check on the WAPI Admin Guide for all available fields.

 

 

Re: Wapi for export_data() ?

Authority
Posts: 42
4250     0

I have used following and able to retreive available fields in my result sets.

 

https://XXXXXX/wapi/v2.1/network?_max_results=20&_paging=1&_return_as_object=1&_return_fields=network,extattrs

 

My question is, the export_data() papi on Network object (below), yields more results and outputs everything.

 

$session->export_data(
type => "csv",
path => $ARGV[0],
object_type => "Infoblox:Smiley Very HappyHCP::Network",
separator => "comma",

 

How can I retreive the same using wapi?

Not sure dhcp_utilization is a network's  field.

{ "Error": "AdmConProtoError: Unknown argument/field: 'dhcp_utilization'", 
  "code": "Client.Ibap.Proto", 
  "text": "Unknown argument/field: 'dhcp_utilization'"
}

Re: Wapi for export_data() ?

Adviser
Posts: 96
4250     0

In WAPI there is nothing like export_data(). You can achive what you need by using the call I posted above.

 

You have limited you call to 20 by _max_results.

 

Maybe the 2.1 WAPI does not have the dhcp_utilization available. Try 2.6.

 

Re: Wapi for export_data() ?

Authority
Posts: 42
4250     0

 I guess maybe with different wapi version I can have dhcp_utilization field.

We are using the latest version of infoblox and the version of api I'm using is from their aoi doccumentation report.

 

Will have to check how do I get wapi's 2.6.

 

Thanks 

Nidhi

Re: Wapi for export_data() ?

Adviser
Posts: 96
4250     0

The latest NIOS 8.2 has WAPI v2.7 available (and all other versions below).

 

So you just change the call to the version you like to use:

 

https://XXXXXX/wapi/v2.6/network

Re: Wapi for export_data() ?

Moderator BRampling
Moderator
Posts: 69
4250     0

The dhcp:statistics object was added in WAPI 2.5 (NIOS 8.0). That should give you the information you're looking for.

Re: Wapi for export_data() ?

Authority
Posts: 42
4250     0

Thanks for your response.

We are still using infoblox wapi's version 2.1. Will check the dhcp oblect you mentioned with the wapi upgrades.

 

I still have a diffrent question related to wapis.

 

How do I retreive all the ffields described in doccumentation of any object using wapi?

usaually I'm able to see only the basic fields of any objects be it range, network or any other objects.

If not directly via a wapi link what are the other possible ways to retreive all the fields?

 

for exp

gridmaster/wapi/v2.1/range?_return_fields=end_addr,comment,network,extattrs&_return_type=xml&_max_results=20

 

is giving

 

value type="object">
<network>00.00.00.00/00</network>
<extattrs type="object"/>
<end_addr>00.00.00.00/00</end_addr>
<_ref>
range/xyz:00.00.00.00/0/default
</_ref>
</value>
 
Please?
 
Thanks
Nidhi

Re: Wapi for export_data() ?

Moderator BRampling
Moderator
Posts: 69
4250     0

The WAPI documentation lists all of the available fields and indicates which are returned by default. To add additional fields add this paramter to your URL:

 

_return_fields+=myfield

 

That will add the additional field "myfield" to the default fields. If you use = instead of +=, you will only get myfield and none of the default fields will be included. You can use commas to add multiple fields (myfield1,myfield2).

Showing results for 
Search instead for 
Do you mean 

Recommended for You