use of com.sequenceiq.common.api.type.CommonStatus in project cloudbreak by hortonworks.
the class AzureStatusMapper method mapCommonStatus.
public static CommonStatus mapCommonStatus(String status) {
CommonStatus mappedStatus;
switch(status) {
case "Accepted":
mappedStatus = CommonStatus.REQUESTED;
break;
case "Ready":
case "Succeeded":
mappedStatus = CommonStatus.CREATED;
break;
case "Canceled":
case "Deleted":
case "Failed":
default:
mappedStatus = CommonStatus.FAILED;
break;
}
LOGGER.debug("Mapped status {} to common status {}", status, mappedStatus.toString());
return mappedStatus;
}
use of com.sequenceiq.common.api.type.CommonStatus in project cloudbreak by hortonworks.
the class AzureResourceDeploymentHelperService method pollForCreation.
public void pollForCreation(AuthenticatedContext authenticatedContext, AzureDnsZoneCreationCheckerContext checkerContext) {
try {
azureDnsZoneCreationPoller.startPolling(authenticatedContext, checkerContext);
} catch (CloudConnectorException e) {
LOGGER.warn("Exception during polling: {}", e.getMessage());
} finally {
AzureClient azureClient = checkerContext.getAzureClient();
CommonStatus deploymentStatus = azureClient.getTemplateDeploymentCommonStatus(checkerContext.getResourceGroupName(), checkerContext.getDeploymentName());
ResourceType resourceType = StringUtils.isEmpty(checkerContext.getNetworkId()) ? AZURE_PRIVATE_DNS_ZONE : AZURE_VIRTUAL_NETWORK_LINK;
azureResourcePersistenceHelperService.updateCloudResource(authenticatedContext, checkerContext.getDeploymentName(), checkerContext.getDeploymentId(), deploymentStatus, resourceType);
}
}
Aggregations