Class: Imperium::Catalog

Inherits:
Client
  • Object
show all
Defined in:
lib/imperium/catalog.rb,
lib/imperium/catalog/service.rb

Overview

A client for the Catalog API.

Defined Under Namespace

Classes: Service

Constant Summary

Constants inherited from Client

Imperium::Client::UNIVERSAL_API_OPTIONS

Instance Attribute Summary

Attributes inherited from Client

#config

Instance Method Summary collapse

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

#list_nodes_for_service(service) ⇒ Array<Service>

List the known nodes for the given service in the global catalog

Returns a Response object that coerces the returned data into Service objects

Parameters:

  • :service (String)

Returns:



23
24
25
26
# File 'lib/imperium/catalog.rb', line 23

def list_nodes_for_service(service)
  response = @http_client.get(prefix_path("service/#{service}"))
  Response.new(response, response_object_class: Service)
end

#list_servicesResponse

List services in the global catalog

Returns:



11
12
13
14
# File 'lib/imperium/catalog.rb', line 11

def list_services
  response = @http_client.get(prefix_path('services'))
  Response.new(response)
end