Class: Fog::Vcloud::Real
- Inherits:
-
Object
- Object
- Fog::Vcloud::Real
- Defined in:
- lib/fog/vcloud.rb,
lib/fog/vcloud/requests/login.rb,
lib/fog/vcloud/requests/get_vdc.rb,
lib/fog/vcloud/requests/get_versions.rb,
lib/fog/vcloud/requests/get_organization.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#login_uri ⇒ Object
Returns the value of attribute login_uri.
-
#supported_versions ⇒ Object
readonly
Returns the value of attribute supported_versions.
Instance Method Summary collapse
- #default_organization_uri ⇒ Object
- #get_organization(organization_uri) ⇒ Object
-
#get_vdc(vdc_uri) ⇒ Object
Get details of a vdc.
- #get_versions ⇒ Object
-
#initialize(options = {}) ⇒ Real
constructor
A new instance of Real.
- #login ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Real
Returns a new instance of Real.
25 26 27 28 29 30 31 32 33 |
# File 'lib/fog/vcloud.rb', line 25 def initialize( = {}) @connections = {} @versions_uri = URI.parse([:versions_uri]) @module = [:module] @version = [:version] @username = [:username] @password = [:password] @login_uri = get_login_uri end |
Instance Attribute Details
#login_uri ⇒ Object
Returns the value of attribute login_uri.
22 23 24 |
# File 'lib/fog/vcloud.rb', line 22 def login_uri @login_uri end |
#supported_versions ⇒ Object (readonly)
Returns the value of attribute supported_versions.
23 24 25 |
# File 'lib/fog/vcloud.rb', line 23 def supported_versions @supported_versions end |
Instance Method Details
#default_organization_uri ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/fog/vcloud.rb', line 35 def default_organization_uri @default_organization_uri ||= begin unless @login_results do_login end org_list = @login_results.body.organizations if organization = @login_results.body.organizations.first URI.parse(organization[:href]) else nil end end end |
#get_organization(organization_uri) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/fog/vcloud/requests/get_organization.rb', line 5 def get_organization(organization_uri) response = request( :expects => 200, :method => 'GET', :parser => Fog::Parsers::Vcloud::GetOrganization.new, :uri => organization_uri ) response end |
#get_vdc(vdc_uri) ⇒ Object
Get details of a vdc
6 7 8 9 10 11 12 13 |
# File 'lib/fog/vcloud/requests/get_vdc.rb', line 6 def get_vdc(vdc_uri) request( :expects => 200, :method => 'GET', :parser => Fog::Parsers::Vcloud::GetVdc.new, :uri => vdc_uri ) end |
#get_versions ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/fog/vcloud/requests/get_versions.rb', line 6 def get_versions unauthenticated_request({ :expects => 200, :method => 'GET', :parser => Fog::Parsers::Vcloud::GetVersions.new, :uri => @versions_uri }) end |