Class: Occi::Infrastructure::Network
- Inherits:
-
Core::Resource
- Object
- Core::Entity
- Core::Resource
- Occi::Infrastructure::Network
- Defined in:
- lib/occi/infrastructure/network.rb,
lib/occi/infrastructure/network/ipnetwork.rb
Defined Under Namespace
Instance Attribute Summary
Attributes inherited from Core::Resource
Attributes inherited from Core::Entity
#actions, #attributes, #id, #kind, #mixins, #model
Class Method Summary collapse
Instance Method Summary collapse
-
#address ⇒ Object
IPNetwork Mixin attributes.
- #address=(address) ⇒ Object
- #allocation ⇒ Object
- #allocation=(allocation) ⇒ Object
- #gateway ⇒ Object
- #gateway=(gateway) ⇒ Object
- #ipnetwork(boolean = true) ⇒ Object
- #label ⇒ Object
- #label=(label) ⇒ Object
- #state ⇒ Object
- #state=(state) ⇒ Object
- #vlan ⇒ Object
- #vlan=(vlan) ⇒ Object
Methods inherited from Core::Resource
#as_json, #initialize, #link, #model=, #summary, #summary=, #to_header, #to_text
Methods inherited from Core::Entity
#as_json, check, #check, #initialize, #inspect, #location, new, #title, #title=, #to_header, #to_s, #to_text, type_identifier
Constructor Details
This class inherits a constructor from Occi::Core::Resource
Class Method Details
Instance Method Details
#address ⇒ Object
IPNetwork Mixin attributes
93 94 95 |
# File 'lib/occi/infrastructure/network.rb', line 93 def address @attributes.occi.network.address if @attributes.occi.network if @attributes.occi end |
#address=(address) ⇒ Object
97 98 99 100 101 102 103 |
# File 'lib/occi/infrastructure/network.rb', line 97 def address=(address) if @mixins.select { |mixin| mixin.kind_of? Occi::Infrastructure::Network::Ipnetwork }.empty? Occi::Log.info 'Adding mixin IPNetwork mixin' @mixins << Occi::Infrastructure::Network::Ipnetwork.new end @attributes.occi!.network!.address = address end |
#allocation ⇒ Object
117 118 119 |
# File 'lib/occi/infrastructure/network.rb', line 117 def allocation @attributes.occi.network.allocation if @attributes.occi.network if @attributes.occi end |
#allocation=(allocation) ⇒ Object
121 122 123 124 125 126 127 |
# File 'lib/occi/infrastructure/network.rb', line 121 def allocation=(allocation) if @mixins.select { |mixin| mixin.kind_of? Occi::Infrastructure::Network::Ipnetwork }.empty? Occi::Log.info 'Adding mixin IPNetwork mixin' @mixins << Occi::Infrastructure::Network::Ipnetwork.new end @attributes.occi!.network!.allocation = allocation end |
#gateway ⇒ Object
105 106 107 |
# File 'lib/occi/infrastructure/network.rb', line 105 def gateway @attributes.occi.network.gateway if @attributes.occi.network if @attributes.occi end |
#gateway=(gateway) ⇒ Object
109 110 111 112 113 114 115 |
# File 'lib/occi/infrastructure/network.rb', line 109 def gateway=(gateway) if @mixins.select { |mixin| mixin.kind_of? Occi::Infrastructure::Network::Ipnetwork }.empty? Occi::Log.info 'Adding mixin IP network' @mixins << Occi::Infrastructure::Network::Ipnetwork.new end @attributes.occi!.network!.gateway = gateway end |
#ipnetwork(boolean = true) ⇒ Object
57 58 59 60 61 62 63 64 65 |
# File 'lib/occi/infrastructure/network.rb', line 57 def ipnetwork(boolean=true) if boolean require 'occi/infrastructure/network/ipnetwork' self.class.send(:include, Occi::Infrastructure::Network::Ipnetwork) mixins << Occi::Infrastructure::Network::Ipnetwork.mixin.type_identifier else mixins.delete Occi::Infrastructure::Network::Ipnetwork.mixin.type_identifier end end |
#label ⇒ Object
75 76 77 |
# File 'lib/occi/infrastructure/network.rb', line 75 def label @attributes.occi.nework.label if @attributes.occi.network if @attributes.occi end |
#label=(label) ⇒ Object
79 80 81 |
# File 'lib/occi/infrastructure/network.rb', line 79 def label=(label) @attributes.occi!.network!.label = label end |
#state ⇒ Object
83 84 85 |
# File 'lib/occi/infrastructure/network.rb', line 83 def state @attributes.occi.nework.state if @attributes.occi.network if @attributes.occi end |
#state=(state) ⇒ Object
87 88 89 |
# File 'lib/occi/infrastructure/network.rb', line 87 def state=(state) @attributes.occi!.network!.state = state end |
#vlan ⇒ Object
67 68 69 |
# File 'lib/occi/infrastructure/network.rb', line 67 def vlan @attributes.occi.nework.vlan if @attributes.occi.network if @attributes.occi end |
#vlan=(vlan) ⇒ Object
71 72 73 |
# File 'lib/occi/infrastructure/network.rb', line 71 def vlan=(vlan) @attributes.occi!.network!.vlan = vlan end |