use of com.cloudera.thunderhead.service.minasshdmanagement.MinaSshdManagementProto.UnregisterSshTunnelingKeyResponse in project cloudbreak by hortonworks.
the class MinaSshdManagementClient method unregisterSshTunnelingKey.
/**
* Wraps call to unregisterSshTunnelingKey.
*
* @param requestId the request ID for the request
* @param minaSshdServiceId the minasshd service ID
* @param keyId the key ID
* @return the response
* @throws CcmException if an exception occurs
*/
public UnregisterSshTunnelingKeyResponse unregisterSshTunnelingKey(String requestId, String minaSshdServiceId, String keyId) throws CcmException {
checkNotNull(requestId, "requestId should not be null.");
checkNotNull(minaSshdServiceId);
checkNotNull(keyId);
MinaSshdManagementBlockingStub blockingStub = newStub(requestId);
UnregisterSshTunnelingKeyRequest.Builder requestBuilder = UnregisterSshTunnelingKeyRequest.newBuilder().setMinaSshdServiceId(minaSshdServiceId).setKeyId(keyId);
try {
LOGGER.debug("Calling unregisterSshTunnelingKey with requestId: {}, minaSshdServiceId: {}, keyId: {}", requestId, minaSshdServiceId, keyId);
UnregisterSshTunnelingKeyResponse response = blockingStub.unregisterSshTunnelingKey(requestBuilder.build());
if (response == null) {
throw new CcmException("Got null response from MinaSshdManagementService unregisterSshTunnelingKey gRPC call", false);
} else {
return response;
}
} catch (StatusRuntimeException e) {
String message = "MinaSshdManagementService unregisterSshTunnelingKey gRPC call failed: " + e.getMessage();
Status status = e.getStatus();
Status.Code code = status.getCode();
boolean retryable = GrpcUtil.isRetryable(code);
LOGGER.debug("Got status code: {}, retryable: {}", code, retryable);
throw new CcmException(message, e, retryable);
}
}
Aggregations