Search in sources :

Example 6 with CdpNodeStatusMonitorClient

use of com.sequenceiq.node.health.client.CdpNodeStatusMonitorClient in project cloudbreak by hortonworks.

the class NodeStatusService method getSaltReport.

public RPCResponse<NodeStatusProto.SaltHealthReport> getSaltReport(Long stackId) {
    Stack stack = stackService.getByIdWithListsInTransaction(stackId);
    MDCBuilder.buildMdcContext(stack);
    LOGGER.debug("Retrieving salt report from the hosts of stack: {}", stack.getResourceCrn());
    try (CdpNodeStatusMonitorClient client = factory.getClient(stack, stack.getPrimaryGatewayInstance())) {
        return client.saltReport();
    } catch (CdpNodeStatusMonitorClientException e) {
        throw new CloudbreakServiceException("Could not get salt report from stack.");
    }
}
Also used : CdpNodeStatusMonitorClientException(com.sequenceiq.node.health.client.CdpNodeStatusMonitorClientException) CloudbreakServiceException(com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) CdpNodeStatusMonitorClient(com.sequenceiq.node.health.client.CdpNodeStatusMonitorClient)

Example 7 with CdpNodeStatusMonitorClient

use of com.sequenceiq.node.health.client.CdpNodeStatusMonitorClient in project cloudbreak by hortonworks.

the class NodeStatusService method getServicesReport.

public RPCResponse<NodeStatusProto.NodeStatusReport> getServicesReport(Stack stack) {
    MDCBuilder.buildMdcContext(stack);
    LOGGER.debug("Retrieving services report from the hosts of stack: {}", stack.getResourceCrn());
    try (CdpNodeStatusMonitorClient client = factory.getClient(stack, stack.getPrimaryGatewayInstance())) {
        return client.nodeServicesReport();
    } catch (CdpNodeStatusMonitorClientException e) {
        throw new CloudbreakServiceException("Could not get services report from stack.");
    }
}
Also used : CdpNodeStatusMonitorClientException(com.sequenceiq.node.health.client.CdpNodeStatusMonitorClientException) CloudbreakServiceException(com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException) CdpNodeStatusMonitorClient(com.sequenceiq.node.health.client.CdpNodeStatusMonitorClient)

Aggregations

CdpNodeStatusMonitorClient (com.sequenceiq.node.health.client.CdpNodeStatusMonitorClient)7 CloudbreakServiceException (com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException)6 CdpNodeStatusMonitorClientException (com.sequenceiq.node.health.client.CdpNodeStatusMonitorClientException)5 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)2 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 Client (javax.ws.rs.client.Client)1