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
public IpamNetworkGetPortgroupName(objIpamNetwork: IpamNetwork): string {
let arrIpamExtensibleAttribute: IpamExtensibleAttribute[] = objIpamNetwork.extensibleAttributes;
let objIpamExtensibleAttribute: IpamExtensibleAttribute = arrIpamExtensibleAttribute.find((objIpamExtensibleAttribute: IpamExtensibleAttribute): boolean => {
return objIpamExtensibleAttribute.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.`);
return objIpamExtensibleAttribute.value;
}
else {
this.objLogger.info(`The Port Group extensible attribute was not found in the network '${objIpamNetwork.address}/${objIpamNetwork.cidr}'.`);
return null;
}
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
