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