første xml update
[virt-orchestrator.git] / vFLOWER / content / Actions / com.vmware.library.vc.vm.spec / getConfigSpecSimple.action.xml
CommitLineData
d8fdd35b
SA
1<?xml version="1.0" encoding="UTF-8"?>
2<dunes-script-module name="getConfigSpecSimple" result-type="Any" api-version="3.1.0" id="7a2f1a94-b487-4af3-be72-ed776ec029ab" version="0.2.1" allowed-operations="fv">
3 <description>
4The ConfigSpec data object type encapsulates configuration settings when creating or reconfiguring a virtual machine. To support incremental changes, these properties are all optional.
5Basic Version
6 </description>
7
8 <param n="deviceChange" t="Array/Any">[optional] Array of VirtualDeviceConfigSpec: Set of virtual devices being modified by the configuration operation.</param>
9
10 <param n="files" t="Any">[optional] VirtualMachineFileInfo: Information about virtual machine files</param>
11
12 <param n="flags" t="Any">[optional] VirtualMachineFlagInfo: Additional flags for a virtual machine.</param>
13
14 <param n="memoryMB" t="number">[optional] Size of a virtual machine's memory, in MB.</param>
15
16 <param n="name" t="string">[optional] Display name of the virtual machine.</param>
17
18 <param n="numCPUs" t="number">[optional] Number of virtual processors in a virtual machine.</param>
19
20 <script encoded="false">
21try {
22 checkParam();
23 var configSpec = new VcVirtualMachineConfigSpec();
24 affectParam();
25 return configSpec;
26}
27catch (ex) {
28 throw "Unable to create VcVirtualMachineConfigSpec: " + ex;
29}
30
31
32function affectParam() {
33 configSpec.deviceChange = deviceChange;
34 configSpec.files = files;
35 configSpec.flags = flags;
36 configSpec.memoryMB = memoryMB;
37 configSpec.name = name;
38 configSpec.numCPUs = numCPUs;
39}
40
41function checkParam() {
42 if (deviceChange != null) {
43 for (var i in deviceChange) {
44 if ((deviceChange[i] instanceof VcVirtualDeviceConfigSpec) == false) throw "deviceChange must be of type 'Array of VcVirtualDeviceConfigSpec'";
45 }
46 }
47 if (files != null &amp;&amp; (files instanceof VcVirtualMachineFileInfo) == false) throw "files must be of type 'VcVirtualMachineFileInfo'";
48 if (flags != null &amp;&amp; (flags instanceof VcVirtualMachineFlagInfo) == false) throw "flags must be of type 'VcVirtualMachineFlagInfo'";
49}
50 </script>
51</dunes-script-module>