Skip to content

Commit

Permalink
[PBH] Implement Edit Flows (sonic-net#2093)
Browse files Browse the repository at this point in the history
PBH Edit Flows is a second phase of PBH feature implementation. It allows user to modify the already existing objects.
PBH Edit Flows offer a full entity update which assumes Config DB field ADD/UPDATE/REMOVE processing.

HLD: sonic-net/SONiC#909

- What I did
Implemented Edit Flows in scope of PBH enhancement

- How I did it
Implementation is done according to the PBH HLD

Signed-off-by: Nazarii Hnydyn <[email protected]>
  • Loading branch information
nazariig authored Mar 30, 2022
1 parent 827358f commit c752457
Show file tree
Hide file tree
Showing 8 changed files with 1,181 additions and 366 deletions.
10 changes: 2 additions & 8 deletions clear/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import sys
import click
import utilities_common.cli as clicommon
import json

from utilities_common import util_base
from show.plugins.pbh import read_pbh_counters
from config.plugins.pbh import serialize_pbh_counters
from . import plugins


Expand Down Expand Up @@ -473,14 +473,8 @@ def statistics(db):
pbh_rules = db.cfgdb.get_table("PBH_RULE")
pbh_counters = read_pbh_counters(pbh_rules)

try:
with open('/tmp/.pbh_counters.txt', 'w') as fp:
json.dump(remap_keys(pbh_counters), fp)
except IOError as err:
pass
serialize_pbh_counters(pbh_counters)

def remap_keys(dict):
return [{'key': k, 'value': v} for k, v in dict.items()]

# ("sonic-clear flowcnt-trap")
@cli.command()
Expand Down
Loading

0 comments on commit c752457

Please sign in to comment.