Class: Session
- Inherits:
-
Object
- Object
- Session
- Extended by:
- RightScale::Api::GatewayExtend
- Includes:
- RightScale::Api::Gateway
- Defined in:
- lib/rest_connection/rightscale/session.rb
Overview
API 1.5
Instance Attribute Summary
Attributes included from RightScale::Api::Base
Class Method Summary collapse
- .accounts(opts = {}) ⇒ Object
- .create(opts = {}) ⇒ Object
- .create_instance_session ⇒ Object
- .index ⇒ Object
- .index_instance_session ⇒ Object
Methods included from RightScale::Api::GatewayExtend
create, filters, find, find_all, find_by, find_with_filter, load, load_all, parse_args, resource_post_name
Methods included from RightScale::Api::GatewayConnection
Methods included from RightScale::Api::BaseExtend
#[], #create, #deny_methods, #filters, #find, #find_all, #find_by, #find_by_cloud_id, #find_by_id, #find_by_nickname, #find_by_nickname_speed, #find_with_filter, #resource_plural_name, #resource_singular_name
Methods included from RightScale::Api::BaseConnection
Methods included from RightScale::Api::Gateway
#[], #[]=, #actions, #hash_of_links, #href, #initialize, #load, #method_missing, #nickname, #parse_params, #rediscover, #save
Methods included from RightScale::Api::Base
#[], #[]=, #destroy, #initialize, #method_missing, #reload, #resource_plural_name, #resource_singular_name, #rs_id, #save
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class RightScale::Api::Gateway
Class Method Details
.accounts(opts = {}) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/rest_connection/rightscale/session.rb', line 49 def self.accounts(opts={}) settings = connection.settings params = { "email" => settings[:user], "password" => settings[:pass], }.merge(opts) a = Array.new connection.get(resource_singular_name + "/accounts").each do |object| a << Account.new(object) end return a end |
.create(opts = {}) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/rest_connection/rightscale/session.rb', line 37 def self.create(opts={}) settings = connection.settings ignored, account = settings[:api_url].split(/\/acct\//) if settings[:api_url].include?("acct") params = { "email" => settings[:user], "password" => settings[:pass], "account_href" => "/api/accounts/#{account}" }.merge(opts) resp = connection.post(resource_singular_name, params) connection. = resp.response['set-cookie'] end |
.create_instance_session ⇒ Object
62 63 64 |
# File 'lib/rest_connection/rightscale/session.rb', line 62 def self.create_instance_session # TODO end |
.index ⇒ Object
33 34 35 |
# File 'lib/rest_connection/rightscale/session.rb', line 33 def self.index self.new(connection.get(resource_singular_name)) end |
.index_instance_session ⇒ Object
66 67 68 |
# File 'lib/rest_connection/rightscale/session.rb', line 66 def self.index_instance_session # TODO end |