class Occi::Infrastructure::Model

See `Occi::Core::Model` for details.

@author Boris Parak <parak@cesnet.cz>

Public Instance Methods

find_os_tpls() click to toggle source

Returns all mixins dependent on the base `os_tpl` mixin defined by OGF.

@return [Set] set of mixins dependent on `os_tpl`

# File lib/occi/infrastructure/model.rb, line 30
def find_os_tpls
  find_dependent Occi::Infrastructure::Mixins::OsTpl.new
end
find_resource_tpls() click to toggle source

Returns all mixins dependent on the base `resource_tpl` mixin defined by OGF.

@return [Set] set of mixins dependent on `resource_tpl`

# File lib/occi/infrastructure/model.rb, line 37
def find_resource_tpls
  find_dependent Occi::Infrastructure::Mixins::ResourceTpl.new
end
instance_builder() click to toggle source

Returns an instance of `Occi::Infrastructure::InstanceBuilder` associated with this model.

@return [Occi::Infrastructure::InstanceBuilder] instance of IB

# File lib/occi/infrastructure/model.rb, line 23
def instance_builder
  Occi::Infrastructure::InstanceBuilder.new(model: self)
end
load_infrastructure!() click to toggle source

Loads OGF's OCCI Infrastructure Standard from `Occi::Infrastructure::Warehouse`.

@example

model = Occi::Infrastructure::Model.new
model.load_infrastructure!
# File lib/occi/infrastructure/model.rb, line 12
def load_infrastructure!
  logger.debug 'Loading Infrastructure from Infrastructure::Warehouse'
  Occi::Infrastructure::Warehouse.bootstrap! self
  self << Occi::Infrastructure::Mixins::OsTpl.new
  self << Occi::Infrastructure::Mixins::ResourceTpl.new
  nil
end