com.vmware.vim25.mo.samples.vm.VmCdOp.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/VmCdOp java/lang/Object ()V Code
LineNumberTable LocalVariableTable this 'Lcom/vmware/vim25/mo/samples/vm/VmCdOp; main ([Ljava/lang/String;)V
Exceptions java/lang/Exception java/lang/System out Ljava/io/PrintStream; EUsage: java VmCdOp
java/io/PrintStream println (Ljava/lang/String;)V " device - disk|cd $ op - add|remove
& ' ( 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
[ _ add
a c b java/lang/String d e equalsIgnoreCase (Ljava/lang/String;)Z g storage1 (2) i vimaster
k l m createAddCdConfigSpec t(Lcom/vmware/vim25/mo/VirtualMachine;Ljava/lang/String;Ljava/lang/String;)Lcom/vmware/vim25/VirtualDeviceConfigSpec; o (com/vmware/vim25/VirtualDeviceConfigSpec
[ q r s setDeviceChange .([Lcom/vmware/vim25/VirtualDeviceConfigSpec;)V u remove w CD/DVD Drive 2
y z { createRemoveCdConfigSpec b(Lcom/vmware/vim25/mo/VirtualMachine;Ljava/lang/String;)Lcom/vmware/vim25/VirtualDeviceConfigSpec; } Invlaid device type [disk|cd]
A ? ? reconfigVM_Task G(Lcom/vmware/vim25/VirtualMachineConfigSpec;)Lcom/vmware/vim25/mo/Task;
? ? ? com/vmware/vim25/mo/Task ? Q waitForMe args [Ljava/lang/String; vmname Ljava/lang/String; op si %Lcom/vmware/vim25/mo/ServiceInstance;
rootFolder Lcom/vmware/vim25/mo/Folder; vm $Lcom/vmware/vim25/mo/VirtualMachine; vmConfigSpec +Lcom/vmware/vim25/VirtualMachineConfigSpec; dsName iso cdSpec *Lcom/vmware/vim25/VirtualDeviceConfigSpec; cdName task Lcom/vmware/vim25/mo/Task;
StackMapTable ? ? com/vmware/vim25/mo/Folder
n ? ? ? 1com/vmware/vim25/VirtualDeviceConfigSpecOperation _ ? 3Lcom/vmware/vim25/VirtualDeviceConfigSpecOperation;
n ? ? ? setOperation 6(Lcom/vmware/vim25/VirtualDeviceConfigSpecOperation;)V ? com/vmware/vim25/VirtualCdrom
? ? +com/vmware/vim25/VirtualCdromIsoBackingInfo
?
? ? ? findDatastoreSummary [(Lcom/vmware/vim25/mo/VirtualMachine;Ljava/lang/String;)Lcom/vmware/vim25/DatastoreSummary;
? ? ? !com/vmware/vim25/DatastoreSummary ? ? getDatastore +()Lcom/vmware/vim25/ManagedObjectReference;
? ? ? ? setDatastore ,(Lcom/vmware/vim25/ManagedObjectReference;)V ? [ ? ]
A ? ? Q getName ? / ? .iso
? ? ? setFileName
? ? ? getIDEController F(Lcom/vmware/vim25/mo/VirtualMachine;)Lcom/vmware/vim25/VirtualDevice;
? ? ? ?
setBacking .(Lcom/vmware/vim25/VirtualDeviceBackingInfo;)V
? ? ? com/vmware/vim25/VirtualDevice ? ? getKey ()I
? ? ? java/lang/Integer ? ? valueOf (I)Ljava/lang/Integer;
? ? ? ? setControllerKey (Ljava/lang/Integer;)V
? ? ? ?
getUnitNumber ()Ljava/lang/Integer;
? ? ? ?
setUnitNumber
? ? ? ( setKey
n ? ? ? setDevice #(Lcom/vmware/vim25/VirtualDevice;)V isoName cdrom Lcom/vmware/vim25/VirtualCdrom; cdDeviceBacking -Lcom/vmware/vim25/VirtualCdromIsoBackingInfo; ds #Lcom/vmware/vim25/DatastoreSummary; vd Lcom/vmware/vim25/VirtualDevice; ? ? u ?
A ? ? ? getConfig -()Lcom/vmware/vim25/VirtualMachineConfigInfo;
findVirtualDevice _(Lcom/vmware/vim25/VirtualMachineConfigInfo;Ljava/lang/String;)Lcom/vmware/vim25/VirtualDevice; No device available cdRemove
)com/vmware/vim25/VirtualMachineConfigInfo getHardware $()Lcom/vmware/vim25/VirtualHardware;
com/vmware/vim25/VirtualHardware getDevice #()[Lcom/vmware/vim25/VirtualDevice;
?
getDeviceInfo ()Lcom/vmware/vim25/Description;
com/vmware/vim25/Description Q getLabel
a equals (Ljava/lang/Object;)Z vmConfig +Lcom/vmware/vim25/VirtualMachineConfigInfo; name devices ![Lcom/vmware/vim25/VirtualDevice; i I$
A)*+
getRuntime .()Lcom/vmware/vim25/VirtualMachineRuntimeInfo;
A-./ getEnvironmentBrowser *()Lcom/vmware/vim25/mo/EnvironmentBrowser;
132 *com/vmware/vim25/VirtualMachineRuntimeInfo4 ? getHost6 No Datastore found8 com/vmware/vim25/mo/HostSystem
A S
7; < R(Lcom/vmware/vim25/mo/ServerConnection;Lcom/vmware/vim25/ManagedObjectReference;)V
>@? &com/vmware/vim25/mo/EnvironmentBrowserAB queryConfigTarget A(Lcom/vmware/vim25/mo/HostSystem;)Lcom/vmware/vim25/ConfigTarget;
DFE com/vmware/vim25/ConfigTarget ?G 1()[Lcom/vmware/vim25/VirtualMachineDatastoreInfo;
IKJ ,com/vmware/vim25/VirtualMachineDatastoreInfo ?L %()Lcom/vmware/vim25/DatastoreSummary;
?NOP isAccessible ()Z
? ? dsSum
vmRuntimeInfo ,Lcom/vmware/vim25/VirtualMachineRuntimeInfo;
envBrowser (Lcom/vmware/vim25/mo/EnvironmentBrowser; hmor )Lcom/vmware/vim25/ManagedObjectReference; configTarget Lcom/vmware/vim25/ConfigTarget; dis /[Lcom/vmware/vim25/VirtualMachineDatastoreInfo;^ 'com/vmware/vim25/ManagedObjectReference\
abc getDefaultDevices G(Lcom/vmware/vim25/mo/VirtualMachine;)[Lcom/vmware/vim25/VirtualDevice;e %com/vmware/vim25/VirtualIDEController
ideController defaultDevices
>ijk queryConfigOption a(Ljava/lang/String;Lcom/vmware/vim25/mo/HostSystem;)Lcom/vmware/vim25/VirtualMachineConfigOption;
mon +com/vmware/vim25/VirtualMachineConfigOptionp getDefaultDevicer %No Datastore found in ComputeResource
.u /No VirtualHardwareInfo found in ComputeResource cfgOpt -Lcom/vmware/vim25/VirtualMachineConfigOption; defaultDevs
SourceFile VmCdOp.java ! / *? ?
C
O
?*?? ? ? ? !? ? #? ? %*2L*2M? )Y? +Y*2? -*2*2? /N-? 2:? 6Y? 8;+? =? A:? &? ? CYE? G+? HL? H? N? -? R? V?? [Y? ]:^,? `? 'f:h:? j: ? nY S? p? 3t,? `? !v:? x:? nYS? p? ? |? ?? ~:? ?W?
? # G I K L M " O &