- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
DevOps - Infoblox - Creating a loopback host (post) and getting the record back (get).
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2022 09:16 AM - edited 06-10-2022 03:49 PM
Hi All,
As part of my integration task , I am creating a loopback host(s) (loopback0, loopback0 and loopback10 )
and getting the the specific loopback record back for information like IPv4 and ipv6 addresses.
Creation is working fine, can anyone suggest which is is best way to fetch just that one loopback host ( say lookback10)- the get host call?
Following is the create call
Usage
infoblox.infoblox_common.create_host(ipv4=loopback1_ipv4, ipv6=loopback1_ipv6,
alloc_use="loopback10",
dns=False, suffix="-lo10")
Function
def create_host(self, ipv4, ipv6, alloc_use, dns, suffix):
self.log.info(f"Creating host entry for {self.properties['hostname']} in {alloc_use}")
_res = self.apihandler.post_url(path="record:host",
params={},
data={
"name": self.properties["hostname"] + suffix,
"ipv4addrs": [{
"ipv4addr": ipv4,
"configure_for_dhcp": False,
"use_for_ea_inheritance": True
}],
"ipv6addrs": [{
"ipv6addr": ipv6,
"configure_for_dhcp": False
}],
"configure_for_dns": dns,
"aliases": [
self.properties["hostname"] + ".net.xxx.xx.xxx-xxx.net"
],
"extattrs": {
"site_id": {
"value": self.site_id
}
}
})
self.log.info(f"Host entry created {_res.json()}")
return _res.json()
Thanks,
Regards,
Sujith