Search in sources :

Example 1 with CommonStatus

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;
}
Also used : CommonStatus(com.sequenceiq.common.api.type.CommonStatus)

Example 2 with CommonStatus

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);
    }
}
Also used : AzureClient(com.sequenceiq.cloudbreak.cloud.azure.client.AzureClient) CloudConnectorException(com.sequenceiq.cloudbreak.cloud.exception.CloudConnectorException) ResourceType(com.sequenceiq.common.api.type.ResourceType) CommonStatus(com.sequenceiq.common.api.type.CommonStatus)

Aggregations

CommonStatus (com.sequenceiq.common.api.type.CommonStatus)2 AzureClient (com.sequenceiq.cloudbreak.cloud.azure.client.AzureClient)1 CloudConnectorException (com.sequenceiq.cloudbreak.cloud.exception.CloudConnectorException)1 ResourceType (com.sequenceiq.common.api.type.ResourceType)1