class Occi::Infrastructure::Network

Public Instance Methods

address() click to toggle source

IPNetwork Mixin attributes

# File lib/occi4/infrastructure/network.rb, line 73
def address
  @attributes.occi_.network_.address
end
address=(address) click to toggle source
# File lib/occi4/infrastructure/network.rb, line 77
def address=(address)
  add_ipnetwork_mixin
  @attributes.occi!.network!.address = address
end
allocation() click to toggle source
# File lib/occi4/infrastructure/network.rb, line 91
def allocation
  @attributes.occi_.network_.allocation
end
allocation=(allocation) click to toggle source
# File lib/occi4/infrastructure/network.rb, line 95
def allocation=(allocation)
  add_ipnetwork_mixin
  @attributes.occi!.network!.allocation = allocation
end
gateway() click to toggle source
# File lib/occi4/infrastructure/network.rb, line 82
def gateway
  @attributes.occi_.network_.gateway
end
gateway=(gateway) click to toggle source
# File lib/occi4/infrastructure/network.rb, line 86
def gateway=(gateway)
  add_ipnetwork_mixin
  @attributes.occi!.network!.gateway = gateway
end
ipnetwork(add = true) click to toggle source
# File lib/occi4/infrastructure/network.rb, line 37
def ipnetwork(add = true)
  if add
    Occi::Log.info "[#{self.class}] Adding mixin IPNetwork"
    @mixins << Occi::Infrastructure::Network::Ipnetwork.mixin
  else
    Occi::Log.info "[#{self.class}] Removing mixin IPNetwork"
    @mixins.delete Occi::Infrastructure::Network::Ipnetwork.mixin
  end
end
label() click to toggle source
# File lib/occi4/infrastructure/network.rb, line 55
def label
  @attributes.occi_.network_.label
end
label=(label) click to toggle source
# File lib/occi4/infrastructure/network.rb, line 59
def label=(label)
  @attributes.occi!.network!.label = label
end
state() click to toggle source
# File lib/occi4/infrastructure/network.rb, line 63
def state
  @attributes.occi_.network_.state
end
state=(state) click to toggle source
# File lib/occi4/infrastructure/network.rb, line 67
def state=(state)
  @attributes.occi!.network!.state = state
end
vlan() click to toggle source
# File lib/occi4/infrastructure/network.rb, line 47
def vlan
  @attributes.occi_.network_.vlan
end
vlan=(vlan) click to toggle source
# File lib/occi4/infrastructure/network.rb, line 51
def vlan=(vlan)
  @attributes.occi!.network!.vlan = vlan
end

Private Instance Methods

add_ipnetwork_mixin() click to toggle source
# File lib/occi4/infrastructure/network.rb, line 102
def add_ipnetwork_mixin
  ipnetwork(true) if @mixins.select { |mixin| mixin.type_identifier == Occi::Infrastructure::Network::Ipnetwork.mixin.type_identifier }.empty?
end