use of com.vmware.vim25.RuntimeFault in project SimianArmy by Netflix.
the class VSphereServiceConnectionWithMockedInventoryNavigator method shouldEncapsulateRuntimeFaultException.
@Test(expectedExceptions = AmazonServiceException.class)
public void shouldEncapsulateRuntimeFaultException() throws RemoteException {
VSphereServiceConnectionWithMockedInventoryNavigator service = new VSphereServiceConnectionWithMockedInventoryNavigator();
InventoryNavigator inventoryNavigatorMock = service.getInventoryNavigatorMock();
when(inventoryNavigatorMock.searchManagedEntities(VIRTUAL_MACHINE_TYPE_NAME)).thenThrow(new RuntimeFault());
service.describeVirtualMachines();
}
use of com.vmware.vim25.RuntimeFault in project coprhd-controller by CoprHD.
the class VCenterAPI method searchManagedEntity.
/**
* Searches from the given parent for a single managed entity with the specified type and name.
*
* @param type the type name.
* @param name the entity name.
* @return the managed entity.
*
* @throws VMWareException if an error occurs.
*/
public <T extends ManagedEntity> T searchManagedEntity(ManagedEntity parent, String type, String name) throws VMWareException {
try {
InventoryNavigator navigator = new InventoryNavigator(parent);
ManagedEntity entity = navigator.searchManagedEntity(type, name);
return (T) entity;
} catch (InvalidProperty e) {
throw new VMWareException(e);
} catch (RuntimeFault e) {
throw new VMWareException(e);
} catch (RemoteException e) {
throw new VMWareException(e);
}
}
use of com.vmware.vim25.RuntimeFault in project coprhd-controller by CoprHD.
the class VCenterAPI method searchManagedEntities.
/**
* Searches from the given parent for managed entities of the specified type.
*
* @param parent the parent entity.
* @param type the type name.
* @param recurse whether to recurse.
* @return the managed entities.
*
* @throws VMWareException if an error occurs.
*/
public ManagedEntity[] searchManagedEntities(ManagedEntity parent, String type, boolean recurse) throws VMWareException {
try {
String[][] typeInfo = new String[][] { new String[] { type, "name" } };
InventoryNavigator navigator = new InventoryNavigator(parent);
ManagedEntity[] entities = navigator.searchManagedEntities(typeInfo, recurse);
return entities;
} catch (InvalidProperty e) {
throw new VMWareException(e);
} catch (RuntimeFault e) {
throw new VMWareException(e);
} catch (RemoteException e) {
throw new VMWareException(e);
}
}
use of com.vmware.vim25.RuntimeFault in project coprhd-controller by CoprHD.
the class HostStorageAPI method refreshStorage.
/**
* Refreshes the storage on the host.
*/
public void refreshStorage() {
try {
HostStorageSystem storageSystem = getStorageSystem();
storageSystem.rescanAllHba();
storageSystem.rescanVmfs();
} catch (HostConfigFault e) {
throw new VMWareException(e);
} catch (RuntimeFault e) {
throw new VMWareException(e);
} catch (RemoteException e) {
throw new VMWareException(e);
}
}
use of com.vmware.vim25.RuntimeFault in project coprhd-controller by CoprHD.
the class HostStorageAPI method attachScsiLun.
/**
* Attaches the lun.
*/
public void attachScsiLun(HostScsiDisk disk) {
try {
HostStorageSystem storageSystem = getStorageSystem();
storageSystem.attachScsiLun(disk.getUuid());
} catch (HostConfigFault e) {
throw new VMWareException(e);
} catch (RuntimeFault e) {
throw new VMWareException(e);
} catch (RemoteException e) {
throw new VMWareException(e);
}
}
Aggregations