første xml update
[virt-orchestrator.git] / vFLOWER / content / Actions / com.vmware.library.vc.vm / cloneVM.action.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <dunes-script-module name="cloneVM" result-type="VC:Task" api-version="3.1.0" id="26dfcb1a-5f7c-48d9-b481-747eaca2b9db" version="0.2.0" allowed-operations="fv">
3     <description>
4 Try to clone a VM.
5     </description>
6
7     <param n="vm" t="VC:VirtualMachine">VM to clone</param>
8
9     <param n="folder" t="VC:VmFolder">The location of the new virtual machine.</param>
10
11     <param n="name" t="string">The name of the new virtual machine.</param>
12
13     <param n="spec" t="Any">VimVirtualMachineCloneSpec: Specifies how to clone the virtual machine.</param>
14
15     <script encoded="false">
16 try {
17         checkParams();
18         return vm.cloneVM_Task(folder, name, spec);
19 }
20 catch (ex) {
21         throw "Unable to start clone operation: " + ex;
22 }
23
24 function checkParams() {
25         if (vm == null) throw "vm cannot be null";
26         if (folder == null) throw "folder cannot be null";
27         if (name == null || name == "") throw "name cannot be null";
28         if (spec == null) throw "spec cannot be null";
29         if ((spec instanceof VcVirtualMachineCloneSpec) == false) throw "spec must be of type VcVirtualMachineCloneSpec";
30 }
31     </script>
32 </dunes-script-module>