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

Version Path
aio_elin-1.1.8 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-1.1.7 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-1.1.4 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-1.1.3 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-1.1.2 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-1.1.1 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-1.1.0 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-1.0.9 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-1.0.8 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-1.0.7 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-1.0.6 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-1.0.5 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-1.0.4 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-1.0.3 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-1.0.2 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-1.0.1 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-1.0.0 lib/modules/cmd/h3c/display_ip_interface_brief.rb
aio_elin-0.0.1 lib/modules/cmd/h3c/display_ip_interface_brief.rb