-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[YANG][SNMP]: Add YANG model for SNMP_AGENT_ADDRESS_CONFIG table #15587
Conversation
|
|
Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com> (cherry picked from commit 14dd2cb17751fcd2ee6f57e4c10d69a721206ca7)
e31e612
to
3a429b8
Compare
leaf vrf_name { | ||
type union { | ||
type string { | ||
pattern ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for empty string is because config CLI adds key in CONFIG_TABLE with empty string for vrf if it is not specified in the CLI argument.
https://github.com/sonic-net/sonic-utilities/blob/49fc3896a0ef907ff337467a3e04d2501ef850fd/config/main.py#L3084
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GNMI path can support it, need GCU to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GCU can support it.
Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
/azp run |
Commenter does not have sufficient privileges for PR 15587 in repo sonic-net/sonic-buildimage |
…ic-net#15587) #### Why I did it sonic-net/sonic-utilities#472 Added SNMP_AGENT_ADDRESS_CONFIG table in config db. This PR is to add corresponding YANG model for that table. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it Added YANG modesl for SNMP_AGENT_ADDRESS_CONFIG. keys: agent_ip, port number, vrf. CLI implementaion checks if agent_ip, port number already exists in CONFIG_DB table, if it does, then new entry is not added. So added another condition to ensure combination of agent_ip and port is unique. Below is an example of how data looks like in DB: ``` 127.0.0.1:6379[4]> HGETALL "SNMP_AGENT_ADDRESS_CONFIG|10.1.1.1|161|foo" 1) "NULL" 2) "NULL" 127.0.0.1:6379[4]> HGETALL "SNMP_AGENT_ADDRESS_CONFIG|10.1.0.32|161|" 1) "NULL" 2) "NULL" ``` #### How to verify it Added unit-test for various combinations and ensures that it passes.
Why I did it
sonic-net/sonic-utilities#472 Added SNMP_AGENT_ADDRESS_CONFIG table in config db.
This PR is to add corresponding YANG model for that table.
Work item tracking
How I did it
Added YANG modesl for SNMP_AGENT_ADDRESS_CONFIG.
keys: agent_ip, port number, vrf.
CLI implementaion checks if agent_ip, port number already exists in CONFIG_DB table, if it does, then new entry is not added.
So added another condition to ensure combination of agent_ip and port is unique.
Below is an example of how data looks like in DB:
How to verify it
Added unit-test for various combinations and ensures that it passes.
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)