Module: IIB::Node
Defined Under Namespace
Class Method Summary collapse
- .create_local_node(name) ⇒ Object
- .delete_local_node(name) ⇒ Object
- .get_all_local_nodes ⇒ Object
- .new(options) ⇒ Object
Class Method Details
.create_local_node(name) ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/iib/node.rb', line 43 def self.create_local_node(name) IIB.check_local_iib_environment iib_create_broker = Mixlib::ShellOut.new("iib createbroker #{name}") iib_create_broker.run_command return IIB::Node.new(type: :CLI, name: name) end |
.delete_local_node(name) ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/iib/node.rb', line 52 def self.delete_local_node(name) IIB.check_local_iib_environment iib_delete_broker = Mixlib::ShellOut.new("iib deletebroker #{name}") iib_delete_broker.run_command end |
.get_all_local_nodes ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/iib/node.rb', line 29 def self.get_all_local_nodes IIB.check_local_iib_environment iib_list = Mixlib::ShellOut.new("iib list -d 0") iib_list.run_command output = iib_list.stdout matches = output.scan(/BIP8099I:\ Broker:\ ([^\ ]*)\ \ -\ \ ([^\n]*)/m) matches.map do |match| IIB::Node.new(type: :CLI,name: match[0]) end end |