- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
"404 Client Error: Not Found for url" with /range WAPI endpoint (for dhcp failover association)
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 11:06 PM - edited 07-18-2023 11:09 PM
Hi,
I run into a brick with this frustrating issue, can't make it work in our python code. Yet, it works great in postman. So weird. We just recently upgraded to 8.6.3 NIOS. The python code for no failover association works fine! Much thanks in advance, for any feedback, as I am trying to meet a hard deadline for my project.
if len(ms_servers) > 1:
params = {
"start_addr": start_addr,
"end_addr": end_addr,
"server_association_type": "MS_FAILOVER",
"failover_association": "-".join(ms_servers),
"name": name,
"comment": comment,
}
else:
# No MS failover association. This works fine!
params = {
"start_addr": start_addr,
"end_addr": end_addr,
"ms_server": {"_struct": "msdhcpserver", "ipv4addr": ms_servers[0]},
"name": name,
"comment": comment,
}
response = self.session.post(url, json=params, verify=False)
Re: "404 Client Error: Not Found for url" with /range WAPI endpoint (for dhcp failover ass
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 05:01 PM - edited 07-20-2023 05:03 PM
I found out what causes the error. Very weird! There is nothing wrong with our python code. Apparently, the 'failover_association' field only accepts a static string. Can Infoblox confirm if this is a bug? Static string assignment is useless, since our app reads the dhcp servers on the fly, from an external file.
So, what works vs what doesn't work:
- This one works:
"failover_association": "dhcp-server-1-dhcp-server-2"
- These ones don't work, which gives that "404 CLIENT ERROR":
"failover_association": "-".join(ms_servers)
"failover_association": servers (where servers is a string variable previously defined, ie, servers = "dhcp-server-1-dhcp-server-2")
"failover_association": f"{servers}"