Skip to content

Instantly share code, notes, and snippets.

@YagmurOzden
YagmurOzden / RestTemplate.js
Created August 29, 2022 09:14
Rest Template for using rest operations.
// VMware vRealize Orchestrator action sample
// vRA 8.7.0
// input type: restHost [REST:RESTHost]
// return type: Any
function createRestOperation(method, urlTemplate) {
var op = new RESTOperation(urlTemplate);
op.name = urlTemplate;
op.method = method;
@YagmurOzden
YagmurOzden / ApplyCustomSpec.js
Created August 3, 2022 07:11
it creates a Custom Specification for reconfigure the VM. and this custom spec creates 2 nic one of them with static connection and the other nic is eth1 and it uses DHCP
// VMware vRealize Orchestrator action sample
// vRA 8.8.0
//It creates 2 nic one of them with static connection and the other nic is eth1 and it uses DHCP
//so therefore i am connecting the machine after this action has deployed and change its value inside.
//action input type: VM vc:virtual machine
guestNetInfoDNSServerList Array string
guestNetInfoDNSSuffixList Array string
guestNetInfoDomain string
@YagmurOzden
YagmurOzden / PowerOFFVM.js
Created July 29, 2022 09:26
Powering off the VM with vim3WaitTaskEnd. VMware vRealize Orchestrator vRO 8.5.0, JavaScprit
// VMware vRealize Orchestrator action sample
// vRA 8.5.0
//action input type: vm : VC:VirtualMachine
//action return type: void
var poweroffTask = vm.powerOffVM_Task();
System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd(
@YagmurOzden
YagmurOzden / PowerONVM.js
Created July 29, 2022 09:25
Powering on the VM with vim3WaitTaskEnd. VMware vRealize Orchestrator vRO 8.5.0, JavaScprit
// VMware vRealize Orchestrator action sample
// vRA 8.5.0
//action input type: vm : VC:VirtualMachine
//action return type: void
var poweronTask = vm.powerOnVM_Task();
System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd(
@YagmurOzden
YagmurOzden / getClustersHost.js
Created April 5, 2022 08:22
returns a random host belonging to that cluster , vRO, vRO action, workflow, cluster, host
// VMware vRealize Orchestrator action sample
// vRA 8.4
//workflow return type: (VC:HostSystem),
// input type: cluster(string, Enter the cluster entry so that the host can be selected)
// this code below gets all clusters
var clusters =VcPlugin.getAllClusterComputeResources();
var hosts = VcPlugin.getAllHostSystems();
@YagmurOzden
YagmurOzden / mailContent.js
Created January 6, 2022 07:34
content of the mail about catalog item informations. | VMware vRO workflow, vSphere, GuestOS, VM, Virtual Machine, vRO action, mail content with html css
// VMware vRealize Orchestrator action sample
// vRA 8.4
//workflow input type: time (number),
// date (string)
//workflow return type: string
@YagmurOzden
YagmurOzden / numberOfRepetitionsAsProp.js
Created January 6, 2022 07:33
This action creates properties about which catalogue item used how many times. | VMware vRO action, vSphere, Configuration Element
// VMware vRealize Orchestrator action sample
// vRA 8.4
//action input type: none
//action return type: Properties
var deployment = System.getModule("<your-path-name>").getConfigurationElementWhoseTypeIsProperties("Catalog Item Credentials","deployment");
var catalogItems =System.getModule("<your-path-name>").getConfigurationElementWhoseTypeIsProperties("Catalog Item Credentials","catalogItems");
@YagmurOzden
YagmurOzden / getVMsCluster.js
Created January 6, 2022 07:25
VMware vRO action, vSphere, Virtual Machine, get virtual machine's cluster
// VMware vRealize Orchestrator action sample
// vRA 8.4
//action input type: vm (VC:VirtualMachine)
//action return type: VC:ClusterComputeResource
var parent = vm.runtime.host;
while (parent !== null && ! (parent instanceof VcClusterComputeResource)) {
@YagmurOzden
YagmurOzden / removeSnapshotORSnapshots.js
Created December 24, 2021 06:42
Deletes the selected snapshot or all snapshots in the selected virtual machine. (VMware vRO workflow, vSphere, snapshot, VM, Virtual Machine)
// VMware vRealize Orchestrator action sample
// vRA 8.4
//workflow input type: VM (VC:VirtualMachine)
// snapshotname (string)
// removeAllSnapshotsOfVM
//workflow output type:
@YagmurOzden
YagmurOzden / setGuestOS.js
Last active December 24, 2021 06:42
VMware vRO workflow, vSphere, GuestOS, VM, Virtual Machine
// VMware vRealize Orchestrator workflow sample
// vRA 8.4
//workflow input type: guestOSName (ARRAY/VC:VirtualMachineGuestOSIdentifier),
// guestOSDescription (ARRAY/string),
// OS (string),
// vmName (string)
//workflow return type: guestOSName (ARRAY/VC:VirtualMachineGuestOSIdentifier)