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 add a Host record using the Infoblox plugin
Function: AddRecordHost
publicAddRecordHost(objIpamConnection:IpamConnection,strIpSubnet:string,intCIDR:number,strFQDN:string,strMacAddress:string="00:00:00:00:00:00",blnEnableDns:boolean=true,strDnsView:string="default",strNetworkView:string="default"):void{
letstrIPAddress:string=this.IpamNetworkGetNextAvailableIP(objIpamConnection,strIpSubnet,intCIDR,strDnsView);
letobjIpamHostInfo:IpamHostInfo=newIpamHostInfo(strFQDN);
objIpamHostInfo.enableDns=blnEnableDns;
objIpamHostInfo.comment="DNS - A Record Deployed by Orchestrator";
objIpamHostInfo.fqdn=strFQDN;
letobjIpamHostAddress:IpamHostAddress=newIpamHostAddress();
objIpamHostAddress.mac=strMacAddress;
objIpamHostAddress.ip=strIPAddress;
try{
objIpamConnection.reconnect();
objIpamConnection.configDefaultNetworkView=strNetworkView;
objIpamConnection.configDefaultDnsView=strDnsView;
letobjIpamHostManager:IpamHostManager=objIpamConnection.getHostManager();
objIpamHostManager.addHost(objIpamHostInfo,objIpamHostAddress);
}
catch (objException){
this.objLogger.info(objException);
}
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
