Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

API & Integration

Reply
Highlighted
Accepted Solution

next_available_ip report/output

Techie
Posts: 5
1452     0

Hi,

 

I am using curl script for multiple host creating with next_available_ip func, however, is it possible in curl to generate some kind of a report at the end to show which IP is assigned to which host?

 

Please advise

 

Cheers,

Sofia

Highlighted

Re: next_available_ip report/output

Adviser
Posts: 138
1452     0

Hi Sofia,

 

You can use the "_return_fields+" parameter to request for the WAPI call to return the host name and the IP addresses assigned, like below

curl -k -u admin:Infoblox -H 'content-type: application/json' -X POST "https://127.0.0.1/wapi/v2.7/record:host?_return_fields%2B=name,ipv4addrs&_return_as_object=1" -d '{"name":"host.info.com","ipv4addrs": [{"ipv4addr":"10.10.10.20"}]}'

The output will look like this:

{"result": 
 {"_ref": "record:host/ZG5zLmhvc3QkLl9kZWZhdWx0LmNvbS5pbmZvLmhvc3Q:host.info.com/default",
  "ipv4addrs": 
   [{"_ref": "record:host_ipv4addr/ZG5zLmhvc3RfYWRkcmVzcyQuX2RlZmF1bHQuY29tLmluZm8uaG9zdC4xMC4xMC4xMC4yMC4:10.10.10.20/host.info.com/default",
    "configure_for_dhcp": false,
    "host": "host.info.com",
    "ipv4addr": "10.10.10.20"
  }],
   "name": "host.info.com",
   "view": "default"
}}

You can get the required information from this output and create a report if you need to.

 

Regards,

Krishna

Highlighted

Re: next_available_ip report/output

Techie
Posts: 5
1452     0

thanks it worked

Showing results for 
Search instead for 
Do you mean 

Recommended for You