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
Public Function: MachineCreate
publicMachineCreate(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):VraMachine{
letobjVraHost:VraHost=objVraProject.host;
letobjVraInfrastructureClient:VraInfrastructureClient=objVraHost.createInfrastructureClient();
// @ts-ignore
letobjVraMachineService:VraMachineService=objVraInfrastructureClient.createMachineService();
letobjVraMachineSpecification:VraMachineSpecification=this.buildVraMachineSpecification(objVraProject,intMachineCount,strName,strDescription,strFlavor,strImage,strFlavorRef,strImageRef,arrTag,arrConstraint,objPropertiesCustom,strMachineBootConfig,strAuthentication,strUsername,strPassword,strSSHKey,strKeyPair,blnPhoneHomeShouldWait,blnPhoneHomeFailOnTimeout,intPhoneHomeTimeoutSeconds);
letobjVraMachine:VraMachine=objVraMachineService.createMachine(objVraMachineSpecification);
returnobjVraMachine;
}TypeScriptDiscover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
