Class AddVirtualSwitchPortGroup


  • @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]
     
    • Constructor Detail

      • AddVirtualSwitchPortGroup

        public AddVirtualSwitchPortGroup()
    • Method Detail

      • setHost

        @Option(name="hostname",
                required=false,
                description="Name of the host")
        public void setHost​(java.lang.String host)
      • setPortgroupname

        @Option(name="portgroupname",
                description="Name of the port group")
        public void setPortgroupname​(java.lang.String portgroupname)
      • setVirtualswitchid

        @Option(name="vswitchid",
                description="Name of the vSwitch to add portgroup to")
        public void setVirtualswitchid​(java.lang.String virtualswitchid)
      • run

        @Action
        public void run()
                 throws com.vmware.vim25.RuntimeFaultFaultMsg,
                        com.vmware.vim25.InvalidPropertyFaultMsg
        Throws:
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.InvalidPropertyFaultMsg