class Mycloud

This file is given as an example. This class is automatically derived from ForjCloudBase and ForjProcess

Defines Meta MyCloud object

This class is automatically derived from ForjCloudBase and ForjProcess

Public Instance Methods

provider_compute_new() click to toggle source
# File lib/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) click to toggle source
# File lib/providers/templates/network.rb, line 29
def provider_create_network(oNetwork, name)
  oNetwork.networks.create(:name => name)
end
provider_network_new() click to toggle source
# File lib/providers/templates/network.rb, line 21
def provider_network_new
  Fog::Network.new({ :provider => :mycloud }.merge(hget_cloudObjMapping))
end
provider_query_network(oNetwork, name) click to toggle source
# File lib/providers/templates/network.rb, line 25
def provider_query_network(oNetwork, name)
  oNetwork.networks.all(:name => name)
end