Class: TestLab::Network

Inherits:
ZTK::DSL::Base
  • Object
show all
Extended by:
ClassMethods
Includes:
Actions, Bind, Provision, Status, Support::Lifecycle, Utility::Misc
Defined in:
lib/testlab/network.rb,
lib/testlab/network/bind.rb,
lib/testlab/network/status.rb,
lib/testlab/network/actions.rb,
lib/testlab/network/provision.rb,
lib/testlab/network/class_methods.rb

Overview

Network Class

Author:

  • Zachary Patten <zachary AT jovelabs DOT com>

Defined Under Namespace

Modules: Actions, Bind, ClassMethods, Provision, Status

Constant Summary collapse

STATUS_KEYS =
%w(id node_id state interface network netmask broadcast provisioners).map(&:to_sym)

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ClassMethods

ips

Methods included from Utility::Misc

#do_provisioner_callbacks, #format_message, #format_object_action, #please_wait, #sudo, #sudo_prompt

Methods included from Support::Lifecycle

#bounce, #build, #demolish, #recycle

Methods included from Status

#broadcast, #cidr, #def_tag, #end_tag, #ip, #netmask, #network, #state, #status

Methods included from Provision

#deprovision, #provision

Methods included from Bind

#arpa, #ptr

Methods included from Actions

#create, #destroy, #down, #up

Constructor Details

#initialize(*args) ⇒ Network

Returns a new instance of Network.



47
48
49
50
51
52
53
# File 'lib/testlab/network.rb', line 47

def initialize(*args)
  @ui = TestLab.ui

  @ui.logger.debug { "Loading Network" }
  super(*args)
  @ui.logger.debug { "Network '#{self.id}' Loaded" }
end

Class Method Details

.by_priority(priority) ⇒ Object



61
62
63
# File 'lib/testlab/network.rb', line 61

def by_priority(priority)
  self.all.select{ |n| n.priority == priority }
end

.priority_groupsObject



57
58
59
# File 'lib/testlab/network.rb', line 57

def priority_groups
  self.all.map(&:priority).sort.uniq.reverse
end