Class: Imperium::Agent
Overview
A client for the Agent API.
Constant Summary
Constants inherited from Client
Instance Attribute Summary
Attributes inherited from Client
Instance Method Summary collapse
-
#deregister_service(service_or_id) ⇒ Object
Deregister a service with the agent.
-
#list_checks ⇒ AgentListChecksResponse
Retreive a list of all checks registered to the local agent.
-
#list_services ⇒ AgentListServicesResponse
Retreive a list of all services registered to the local agent.
-
#register_service(service) ⇒ Object
Register a new service with the agent.
Methods inherited from Client
default_client, inherited, #initialize, #path_prefix, reset_default_client, reset_default_clients
Constructor Details
This class inherits a constructor from Imperium::Client
Instance Method Details
#deregister_service(service_or_id) ⇒ Object
Deregister a service with the agent.
14 15 16 17 |
# File 'lib/imperium/agent.rb', line 14 def deregister_service(service_or_id) id = (service_or_id.is_a?(Service) ? service_or_id.id : service_or_id) Response.new(@http_client.put(prefix_path("service/deregister/#{id}"), '')) end |
#list_checks ⇒ AgentListChecksResponse
Retreive a list of all checks registered to the local agent.
23 24 25 26 |
# File 'lib/imperium/agent.rb', line 23 def list_checks response = @http_client.get(prefix_path('checks')) AgentListChecksResponse.new(response) end |
#list_services ⇒ AgentListServicesResponse
Retreive a list of all services registered to the local agent.
32 33 34 35 |
# File 'lib/imperium/agent.rb', line 32 def list_services response = @http_client.get(prefix_path('services')) AgentListServicesResponse.new(response) end |