Infoblox Exchange Cybersecurity Roadshow 2020 – Join us!
North America | Europe | Middle East/Africa | Asia-Pacific

API Examples

Accepted Solution

API get DHCP lease related info

Posts: 3
10205     0


     I want use API to obtain DHCP lease ip all related info , need include lease allocation and end time .
I can not found this from API guide , so is this possible ? If yes , what API can help achieve ?


Any help will be appreciated.

Re: API get DHCP lease related info

MRichard Community Manager
Community Manager
Posts: 141
10206     0


curl -k1 -u admin:infoblox -X GET ',starts,ends,tstp,binding_state,hardware,uid&_return_as_object=1'

If there's a large number of leases, you will need to request them in pages.  Here's how you request them 10 at a time.  (10 is good for an example, 1000 is more realistic in an automated script...)

curl -k -u admin:infoblox -X GET ',starts,ends,tstp,binding_state,hardware,uid&_paging=1&_return_as_object=1&_max_results=10'

which returns:

    "next_page_id": "789c5...",
    "result": [
    <lots of leases>

For next page, use that next_page_id value in the request:

curl -k -u admin:infoblox -X GET ''

This returns another next_page_id, which goes into the next page request.  repeat until next_page_id is empty, this means all pages have been returned


Re: API get DHCP lease related info

Posts: 3
10206     0

Dear MRichard,

       Many thank your reply ! You reply is helpful !


        But i am confusing about API return lease Start and End time . I can not match return value with lease real time .


For example :

In my lab , lease  Start time is :2018-07-16 10:35:06 CST ,

and lease End time is :2018-07-16 22:35:06 CST  ;


But API return lease Start and End time is strange number:


<value type="object">
<ends type="int">1531751706</ends>
<starts type="int">1531708506</starts>


Do you know how to match these API return "int number" with lease real time ?





Re: API get DHCP lease related info

Posts: 11
10206     0
Hi King, You can use to convert the epodch to human readable data and time. BR, Simon
Showing results for 
Search instead for 
Do you mean 

Recommended for You

Businesses are investing heavily into securing company resources from cyber-attacks form cybercrimin