@Sample(name="add-virtual-switch-port-group",
description="add a Virtual Machine Port Group to a vSwitch")
public class AddVirtualSwitchPortGroup
extends ConnectedVimServiceBase
AddVirtualSwitchPortGroup This sample is used to add a Virtual Machine Port Group to a vSwitch Parameters: url [required] : url of the web service username [required] : username for the authentication password [required] : password for the authentication vswitchid [required] : Name of the vSwitch to add portgroup to portgroupname [required] : Name of the port group hostname [optional] : Name of the host Command Line: Add Virtual switch Port Group: run.bat com.vmware.host.AddVirtualSwitchPortGroup --url [webserviceurl] --username [username] --password [password] --vswitchid [mySwitch] --portgroupname [myportgroup] --hostname [hostname]
ConnectedVimServiceBase.ConnectionExceptionPROP_ME_NAME, SVC_INST_NAME| Constructor and Description |
|---|
AddVirtualSwitchPortGroup() |
| Modifier and Type | Method and Description |
|---|---|
void |
run() |
void |
setHost(java.lang.String host) |
void |
setPortgroupname(java.lang.String portgroupname) |
void |
setVirtualswitchid(java.lang.String virtualswitchid) |
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection@Option(name="hostname",
required=false,
description="Name of the host")
public void setHost(java.lang.String host)
@Option(name="portgroupname",
description="Name of the port group")
public void setPortgroupname(java.lang.String portgroupname)
@Option(name="vswitchid",
description="Name of the vSwitch to add portgroup to")
public void setVirtualswitchid(java.lang.String virtualswitchid)
@Action
public void run()
throws com.vmware.vim25.RuntimeFaultFaultMsg,
com.vmware.vim25.InvalidPropertyFaultMsg
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsg