use of com.emc.storageos.svcs.errorhandling.resources.UnauthorizedException in project coprhd-controller by CoprHD.
the class GeoServiceClient method syncVdcConfig.
/**
* Send the VDC config list to a remote VDC.
*
* @param vdcConfigList the merged list of VDC config
* @throws Exception
*/
public void syncVdcConfig(VdcConfigSyncParam vdcConfigList, String vdcName) throws GeoException {
WebResource rRoot = createRequest(VDCCONFIG_URI);
rRoot.accept(MediaType.APPLICATION_XML);
try {
addSignature(rRoot).put(vdcConfigList);
} catch (UnauthorizedException e) {
log.error("Failed to sync VDC : 401 Unauthorized, " + vdcName, e);
throw GeoException.fatals.remoteVdcAuthorizationFailed(vdcName, e);
} catch (GeoException e) {
throw e;
} catch (Exception e) {
log.error("Failed to sync VDC : " + vdcName, e);
throw GeoException.fatals.failedToSyncConfigurationForVdc(vdcName, e);
}
}
use of com.emc.storageos.svcs.errorhandling.resources.UnauthorizedException in project coprhd-controller by CoprHD.
the class GeoServiceClient method syncVdcConfigPreCheck.
/**
* Retrieve the VDC config info from a remote VDC.
* 1. For adding a new vdc, the target vdc should be in ISOLATED status and is a fresh installation.
* 2. For updating an existing vdc, the target vdc should be in CONNECTED status.
*
* @param checkParam
* @throws Exception
*/
public VdcPreCheckResponse syncVdcConfigPreCheck(VdcPreCheckParam checkParam, String vdcName) throws GeoException {
WebResource rRoot;
rRoot = createRequest(VDCCONFIG_PRECHECK_URI);
rRoot.accept(MediaType.APPLICATION_XML);
try {
return addSignature(rRoot).post(VdcPreCheckResponse.class, checkParam);
} catch (UnauthorizedException e) {
throw GeoException.fatals.remoteVdcAuthorizationFailed(vdcName, e);
} catch (GeoException e) {
throw e;
} catch (Exception e) {
throw GeoException.fatals.failedToSendPreCheckRequest(vdcName, e);
}
}
use of com.emc.storageos.svcs.errorhandling.resources.UnauthorizedException in project coprhd-controller by CoprHD.
the class GeoServiceClient method checkDependencies.
/**
* Query the dependencies of a DataObject resource
*
* @param clazz the resource type to be queried
* @param id the resource object ID
* @param activeOnly
* @return the type name of the dependency, otherwise return null
* @throws Exception
*/
public <T extends DataObject> String checkDependencies(Class<T> clazz, URI id, boolean activeOnly) {
WebResource rRoot = createRequest(DEPENDENCIES_URI + clazz.getName() + "/" + id).queryParam("active_only", Boolean.toString(activeOnly));
rRoot.accept(MediaType.APPLICATION_XML);
try {
return addSignature(rRoot).get(String.class);
} catch (UnauthorizedException e) {
throw GeoException.fatals.remoteVdcAuthorizationFailed(endPoint, e);
} catch (GeoException e) {
throw e;
} catch (Exception e) {
throw GeoException.fatals.unableConnect(endPoint, e);
}
}
use of com.emc.storageos.svcs.errorhandling.resources.UnauthorizedException in project coprhd-controller by CoprHD.
the class GeoServiceClient method vdcNatCheck.
public VdcNatCheckResponse vdcNatCheck(VdcNatCheckParam checkParam) {
WebResource rRoot = createRequest(VDCCONFIG_NETCHECK_URI);
rRoot.accept(MediaType.APPLICATION_XML);
try {
return addSignature(rRoot).post(VdcNatCheckResponse.class, checkParam);
} catch (UnauthorizedException e) {
log.error("Failed to perform NAT check", e);
throw GeoException.fatals.remoteVdcAuthorizationFailed(endPoint, e);
} catch (GeoException e) {
log.error("Failed to perform NAT check", e);
throw e;
} catch (Exception e) {
log.error("Failed to perform NAT check", e);
throw GeoException.fatals.unableConnect(endPoint, e);
}
}
use of com.emc.storageos.svcs.errorhandling.resources.UnauthorizedException in project coprhd-controller by CoprHD.
the class GeoServiceClient method vdcNodeCheck.
/**
* check all nodes are visible
*
* @param checkParam
* @throws Exception
*/
public VdcNodeCheckResponse vdcNodeCheck(VdcNodeCheckParam checkParam) {
WebResource rRoot;
rRoot = createRequest(VDCCONFIG_NODECHECK_URI);
rRoot.accept(MediaType.APPLICATION_XML);
try {
return addSignature(rRoot).post(VdcNodeCheckResponse.class, checkParam);
} catch (UnauthorizedException e) {
throw GeoException.fatals.remoteVdcAuthorizationFailed(endPoint, e);
} catch (GeoException e) {
throw e;
} catch (Exception e) {
throw GeoException.fatals.unableConnect(endPoint, e);
}
}
Aggregations