public interface ConsulOperations
| Modifier and Type | Method and Description |
|---|---|
org.reactivestreams.Publisher<java.lang.Boolean> |
deregister(@NotNull CatalogEntry entry)
Register a new
CatalogEntry. |
org.reactivestreams.Publisher<io.micronaut.http.HttpStatus> |
deregister(@NotNull java.lang.String service)
Register a new
CatalogEntry. |
default org.reactivestreams.Publisher<io.micronaut.http.HttpStatus> |
fail(java.lang.String checkId)
Fail the TTL check.
|
org.reactivestreams.Publisher<io.micronaut.http.HttpStatus> |
fail(java.lang.String checkId,
java.lang.String note)
Fail the TTL check.
|
default org.reactivestreams.Publisher<java.util.List<HealthEntry>> |
getHealthyServices(@NotNull java.lang.String service)
Gets service health information.
|
org.reactivestreams.Publisher<java.util.List<HealthEntry>> |
getHealthyServices(@NotNull java.lang.String service,
java.lang.Boolean passing,
java.lang.String tag,
java.lang.String dc)
Gets the healthy services that are passing health checks.
|
org.reactivestreams.Publisher<java.util.List<MemberEntry>> |
getMembers()
Returns the members the agent sees in the cluster gossip pool.
|
org.reactivestreams.Publisher<java.util.List<CatalogEntry>> |
getNodes()
Gets all of the registered nodes.
|
org.reactivestreams.Publisher<java.util.List<CatalogEntry>> |
getNodes(@NotNull java.lang.String datacenter)
Gets all the nodes for the given data center.
|
org.reactivestreams.Publisher<LocalAgentConfiguration> |
getSelf()
Returns the configuration and member information of the local agent.
|
org.reactivestreams.Publisher<java.util.Map<java.lang.String,java.util.List<java.lang.String>>> |
getServiceNames()
Gets all of the service names and optional tags.
|
org.reactivestreams.Publisher<java.util.Map<java.lang.String,ServiceEntry>> |
getServices()
Gets all of the registered services.
|
default org.reactivestreams.Publisher<io.micronaut.http.HttpStatus> |
pass(java.lang.String checkId)
Pass the TTL check.
|
org.reactivestreams.Publisher<io.micronaut.http.HttpStatus> |
pass(java.lang.String checkId,
java.lang.String note)
Pass the TTL check.
|
org.reactivestreams.Publisher<java.lang.Boolean> |
putValue(java.lang.String key,
java.lang.String value)
Writes a value for the given key to Consul.
|
org.reactivestreams.Publisher<java.util.List<KeyValue>> |
readValues(java.lang.String key)
Reads a Key from Consul.
|
org.reactivestreams.Publisher<java.util.List<KeyValue>> |
readValues(java.lang.String key,
java.lang.String datacenter,
java.lang.Boolean raw,
java.lang.String seperator)
Reads a Key from Consul.
|
org.reactivestreams.Publisher<java.lang.Boolean> |
register(@NotNull CatalogEntry entry)
Register a new
CatalogEntry. |
org.reactivestreams.Publisher<io.micronaut.http.HttpStatus> |
register(@NotNull NewServiceEntry entry)
Register a new
CatalogEntry. |
org.reactivestreams.Publisher<java.lang.String> |
status() |
default org.reactivestreams.Publisher<io.micronaut.http.HttpStatus> |
warn(java.lang.String checkId)
Warn the TTL check.
|
org.reactivestreams.Publisher<io.micronaut.http.HttpStatus> |
warn(java.lang.String checkId,
java.lang.String note)
Warn the TTL check.
|
@Put(value="/kv/{+key}",
processes="text/plain",
single=true)
org.reactivestreams.Publisher<java.lang.Boolean> putValue(java.lang.String key,
@Body
java.lang.String value)
key - The keyvalue - The value as a StringPublisher that emits a boolean if the operation succeeded@Get(uri="/kv/{+key}?recurse",
single=true)
org.reactivestreams.Publisher<java.util.List<KeyValue>> readValues(java.lang.String key)
key - The key to readPublisher that emits a list of KeyValue@Get(uri="/kv/{+key}?recurse=true{&dc}{&raw}{&seperator}",
single=true)
@Retryable(attempts="${consul.client.config.retry-count:3}",
delay="${consul.client.config.retry-delay:1s}")
org.reactivestreams.Publisher<java.util.List<KeyValue>> readValues(java.lang.String key,
@Nullable @QueryValue(value="dc")
java.lang.String datacenter,
@Nullable
java.lang.Boolean raw,
@Nullable
java.lang.String seperator)
key - The keydatacenter - The data centerraw - Whether the value should be raw without encoding or metadataseperator - The separator to usePublisher that emits a list of KeyValue@Put(value="/agent/check/pass/{checkId}{?note}")
@Retryable(attempts="${consul.client.registration.retry-count:3}",
delay="${consul.client.registration.retry-delay:3s}")
org.reactivestreams.Publisher<io.micronaut.http.HttpStatus> pass(java.lang.String checkId,
@Nullable
java.lang.String note)
checkId - The check IDnote - An optional noteHttpStatus of HttpStatus.OK if all is well@Put(value="/agent/check/warn/{checkId}{?note}")
org.reactivestreams.Publisher<io.micronaut.http.HttpStatus> warn(java.lang.String checkId,
@Nullable
java.lang.String note)
checkId - The check IDnote - An optional noteHttpStatus of HttpStatus.OK if all is well@Put(value="/agent/check/fail/{checkId}{?note}")
@Retryable(attempts="${consul.client.registration.retry-count:3}",
delay="${consul.client.registration.retry-delay:3s}")
org.reactivestreams.Publisher<io.micronaut.http.HttpStatus> fail(java.lang.String checkId,
@Nullable
java.lang.String note)
checkId - The check IDnote - An optional noteHttpStatus of HttpStatus.OK if all is well@Get(uri="/status/leader",
single=true)
@Retryable
org.reactivestreams.Publisher<java.lang.String> status()
@Put(uri="/catalog/register",
single=true)
org.reactivestreams.Publisher<java.lang.Boolean> register(@NotNull @Body
@NotNull CatalogEntry entry)
CatalogEntry. See https://www.consul.io/api/catalog.html.entry - The entry to registerPublisher that emits a boolean true if the operation was successful@Put(uri="/catalog/deregister",
single=true)
org.reactivestreams.Publisher<java.lang.Boolean> deregister(@NotNull @Body
@NotNull CatalogEntry entry)
CatalogEntry. See https://www.consul.io/api/catalog.html.entry - The entry to registerPublisher that emits a boolean true if the operation was successful@Put(value="/agent/service/register")
@Retryable(attempts="${consul.client.registration.retry-count:3}",
delay="${consul.client.registration.retry-delay:3s}")
org.reactivestreams.Publisher<io.micronaut.http.HttpStatus> register(@NotNull @Body
@NotNull NewServiceEntry entry)
CatalogEntry. See https://www.consul.io/api/catalog.html.entry - The entry to registerPublisher that emits a boolean true if the operation was successful@Put(value="/agent/service/deregister/{service}")
@Retryable(attempts="${consul.client.registration.retry-count:3}",
delay="${consul.client.registration.retry-delay:3s}")
org.reactivestreams.Publisher<io.micronaut.http.HttpStatus> deregister(@NotNull
@NotNull java.lang.String service)
CatalogEntry. See https://www.consul.io/api/catalog.html.service - The service to registerPublisher that emits a boolean true if the operation was successful@Get(uri="/agent/services",
single=true)
org.reactivestreams.Publisher<java.util.Map<java.lang.String,ServiceEntry>> getServices()
NewServiceEntry instances@Get(uri="/agent/members",
single=true)
org.reactivestreams.Publisher<java.util.List<MemberEntry>> getMembers()
MemberEntry instances@Get(uri="/agent/self",
single=true)
org.reactivestreams.Publisher<LocalAgentConfiguration> getSelf()
LocalAgentConfiguration instance@Get(uri="/health/service/{service}{?passing,tag,dc}",
single=true)
org.reactivestreams.Publisher<java.util.List<HealthEntry>> getHealthyServices(@NotNull
@NotNull java.lang.String service,
@Nullable
java.lang.Boolean passing,
@Nullable
java.lang.String tag,
@Nullable
java.lang.String dc)
service - The servicepassing - The passing parametertag - The tagdc - The dcHealthEntry instances@Get(uri="/catalog/nodes",
single=true)
org.reactivestreams.Publisher<java.util.List<CatalogEntry>> getNodes()
@Get(uri="/catalog/nodes?dc={datacenter}",
single=true)
org.reactivestreams.Publisher<java.util.List<CatalogEntry>> getNodes(@NotNull
@NotNull java.lang.String datacenter)
datacenter - The data center@Get(uri="/catalog/services",
single=true)
org.reactivestreams.Publisher<java.util.Map<java.lang.String,java.util.List<java.lang.String>>> getServiceNames()
default org.reactivestreams.Publisher<io.micronaut.http.HttpStatus> pass(java.lang.String checkId)
checkId - The check IDHttpStatus of HttpStatus.OK if all is welldefault org.reactivestreams.Publisher<io.micronaut.http.HttpStatus> warn(java.lang.String checkId)
checkId - The check IDHttpStatus of HttpStatus.OK if all is welldefault org.reactivestreams.Publisher<io.micronaut.http.HttpStatus> fail(java.lang.String checkId)
checkId - The check IDHttpStatus of HttpStatus.OK if all is welldefault org.reactivestreams.Publisher<java.util.List<HealthEntry>> getHealthyServices(@NotNull @NotNull java.lang.String service)
service - The serviceHealthEntry instances