Class: RightScale::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/rightscale/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(account, email, password) ⇒ Client

Returns a new instance of Client.



5
6
7
8
# File 'lib/rightscale/client.rb', line 5

def initialize(, email, password)
  @account, @email, @password = , email, password
  self.class.base_uri "https://my.rightscale.com/api/acct/#{@account}"
end

Instance Method Details

#deploymentsObject



19
20
21
# File 'lib/rightscale/client.rb', line 19

def deployments  
  @deployments ||= Deployments.new(self)
end

#get(path, options = {}) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/rightscale/client.rb', line 10

def get(path, options={})
  options.merge!({
    :basic_auth => {:username => @email, :password => @password},
    :headers    => {'X-API-VERSION' => '1.0'}
  })
  
  self.class.get("#{path}", options)
end

#right_scriptsObject



31
32
33
# File 'lib/rightscale/client.rb', line 31

def right_scripts
  @right_scripts ||= RightScripts.new(self, :resource => 'right_scripts')
end

#serversObject



23
24
25
# File 'lib/rightscale/client.rb', line 23

def servers
  @servers ||= Servers.new(self)
end

#statusesObject



27
28
29
# File 'lib/rightscale/client.rb', line 27

def statuses
  @statuses ||= Statuses.new(self)
end