Are you interested in our Early Access Program (EAP)? This program allows you to preview code, test in your lab and provide feedback prior to General Availability (GA) release of all Infoblox products. If so, please click the link here.

API & Integration, DevOps,NetOps,SecOps

Reply

Add existing MS Dhcp Failover Association to DHCP range

Techie
Posts: 8
428     1

The following code returns a 400 when ran. I think it may have something to do with the ms_server fields. Does anyone know what these should be? 

I know the server_association_type is correct as thats clearly documented, however im not sure if for the ms_server fields, do i need to specify the "name" of the failover assoation etc ... 

dhcp_range_payload = json.dumps({"start_addr": dhcp_ib_range_prefix + '100',
"end_addr": dhcp_ib_range_prefix + '245',
"server_association_type": "MS_FAILOVER",
"network_view": "default",
"name": comment_dict[ib_subnet],
"ms_server": {"_struct": "msdhcpserver",
"ipv4addr": "dcedhcp02.insightglobal.net"},
"ms_options":
[{"name": "routers",
"num": 3,
"value": ib_gateway_ip}],
})

 

Re: Add existing MS Dhcp Failover Association to DHCP range

Techie
Posts: 8
429     1

I found a field i was missing for "failover associtation" With this code i am not getting: 

{ "Error": "AdmConDataError: expected single object, got 2"}

 

# Add DHCP ranges to subnets
dhcp_clean_ip_address_list = ib_subnet.replace(' ', '').split('.')
dhcp_clean_ip_address_list.pop(3)
dhcp_clean_ip_address_list.append('')
dhcp_ib_range_prefix = '.'.join(dhcp_clean_ip_address_list)
ranges_url = "https://172.18.101.100/wapi/v2.7/range"
dhcp_range_payload = json.dumps({"start_addr": dhcp_ib_range_prefix + '100',
"end_addr": dhcp_ib_range_prefix + '245',
"server_association_type": "MS_FAILOVER",
"failover_association": "dcedhcp02.insightglobal.net-dcwdhcp02.insightglobal.net",
"network_view": "default",
"name": comment_dict[ib_subnet],
"ms_options":
[{"name": "routers",
"num": 3,
"value": ib_gateway_ip}],
})
ib_dhcp_response = requests.request("POST", ranges_url, headers=headers, data=dhcp_range_payload, verify=False)
bar.finish()
print(ib_dhcp_response.content)

 Any ideas ??

Re: Add existing MS Dhcp Failover Association to DHCP range

Moderator
Moderator
Posts: 191
429     1

I'm getting the same error message.  It works through the NIOS GUI.  It works when I assign the range to a single MS server. But not when I try to assign the range to the failover association. It appears to be a defect.  Can you please open a support case and give them the details, along with your NIOS and Windows Server versions.  You're welcome to refer to this forum post also, when you open the case.

Re: Add existing MS Dhcp Failover Association to DHCP range

Member
Posts: 2
429     1

Hi,

 

This is a known bug: NIOS-85974.  Support told me it it is targeted to be fixed in 8.6.3 and 9.0.  In the meantime you can work around generating a CSV import file and using a CSV upload over WAPI. 

 

Regards,

Christina.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You