Module: RedfishClient

Defined in:
lib/redfish_client.rb,
lib/redfish_client/root.rb,
lib/redfish_client/version.rb,
lib/redfish_client/nil_hash.rb,
lib/redfish_client/resource.rb,
lib/redfish_client/response.rb,
lib/redfish_client/connector.rb,
lib/redfish_client/event_listener.rb

Defined Under Namespace

Classes: Connector, EventListener, NilHash, Resource, Response, Root

Constant Summary collapse

VERSION =
"0.6.0"

Class Method Summary collapse

Class Method Details

.new(url, prefix: "/redfish/v1", verify: true, use_cache: true, use_session: true) ⇒ Object

Create new Redfish API client.

Parameters:

  • url (String)

    base URL of Redfish API

  • prefix (String) (defaults to: "/redfish/v1")

    Redfish API prefix

  • verify (Boolean) (defaults to: true)

    verify certificates for https connections

  • use_session (Boolean) (defaults to: true)

    Use a session for authentication

  • use_cache (Boolean) (defaults to: true)

    cache API responses



16
17
18
19
20
# File 'lib/redfish_client.rb', line 16

def self.new(url, prefix: "/redfish/v1", verify: true, use_cache: true, use_session: true)
  cache = (use_cache ? Hash : NilHash).new
  con = Connector.new(url, verify: verify, cache: cache, use_session: use_session)
  Root.new(con, oid: prefix)
end