use of com.cloudera.thunderhead.service.publicendpointmanagement.PublicEndpointManagementProto.PollCertificateSigningResponse in project cloudbreak by hortonworks.
the class CreateCertificationPoller method process.
@Override
public AttemptResult<List<String>> process() throws Exception {
attempt++;
PollCertificateSigningResponse response = grpcClusterDnsClient.pollCertificateSigning(workflowId, requestId);
final SigningStatus actualStatus = response.getStatus();
LOGGER.debug("Polling attempt result: {}", actualStatus);
if (SigningStatus.SUCCEEDED.equals(actualStatus)) {
return AttemptResults.finishWith(response.getCertificatesList());
}
if (SigningStatus.FAILED.equals(actualStatus)) {
// return AttemptResults.breakFor(String.format("Certificate creation is failed for %s with message: %s ", workflowId));
return AttemptResults.breakFor(String.format("Certificate creation is failed for %s.", workflowId));
}
LOGGER.info("The certificate polls continued, attempt: {}", attempt);
return AttemptResults.justContinue();
}
use of com.cloudera.thunderhead.service.publicendpointmanagement.PublicEndpointManagementProto.PollCertificateSigningResponse in project cloudbreak by hortonworks.
the class GrpcClusterDnsClient method pollCertificateSigning.
public PollCertificateSigningResponse pollCertificateSigning(String signingWorkflowId, Optional<String> requestId) {
try (ManagedChannelWrapper channelWrapper = makeWrapper()) {
ClusterDnsClient client = makeClient(channelWrapper.getChannel(), regionAwareInternalCrnGeneratorFactory.iam().getInternalCrnForServiceAsString());
LOGGER.info("Get the result of certification creation with signingWorkflowId: {} and requestId: {}", signingWorkflowId, requestId);
PollCertificateSigningResponse response = client.pollCertificateSigning(requestId.orElse(UUID.randomUUID().toString()), signingWorkflowId);
LOGGER.info("The workflow id for polling the result of creation: {}", signingWorkflowId);
return response;
}
}
Aggregations