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 Machine Custom Properties
Public Function: MachineCustomPropertiesCreate
public MachineCustomPropertiesCreate(objVraMachine: VraMachine, objProperties: Properties): VraMachine {
let objVraUpdateMachineSpecification: VraUpdateMachineSpecification = new VraUpdateMachineSpecification();
let arrKey: string[] = objProperties.keys;
arrKey.forEach((strKey: string): void => {
objVraUpdateMachineSpecification.putCustomPropertiesItem(strKey, objProperties.get(strKey));
});
let objVraHost: VraHost = objVraMachine.host;
let objVraInfrastructureClient: VraInfrastructureClient = objVraHost.createInfrastructureClient();
// @ts-ignore
let objVraMachineService: VraMachineService = objVraInfrastructureClient.createMachineService();
objVraMachine = objVraMachineService.updateMachine(objVraMachine, objVraUpdateMachineSpecification);
return objVraMachine;
}TypeScriptDiscover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
