første xml update
[virt-orchestrator.git] / vFLOWER / content / Actions / com.vmware.library.vc.vm.spec.nic / getCustomizationIPSettings.action.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <dunes-script-module name="getCustomizationIPSettings" result-type="Any" api-version="3.1.0" id="8e6d65f2-5f54-4c90-b553-00448b577f83" version="0.2.0" allowed-operations="fv">
3     <description>Define IP settings for a virtual network adapter.</description>
4
5     <param n="dnsDomain" t="string">[Optional] A DNS domain suffix such as dunes.ch.</param>
6
7     <param n="dnsServerList" t="Array/string">[Optional] A list of server IP addresses to use for DNS lookup in a Windows guest operating system.</param>
8
9     <param n="gateway" t="Array/string">[Optional] List of gateways, in order of preference.</param>
10
11     <param n="ip" t="Any">VimCustomizationIpGenerator: Specification to obtain a unique IP address for this virtual network adapter.</param>
12
13     <param n="netBIOS" t="VC:CustomizationNetBIOSMode">[Optional] NetBIOS setting for Windows.</param>
14
15     <param n="primaryWINS" t="string">[Optional] The IP address of the primary WINS server. This property is ignored for Linux guest operating systems.</param>
16
17     <param n="secondaryWINS" t="string">[Optional] The IP address of the secondary WINS server. This property is ignored for Linux guest operating systems.</param>
18
19     <param n="subnetMask" t="string">[Optional] Subnet mask for this virtual network adapter.</param>
20
21     <script encoded="false">
22 var ipSettings;
23 checkParams();
24 ipSettings = new VcCustomizationIPSettings();
25 affectParams();
26 return ipSettings;
27
28 function affectParams() {
29         ipSettings.dnsDomain = dnsDomain;
30         ipSettings.dnsServerList = dnsServerList;
31         ipSettings.gateway = gateway;
32         ipSettings.ip = ip;
33         if (netBIOS != null)
34                 ipSettings.netBIOS = VcCustomizationNetBIOSMode.fromString(netBIOS.name) ;
35         ipSettings.primaryWINS = primaryWINS;
36         ipSettings.secondaryWINS = secondaryWINS;
37         ipSettings.subnetMask = subnetMask;
38 }
39
40 function checkParams() {
41         if (ip == null) throw  "ReferenceError: ip cannot be null";
42
43         if (((ip instanceof VcCustomizationCustomIpGenerator) || (ip instanceof VcCustomizationDhcpIpGenerator) ||
44                  (ip instanceof VcCustomizationFixedIp) || (ip instanceof VcCustomizationUnknownIpGenerator)) == false)
45                 throw "ReferenceError: ip must be of type VcCustomizationCustomIpGenerator, VcCustomizationDhcpIpGenerator, VcCustomizationFixedIp or VcCustomizationUnknownIpGenerator";
46         if (ip instanceof VcCustomizationFixedIp) {
47                 if (subnetMask == null || subnetMask == "") {
48                         throw "ReferenceError: SubnetMask is not set";
49                 }
50                 if (gateway == null || gateway.length==0) {
51                         throw "ReferenceError: Gateway is not set";
52                 }
53         }
54 }
55     </script>
56 </dunes-script-module>