class Consul::Catalog

Defined in:

consul/client/catalog.cr

Instance Method Summary

Instance methods inherited from class Consul::Transport

client : HTTP::Client client, consistency : String consistency, delete(path : String) : HTTP::Client::Response delete, get(path : String) : HTTP::Client::Response get, get_consistency : String get_consistency, put(path : String, data : JSON::Any) : HTTP::Client::Response
put(path : String, data : String) : HTTP::Client::Response
put(path : String) : HTTP::Client::Response
put

Constructor methods inherited from class Consul::Transport

new(client : HTTP::Client, consistency : String = "default") new

Instance Method Detail

def deregister(node : String, datacenter : String | Nil = nil, check_id : String | Nil = nil, service_id : String | Nil = self.nil?) #

deregister is a low-level mechanism for directly removing entries from the Catalog. It is usually preferable to instead use the agent endpoints for deregistration as they are simpler and perform anti-entropy


[View source]
def get_datacenters : Array(String) #

get_datacenters returns the list of all known datacenters. The datacenters will be sorted in ascending order based on the estimated median round trip time from the server to the servers in that datacenter


[View source]
def get_nodes(dc : String | Nil = nil, near : String | Nil = nil, node_meta : String | Nil = nil) : Array(Consul::Types::Catalog::Node) #

get_nodes returns the nodes registered in a given datacenter


[View source]
def get_nodes_for_service(service : String, datacenter : String | Nil = nil, tag : String | Nil = nil, near : String | Nil = nil, node_meta : String | Nil = nil, filter : String | Nil = nil) : Array(Consul::Types::Catalog::NodeService) #

get_nodes_for_service returns the nodes providing a service in a given datacenter


[View source]
def get_service_for_node(node : String, datacenter : String | Nil = nil, filter : String | Nil = nil) : Array(Consul::Types::Catalog::NodeService) #

get_services_for_node returns the node's registered services


[View source]
def get_services(datacenter : String | Nil = nil, node_meta : String | Nil = nil) : Hash(String, Array(String)) #

get_services returns the services registered in a given datacenter


[View source]
def register(node : String, address : String, id : String | Nil = nil, datacenter : String | Nil = nil, service : Consul::Service | Nil = nil, check : Hash(String, String) | Nil = nil, node_meta : Hash(String, String) | Nil = nil) #

register is a low-level mechanism for registering or updating entries in the catalog. It is usually preferable to instead use the agent endpoints for registration as they are simpler and perform anti-entropy


[View source]