Search in sources :

Example 1 with UpgradeCcmRemoveAgentResult

use of com.sequenceiq.cloudbreak.reactor.api.event.cluster.upgrade.ccm.UpgradeCcmRemoveAgentResult in project cloudbreak by hortonworks.

the class RemoveAgentHandler method doAccept.

@Override
protected Selectable doAccept(HandlerEvent<UpgradeCcmRemoveAgentRequest> event) {
    UpgradeCcmRemoveAgentRequest request = event.getData();
    Long stackId = request.getResourceId();
    LOGGER.info("Remove agent for CCM upgrade...");
    try {
        upgradeCcmService.removeAgent(stackId, request.getOldTunnel());
    } catch (CloudbreakOrchestratorException e) {
        LOGGER.debug("Failed removing agent with a salt state");
        return new UpgradeCcmFailedEvent(stackId, request.getOldTunnel(), e);
    }
    return new UpgradeCcmRemoveAgentResult(stackId, request.getClusterId(), request.getOldTunnel());
}
Also used : UpgradeCcmRemoveAgentRequest(com.sequenceiq.cloudbreak.reactor.api.event.cluster.upgrade.ccm.UpgradeCcmRemoveAgentRequest) CloudbreakOrchestratorException(com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorException) UpgradeCcmFailedEvent(com.sequenceiq.cloudbreak.reactor.api.event.cluster.upgrade.ccm.UpgradeCcmFailedEvent) UpgradeCcmRemoveAgentResult(com.sequenceiq.cloudbreak.reactor.api.event.cluster.upgrade.ccm.UpgradeCcmRemoveAgentResult)

Aggregations

CloudbreakOrchestratorException (com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorException)1 UpgradeCcmFailedEvent (com.sequenceiq.cloudbreak.reactor.api.event.cluster.upgrade.ccm.UpgradeCcmFailedEvent)1 UpgradeCcmRemoveAgentRequest (com.sequenceiq.cloudbreak.reactor.api.event.cluster.upgrade.ccm.UpgradeCcmRemoveAgentRequest)1 UpgradeCcmRemoveAgentResult (com.sequenceiq.cloudbreak.reactor.api.event.cluster.upgrade.ccm.UpgradeCcmRemoveAgentResult)1