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

API & Integration

Reply
Highlighted
Accepted Solution

Trying to add a DHCP range with a Failover association instead of a DHCP member using the REST API.

Techie
Posts: 6
4129     0

I'm new to the REST API and I'm trying to add a DHCP range with the member set to a failover association. I've been successful at adding a range with a single member but I've been unable to find the data structure for adding a range with the failover association. The structure for adding a range with a member is this.

 

{"result": {"_ref": "range/ZG5zLmRoY3BfcmFuZ2UkMTAuMTAuMTAuMjAvMTAuMTAuMTAuMTAwLy8vMC8:10.10.10.20/10.10.10.100/default", "end_addr": "10.10.10.100", "member": {"_struct": "dhcpmember", "ipv4addr": "172.26.1.3", "ipv6addr": null, "name": "member1.localdomain" }, "network": "10.10.10.0/24", "network_view": "default", "start_addr": "10.10.10.20" }} 

 

Can anyone tell me what construct looks like for adding the range with a failover association instead of a member?

 

Thanks very much.

Highlighted

Re: Trying to add a DHCP range with a Failover association instead of a DHCP member using the REST A

Community Manager
Community Manager
Posts: 160
4130     0

Adding a range and assinging a failover is a bit more simple than the member, we just need to give the name of the failover association.  For example:

 

{"start_addr": "10.99.1.100", "end_addr": "10.99.1.199","failover_association": "Dallas-Chicago"}"

 

And here's the full unix curl example to make a new range, assigned to the failover:

 

curl -k1 -u admin:infoblox -X POST 'https://10.9.16.6/wapi/v2.7/range'  -H "Content-Type: application/json" \
       -d "{\"end_addr\": \"10.99.1.199\",\"start_addr\": \"10.99.1.100\",\"failover_association\": \"Dallas-Chicago\"}"

 

 

 

Highlighted

Re: Trying to add a DHCP range with a Failover association instead of a DHCP member using the REST A

Techie
Posts: 6
4130     0

That worked perfectly. Thank you so much for your assitance.

Highlighted

Re: Trying to add a DHCP range with a Failover association instead of a DHCP member using the REST A

Techie
Posts: 6
4130     0

On a side note, if you use single quotes around the -d string you don't need to use the backslashes.

 

-d '{"end_addr": "10.99.1.199","start_addr": "10.99.1.100","failover_association": "Dallas-Chicago"}'

 

This works too. I find it just makes it easier to read and type.

Highlighted

Re: Trying to add a DHCP range with a Failover association instead of a DHCP member using the REST A

Techie
Posts: 5
4130     0

Can you suggest how to do this using the /network endpoint? I usually create the network, range and tie it to the vlan all in one step. Like:

 

json_data={"network_view":api_auth.ib_default_view,"network":network,"members":[{"_struct":"dhcpmember","_ref":dhcp_member_ref}],"use_options":True,"comment":comment,"vlans":[{"vlan":vlan_ref}] }
 
So essentially I'm replacing: "members":[{"_struct":"dhcpmember","_ref":dhcp_member_ref}]
with: "failover_association":dhcp_failover
 
Where dhcp failover is the name of the failover group. 
Highlighted

Re: Trying to add a DHCP range with a Failover association instead of a DHCP member using the REST A

[ Edited ]
Techie
Posts: 5
4130     0

I'm guessing I have to pull the members from the failover association, and add all members to the network endpoint call. Caveat being if one member is replaced with another, would I lose the association with the failover group members in the DHCP range?

 

Would love to see the curls that do the assignment to the network, then the assignment of the dhcp failover to the range.

Showing results for 
Search instead for 
Do you mean 

Recommended for You