To use this function add it to the class library file named PluginAVIService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: PluginAVIService.ts
Description: Orchestrator Function to Build an AVI Pool.
Private Function: AviPoolBuild
privateAviPoolBuild(strPoolName:string,strPoolUUID:string,strLogicalRouterTier1:string,strAlgorithm:string,arrIpAddress:string[],intPort:number,intRatio:number=1,strAviIpAddrType:"V4"|"V6",strHealthMonitorName:string,strAviCloud:string,strTenant:string):AviPool{
letarrAviServer:AviServer[]=arrIpAddress.map((strIpAddress:string):AviServer=>{
letobjAviServer:AviServer=this.AviServerBuild(strIpAddress,intPort,strAviIpAddrType,intRatio);
returnobjAviServer;
});
letobjAviPool:AviPool=newAviPool();
objAviPool.setCloudRef("/api/cloud?name="+strAviCloud);
objAviPool.setTenantRef("/api/tenant?name="+strTenant);
objAviPool.setServers(arrAviServer);
objAviPool.setName(strPoolName);
objAviPool.addHealthMonitorRefsItem(`/api/healthmonitor?name=${strHealthMonitorName}`);
objAviPool.setDefaultServerPort(intPort);
objAviPool.setLbAlgorithm(strAlgorithm);
if (strPoolUUID){
objAviPool.setUuid(strPoolUUID);
}
if (strLogicalRouterTier1){
objAviPool.setTier1Lr(strLogicalRouterTier1);
}
returnobjAviPool;
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
