Package org.kiwiproject.consul
Class CatalogClient
java.lang.Object
org.kiwiproject.consul.CatalogClient
HTTP Client for /v1/catalog/ endpoints.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidderegister(CatalogDeregistration deregistration) De-registers a service or node.voidderegister(CatalogDeregistration deregistration, QueryOptions options) De-registers a service or node.Retrieves all datacenters.getDatacenters(QueryOptions queryOptions) Get the list of datacenters with query optionsRetrieves a single node.getNode(String node, QueryOptions queryOptions) Retrieves a single node for a given datacenter withQueryOptions.voidgetNode(String node, QueryOptions queryOptions, ConsulResponseCallback<CatalogNode> callback) Asynchronously retrieves the single node for a given datacenter withQueryOptions.getNodes()Retrieves all nodes.getNodes(QueryOptions queryOptions) Retrieves all nodes for a given datacenter withQueryOptions.voidgetNodes(QueryOptions queryOptions, ConsulResponseCallback<List<Node>> callback) Asynchronously retrieves the nodes for a given datacenter withQueryOptions.getService(String service) Retrieves the single service.getService(String service, QueryOptions queryOptions) Retrieves a single service for a given datacenter withQueryOptions.voidgetService(String service, QueryOptions queryOptions, ConsulResponseCallback<List<CatalogService>> callback) Asynchronously retrieves the single service for a given datacenter withQueryOptions.Retrieves all services for a given datacenter.voidgetServices(ConsulResponseCallback<Map<String, List<String>>> callback) Asynchronously retrieves the services for a given datacenter.getServices(QueryOptions queryOptions) Retrieves all services for a given datacenter.voidgetServices(QueryOptions queryOptions, ConsulResponseCallback<Map<String, List<String>>> callback) Asynchronously retrieves the services for a given datacenter.voidregister(CatalogRegistration registration) Registers a service or node.voidregister(CatalogRegistration registration, QueryOptions options) Registers a service or node.
-
Field Details
-
http
-
-
Method Details
-
getDatacenters
Retrieves all datacenters.GET /v1/catalog/datacenters
- Returns:
- A list of datacenter names.
-
getDatacenters
Get the list of datacenters with query options- Parameters:
queryOptions- the query options to use- Returns:
- a list of the datacenters
-
getNodes
Retrieves all nodes.GET /v1/catalog/nodes
- Returns:
- A
ConsulResponsecontaining a list ofNodeobjects.
-
getNodes
Retrieves all nodes for a given datacenter withQueryOptions.GET /v1/catalog/nodes?dc={datacenter}
- Parameters:
queryOptions- The Query Options to use.- Returns:
- A
ConsulResponsecontaining a list ofNodeobjects.
-
getNodes
Asynchronously retrieves the nodes for a given datacenter withQueryOptions.GET /v1/catalog/nodes?dc={datacenter}
- Parameters:
queryOptions- The Query Options to use.callback- Callback implemented by callee to handle results, which is a list ofNodeobjects.
-
getServices
Retrieves all services for a given datacenter.GET /v1/catalog/services?dc={datacenter}
- Returns:
- A
ConsulResponsecontaining a map of service name to a list of tags.
-
getServices
Asynchronously retrieves the services for a given datacenter.GET /v1/catalog/services?dc={datacenter}
- Parameters:
callback- Callback implemented by callee to handle results; the callback is provided a map of service name to a list of tags.
-
getServices
Retrieves all services for a given datacenter.GET /v1/catalog/services?dc={datacenter}
- Parameters:
queryOptions- The Query Options to use.- Returns:
- A
ConsulResponsecontaining a map of service name to a list of tags.
-
getServices
public void getServices(QueryOptions queryOptions, ConsulResponseCallback<Map<String, List<String>>> callback) Asynchronously retrieves the services for a given datacenter.GET /v1/catalog/services?dc={datacenter}
- Parameters:
queryOptions- The Query Options to use.callback- Callback implemented by callee to handle results, containing a map of service name to a list of tags
-
getService
Retrieves the single service.GET /v1/catalog/service/{service}
- Parameters:
service- the name of the service to get- Returns:
- A
ConsulResponsecontainingCatalogServiceobjects.
-
getService
Retrieves a single service for a given datacenter withQueryOptions.GET /v1/catalog/service/{service}?dc={datacenter}
- Parameters:
service- the name of the service to getqueryOptions- The Query Options to use.- Returns:
- A
ConsulResponsecontainingCatalogServiceobjects.
-
getService
public void getService(String service, QueryOptions queryOptions, ConsulResponseCallback<List<CatalogService>> callback) Asynchronously retrieves the single service for a given datacenter withQueryOptions.GET /v1/catalog/service/{service}?dc={datacenter}
- Parameters:
service- the name of the service to getqueryOptions- The Query Options to use.callback- Callback implemented by callee to handle results, containing a list ofCatalogServiceobjects
-
getNode
Retrieves a single node.GET /v1/catalog/node/{node}
- Parameters:
node- the name of the node to get- Returns:
- A list of matching
CatalogServiceobjects.
-
getNode
Retrieves a single node for a given datacenter withQueryOptions.GET /v1/catalog/node/{node}?dc={datacenter}
- Parameters:
node- the name of the node to getqueryOptions- The Query Options to use.- Returns:
- A list of matching
CatalogServiceobjects.
-
getNode
public void getNode(String node, QueryOptions queryOptions, ConsulResponseCallback<CatalogNode> callback) Asynchronously retrieves the single node for a given datacenter withQueryOptions.GET /v1/catalog/node/{node}?dc={datacenter}
- Parameters:
node- the name of the node to getqueryOptions- The Query Options to use.callback- Callback implemented by callee to handle results.
-
register
Registers a service or node.PUT /v1/catalog/register
- Parameters:
registration- ACatalogRegistration
-
register
Registers a service or node.PUT /v1/catalog/register
- Parameters:
registration- ACatalogRegistrationoptions- The Query Options to use.
-
deregister
De-registers a service or node.PUT /v1/catalog/deregister
- Parameters:
deregistration- ACatalogDeregistration
-
deregister
De-registers a service or node.PUT /v1/catalog/deregister
- Parameters:
deregistration- ACatalogDeregistrationoptions- The Query Options to use.
-
getNetworkTimeoutConfig
-
getConfig
-
getEventHandler
-