Class RemoveVirtualNic


  • @Sample(name="remove-virtual-nic",
            description="removes a Virtual Nic from a PortGroup on a vSwitch")
    public class RemoveVirtualNic
    extends ConnectedVimServiceBase
     RemoveVirtualNic
    
     This sample removes a Virtual Nic from a PortGroup on a vSwitch
    
     Parameters:
     url              [required] : url of the web service
     username         [required] : username for the authentication
     password         [required] : password for the authentication
     portgroupname    [required] : Name of port group to remove Virtual Nic from
     hostname         [required] : Name of host
     datacentername   [optional] : Name of datacenter
    
     Command Line:
     Remove a VirtualNic from a PortGroup
     run.bat com.vmware.host.RemoveVirtualNic --url [webserviceurl]
     --username [username] --password  [password] --datacentername [mydatacenter]
     --portgroupname [myportgroup] --hostname [hostname]
    
     Remove a VirtualNic from a PortGroup without hostname
     run.bat com.vmware.host.RemoveVirtualNic --url [webserviceurl]
     --username [username] --password  [password] --datacentername [mydatacenter]
     --portgroupname [myportgroup]
    
     Remove a VirtualNic from a PortGroup without datacentername
     run.bat com.vmware.host.RemoveVirtualNic --url [webserviceurl]
     --username [username] --password  [password]
     --portgroupname [myportgroup] --hostname [name of the host]
     
    • Constructor Detail

      • RemoveVirtualNic

        public RemoveVirtualNic()
    • Method Detail

      • setDatacenter

        @Option(name="datacentername",
                required=false,
                description="Name of datacenter")
        public void setDatacenter​(java.lang.String datacenter)
      • setHost

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

        @Option(name="portgroupname",
                description="Name of port group to remove Virtual Nic from")
        public void setPortgroupname​(java.lang.String portgroupname)
      • run

        @Action
        public void run()