class

Consul::Catalog

Inherits Consul::Transport / Reference / Object

Instance methods

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

Source
get_datacenters

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

Source
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

Source
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

Source
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

Source
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

Source
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

Source