Sha256: bc24181b841dee76d51080039d0a8a56e85706e6c0b18c6523868cc35de366d5
Contents?: true
Size: 940 Bytes
Versions: 18
Compression:
Stored size: 940 Bytes
Contents
#coding=utf-8 require "aio/core" class Aio::Module::Cmd::H3C::DisplayIpInterfaceBrief < Aio::Module::Cmd::H3C include Aio::Module def initialize super({ :cmd_full => "display ip interface brief", :cmd_short => "dis ip int b", :author => "Elin", :description => "This is H3C Command# display ip interface brief", :ranking => Ranking_1, :platform => "all", }) end def parse context = self.context.dup useful[:interface_brief] = {} context.readline_match_block(/Interface Physical Protocol IP Address/) {|b|b} context.readline_match_block_loop(/(?<interface_id>[^\s]+) (?<status>[^\s]+) (?<protocol>[^\s]+) (?<ip>[^\s]+)/, reg_blank) do |block| iface = {} iface_id = block[:interface_id] useful[:interface_brief][iface_id.to_sym] = iface block.update(iface, :interface_id) block.update(iface, :ip) block.update(iface, :status) block.update(iface, :protocol) end end end
Version data entries
18 entries across 18 versions & 1 rubygems