To use this function add it to the class library file named PluginVRAService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: PluginVRAService.ts
Description: Orchestrator Function to Create a Machine Asynchronously
Public Function: MachineCreateASync
public MachineCreateASync(objVraProject: VraProject, intMachineCount: number, strName: string, strDescription: string, strFlavor: string, strImage: string, strFlavorRef: string, strImageRef: string, arrTag: string[], arrConstraint: string[], objPropertiesCustom: Properties, strMachineBootConfig: string, strAuthentication: "usernamePassword" | "publicPrivateKey" | "generatedPublicPrivateKey" | "keyPairName", strUsername: string, strPassword: string, strSSHKey: string, strKeyPair: string, blnPhoneHomeShouldWait: boolean = false, blnPhoneHomeFailOnTimeout: boolean = false, intPhoneHomeTimeoutSeconds: number = 600): VraRequestTracker {
let objVraHost: VraHost = objVraProject.host;
let objVraInfrastructureClient: VraInfrastructureClient = objVraHost.createInfrastructureClient();
// @ts-ignore
let objVraMachineService: VraMachineService = objVraInfrastructureClient.createMachineService();
let objVraMachineSpecification: VraMachineSpecification = this.buildVraMachineSpecification(objVraProject, intMachineCount, strName, strDescription, strFlavor, strImage, strFlavorRef, strImageRef, arrTag, arrConstraint, objPropertiesCustom, strMachineBootConfig, strAuthentication, strUsername, strPassword, strSSHKey, strKeyPair, blnPhoneHomeShouldWait, blnPhoneHomeFailOnTimeout, intPhoneHomeTimeoutSeconds);
let objVraRequestTracker: VraRequestTracker = objVraMachineService.createMachineAsync(objVraMachineSpecification);
return objVraRequestTracker;
}TypeScriptDiscover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
