To use this function add it to the class library file named InfobloxService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: InfobloxService.ts
Description: Orchestrator Function to remove a Host record using the Infoblox plugin
Function: RemoveRecordHost
publicRemoveRecordHost(objIpamConnection:IpamConnection,strFQDN:string,strDnsView:string="default",strNetworkView:string="default"):void{
try{
objIpamConnection.reconnect();
objIpamConnection.configDefaultNetworkView=strNetworkView;
objIpamConnection.configDefaultDnsView=strDnsView;
letobjIpamHostManager:IpamHostManager=objIpamConnection.getHostManager();
letarrIpamHost:IpamHost[]=objIpamHostManager.findHostsByName(strFQDN,strDnsView);
letobjIpamHost:IpamHost=arrIpamHost.find((objIpamHost:IpamHost):boolean=>{
returnobjIpamHost.fqdn===strFQDN;
});
objIpamHostManager.removeHost(objIpamHost.reference);
}
catch (objException){
this.objLogger.info(objException);
}
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
