# # 这个模块用于转换不同设备间的命令 # 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 configuration(klass) case klass when Cisco, Maipu 'show run' when H3C, Huawei 'display current' 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" when Maipu "show system module brief" 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