Search in sources :

Example 1 with CdpNodeStatusMonitorClientException

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

the class NodeStatusService method saltPing.

public RPCResponse<NodeStatusProto.SaltHealthReport> saltPing(Long stackId) {
    Stack stack = stackService.getByIdWithListsInTransaction(stackId);
    MDCBuilder.buildMdcContext(stack);
    LOGGER.debug("Retrieving salt ping report from the hosts of stack: {}", stack.getResourceCrn());
    try (CdpNodeStatusMonitorClient client = factory.getClient(stack, stack.getPrimaryGatewayInstance())) {
        return client.saltPing(false, false);
    } catch (CdpNodeStatusMonitorClientException e) {
        throw new CloudbreakServiceException("Could not get salt ping 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 2 with CdpNodeStatusMonitorClientException

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

the class NodeStatusService method getSystemMetrics.

public RPCResponse<NodeStatusProto.NodeStatusReport> getSystemMetrics(Stack stack) {
    MDCBuilder.buildMdcContext(stack);
    LOGGER.debug("Retrieving system metrics report from the hosts of stack: {}", stack.getResourceCrn());
    try (CdpNodeStatusMonitorClient client = factory.getClient(stack, stack.getPrimaryGatewayInstance())) {
        return client.systemMetricsReport();
    } catch (CdpNodeStatusMonitorClientException e) {
        throw new CloudbreakServiceException("Could not get system metrics 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)

Example 3 with CdpNodeStatusMonitorClientException

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

the class NodeStatusService method getMeteringReport.

public RPCResponse<NodeStatusProto.NodeStatusReport> getMeteringReport(Stack stack) {
    MDCBuilder.buildMdcContext(stack);
    LOGGER.debug("Retrieving metering report from the hosts of stack: {}", stack.getResourceCrn());
    try (CdpNodeStatusMonitorClient client = factory.getClient(stack, stack.getPrimaryGatewayInstance())) {
        return client.nodeMeteringReport();
    } catch (CdpNodeStatusMonitorClientException e) {
        throw new CloudbreakServiceException("Could not get metering 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)

Example 4 with CdpNodeStatusMonitorClientException

use of com.sequenceiq.node.health.client.CdpNodeStatusMonitorClientException 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 5 with CdpNodeStatusMonitorClientException

use of com.sequenceiq.node.health.client.CdpNodeStatusMonitorClientException 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

CloudbreakServiceException (com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException)5 CdpNodeStatusMonitorClient (com.sequenceiq.node.health.client.CdpNodeStatusMonitorClient)5 CdpNodeStatusMonitorClientException (com.sequenceiq.node.health.client.CdpNodeStatusMonitorClientException)5 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)2