Class: Openstack

Inherits:
BaseDefinition
  • Object
show all
Defined in:
lib/providers/openstack/openstack.rb

Overview

This class describes how to process some actions, and will do everything prior this task to make it to work.

Instance Method Summary collapse

Constructor Details

#initializeOpenstack

Returns a new instance of Openstack.



20
21
22
# File 'lib/providers/openstack/openstack.rb', line 20

def initialize
  superclass.provides([:compute, :network])
end

Instance Method Details

#computeObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/providers/openstack/openstack.rb', line 24

def compute
  Fog::Compute.new(
    :provider => :openstack,
    :openstack_api_key => superclass.oForjAccount.get(:account_id),
    :openstack_username => superclass.oForjAccount.get(:account_key),
    :openstack_auth_url => superclass.oForjAccount.get(:auth_uri),
    :openstack_tenant => superclass.oForjAccount.get(:tenant_id),
    :openstack_region => superclass.oForjAccount.get(:compute)
     )
end

#networkObject



35
36
37
38
39
40
41
42
43
44
# File 'lib/providers/openstack/openstack.rb', line 35

def network
  Fog::Network.new(
    :provider => :openstack,
    :openstack_api_key => superclass.oForjAccount.get(:account_id),
    :openstack_username => superclass.oForjAccount.get(:account_key),
    :openstack_auth_url => superclass.oForjAccount.get(:auth_uri),
    :openstack_tenant => superclass.oForjAccount.get(:tenant_id),
    :openstack_region => superclass.oForjAccount.get(:network)
     )
end