To use this function add it to the class library file named vCenterVAPIService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: vCenterVAPIService.ts
Function VAPIConnect
protectedVAPIConnect(objVcSdkConnection:VcSdkConnection):boolean{
letblnReturn:boolean=false;
try{
this.objVAPIEndpoint=VAPIManager.findEndpoint("https://"+objVcSdkConnection.id+"/api");
this.objVAPIClient=this.objVAPIEndpoint.client(null,null);
blnReturn=true;
}
catch (objException){
blnReturn=false;
}
returnblnReturn;
}Function VAPIDisconnect
protectedVAPIDisconnect():boolean{
letblnReturn:boolean=false;
try{
this.objVAPIClient.close();
this.objVAPIEndpoint=null;
this.objVAPIClient=null;
blnReturn=true;
}
catch (objException){
blnReturn=false;
}
returnblnReturn;
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
