Search in sources :

Example 31 with VNXeCommandJob

use of com.emc.storageos.vnxe.models.VNXeCommandJob in project coprhd-controller by CoprHD.

the class VNXeApiClient method expandLun.

public VNXeCommandJob expandLun(String lunID, long newSize, String lunGroupID) {
    VNXeCommandJob job = null;
    _logger.info("expanding lun:" + lunID);
    VNXeLun vnxeLun = getLun(lunID);
    if (vnxeLun == null) {
        _logger.info("Could not find lun in the vxne");
        throw VNXeException.exceptions.vnxeCommandFailed("Could not find lun in the vnxe for: " + lunID);
    }
    LunModifyParam lunModifyParam = new LunModifyParam();
    // set lunParam
    LunParam lunParam = new LunParam();
    lunParam.setSize(newSize);
    lunModifyParam.setLunParameters(lunParam);
    if (vnxeLun.getType() == GENERIC_STORAGE_LUN_TYPE) {
        if (lunGroupID == null || lunGroupID.isEmpty()) {
            _logger.error("Lun Group Id not found for lun: " + lunID);
            throw VNXeException.exceptions.vnxeCommandFailed("Could not find lun group for lun: " + lunID);
        }
        LunGroupModifyParam param = new LunGroupModifyParam();
        List<LunModifyParam> lunModifyParamList = new ArrayList<LunModifyParam>();
        lunModifyParam.setLun(new VNXeBase(lunID));
        lunModifyParamList.add(lunModifyParam);
        param.setLunModify(lunModifyParamList);
        if (isUnityClient()) {
            ConsistencyGroupRequests cgRequest = new ConsistencyGroupRequests(_khClient);
            job = cgRequest.modifyConsistencyGroupAsync(lunGroupID, param);
        } else {
            LunGroupRequests lunGroupRequest = new LunGroupRequests(_khClient);
            job = lunGroupRequest.modifyLunGroupAsync(lunGroupID, param);
        }
    } else if (vnxeLun.getType() == STANDALONE_LUN_TYPE) {
        BlockLunRequests req = new BlockLunRequests(_khClient);
        job = req.modifyLunAsync(lunModifyParam, lunID);
    }
    return job;
}
Also used : VNXeCommandJob(com.emc.storageos.vnxe.models.VNXeCommandJob) VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) LunParam(com.emc.storageos.vnxe.models.LunParam) BlockLunRequests(com.emc.storageos.vnxe.requests.BlockLunRequests) LunGroupRequests(com.emc.storageos.vnxe.requests.LunGroupRequests) LunGroupModifyParam(com.emc.storageos.vnxe.models.LunGroupModifyParam) ArrayList(java.util.ArrayList) VNXeLun(com.emc.storageos.vnxe.models.VNXeLun) ConsistencyGroupRequests(com.emc.storageos.vnxe.requests.ConsistencyGroupRequests) HostLunModifyParam(com.emc.storageos.vnxe.models.HostLunModifyParam) LunModifyParam(com.emc.storageos.vnxe.models.LunModifyParam)

Example 32 with VNXeCommandJob

use of com.emc.storageos.vnxe.models.VNXeCommandJob in project coprhd-controller by CoprHD.

the class ApiClientTest method getJob.

// @Test
public void getJob() {
    JobRequest req = new JobRequest(_client, "N-612");
    VNXeCommandJob job = req.get();
    System.out.println(job.getMessageOut().getMessage());
}
Also used : VNXeCommandJob(com.emc.storageos.vnxe.models.VNXeCommandJob)

Example 33 with VNXeCommandJob

use of com.emc.storageos.vnxe.models.VNXeCommandJob in project coprhd-controller by CoprHD.

the class ApiClientTest method restoreSnap.

// @Test
public void restoreSnap() {
    VNXeCommandJob job = apiClient.restoreSnap("38654706051");
    System.out.println(job.getId());
}
Also used : VNXeCommandJob(com.emc.storageos.vnxe.models.VNXeCommandJob)

Example 34 with VNXeCommandJob

use of com.emc.storageos.vnxe.models.VNXeCommandJob in project coprhd-controller by CoprHD.

the class ApiClientTest method createSnap.

// @Test
public void createSnap() {
    VNXeCommandJob job = apiClient.createSnap("res_47", "snap1vipr41812", false);
    System.out.println(job.getId());
}
Also used : VNXeCommandJob(com.emc.storageos.vnxe.models.VNXeCommandJob)

Example 35 with VNXeCommandJob

use of com.emc.storageos.vnxe.models.VNXeCommandJob in project coprhd-controller by CoprHD.

the class ApiClientTest method createLun.

@Test
public void createLun() {
    String name = "tyu-lun1";
    VNXeCommandJob job = apiClient.createLun(name, "pool_1", 2000000000L, true, null);
    System.out.println(job.getId());
}
Also used : VNXeCommandJob(com.emc.storageos.vnxe.models.VNXeCommandJob) Test(org.junit.Test)

Aggregations

VNXeCommandJob (com.emc.storageos.vnxe.models.VNXeCommandJob)73 VNXeApiClient (com.emc.storageos.vnxe.VNXeApiClient)48 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)41 ServiceError (com.emc.storageos.svcs.errorhandling.model.ServiceError)40 VNXeException (com.emc.storageos.vnxe.VNXeException)40 QueueJob (com.emc.storageos.volumecontroller.impl.job.QueueJob)40 ControllerException (com.emc.storageos.volumecontroller.ControllerException)30 BlockSnapshot (com.emc.storageos.db.client.model.BlockSnapshot)24 Snapshot (com.emc.storageos.db.client.model.Snapshot)18 VNXeFileTaskCompleter (com.emc.storageos.volumecontroller.impl.vnxe.job.VNXeFileTaskCompleter)18 ArrayList (java.util.ArrayList)18 FileShare (com.emc.storageos.db.client.model.FileShare)17 SMBFileShare (com.emc.storageos.db.client.model.SMBFileShare)16 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)16 Volume (com.emc.storageos.db.client.model.Volume)13 URI (java.net.URI)10 VNXeBase (com.emc.storageos.vnxe.models.VNXeBase)9 FileExport (com.emc.storageos.db.client.model.FileExport)8 FileShareExport (com.emc.storageos.volumecontroller.FileShareExport)8 DbClient (com.emc.storageos.db.client.DbClient)7