Package com.orbitz.consul
Class HealthClient
- java.lang.Object
-
- com.orbitz.consul.HealthClient
-
public class HealthClient extends java.lang.ObjectHTTP Client for /v1/health/ endpoints.
-
-
Method Summary
Modifier and Type Method Description ConsulResponse<java.util.List<ServiceHealth>>getAllServiceInstances(java.lang.String service)Retrieves the healthchecks for all nodes.ConsulResponse<java.util.List<ServiceHealth>>getAllServiceInstances(java.lang.String service, QueryOptions queryOptions)Retrieves the healthchecks for all nodes in a given datacenter withQueryOptions.voidgetAllServiceInstances(java.lang.String service, QueryOptions queryOptions, ConsulResponseCallback<java.util.List<ServiceHealth>> callback)Asynchronously retrieves the healthchecks for all nodes in a given datacenter withQueryOptions.ConsulResponse<java.util.List<HealthCheck>>getChecksByState(State state)Retrieves the healthchecks for a state.ConsulResponse<java.util.List<HealthCheck>>getChecksByState(State state, QueryOptions queryOptions)Retrieves the healthchecks for a state in a given datacenter withQueryOptions.voidgetChecksByState(State state, QueryOptions queryOptions, ConsulResponseCallback<java.util.List<HealthCheck>> callback)Asynchronously retrieves the healthchecks for a state in a given datacenter withQueryOptions.ClientConfiggetConfig()ClientEventHandlergetEventHandler()ConsulResponse<java.util.List<ServiceHealth>>getHealthyServiceInstances(java.lang.String service)Retrieves the healthchecks for all healthy service instances.ConsulResponse<java.util.List<ServiceHealth>>getHealthyServiceInstances(java.lang.String service, QueryOptions queryOptions)Retrieves the healthchecks for all healthy service instances in a given datacenter withQueryOptions.voidgetHealthyServiceInstances(java.lang.String service, QueryOptions queryOptions, ConsulResponseCallback<java.util.List<ServiceHealth>> callback)Asynchronously retrieves the healthchecks for all healthy service instances in a given datacenter withQueryOptions.ConsulResponse<java.util.List<HealthCheck>>getNodeChecks(java.lang.String node)Retrieves the healthchecks for a node.ConsulResponse<java.util.List<HealthCheck>>getNodeChecks(java.lang.String node, QueryOptions queryOptions)Retrieves the healthchecks for a node in a given datacenter withQueryOptions.ConsulResponse<java.util.List<HealthCheck>>getServiceChecks(java.lang.String service)Retrieves the healthchecks for a service.ConsulResponse<java.util.List<HealthCheck>>getServiceChecks(java.lang.String service, QueryOptions queryOptions)Retrieves the healthchecks for a service in a given datacenter withQueryOptions.voidgetServiceChecks(java.lang.String service, QueryOptions queryOptions, ConsulResponseCallback<java.util.List<HealthCheck>> callback)Asynchronously retrieves the healthchecks for a service in a given datacenter withQueryOptions.
-
-
-
Field Detail
-
http
protected final Http http
-
-
Method Detail
-
getNodeChecks
public ConsulResponse<java.util.List<HealthCheck>> getNodeChecks(java.lang.String node)
Retrieves the healthchecks for a node. GET /v1/health/node/{node}- Parameters:
node- The node to return checks for- Returns:
- A
ConsulResponsecontaining a list ofHealthCheckobjects.
-
getNodeChecks
public ConsulResponse<java.util.List<HealthCheck>> getNodeChecks(java.lang.String node, QueryOptions queryOptions)
Retrieves the healthchecks for a node in a given datacenter withQueryOptions. GET /v1/health/node/{node}?dc={datacenter}- Parameters:
node- The node to return checks forqueryOptions- The Query Options to use.- Returns:
- A
ConsulResponsecontaining a list ofHealthCheckobjects.
-
getServiceChecks
public ConsulResponse<java.util.List<HealthCheck>> getServiceChecks(java.lang.String service)
Retrieves the healthchecks for a service. GET /v1/health/checks/{service}- Returns:
- A
ConsulResponsecontaining a list ofHealthCheckobjects.
-
getServiceChecks
public ConsulResponse<java.util.List<HealthCheck>> getServiceChecks(java.lang.String service, QueryOptions queryOptions)
Retrieves the healthchecks for a service in a given datacenter withQueryOptions. GET /v1/health/checks/{service}?dc={datacenter}- Parameters:
queryOptions- The Query Options to use.- Returns:
- A
ConsulResponsecontaining a list ofHealthCheckobjects.
-
getServiceChecks
public void getServiceChecks(java.lang.String service, QueryOptions queryOptions, ConsulResponseCallback<java.util.List<HealthCheck>> callback)Asynchronously retrieves the healthchecks for a service in a given datacenter withQueryOptions. GET /v1/health/checks/{service}?dc={datacenter}- Parameters:
service- The service to query.queryOptions- The Query Options to use.callback- Callback implemented by callee to handle results.HealthCheckobjects.
-
getChecksByState
public ConsulResponse<java.util.List<HealthCheck>> getChecksByState(State state)
Retrieves the healthchecks for a state. GET /v1/health/state/{state}- Parameters:
state- The state to query.- Returns:
- A
ConsulResponsecontaining a list ofHealthCheckobjects.
-
getChecksByState
public ConsulResponse<java.util.List<HealthCheck>> getChecksByState(State state, QueryOptions queryOptions)
Retrieves the healthchecks for a state in a given datacenter withQueryOptions. GET /v1/health/state/{state}?dc={datacenter}- Parameters:
state- The state to query.queryOptions- The Query Options to use.- Returns:
- A
ConsulResponsecontaining a list ofHealthCheckobjects.
-
getChecksByState
public void getChecksByState(State state, QueryOptions queryOptions, ConsulResponseCallback<java.util.List<HealthCheck>> callback)
Asynchronously retrieves the healthchecks for a state in a given datacenter withQueryOptions. GET /v1/health/state/{state}?dc={datacenter}- Parameters:
state- The state to query.queryOptions- The Query Options to use.callback- Callback implemented by callee to handle results.
-
getHealthyServiceInstances
public ConsulResponse<java.util.List<ServiceHealth>> getHealthyServiceInstances(java.lang.String service)
Retrieves the healthchecks for all healthy service instances. GET /v1/health/service/{service}?passing- Parameters:
service- The service to query.- Returns:
- A
ConsulResponsecontaining a list ofHealthCheckobjects.
-
getHealthyServiceInstances
public ConsulResponse<java.util.List<ServiceHealth>> getHealthyServiceInstances(java.lang.String service, QueryOptions queryOptions)
Retrieves the healthchecks for all healthy service instances in a given datacenter withQueryOptions. GET /v1/health/service/{service}?dc={datacenter}&passing- Parameters:
service- The service to query.queryOptions- The Query Options to use.- Returns:
- A
ConsulResponsecontaining a list ofHealthCheckobjects.
-
getHealthyServiceInstances
public void getHealthyServiceInstances(java.lang.String service, QueryOptions queryOptions, ConsulResponseCallback<java.util.List<ServiceHealth>> callback)Asynchronously retrieves the healthchecks for all healthy service instances in a given datacenter withQueryOptions. GET /v1/health/service/{service}?dc={datacenter}&passing Experimental.- Parameters:
service- The service to query.queryOptions- The Query Options to use.callback- Callback implemented by callee to handle results.
-
getAllServiceInstances
public ConsulResponse<java.util.List<ServiceHealth>> getAllServiceInstances(java.lang.String service)
Retrieves the healthchecks for all nodes. GET /v1/health/service/{service}- Parameters:
service- The service to query.- Returns:
- A
ConsulResponsecontaining a list ofHealthCheckobjects.
-
getAllServiceInstances
public ConsulResponse<java.util.List<ServiceHealth>> getAllServiceInstances(java.lang.String service, QueryOptions queryOptions)
Retrieves the healthchecks for all nodes in a given datacenter withQueryOptions. GET /v1/health/service/{service}?dc={datacenter}- Parameters:
service- The service to query.queryOptions- The Query Options to use.- Returns:
- A
ConsulResponsecontaining a list ofHealthCheckobjects.
-
getAllServiceInstances
public void getAllServiceInstances(java.lang.String service, QueryOptions queryOptions, ConsulResponseCallback<java.util.List<ServiceHealth>> callback)Asynchronously retrieves the healthchecks for all nodes in a given datacenter withQueryOptions. GET /v1/health/service/{service}?dc={datacenter} Experimental.- Parameters:
service- The service to query.queryOptions- The Query Options to use.callback- Callback implemented by callee to handle results.
-
getConfig
public ClientConfig getConfig()
-
getEventHandler
public ClientEventHandler getEventHandler()
-
-