Function: AVI Controller Add

by Simon Sparks · 8 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 add an AVI Controller.

Public Function: AviControllerAdd

public AviControllerAdd(strAviControllerFQDN: string, strUsername: string, strPassword: string, strTenant: string, strVersion: string, strToken: string): string {

    let blnIsHttps: boolean = strAviControllerFQDN.indexOf('https') === 0;

    if (blnIsHttps === true) {
        strAviControllerFQDN = strAviControllerFQDN.substring(8, strAviControllerFQDN.length);

        let intPositionOfEnd: number = strAviControllerFQDN.indexOf("/");

        if (intPositionOfEnd !== -1) {
            strAviControllerFQDN = strAviControllerFQDN.substring(0, intPositionOfEnd);
        }
    } else {
        strAviControllerFQDN = strAviControllerFQDN;
    }

    try {
        let strResult: string = AviVroPlugin.addVroClient(strAviControllerFQDN, strUsername, strPassword, strTenant, strVersion, strToken);

        return strResult;
    }
    catch (objException) {
        return "";
    }
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like