første xml update
[virt-orchestrator.git] / vFLOWER / content / Actions / com.vmware.library.vc.vm.spec / getCustomizationSpec.action.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <dunes-script-module name="getCustomizationSpec" result-type="Any" api-version="3.1.0" id="83fb285c-7f3a-44e4-877b-437d0bcfec25" version="0.2.0" allowed-operations="fv">
3     <description>The Specification data object type contains information required to customize a virtual machine when deploying it or migrating it to a new host.</description>
4
5     <param n="globalIPSettings" t="Any">VimCustomizationGlobalIPSettings: Global IP settings constitute the IP settings that are not specific to a particular virtual network adapter.</param>
6
7     <param n="identity" t="Any">VimCustomizationIdentitySettings: Network identity and settings, similar to Microsoft's Sysprep tool. This is a Sysprep, LinuxPrep, or SysprepText object.</param>
8
9     <param n="nicSettingMap" t="Array/Any">[Optional] Array of VimCustomizationAdapterMapping: IP settings that are specific to a particular virtual network adapter.</param>
10
11     <param n="options" t="Any">[Optional] VimCustomizationOptions: Optional operations (either LinuxOptions or WinOptions).</param>
12
13     <script encoded="false">
14 var customSpec
15 try {
16         checkParams();
17         customSpec = new VcCustomizationSpec();
18         affectParams();
19         return customSpec;
20 }
21 catch (ex) {
22         throw "Unable to create VcCustomizationSpec: " + ex;
23 }
24
25 function affectParams() {
26         customSpec.globalIPSettings = globalIPSettings;
27         customSpec.identity = identity;
28         customSpec.nicSettingMap = nicSettingMap;
29         customSpec.options = options;
30 }
31
32 function checkParams() {
33         if (globalIPSettings == null) throw "globalIPSettings cannot be null";
34         if ((globalIPSettings instanceof VcCustomizationGlobalIPSettings) == false) throw "globalIPSettings must be of type VcCustomizationGlobalIPSettings";
35         if (identity == null) throw "identity cannot be null";
36         if (((identity instanceof VcCustomizationLinuxPrep) || (identity instanceof VcCustomizationSysprep) || (identity instanceof VcCustomizationSysprepText)) == false )
37                 throw "identity must be of type VcCustomizationLinuxPrep, VcCustomizationSysprep or VcCustomizationSysprepText";
38         if (nicSettingMap != null) {
39                 for (var i in nicSettingMap) {
40                         if ((nicSettingMap[i] instanceof VcCustomizationAdapterMapping) == false) {
41                                 throw "nicSettingMap must be of type VcCustomizationAdapterMapping";
42                         }
43                 }
44         }
45         if (options != null &amp;&amp; ((options instanceof VcCustomizationLinuxOptions) || (options instanceof VcCustomizationWinOptions)) == false) throw "options must be of type VcCustomizationOptions";
46 }
47     </script>
48 </dunes-script-module>