Class: Occi::InfrastructureExt::Model

Inherits:
Occi::Infrastructure::Model show all
Defined in:
lib/occi/infrastructure_ext/model.rb

Overview

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

Author:

Constant Summary

Constants included from Core::Helpers::Renderable

Core::Helpers::Renderable::RENDERER_FACTORY_CLASS

Instance Attribute Summary

Attributes inherited from Core::Model

#categories

Instance Method Summary collapse

Methods inherited from Occi::Infrastructure::Model

#find_os_tpls, #find_resource_tpls, #load_infrastructure!

Methods inherited from Core::Model

#<<, #actions, #all, #associated_actions, #depended_on_mixins, #empty?, #find_by_identifier, #find_by_identifier!, #find_by_location, #find_by_schema, #find_by_term, #find_dependent, #find_related, #initialize, #kinds, #load_core!, #mixins, #parent_kinds, #remove, #valid!, #valid?

Methods included from Core::Helpers::Renderable

extended, included, #render, #renderer_factory, renderer_factory, renderer_factory_class, #renderer_for

Constructor Details

This class inherits a constructor from Occi::Core::Model

Instance Method Details

#find_availability_zonesSet

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

Returns:

  • (Set)

    set of mixins dependent on `availability_zone`


31
32
33
# File 'lib/occi/infrastructure_ext/model.rb', line 31

def find_availability_zones
  find_dependent Occi::InfrastructureExt::Mixins::AvailabilityZone.new
end

#find_floatingippoolsSet

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

Returns:

  • (Set)

    set of mixins dependent on `floatingippool`


45
46
47
# File 'lib/occi/infrastructure_ext/model.rb', line 45

def find_floatingippools
  find_dependent Occi::InfrastructureExt::Mixins::Floatingippool.new
end

#find_regionsSet

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

Returns:

  • (Set)

    set of mixins dependent on `region`


38
39
40
# File 'lib/occi/infrastructure_ext/model.rb', line 38

def find_regions
  find_dependent Occi::InfrastructureExt::Mixins::Region.new
end

#instance_builderOcci::InfrastructureExt::InstanceBuilder

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

Returns:


24
25
26
# File 'lib/occi/infrastructure_ext/model.rb', line 24

def instance_builder
  Occi::InfrastructureExt::InstanceBuilder.new(model: self)
end

#load_infrastructure_ext!Object

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

Examples:

model = Occi::InfrastructureExt::Model.new
model.load_infrastructure_ext!

12
13
14
15
16
17
18
19
# File 'lib/occi/infrastructure_ext/model.rb', line 12

def load_infrastructure_ext!
  logger.debug 'Loading InfrastructureExt from InfrastructureExt::Warehouse'
  Occi::InfrastructureExt::Warehouse.bootstrap! self
  self << Occi::InfrastructureExt::Mixins::AvailabilityZone.new
  self << Occi::InfrastructureExt::Mixins::Region.new
  self << Occi::InfrastructureExt::Mixins::Floatingippool.new
  nil
end