|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.orbitz.consul.AgentClient
public class AgentClient
HTTP Client for /v1/agent/ endpoints.
| Method Summary | |
|---|---|
void |
check(java.lang.String checkId,
State state,
java.lang.String note)
Checks in with Consul. |
void |
checkTtl(java.lang.String serviceId,
State state,
java.lang.String note)
Prepends the default TTL prefix to the serviceId to produce a check id, then delegates to check(String checkId, State state, String note) This method only works with TTL checks that have not been given a custom name. |
void |
deregister(java.lang.String serviceId)
De-register a particular service from the Consul Agent. |
void |
deregisterCheck(java.lang.String checkId)
De-registers a Health Check with the Agent |
void |
fail(java.lang.String serviceId)
Sets a TTL service check to "critical" state. |
void |
fail(java.lang.String serviceId,
java.lang.String note)
Sets a TTL service check to "critical" state with a note. |
void |
failCheck(java.lang.String checkId)
Sets a TTL check to "critical" state. |
void |
failCheck(java.lang.String checkId,
java.lang.String note)
Sets a TTL check to "critical" state with a note. |
void |
forceLeave(java.lang.String node)
GET /v1/agent/force-leave/{node} Instructs the agent to force a node into the "left" state. |
Agent |
getAgent()
Retrieves the Agent's configuration and member information. |
java.util.Map<java.lang.String,HealthCheck> |
getChecks()
Retrieves all checks registered with the Agent. |
java.util.List<Member> |
getMembers()
Retrieves all members that the Agent can see in the gossip pool. |
java.util.Map<java.lang.String,Service> |
getServices()
Retrieves all services registered with the Agent. |
boolean |
isRegistered(java.lang.String serviceId)
Indicates whether or not a particular service is registered with the local Consul agent. |
boolean |
join(java.lang.String address)
GET /v1/agent/join/{address} Instructs the agent to join a node. |
boolean |
join(java.lang.String address,
boolean wan)
GET /v1/agent/join/{address}?wan=1 Instructs the agent to join a node. |
void |
pass(java.lang.String serviceId)
Sets a TTL service check to "passing" state |
void |
pass(java.lang.String serviceId,
java.lang.String note)
Sets a TTL service check to "passing" state with a note |
void |
passCheck(java.lang.String checkId)
Sets a TTL check to "passing" state |
void |
passCheck(java.lang.String checkId,
java.lang.String note)
Sets a TTL check to "passing" state with a note |
void |
ping()
Pings the Consul Agent. |
void |
register(int port,
long ttl,
java.lang.String name,
java.lang.String id,
java.lang.String... tags)
Registers the client as a service with Consul. |
void |
register(int port,
Registration.Check check,
java.lang.String name,
java.lang.String id,
java.lang.String... tags)
Registers the client as a service with Consul. |
void |
register(int port,
java.lang.String script,
long interval,
java.lang.String name,
java.lang.String id,
java.lang.String... tags)
Registers the client as a service with Consul. |
void |
register(int port,
java.net.URL http,
long interval,
java.lang.String name,
java.lang.String id,
java.lang.String... tags)
Registers the client as a service with Consul. |
void |
register(Registration registration)
Registers the client as a service with Consul. |
void |
registerCheck(Check check)
Registers a Health Check with the Agent. |
void |
registerCheck(java.lang.String checkId,
java.lang.String name,
long ttl)
Registers a Health Check with the Agent. |
void |
registerCheck(java.lang.String checkId,
java.lang.String name,
long ttl,
java.lang.String notes)
Registers a Health Check with the Agent. |
void |
registerCheck(java.lang.String checkId,
java.lang.String name,
java.lang.String script,
long interval)
Registers a Health Check with the Agent. |
void |
registerCheck(java.lang.String checkId,
java.lang.String name,
java.lang.String script,
long interval,
java.lang.String notes)
Registers a Health Check with the Agent. |
void |
registerCheck(java.lang.String checkId,
java.lang.String name,
java.net.URL http,
long interval)
Registers a Health Check with the Agent. |
void |
registerCheck(java.lang.String checkId,
java.lang.String name,
java.net.URL http,
long interval,
java.lang.String notes)
Registers a Health Check with the Agent. |
void |
warn(java.lang.String serviceId)
Sets a TTL service check to "warning" state. |
void |
warn(java.lang.String serviceId,
java.lang.String note)
Sets a TTL service check to "warning" state with a note. |
void |
warnCheck(java.lang.String checkId)
Sets a TTL check to "warning" state. |
void |
warnCheck(java.lang.String checkId,
java.lang.String note)
Sets a TTL check to "warning" state with a note. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public boolean isRegistered(java.lang.String serviceId)
true if a particular service is registered with
the local Consul agent, otherwise false.public void ping()
public void register(int port,
long ttl,
java.lang.String name,
java.lang.String id,
java.lang.String... tags)
port - The public facing port of the service to register with Consul.ttl - Time to live for the Consul dead man's switch.name - Service name to register.id - Service id to register.tags - Tags to register with.
public void register(int port,
java.lang.String script,
long interval,
java.lang.String name,
java.lang.String id,
java.lang.String... tags)
port - The public facing port of the service to register with Consul.script - Health script for Consul to use.interval - Health script run interval in seconds.name - Service name to register.id - Service id to register.tags - Tags to register with.
public void register(int port,
java.net.URL http,
long interval,
java.lang.String name,
java.lang.String id,
java.lang.String... tags)
port - The public facing port of the service to register with Consul.http - Health check URL.interval - Health script run interval in seconds.name - Service name to register.id - Service id to register.tags - Tags to register with.
public void register(int port,
Registration.Check check,
java.lang.String name,
java.lang.String id,
java.lang.String... tags)
port - The public facing port of the service to register with Consul.check - The health check to run periodically. Can be null.name - Service name to register.id - Service id to register.tags - Tags to register with.public void register(Registration registration)
registration - The registration payload.public void deregister(java.lang.String serviceId)
public void registerCheck(java.lang.String checkId,
java.lang.String name,
java.lang.String script,
long interval)
checkId - The Check ID to use. Must be unique for the Agent.name - The Check Name.script - Health script for Consul to use.interval - Health script run interval in seconds.
public void registerCheck(java.lang.String checkId,
java.lang.String name,
java.net.URL http,
long interval)
checkId - The Check ID to use. Must be unique for the Agent.name - The Check Name.http - Health check URL.interval - Health script run interval in seconds.
public void registerCheck(java.lang.String checkId,
java.lang.String name,
java.lang.String script,
long interval,
java.lang.String notes)
checkId - The Check ID to use. Must be unique for the Agent.name - The Check Name.script - Health script for Consul to use.interval - Health script run interval in seconds.notes - Human readable notes. Not used by Consul.
public void registerCheck(java.lang.String checkId,
java.lang.String name,
java.net.URL http,
long interval,
java.lang.String notes)
checkId - The Check ID to use. Must be unique for the Agent.name - The Check Name.http - Health check URL.interval - Health script run interval in seconds.notes - Human readable notes. Not used by Consul.
public void registerCheck(java.lang.String checkId,
java.lang.String name,
long ttl)
checkId - The Check ID to use. Must be unique for the Agent.name - The Check Name.ttl - Time to live for the Consul dead man's switch.
public void registerCheck(java.lang.String checkId,
java.lang.String name,
long ttl,
java.lang.String notes)
checkId - The Check ID to use. Must be unique for the Agent.name - The Check Name.ttl - Time to live for the Consul dead man's switch.notes - Human readable notes. Not used by Consul.public void registerCheck(Check check)
check - The Check to register.public void deregisterCheck(java.lang.String checkId)
checkId - the id of the Check to deregisterpublic Agent getAgent()
public java.util.Map<java.lang.String,HealthCheck> getChecks()
public java.util.Map<java.lang.String,Service> getServices()
public java.util.List<Member> getMembers()
public void forceLeave(java.lang.String node)
node -
public void check(java.lang.String checkId,
State state,
java.lang.String note)
throws NotRegisteredException
checkId - The Check ID to check in.state - The current state of the Check.note - Any note to associate with the Check.
NotRegisteredException
public void checkTtl(java.lang.String serviceId,
State state,
java.lang.String note)
throws NotRegisteredException
serviceId - state - note -
NotRegisteredException
public void pass(java.lang.String serviceId)
throws NotRegisteredException
NotRegisteredException
public void pass(java.lang.String serviceId,
java.lang.String note)
throws NotRegisteredException
NotRegisteredException
public void warn(java.lang.String serviceId)
throws NotRegisteredException
NotRegisteredException
public void warn(java.lang.String serviceId,
java.lang.String note)
throws NotRegisteredException
NotRegisteredException
public void fail(java.lang.String serviceId)
throws NotRegisteredException
NotRegisteredException
public void fail(java.lang.String serviceId,
java.lang.String note)
throws NotRegisteredException
NotRegisteredException
public void passCheck(java.lang.String checkId)
throws NotRegisteredException
NotRegisteredException
public void passCheck(java.lang.String checkId,
java.lang.String note)
throws NotRegisteredException
NotRegisteredException
public void warnCheck(java.lang.String checkId)
throws NotRegisteredException
NotRegisteredException
public void warnCheck(java.lang.String checkId,
java.lang.String note)
throws NotRegisteredException
NotRegisteredException
public void failCheck(java.lang.String checkId)
throws NotRegisteredException
NotRegisteredException
public void failCheck(java.lang.String checkId,
java.lang.String note)
throws NotRegisteredException
NotRegisteredExceptionpublic boolean join(java.lang.String address)
address - The address to join.
true if successful, otherwise false.
public boolean join(java.lang.String address,
boolean wan)
address - The address to join.wan - Use WAN pool.
true if successful, otherwise false.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||