Class: Mycloud
- Inherits:
-
Object
- Object
- Mycloud
- Defined in:
- lib/process/cloud/providers/templates/compute.rb,
lib/process/cloud/providers/templates/mycloud.rb,
lib/process/cloud/providers/templates/network.rb
Overview
This class is automatically derived from ForjCloudBase and ForjProcess
Instance Method Summary collapse
- #provider_compute_new ⇒ Object
- #provider_create_network(oNetwork, name) ⇒ Object
- #provider_network_new ⇒ Object
- #provider_query_network(oNetwork, name) ⇒ Object
Instance Method Details
#provider_compute_new ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/process/cloud/providers/templates/compute.rb', line 20 def provider_compute_new # My fog connection # hget_cloudObjMapping() is a ForjCloudBase function which will build a # hash from data required with needed mapped keys(see core.rb) Fog::Compute.new({ :provider => :mycloud }.merge(hget_cloudObjMapping)) # If you do not want to get data mapped automatically, you can use # @oForjAccount.get() # This means in following declaration in your core.rb: # obj_needs(:data, :<CloudDataKey},{:mapping => :<MyCloudKeyMapped>}) # can be updated by removing the mapping => <Value> Fog::Compute.new( :provider => :mycloud, :user => @oForjAccount.get(:account_id), :pwd => @oForjAccount.get(:account_key), :auth_uri => @oForjAccount.get(:auth_uri), :project => @oForjAccount.get(:tenant), :compute_service => @oForjAccount.get(:compute) ) end |
#provider_create_network(oNetwork, name) ⇒ Object
29 30 31 |
# File 'lib/process/cloud/providers/templates/network.rb', line 29 def provider_create_network(oNetwork, name) oNetwork.networks.create(:name => name) end |
#provider_network_new ⇒ Object
21 22 23 |
# File 'lib/process/cloud/providers/templates/network.rb', line 21 def provider_network_new Fog::Network.new({ :provider => :mycloud }.merge(hget_cloudObjMapping)) end |
#provider_query_network(oNetwork, name) ⇒ Object
25 26 27 |
# File 'lib/process/cloud/providers/templates/network.rb', line 25 def provider_query_network(oNetwork, name) oNetwork.networks.all(:name => name) end |