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 Detach a Disk from a Machine
Public Function: MachineDetachDisk
publicMachineDetachDisk(objVraMachine:VraMachine,objVraBlockDevice:VraBlockDevice):VraRequestTracker{
if (objVraBlockDevice.blockDeviceStatus!=="ATTACHED"){
this.objLogger.info("Disk should be in attached state");
returnnull;
}
else{
letobjVraHost:VraHost=objVraMachine.host;
letobjVraInfrastructureClient:VraInfrastructureClient=objVraHost.createInfrastructureClient();
// @ts-ignore
letobjVraMachineService:VraMachineService=objVraInfrastructureClient.createMachineService();
letobjVraRequestTracker:VraRequestTracker=objVraMachineService.detachMachineDisk(objVraMachine.id,objVraBlockDevice.id);
returnobjVraRequestTracker;
}
}TypeScriptDiscover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
