-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[Cherry pick pr21218] [YangModel][asic_sensors] Add ASIC_SENSORS yang models #21218 #21308
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
Merged
rlhui
merged 1 commit into
sonic-net:202405
from
mlok-nokia:cherry-pick-pr21218-asic-sensor-yang-model
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/sonic-yang-models/tests/yang_model_tests/tests/asic-sensors.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { | ||
| "ASIC_SENSORS_TABLE": { | ||
| "desc": "Config DB interval parameters for ASIC Sensors polling" | ||
| }, | ||
| "ASIC_SENSORS_INVALID_POLLER_INTERVAL": { | ||
| "desc": "Configure an invalid ASIC Sensors polling interval", | ||
| "eStrKey" : "Pattern" | ||
| }, | ||
| "ASIC_SENSORS_INVALID_POLLER_ADMIN_STATUS": { | ||
| "desc": "Configure an invalid ASIC Sensors polling admin status", | ||
| "eStrKey" : "InvalidValue" | ||
| }, | ||
| "ASIC_SENSORS_POLLER_INTERVAL_BAD_LEN_MAX": { | ||
| "desc": "Configure an invalid ASIC Sensors polling interval: out of range value", | ||
| "eStrKey" : "InvalidValue" | ||
| }, | ||
| "ASIC_SENSORS_POLLER_INTERVAL_EMPTY_VALUE": { | ||
| "desc": "Configure an empty ASIC Sensors polling interval", | ||
| "eStrKey" : "InvalidValue" | ||
| }, | ||
| "ASIC_SENSORS_POLLER_ADMIN_STATUS_EMPTY_VALUE": { | ||
| "desc": "Configure an empty ASIC Sensors polling admin status", | ||
| "eStrKey" : "InvalidValue" | ||
| } | ||
| } |
74 changes: 74 additions & 0 deletions
74
src/sonic-yang-models/tests/yang_model_tests/tests_config/asic-sensors.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| { | ||
| "ASIC_SENSORS_TABLE": { | ||
| "sonic-asic-sensors:sonic-asic-sensors": { | ||
| "sonic-asic-sensors:ASIC_SENSORS": { | ||
| "ASIC_SENSORS_POLLER_INTERVAL": { | ||
| "interval": "10" | ||
| }, | ||
| "ASIC_SENSORS_POLLER_STATUS": { | ||
| "admin_status": "enable" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "ASIC_SENSORS_INVALID_POLLER_INTERVAL": { | ||
| "sonic-asic-sensors:sonic-asic-sensors": { | ||
| "sonic-asic-sensors:ASIC_SENSORS": { | ||
| "ASIC_SENSORS_POLLER_INTERVAL": { | ||
| "interval": "0" | ||
| }, | ||
| "ASIC_SENSORS_POLLER_STATUS": { | ||
| "admin_status": "enable" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "ASIC_SENSORS_INVALID_POLLER_ADMIN_STATUS": { | ||
| "sonic-asic-sensors:sonic-asic-sensors": { | ||
| "sonic-asic-sensors:ASIC_SENSORS": { | ||
| "ASIC_SENSORS_POLLER_INTERVAL": { | ||
| "interval": "10" | ||
| }, | ||
| "ASIC_SENSORS_POLLER_STATUS": { | ||
| "admin_status": "testing" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "ASIC_SENSORS_POLLER_INTERVAL_BAD_LEN_MAX": { | ||
| "sonic-asic-sensors:sonic-asic-sensors": { | ||
| "sonic-asic-sensors:ASIC_SENSORS": { | ||
| "ASIC_SENSORS_POLLER_INTERVAL": { | ||
| "interval": "1010101010101010101010" | ||
| }, | ||
| "ASIC_SENSORS_POLLER_STATUS": { | ||
| "admin_status": "enable" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "ASIC_SENSORS_POLLER_INTERVAL_EMPTY_VALUE": { | ||
| "sonic-asic-sensors:sonic-asic-sensors": { | ||
| "sonic-asic-sensors:ASIC_SENSORS": { | ||
| "ASIC_SENSORS_POLLER_INTERVAL": { | ||
| "interval": "" | ||
| }, | ||
| "ASIC_SENSORS_POLLER_STATUS": { | ||
| "admin_status": "enable" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "ASIC_SENSORS_POLLER_ADMIN_STATUS_EMPTY_VALUE": { | ||
| "sonic-asic-sensors:sonic-asic-sensors": { | ||
| "sonic-asic-sensors:ASIC_SENSORS": { | ||
| "ASIC_SENSORS_POLLER_INTERVAL": { | ||
| "interval": "10" | ||
| }, | ||
| "ASIC_SENSORS_POLLER_STATUS": { | ||
| "admin_status": "" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| module sonic-asic-sensors { | ||
| yang-version 1.1; | ||
| namespace "http://github.com/sonic-net/sonic-asic-sensors"; | ||
| prefix asic-sensors; | ||
|
|
||
| import sonic-types { | ||
| prefix stypes; | ||
| } | ||
|
|
||
| description "ASIC SENSORs config yang Module for SONiC OS"; | ||
|
|
||
| revision 2024-11-19 { | ||
| description "First Revision"; | ||
| } | ||
|
|
||
| container sonic-asic-sensors { | ||
| container ASIC_SENSORS { | ||
| description "ASIC_SENSORS part of config_db.json"; | ||
|
|
||
| container ASIC_SENSORS_POLLER_INTERVAL { | ||
| leaf interval { | ||
| description "ASIC SENSORS polling interval"; | ||
| type uint32 { | ||
| range "1..999"; | ||
| } | ||
| units seconds; | ||
| default "10 "; | ||
| } | ||
| } /* ASIC_SENSORS_POLLER_INTERVAL */ | ||
|
|
||
| container ASIC_SENSORS_POLLER_STATUS { | ||
| leaf admin_status { | ||
| description "ASIC SENSORS polling administrative status"; | ||
| type stypes:mode-status; | ||
| default "enable"; | ||
| } /* admin_status */ | ||
| } /* ASIC_SENSORS_POLLER_STATUS */ | ||
|
|
||
| } /* end of ASIC_SENSORS */ | ||
| } /* end of container sonic-asic-sensors */ | ||
| } /* end of module sonic-asic-sensors */ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
why the formatting is changed here?
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 master has changed.