-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateProperties.js
More file actions
18 lines (14 loc) · 816 Bytes
/
updateProperties.js
File metadata and controls
18 lines (14 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//define variables
virtualMachineId = payload.machine.get("id");
//get virtual machine entity from id
virtualMachineEntity = System.getModule("com.vmware.library.vcac").getVirtualMachineEntityFromId(host,virtualMachineId);
//Property names and values to update
propertyName = [name1, name2];
propertyValues = [value1, value2];
//Update properties
var n
System.log("Updating propertyNames: " + propertyName + " with propertyValues " + propertyValue);
for (n = 0; n < propertyName.length; n++ ){
System.log("Updating propertyName: " + propertyName[n] + " with propertyValue " + propertyValue[n]);
System.getModule("com.vmware.library.vcac").addUpdatePropertyFromVirtualMachineEntity(host,virtualMachineEntity,propertyName[n],propertyValue[n],propertyIsHidden,propertyIsRuntime,propertyIsEncrypted,doNotUpdate) ;
}