com.orbitz.consul
Class Consul

java.lang.Object
  extended by com.orbitz.consul.Consul

public class Consul
extends java.lang.Object

Client for interacting with the Consul HTTP API.


Field Summary
static java.lang.String DEFAULT_HTTP_HOST
          Default Consul HTTP API host.
static int DEFAULT_HTTP_PORT
          Default Consul HTTP API port.
 
Method Summary
 AgentClient agentClient()
          Get the Agent HTTP client.
 CatalogClient catalogClient()
          Get the Catalog HTTP client.
 EventClient eventClient()
          Get the Event HTTP client.
 HealthClient healthClient()
          Get the Health HTTP client.
 KeyValueClient keyValueClient()
          Get the Key/Value HTTP client.
static Consul newClient()
          Creates a new client given a host and a port.
static Consul newClient(java.lang.String url, javax.ws.rs.client.ClientBuilder builder)
          Creates a new client given a complete URL.
static Consul newClient(java.lang.String host, int port)
          Creates a new client given a host and a port.
static Consul newClient(java.lang.String host, int port, javax.ws.rs.client.ClientBuilder builder)
          Creates a new client given a host and a port.
 SessionClient sessionClient()
          Get the SessionInfo HTTP client.
 StatusClient statusClient()
          Get the Status HTTP client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_HTTP_HOST

public static final java.lang.String DEFAULT_HTTP_HOST
Default Consul HTTP API host.

See Also:
Constant Field Values

DEFAULT_HTTP_PORT

public static final int DEFAULT_HTTP_PORT
Default Consul HTTP API port.

See Also:
Constant Field Values
Method Detail

newClient

public static Consul newClient(java.lang.String url,
                               javax.ws.rs.client.ClientBuilder builder)
Creates a new client given a complete URL.

Parameters:
url - The Consul API URL.
builder - The JAX-RS client builder instance.
Returns:
A new client.

newClient

public static Consul newClient(java.lang.String host,
                               int port,
                               javax.ws.rs.client.ClientBuilder builder)
Creates a new client given a host and a port.

Parameters:
host - The Consul API hostname or IP.
port - The Consul port.
builder - The JAX-RS client builder instance.
Returns:
A new client.

newClient

public static Consul newClient(java.lang.String host,
                               int port)
Creates a new client given a host and a port.

Parameters:
host - The Consul API hostname or IP.
port - The Consul port.
Returns:
A new client.

newClient

public static Consul newClient()
Creates a new client given a host and a port.

Returns:
A new client.

agentClient

public AgentClient agentClient()
Get the Agent HTTP client. /v1/agent

Returns:
The Agent HTTP client.

catalogClient

public CatalogClient catalogClient()
Get the Catalog HTTP client. /v1/catalog

Returns:
The Catalog HTTP client.

healthClient

public HealthClient healthClient()
Get the Health HTTP client. /v1/health

Returns:
The Health HTTP client.

keyValueClient

public KeyValueClient keyValueClient()
Get the Key/Value HTTP client. /v1/kv

Returns:
The Key/Value HTTP client.

statusClient

public StatusClient statusClient()
Get the Status HTTP client. /v1/status

Returns:
The Status HTTP client.

sessionClient

public SessionClient sessionClient()
Get the SessionInfo HTTP client. /v1/session

Returns:
The SessionInfo HTTP client.

eventClient

public EventClient eventClient()
Get the Event HTTP client. /v1/event

Returns:
The Event HTTP client.