def config_port_group(args): if args.pg_name == None or args.Breakout == None or args.PHY_Mode == None or args.Port_Speed == None: return False br_mode = get_value(yang_breakout, args.Breakout) phy_mode= get_value(yang_phy_mode, args.PHY_Mode) port_speed = get_value(yang_speed, args.Port_Speed) call(["cps_set_oid.py", "-qua", "target", "-oper", "set", _pg_key, pg_utils.pg_attr('id') + '=' + args.pg_name, pg_utils.pg_attr('breakout-mode') + '=' + str(br_mode), pg_utils.pg_attr('port-speed') + '=' + str(port_speed), pg_utils.pg_attr('phy-mode') + '=' + str(phy_mode)])
def show_port_group(args): if args.pg_name == 'all': call(["cps_get_oid.py", "target/", _pg_key]) else: call([ "cps_get_oid.py", "target/", _pg_key, pg_utils.pg_attr('id') + '=' + args.pg_name ]) call([ "cps_get_oid.py", "observed/", _pg_state_key, pg_utils.pg_state_attr('id') + '=' + args.pg_name ])