com.vmware.vim25.mo.samples.network.AddNIC.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 ? *com/vmware/vim25/mo/samples/network/AddNIC java/lang/Object ()V Code
LineNumberTable LocalVariableTable this ,Lcom/vmware/vim25/mo/samples/network/AddNIC; main ([Ljava/lang/String;)V
Exceptions java/lang/Exception java/lang/System out Ljava/io/PrintStream; .Usage: java AddNIC
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 + dev.acme.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;
! ? ? ? getServerConnection (()Lcom/vmware/vim25/mo/ServerConnection;
? ? ? $com/vmware/vim25/mo/ServerConnection ? logout 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 AddNIC.java ! / *? ?
1
(
?*?? ? ? ?? !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}?
? ??
? ?:? ? +? ?? ??
? % 5 7 9 <