Class: Alaxala::Interface

Inherits:
Parser show all
Defined in:
lib/netutils/cli/alaxala/interface.rb

Constant Summary collapse

PORT_RE =

AX8600 Date 2017/10/14 20:16:41 JST Port Counts: 54 Port Status Speed Duplex FCtl FrLen Description

1/1  up       10GBASE-SR      full       off  1518  hogehoge
1/2  up       10GBASE-SR      full       off  1518  fugafuga
/^\s*([0-9\/\s]+)\s+([^\s]*)\s*(up|down|dis|inact|init)\s+([^\s]+)\s+(full|half|-)(?:\(auto\))?\s+(on|off|-)\s+(?:[0-9]+|-)\s+.*$/

Constants inherited from FSM

FSM::FSM_S_INIT

Instance Method Summary collapse

Methods inherited from Parser

#add, #parse, #regexp

Methods inherited from FSM

#add, #cb, #changeto, #state_name

Constructor Details

#initialize(sw) ⇒ Interface

Returns a new instance of Interface.



50
51
52
53
54
55
56
57
# File 'lib/netutils/cli/alaxala/interface.rb', line 50

def initialize(sw)
  super()
  add('Init',  :init)
  add('Date',  :date, /^Port Counts:.*$/)
  add('Count', :count, /^Port\s+(?:Name|Status).*$/)
  add('Port',  :port)
  @sw = sw
end

Instance Method Details

#cmdObject



6
7
8
# File 'lib/netutils/cli/alaxala/interface.rb', line 6

def cmd
  return 'show port'
end