Package com.vmware.host
Class AddVirtualNic
- java.lang.Object
-
- com.vmware.connection.ConnectedVimServiceBase
-
- com.vmware.host.AddVirtualNic
-
@Sample(name="add-virtual-nic", description="This sample is used to add a Virtual Nic to a PortGroup") public class AddVirtualNic extends ConnectedVimServiceBaseAddVirtualNic This sample is used to add a Virtual Nic to a PortGroup or a DVPortGroup Parameters: url [required] : url of the web service username [required] : username for the authentication password [required] : password for the authentication portgroupname [required] : Name of the port group ipaddress [optional] : ipaddress for the nic, if not set DHCP will be in affect for the nic hostname [required] : Name of the host Command Line: Add VirtualNic to a PortGroup on a Virtual Switch run.bat com.vmware.host.AddVirtualNic --url [webserviceurl] --username [username] --password [password] --hostname [hostname] --portgroupname [myportgroup] --ipaddress [AAA.AAA.AAA.AAA]
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vmware.connection.ConnectedVimServiceBase
ConnectedVimServiceBase.ConnectionException
-
-
Field Summary
-
Fields inherited from class com.vmware.connection.ConnectedVimServiceBase
PROP_ME_NAME, SVC_INST_NAME
-
-
Constructor Summary
Constructors Constructor Description AddVirtualNic()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()voidsetHostname(java.lang.String hostname)voidsetIpaddress(java.lang.String ipaddress)voidsetPortgroupname(java.lang.String portgroupname)-
Methods inherited from class com.vmware.connection.ConnectedVimServiceBase
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection
-
-
-
-
Method Detail
-
setPortgroupname
@Option(name="portgroupname", required=true, description="Name of the port group") public void setPortgroupname(java.lang.String portgroupname)
-
setIpaddress
@Option(name="ipaddress", required=false, description="ipaddress for the nic, if not set DHCP will be in affect for the nic") public void setIpaddress(java.lang.String ipaddress)
-
setHostname
@Option(name="hostname", required=false, description="Name of the host") public void setHostname(java.lang.String hostname)
-
run
@Action public void run() throws com.vmware.vim25.RuntimeFaultFaultMsg, com.vmware.vim25.AlreadyExistsFaultMsg, com.vmware.vim25.InvalidStateFaultMsg, java.lang.reflect.InvocationTargetException, com.vmware.vim25.InvalidPropertyFaultMsg, java.lang.NoSuchMethodException, java.lang.IllegalAccessException, com.vmware.vim25.HostConfigFaultFaultMsg- Throws:
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.AlreadyExistsFaultMsgcom.vmware.vim25.InvalidStateFaultMsgjava.lang.reflect.InvocationTargetExceptioncom.vmware.vim25.InvalidPropertyFaultMsgjava.lang.NoSuchMethodExceptionjava.lang.IllegalAccessExceptioncom.vmware.vim25.HostConfigFaultFaultMsg
-
-