com.vmware.vim25.mo.samples.vm.VmNicOp.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/vm/VmNicOp java/lang/Object ()V Code
LineNumberTable LocalVariableTable this (Lcom/vmware/vim25/mo/samples/vm/VmNicOp; main ([Ljava/lang/String;)V
Exceptions java/lang/Exception java/lang/System out Ljava/io/PrintStream; DUsage: java VmNicOp
java/io/PrintStream println (Ljava/lang/String;)V " op - add|remove $ 2name - NIC name when remove; Network name when add
& ' ( exit (I)V * #com/vmware/vim25/mo/ServiceInstance , java/net/URL
+ .
) 0 1 6(Ljava/net/URL;Ljava/lang/String;Ljava/lang/String;Z)V
) 3 4 5
getRootFolder ()Lcom/vmware/vim25/mo/Folder; 7 &com/vmware/vim25/mo/InventoryNavigator
6 9 : &(Lcom/vmware/vim25/mo/ManagedEntity;)V < VirtualMachine
6 > ? @ searchManagedEntity I(Ljava/lang/String;Ljava/lang/String;)Lcom/vmware/vim25/mo/ManagedEntity; B "com/vmware/vim25/mo/VirtualMachine D java/lang/StringBuilder F No VM
C .
C I J K append -(Ljava/lang/String;)Ljava/lang/StringBuilder; M found
C O P Q toString ()Ljava/lang/String;
) S T U getServerConnection (()Lcom/vmware/vim25/mo/ServerConnection;
W Y X $com/vmware/vim25/mo/ServerConnection Z logout \ )com/vmware/vim25/VirtualMachineConfigSpec
[
_ ` a getNICDeviceConfigSpec t(Lcom/vmware/vim25/mo/VirtualMachine;Ljava/lang/String;Ljava/lang/String;)Lcom/vmware/vim25/VirtualDeviceConfigSpec; c (com/vmware/vim25/VirtualDeviceConfigSpec
[ e f g setDeviceChange .([Lcom/vmware/vim25/VirtualDeviceConfigSpec;)V
A i j k reconfigVM_Task G(Lcom/vmware/vim25/VirtualMachineConfigSpec;)Lcom/vmware/vim25/mo/Task;
m o n com/vmware/vim25/mo/Task p Q waitForMe r success t Done with NIC for VM: v Failed with NIC for VM: args [Ljava/lang/String; vmname Ljava/lang/String; op name si %Lcom/vmware/vim25/mo/ServiceInstance;
rootFolder Lcom/vmware/vim25/mo/Folder; vm $Lcom/vmware/vim25/mo/VirtualMachine; vmConfigSpec +Lcom/vmware/vim25/VirtualMachineConfigSpec; nicSpec *Lcom/vmware/vim25/VirtualDeviceConfigSpec; result task Lcom/vmware/vim25/mo/Task;
StackMapTable x ? java/lang/String ? com/vmware/vim25/mo/Folder
b
A ? ? ? getConfig -()Lcom/vmware/vim25/VirtualMachineConfigInfo; ? add
? ? ? ? equalsIgnoreCase (Ljava/lang/String;)Z
? ? ? doesNetworkNameExist 9(Lcom/vmware/vim25/mo/VirtualMachine;Ljava/lang/String;)Z ? ? ? 1com/vmware/vim25/VirtualDeviceConfigSpecOperation ? ? 3Lcom/vmware/vim25/VirtualDeviceConfigSpecOperation;
b ? ? ? setOperation 6(Lcom/vmware/vim25/VirtualDeviceConfigSpecOperation;)V ? com/vmware/vim25/VirtualPCNet32
? ? 6com/vmware/vim25/VirtualEthernetCardNetworkBackingInfo
?
? ? ?
setDeviceName ? generated
? ? ? $com/vmware/vim25/VirtualEthernetCard ? setAddressType
? ? ? ?
setBacking .(Lcom/vmware/vim25/VirtualDeviceBackingInfo;)V
? ? ? ( setKey
b ? ? ? setDevice #(Lcom/vmware/vim25/VirtualDevice;)V ? remove
? ? ? )com/vmware/vim25/VirtualMachineConfigInfo ? ? getHardware $()Lcom/vmware/vim25/VirtualHardware;
? ? ? com/vmware/vim25/VirtualHardware ? ? getDevice #()[Lcom/vmware/vim25/VirtualDevice; ? ? ? ?
? ? ? com/vmware/vim25/VirtualDevice ? ?
getDeviceInfo ()Lcom/vmware/vim25/Description;
? ? ? com/vmware/vim25/Description ? Q getLabel vmConfigInfo +Lcom/vmware/vim25/VirtualMachineConfigInfo; nic &Lcom/vmware/vim25/VirtualEthernetCard;
nicBacking 8Lcom/vmware/vim25/VirtualEthernetCardNetworkBackingInfo; vds ![Lcom/vmware/vim25/VirtualDevice; i I ?
A ? ? ?
getRuntime .()Lcom/vmware/vim25/VirtualMachineRuntimeInfo;
A ? ? ? getEnvironmentBrowser *()Lcom/vmware/vim25/mo/EnvironmentBrowser;
? ? ? *com/vmware/vim25/VirtualMachineRuntimeInfo ? ? getHost +()Lcom/vmware/vim25/ManagedObjectReference; ? com/vmware/vim25/mo/HostSystem
A S
? ? ? R(Lcom/vmware/vim25/mo/ServerConnection;Lcom/vmware/vim25/ManagedObjectReference;)V
? ? &com/vmware/vim25/mo/EnvironmentBrowser queryConfigTarget A(Lcom/vmware/vim25/mo/HostSystem;)Lcom/vmware/vim25/ConfigTarget;
com/vmware/vim25/ConfigTarget
getNetwork /()[Lcom/vmware/vim25/VirtualMachineNetworkInfo;
*com/vmware/vim25/VirtualMachineNetworkInfo
#()Lcom/vmware/vim25/NetworkSummary;
com/vmware/vim25/NetworkSummary isAccessible ()Z
Q getName netName
vmRuntimeInfo ,Lcom/vmware/vim25/VirtualMachineRuntimeInfo;
envBrowser (Lcom/vmware/vim25/mo/EnvironmentBrowser; hmor )Lcom/vmware/vim25/ManagedObjectReference; host Lcom/vmware/vim25/mo/HostSystem; cfg Lcom/vmware/vim25/ConfigTarget; nets -[Lcom/vmware/vim25/VirtualMachineNetworkInfo;
netSummary !Lcom/vmware/vim25/NetworkSummary;' 'com/vmware/vim25/ManagedObjectReference#
SourceFile VmNicOp.java ! / *? ?
<