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 Snapshot
Public Function: MachineSnapshotCreate
public MachineSnapshotCreate(objVraMachine: VraMachine, strName: string, strDescription: string, blnSnapshotMemory: boolean = false): VraRequestTracker {
let objVraHref: VraHref = new VraHref();
objVraHref.addHrefsItem(objVraMachine.id);
let objVraSnapshotSpecification: VraSnapshotSpecification = new VraSnapshotSpecification();
objVraSnapshotSpecification.name = strName;
objVraSnapshotSpecification.description = strDescription
objVraSnapshotSpecification.id = objVraMachine.id;
objVraSnapshotSpecification.snapshotMemory = blnSnapshotMemory;
objVraSnapshotSpecification.putLinksItem("snaphostHref", objVraHref);
let objVraHost: VraHost = objVraMachine.host;
let objVraInfrastructureClient: VraInfrastructureClient = objVraHost.createInfrastructureClient();
// @ts-ignore
let objVraMachineService: VraMachineService = objVraInfrastructureClient.createMachineService();
let objVraRequestTracker: VraRequestTracker = objVraMachineService.createMachineSnapshot(objVraMachine.id, objVraSnapshotSpecification);
return objVraRequestTracker;
}TypeScriptDiscover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
