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 get Port Group Name from an Ipam Network.
Function: IpamNetworkGetPortgroupName
publicIpamNetworkGetPortgroupName(objIpamNetwork:IpamNetwork):string{
letarrIpamExtensibleAttribute:IpamExtensibleAttribute[]=objIpamNetwork.extensibleAttributes;
letobjIpamExtensibleAttribute:IpamExtensibleAttribute=arrIpamExtensibleAttribute.find((objIpamExtensibleAttribute:IpamExtensibleAttribute):boolean=>{
returnobjIpamExtensibleAttribute.name==='Port Group';
});
if (objIpamExtensibleAttribute){
this.objLogger.info(`The Port Group extensible attribute '${objIpamExtensibleAttribute.value}' was retrieved from the network '${objIpamNetwork.address}/'${objIpamNetwork.cidr}' successfully.`);
returnobjIpamExtensibleAttribute.value;
}
else{
this.objLogger.info(`The Port Group extensible attribute was not found in the network '${objIpamNetwork.address}/${objIpamNetwork.cidr}'.`);
returnnull;
}
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
