From 128462ae15a5ecb9043a3433c33a6b462a30f472 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Wed, 22 May 2019 11:20:53 -0700 Subject: [PATCH] [config]: Add --policer option for mirror session (#537) Signed-off-by: Shu0T1an ChenG --- config/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/main.py b/config/main.py index 2190c82fd83a..111c125b35d5 100755 --- a/config/main.py +++ b/config/main.py @@ -530,7 +530,8 @@ def mirror_session(): @click.argument('ttl', metavar='', required=True) @click.argument('gre_type', metavar='[gre_type]', required=False) @click.argument('queue', metavar='[queue]', required=False) -def add(session_name, src_ip, dst_ip, dscp, ttl, gre_type, queue): +@click.option('--policer') +def add(session_name, src_ip, dst_ip, dscp, ttl, gre_type, queue, policer): """ Add mirror session """ @@ -544,6 +545,9 @@ def add(session_name, src_ip, dst_ip, dscp, ttl, gre_type, queue): "ttl": ttl } + if policer is not None: + session_info['policer'] = policer + if gre_type is not None: session_info['gre_type'] = gre_type