Sha256: 1467a1232c7b38341d599abddf4114e5326b7cfcdc706df4e0e292f2195619d1

Contents?: true

Size: 1.67 KB

Versions: 15

Compression:

Stored size: 1.67 KB

Contents

#
#	这个模块用于转换不同设备间的命令
#
module Aio::Device
	module CmdSwitch

		include Aio::Module
		
		class << self
			def version(klass)
				case klass
				when Cisco, Maipu
					"show version"
				when H3C
					"display version"
				end
			end

			def cpu(klass)
				case klass
				when Cisco
					"show process cpu"
				when H3C
					"display cpu-usage"
				when Maipu
					"show cpu"
				end
			end

			def memory(klass)
				case klass
				when Cisco
					"show process memory"
				when H3C
					"display memory"
				when Maipu
					"show memory"
				end
			end

			def inventory(klass)
				case klass
				when Cisco
					"show inventory"
				when H3C
					"display device manuinfo"
				end
			end

			def clock(klass)
				case klass
				when Cisco, Maipu
					"show clock"
				when H3C
					"display clock"
				end
			end

			def environment(klass)
				case klass
				when Cisco, Maipu
					"show environment"
				end
			end

			def power(klass)
				case klass
				when Cisco
					"show environment"
				when H3C
					"display power"
				when Maipu
					"show system power"
				end
			end

			def fan(klass)
				case klass
				when Cisco
					"show environment"
				when H3C
					"display fan"
				when Maipu
					"show system fan"
				end
			end

			def interface(klass)
				case klass
				when Cisco, Maipu
					"show interfaces"
				when H3C, Huawei
					"display interface"
				end
			end

			def interface_brief(klass)
				case klass
				when Cisco
				#	if klass.platform == FW
				#		"show interface ip brief"
						"show ip interface brief"
				when H3C
					"display ip interface brief"
				when Maipu
					"show ip interface brief"
				end
			end
					

		end # class self
	end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
aio_elin-1.1.4 lib/aio/core/device/cmd_switch.rb
aio_elin-1.1.3 lib/aio/core/device/cmd_switch.rb
aio_elin-1.1.2 lib/aio/core/device/cmd_switch.rb
aio_elin-1.1.1 lib/aio/core/device/cmd_switch.rb
aio_elin-1.1.0 lib/aio/core/device/cmd_switch.rb
aio_elin-1.0.9 lib/aio/core/device/cmd_switch.rb
aio_elin-1.0.8 lib/aio/core/device/cmd_switch.rb
aio_elin-1.0.7 lib/aio/core/device/cmd_switch.rb
aio_elin-1.0.6 lib/aio/core/device/cmd_switch.rb
aio_elin-1.0.5 lib/aio/core/device/cmd_switch.rb
aio_elin-1.0.4 lib/aio/core/device/cmd_switch.rb
aio_elin-1.0.3 lib/aio/core/device/cmd_switch.rb
aio_elin-1.0.2 lib/aio/core/device/cmd_switch.rb
aio_elin-1.0.1 lib/aio/core/device/cmd_switch.rb
aio_elin-1.0.0 lib/aio/core/device/cmd_switch.rb