Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ exclude =
files/disable
files/generate
files/import
ignore = F841 W503 E721 E722 E226
ignore = F841 W503 E721 E722 E226 E203
1 change: 1 addition & 0 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ uv pip install --no-cache --system -r /src/requirements.ansible.txt
uv pip install --no-cache --system -r /src/requirements.openstack-image-manager.txt
uv pip install --no-cache --system -r /src/requirements.openstack-flavor-manager.txt
uv pip install --no-cache --system -r /src/requirements.netbox-manager.txt
uv pip install --no-cache --system -r /src/requirements.sonic.txt

# install python-osism
uv pip install --no-cache --system /src
Expand Down
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pottery = "==3.0.1"
prompt-toolkit = "==3.0.52"
pyang = "==2.7.1"
pynetbox = "==7.6.1"
sonic-yang-mgmt = {git = "https://github.com/sonic-net/sonic-buildimage.git", ref = "9ef3658e5315002006ea1d6da2524ad14f77c928", subdirectory = "src/sonic-yang-mgmt"}
pytest-testinfra = "==10.2.2"
python-dateutil = "==2.9.0.post0"
redfish = "==3.3.5"
Expand Down
25 changes: 25 additions & 0 deletions files/sonic/yang_models/sonic-extension.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module sonic-extension {

yang-version 1.1;

namespace "http://github.com/sonic-net/sonic-extension";
prefix sonic-extension;

description "Extension yang Module for SONiC OS";

revision 2019-07-01 {
description "First Revision";
}

/* For complete guide of using these extensions in SONiC yangs, refer
SONiC yang guidelines at
https://github.com/Azure/SONiC/blob/master/doc/mgmt/SONiC_YANG_Model_Guidelines.md */

extension db-name {
description "DB name, e.g. APPL_DB, CONFIG_DB";
argument "value";
}



}
Empty file modified files/sonic/yang_models/sonic-passwh.yang
100755 → 100644
Empty file.
125 changes: 125 additions & 0 deletions files/sonic/yang_models/sonic-policer.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@

/* this is sonic py yang model */

module sonic-policer {

yang-version 1.1;

namespace "http://github.com/sonic-net/sonic-policer";
prefix policer;

import sonic-types {
prefix stypes;
}

description "Policer YANG Module for SONiC OS";

revision 2022-02-03 {
description
"First Revision";
}

container sonic-policer {
container POLICER {
list POLICER_LIST {
key name;

leaf name {
type string;
description "Policer name";
}

leaf meter_type {
mandatory true;
type stypes:meter_type;
description "Policer meter type";
}

leaf mode {
mandatory true;
type stypes:policer_mode;
description "Policer mode";
}

leaf color {
type stypes:policer_color_source;
description "Policer color Source";
}

leaf cir {
type uint64;
description
"Committed information rate for the dual-rate token
bucket policer. This value represents the rate at which
tokens are added to the primary bucket. Unit is bytes/sec
or packets/sec based on meter_type";
}

leaf cbs {
must "((current()/../cir) and (current()/../cir > 0))" {
error-message "cbs can't be configured without cir.";
}
must "(current() >= current()/../cir)" {
error-message "cbs must be greater than or equal to cir";
}
type uint64;
description
"Committed burst size for the dual-rate token bucket
policer. This value represents the depth of the token
bucket. Unit is bytes or packets based on meter_type";
}

leaf pir {
when "current()/../mode = 'tr_tcm'";
must "((current()/../cir) and (current()/../cir > 0))" {
error-message "pir can't be configured without cir.";
}
must "(current() >= current()/../cir)" {
error-message "pir must be greater than or equal to cir";
}
type uint64;
description
"Peak information rate for the dual-rate token bucket
policer. This value represents the rate at which tokens
are added to the secondary bucket. Unit is bytes/sec or
packets/sec based on meter_type";
}

leaf pbs {
when "((current()/../mode = 'sr_tcm') or (current()/../mode = 'tr_tcm'))";
must "((not(current()/../cbs)) or (current() >= current()/../cbs))" {
error-message "pbs must be greater than or equal to cbs";
}
type uint64;
description
"Excess burst size for the dual-rate token bucket policer.
This value represents the depth of the secondary bucket. Unit
is bytes or packets based on meter_type";
}

leaf green_packet_action {
type stypes:policer_packet_action;
default "forward";
description "Green action";
}

leaf yellow_packet_action {
when "((current()/../mode = 'sr_tcm') or (current()/../mode = 'tr_tcm'))";
type stypes:policer_packet_action;
default "forward";
description "Yellow action";
}

leaf red_packet_action {
type stypes:policer_packet_action;
default "forward";
description "Red action";
}
}
/* end of list POLICER_LIST */
}
/* end of container POLICER */
}
/* end of top level container */
}
/* end of module sonic-policer */
Loading