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;
}
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;
}
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;
}
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());
}
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());
}
Aggregations