Function: AVI Pool Build

by Simon Sparks · 11 March 2026

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

private AviPoolBuild(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 {
    let arrAviServer: AviServer[] = arrIpAddress.map((strIpAddress: string): AviServer => {

        let objAviServer: AviServer = this.AviServerBuild(strIpAddress, intPort, strAviIpAddrType, intRatio);

        return objAviServer;
    });

    let objAviPool: AviPool = new AviPool();
    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);
    }

    return objAviPool;
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like