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

DevOps - Infoblox - Creating a loopback host (post) and getting the record back (get).

[ Edited ]
Member
Posts: 1
370     0

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

Showing results for 
Search instead for 
Did you mean: 

Recommended for You