Class: Rubineti::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/rubineti/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Client

Required: user: A String containing the username for use in HTTP Basic auth. password: A String containing the password for use in HTTP Basic auth. host: A String with the host to connect.



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/rubineti/client.rb', line 16

def initialize options
  @connection = Hugs::Client.new(
    :user     => options[:user],
    :password => options[:password],
    :host     => options[:host],
    :port     => options[:port] || 5080,
    :scheme   => "https"
  )
  @connection.raise_4xx = true
  @connection.raise_5xx = true
end

Instance Method Details

#clusterObject



28
29
30
# File 'lib/rubineti/client.rb', line 28

def cluster
  @cluster ||= Rubineti::Cluster.new @connection
end

#instanceObject



32
33
34
# File 'lib/rubineti/client.rb', line 32

def instance
  @instance ||= Rubineti::Instance.new @connection
end

#jobObject



36
37
38
# File 'lib/rubineti/client.rb', line 36

def job
  @job ||= Rubineti::Job.new @connection
end

#nodeObject



40
41
42
# File 'lib/rubineti/client.rb', line 40

def node
  @node ||= Rubineti::Node.new @connection
end