class Consul::Agent

Defined in:

consul/agent/agent.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_check(check_id : String) #

deregister_check remove a check from the local agent. The agent will take care of deregistering the check from the catalog. If the check with the provided ID does not exist, no action is taken


[View source]
def deregister_service(service_id : String) #

deregister_service removes a service from the local agent. If the service does not exist, no action is taken


[View source]
def get_checks(filter : String) : Hash(String, Consul::Types::Agent::Check) #

[View source]
def get_checks : Hash(String, Consul::Types::Agent::Check) #

get_checks returns all checks that are registered with the local agent.


[View source]
def get_service_conf(name : String) : Consul::Types::Agent::ServiceConf #

get_service_conf returns the full service definition for a single service instance registered on the local agent


[View source]
def get_service_health(name : String) : Array(Consul::Types::Agent::ServiceHealth) #

get_local_service_health returns an aggregated state of service(s) on the local agent by name


[View source]
def get_services(filter : String) : Hash(String, Consul::Types::Agent::Service) #

[View source]
def get_services : Hash(String, Consul::Types::Agent::Service) #

get_services returns all the services that are registered with the local agent


[View source]
def register_check(check : Consul::Check) #

register_check adds a new check to the local agent. Checks may be of script, HTTP, TCP, or TTL type. The agent is responsible for managing the status of the check and keeping the Catalog in sync


[View source]
def register_service(service : Consul::Service) #

register_service adds a new service, with an optional health check, to the local agent TO-DO: implement kind, proxy, connect


[View source]
def set_service_maintenenance(service_id : String, enable : Bool, reason = "") #

set_serice_maintenence places a given service into "maintenance mode". During maintenance mode, the service will be marked as unavailable and will not be present in DNS or API queries


[View source]
def ttl_check_fail(check_id : String, note : String | Nil = nil) #

ttl_check_fail is used with a TTL type check to set the status of the check to critical and to reset the TTL clock


[View source]
def ttl_check_pass(check_id : String, note : String | Nil = nil) #

ttl_check_pass is used with a TTL type check to set the status of the check to passing and to reset the TTL clock


[View source]
def ttl_check_update(check_id : String, status : String | Nil = nil, output : String | Nil = nil) #

ttl_check_upate is used with a TTL type check to set the status of the check and to reset the TTL clock


[View source]
def ttl_check_warn(check_id : String, note : String | Nil = nil) #

ttl_check_warn is used with a TTL type check to set the status of the check to warning and to reset the TTL clock


[View source]