Search in sources :

Example 66 with BiosCommandResult

use of com.emc.storageos.volumecontroller.impl.BiosCommandResult in project coprhd-controller by CoprHD.

the class VNXFileStorageDeviceXML method getFSSnapshotList.

// Get FS snapshot list from the array
@Override
public BiosCommandResult getFSSnapshotList(StorageSystem storage, FileDeviceInputOutput args, List<String> snapshots) throws ControllerException {
    // TODO: Implement method
    String op = "getFSSnapshotList";
    String devType = storage.getSystemType();
    BiosCommandResult result = BiosCommandResult.createErrorResult(DeviceControllerException.errors.unsupportedOperationOnDevType(op, devType));
    return result;
}
Also used : BiosCommandResult(com.emc.storageos.volumecontroller.impl.BiosCommandResult)

Example 67 with BiosCommandResult

use of com.emc.storageos.volumecontroller.impl.BiosCommandResult in project coprhd-controller by CoprHD.

the class VNXFileStorageDeviceXML method doRestoreFS.

@Override
public BiosCommandResult doRestoreFS(StorageSystem storage, FileDeviceInputOutput args) throws ControllerException {
    _log.info("FileShare, Snapshot {} {}", args.getFsUUID(), args.getSnapshotId());
    _log.info("FSName: {}", args.getFsName());
    _log.info("SnapShotName: {}", args.getSnapshotName());
    int snapNativeId = 0;
    XMLApiResult result = null;
    ApplicationContext context = null;
    try {
        context = loadContext();
        VNXFileCommApi vnxComm = loadVNXFileCommunicationAPIs(context);
        if (null == vnxComm) {
            throw VNXException.exceptions.communicationFailed(VNXCOMM_ERR_MSG);
        }
        result = vnxComm.doRestoreSnapshot(storage, args.getFsNativeId(), args.getFsName(), args.getSnapNativeId(), args.getSnapshotName());
        _log.info("restoreSnapshot call result : {}", result.isCommandSuccess());
    } catch (NumberFormatException ne) {
        // Call failed
        result = new XMLApiResult();
        result.setCommandFailed();
        result.setMessage("Not valid snapshot Id " + args.getSnapNativeId());
    } catch (VNXException e) {
        throw new DeviceControllerException(e);
    } finally {
        clearContext(context);
    }
    _log.info("restoreSnapshot call result : {}", result.isCommandSuccess());
    BiosCommandResult cmdResult = null;
    if (result.isCommandSuccess()) {
        cmdResult = BiosCommandResult.createSuccessfulResult();
    } else {
        cmdResult = BiosCommandResult.createErrorResult(DeviceControllerErrors.vnx.unableToRestoreFileSystem(result.getMessage()));
    }
    return cmdResult;
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ApplicationContext(org.springframework.context.ApplicationContext) VNXException(com.emc.storageos.vnx.xmlapi.VNXException) BiosCommandResult(com.emc.storageos.volumecontroller.impl.BiosCommandResult) VNXFileCommApi(com.emc.storageos.volumecontroller.impl.plugins.provisioning.VNXFileCommApi) XMLApiResult(com.emc.storageos.vnx.xmlapi.XMLApiResult) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) Checkpoint(com.emc.nas.vnxfile.xmlapi.Checkpoint)

Example 68 with BiosCommandResult

use of com.emc.storageos.volumecontroller.impl.BiosCommandResult in project coprhd-controller by CoprHD.

the class VNXeStorageDevice method doDeleteQuotaDirectory.

@Override
public BiosCommandResult doDeleteQuotaDirectory(StorageSystem storage, FileDeviceInputOutput args) throws ControllerException {
    BiosCommandResult result = new BiosCommandResult();
    ServiceError serviceError = DeviceControllerErrors.vnxe.operationNotSupported("Delete Quota Directory", "VNXe");
    result = BiosCommandResult.createErrorResult(serviceError);
    return result;
}
Also used : ServiceError(com.emc.storageos.svcs.errorhandling.model.ServiceError) BiosCommandResult(com.emc.storageos.volumecontroller.impl.BiosCommandResult)

Example 69 with BiosCommandResult

use of com.emc.storageos.volumecontroller.impl.BiosCommandResult in project coprhd-controller by CoprHD.

the class BiosCommandResultTest method doCreateFS.

// In the default/public build, we do not have access to an isilon, so this test is off by default.
@Ignore
@Test
public void doCreateFS() throws Exception {
    FileShare fs = new FileShare();
    fs.setId(URIUtil.createId(FileShare.class));
    fs.setLabel("test");
    fs.setCapacity(102400L);
    FileDeviceInputOutput args = new FileDeviceInputOutput();
    args.addStoragePool(_pool);
    args.setVPool(createVPool());
    args.addFSFileObject(fs);
    final BiosCommandResult result = _isi.doCreateFS(_device, args);
    Assert.assertEquals(Status.error.name(), result.getCommandStatus());
    Assert.assertEquals(false, result.getCommandSuccess());
    Assert.assertEquals(ServiceCode.ISILON_CONNECTION_ERROR, result.getServiceCoded().getServiceCode());
    Assert.assertEquals("Unable to connect to isilon using url https://127.0.0.1:8080/", result.getMessage());
    Assert.assertNotNull(result.getServiceCoded());
}
Also used : BiosCommandResult(com.emc.storageos.volumecontroller.impl.BiosCommandResult) FileDeviceInputOutput(com.emc.storageos.volumecontroller.FileDeviceInputOutput) FileShare(com.emc.storageos.db.client.model.FileShare) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 70 with BiosCommandResult

use of com.emc.storageos.volumecontroller.impl.BiosCommandResult in project coprhd-controller by CoprHD.

the class VNXeStorageDevice method doUpdateQuotaDirectory.

@Override
public BiosCommandResult doUpdateQuotaDirectory(StorageSystem storage, FileDeviceInputOutput args, QuotaDirectory qd) throws ControllerException {
    BiosCommandResult result = new BiosCommandResult();
    ServiceError serviceError = DeviceControllerErrors.vnxe.operationNotSupported("Update Quota Directory", "VNXe");
    result = BiosCommandResult.createErrorResult(serviceError);
    return result;
}
Also used : ServiceError(com.emc.storageos.svcs.errorhandling.model.ServiceError) BiosCommandResult(com.emc.storageos.volumecontroller.impl.BiosCommandResult)

Aggregations

BiosCommandResult (com.emc.storageos.volumecontroller.impl.BiosCommandResult)135 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)76 ServiceError (com.emc.storageos.svcs.errorhandling.model.ServiceError)69 ControllerException (com.emc.storageos.volumecontroller.ControllerException)64 NetAppException (com.emc.storageos.netapp.NetAppException)34 ArrayList (java.util.ArrayList)34 NetworkDeviceControllerException (com.emc.storageos.networkcontroller.exceptions.NetworkDeviceControllerException)28 NetAppCException (com.emc.storageos.netappc.NetAppCException)19 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)18 NetAppApi (com.emc.storageos.netapp.NetAppApi)18 NetAppClusterApi (com.emc.storageos.netappc.NetAppClusterApi)18 URI (java.net.URI)16 VNXException (com.emc.storageos.vnx.xmlapi.VNXException)15 XMLApiResult (com.emc.storageos.vnx.xmlapi.XMLApiResult)15 VNXFileCommApi (com.emc.storageos.volumecontroller.impl.plugins.provisioning.VNXFileCommApi)15 ApplicationContext (org.springframework.context.ApplicationContext)15 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)15 FileShare (com.emc.storageos.db.client.model.FileShare)14 SMBFileShare (com.emc.storageos.db.client.model.SMBFileShare)14 NetworkSystem (com.emc.storageos.db.client.model.NetworkSystem)11