com.vmware.vim25.mo.samples.network.AddVirtualSwitch.class Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vijava Show documentation
Show all versions of vijava Show documentation
Java API for accessing VMWare web services API
The newest version!
???? 2 ? 4com/vmware/vim25/mo/samples/network/AddVirtualSwitch java/lang/Object ()V Code
LineNumberTable LocalVariableTable this 6Lcom/vmware/vim25/mo/samples/network/AddVirtualSwitch; main ([Ljava/lang/String;)V
Exceptions java/lang/Exception java/lang/System out Ljava/io/PrintStream; 5Usage: java AddVirtualNic
java/io/PrintStream println (Ljava/lang/String;)V " #com/vmware/vim25/mo/ServiceInstance $ java/net/URL
# &
! ( ) 6(Ljava/net/URL;Ljava/lang/String;Ljava/lang/String;Z)V + sjin-dev1.eng.vmware.com - ViMaster PortGroup / ViMaster Switch
! 1 2 3
getRootFolder ()Lcom/vmware/vim25/mo/Folder; 5 &com/vmware/vim25/mo/InventoryNavigator
4 7 8 &(Lcom/vmware/vim25/mo/ManagedEntity;)V :
HostSystem
4 < = > searchManagedEntity I(Ljava/lang/String;Ljava/lang/String;)Lcom/vmware/vim25/mo/ManagedEntity; @ com/vmware/vim25/mo/HostSystem
? B C D getHostNetworkSystem )()Lcom/vmware/vim25/mo/HostNetworkSystem; F &com/vmware/vim25/HostVirtualSwitchSpec
E
E I J K setNumPorts (I)V
M O N %com/vmware/vim25/mo/HostNetworkSystem P Q addVirtualSwitch =(Ljava/lang/String;Lcom/vmware/vim25/HostVirtualSwitchSpec;)V S "com/vmware/vim25/HostPortGroupSpec
R
R V W setName
R Y Z K setVlanId
R \ ] setVswitchName _ "com/vmware/vim25/HostNetworkPolicy
^
R b c d setPolicy '(Lcom/vmware/vim25/HostNetworkPolicy;)V
M f g h addPortGroup '(Lcom/vmware/vim25/HostPortGroupSpec;)V j #com/vmware/vim25/HostVirtualNicSpec
i m 00:50:56:7d:5e:0b
i o p setMac r com/vmware/vim25/HostIpConfig
q
q u v w setDhcp (Z)V y
10.20.143.204
q { | setIpAddress ~
255.255.252.0
q ? ?
setSubnetMask
i ? ? ? setIp "(Lcom/vmware/vim25/HostIpConfig;)V ? VMKernel
M ? ? ?
addVirtualNic K(Ljava/lang/String;Lcom/vmware/vim25/HostVirtualNicSpec;)Ljava/lang/String; ? java/lang/StringBuilder ? Successful created :
? &
? ? ? ? append -(Ljava/lang/String;)Ljava/lang/StringBuilder;
? ? ? ? toString ()Ljava/lang/String; args [Ljava/lang/String; si %Lcom/vmware/vim25/mo/ServiceInstance; hostname Ljava/lang/String;
portGroupName
switchName
rootFolder Lcom/vmware/vim25/mo/Folder; host Lcom/vmware/vim25/mo/HostSystem; hns 'Lcom/vmware/vim25/mo/HostNetworkSystem; spec (Lcom/vmware/vim25/HostVirtualSwitchSpec; hpgs $Lcom/vmware/vim25/HostPortGroupSpec; hvns %Lcom/vmware/vim25/HostVirtualNicSpec; hic Lcom/vmware/vim25/HostIpConfig; result
StackMapTable
SourceFile AddVirtualSwitch.java ! / *? ?
3
8
?*?? ? ? ?? !Y? #Y*2? %*2*2? 'L*M,N.:+? 0::? 4Y? 69,? ;? ?:? A:? EY? G:? H? L? RY? T: -? U ? X ? [ ? ^Y? `? a ? e? iY? k:
l? n? qY? s:? tx? z}?
? ??
? ?:? ? ? ? ?Y?? ?? ?? ?? ?
? % 7 9 ; > ? $ > ( A + B . C 2 E 8 F ; G ? H A G D H J G O J V M _ N f O o R x S ~ T ? U ? V ? W ? Z ? [ ? \ ? ] ? ^ ? _ ? ` ? a ? b ? d ? e ?
? ? ? ( ? ? ? + ? ? ? . ? ? ? 2 ? ? ? 8 ? ? ? ; ? ? ? V ? ? ? _ ? ? ? x ? ? ? ? V ? ?
? F ? ? ? ? ? ? ? ?