Search in sources :

Example 16 with VNXeCommandResult

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

the class DeleteHostRequest method deleteHostInitiatorSync.

private VNXeCommandResult deleteHostInitiatorSync() {
    deleteRequest(null);
    VNXeCommandResult result = new VNXeCommandResult();
    result.setSuccess(true);
    return result;
}
Also used : VNXeCommandResult(com.emc.storageos.vnxe.models.VNXeCommandResult)

Example 17 with VNXeCommandResult

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

the class DeleteStorageResourceRequest method deleteResourceSync.

private VNXeCommandResult deleteResourceSync(String resourceId, boolean isForceSnapDeletion) {
    _url = URL + resourceId;
    DeleteStorageResourceParam parm = new DeleteStorageResourceParam();
    parm.setForceSnapDeletion(isForceSnapDeletion);
    deleteRequest(parm);
    VNXeCommandResult result = new VNXeCommandResult();
    result.setSuccess(true);
    return result;
}
Also used : VNXeCommandResult(com.emc.storageos.vnxe.models.VNXeCommandResult) DeleteStorageResourceParam(com.emc.storageos.vnxe.models.DeleteStorageResourceParam)

Example 18 with VNXeCommandResult

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

the class KHRequests method postRequestSync.

public VNXeCommandResult postRequestSync(ParamBase param) {
    ClientResponse response = postRequest(param);
    if (response.getClientResponseStatus() == ClientResponse.Status.NO_CONTENT) {
        VNXeCommandResult result = new VNXeCommandResult();
        result.setSuccess(true);
        return result;
    }
    String resString = response.getEntity(String.class);
    _logger.debug("KH API returned: {} ", resString);
    JSONObject res;
    String objectString = null;
    VNXeCommandResult returnedObject = null;
    try {
        res = new JSONObject(resString);
        if (res != null) {
            JSONObject object = (JSONObject) res.get(VNXeConstants.CONTENT);
            if (object != null) {
                objectString = object.toString();
                ObjectMapper mapper = new ObjectMapper();
                try {
                    returnedObject = mapper.readValue(objectString, VNXeCommandResult.class);
                    returnedObject.setSuccess(true);
                } catch (JsonParseException e) {
                    _logger.error(String.format("unexpected data returned: %s", objectString), e);
                    throw VNXeException.exceptions.unexpectedDataError(String.format("unexpected data returned: %s", objectString), e);
                } catch (JsonMappingException e) {
                    _logger.error(String.format("unexpected data returned: %s", objectString), e);
                    throw VNXeException.exceptions.unexpectedDataError(String.format("unexpected data returned: %s", objectString), e);
                } catch (IOException e) {
                    _logger.error(String.format("unexpected data returned: %s", objectString), e);
                    throw VNXeException.exceptions.unexpectedDataError(String.format("unexpected data returned: %s", objectString), e);
                }
            }
        }
    } catch (JSONException e) {
        _logger.error(String.format("unexpected data returned: %s from: %s", resString, _url), e);
        throw VNXeException.exceptions.unexpectedDataError(String.format("unexpected data returned: %s", objectString), e);
    }
    return returnedObject;
}
Also used : ClientResponse(com.sun.jersey.api.client.ClientResponse) VNXeCommandResult(com.emc.storageos.vnxe.models.VNXeCommandResult) JSONObject(org.codehaus.jettison.json.JSONObject) JsonMappingException(org.codehaus.jackson.map.JsonMappingException) JSONException(org.codehaus.jettison.json.JSONException) IOException(java.io.IOException) JsonParseException(org.codehaus.jackson.JsonParseException) ObjectMapper(org.codehaus.jackson.map.ObjectMapper)

Example 19 with VNXeCommandResult

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

the class ApiClientTest method deleteLunGroup.

// @Test
public void deleteLunGroup() {
    VNXeCommandResult result = apiClient.deleteLunGroup("res_14", true, true);
    System.out.println(result.getId());
}
Also used : VNXeCommandResult(com.emc.storageos.vnxe.models.VNXeCommandResult)

Example 20 with VNXeCommandResult

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

the class ApiClientTest method addLunsToLunGroup.

// @Test
public void addLunsToLunGroup() {
    List<String> luns = new ArrayList<String>();
    luns.add("sv_27");
    VNXeCommandResult result = apiClient.addLunsToLunGroup("res_14", luns);
    System.out.println(result.getSuccess());
}
Also used : VNXeCommandResult(com.emc.storageos.vnxe.models.VNXeCommandResult) ArrayList(java.util.ArrayList)

Aggregations

VNXeCommandResult (com.emc.storageos.vnxe.models.VNXeCommandResult)23 HostCreateParam (com.emc.storageos.vnxe.models.HostCreateParam)4 VNXeBase (com.emc.storageos.vnxe.models.VNXeBase)3 HostListRequest (com.emc.storageos.vnxe.requests.HostListRequest)3 Test (org.junit.Test)3 BlockConsistencyGroup (com.emc.storageos.db.client.model.BlockConsistencyGroup)2 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)2 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)2 ServiceError (com.emc.storageos.svcs.errorhandling.model.ServiceError)2 VNXeApiClient (com.emc.storageos.vnxe.VNXeApiClient)2 VNXeException (com.emc.storageos.vnxe.VNXeException)2 HostIpPortCreateParam (com.emc.storageos.vnxe.models.HostIpPortCreateParam)2 VNXeHostInitiator (com.emc.storageos.vnxe.models.VNXeHostInitiator)2 ControllerException (com.emc.storageos.volumecontroller.ControllerException)2 ArrayList (java.util.ArrayList)2 TenantOrg (com.emc.storageos.db.client.model.TenantOrg)1 DeleteStorageResourceParam (com.emc.storageos.vnxe.models.DeleteStorageResourceParam)1 FileSystemQuotaConfigParam (com.emc.storageos.vnxe.models.FileSystemQuotaConfigParam)1 FileSystemQuotaCreateParam (com.emc.storageos.vnxe.models.FileSystemQuotaCreateParam)1 HostInitiatorCreateParam (com.emc.storageos.vnxe.models.HostInitiatorCreateParam)1