-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds YANG models for configurable intervals in CONFIG_DB for stormond (…
…#18657) #### Why I did it This is part of a larger feature: [SONiC Storage Monitoring Daemon](sonic-net/SONiC#1481) -- this commit adds the option to configure the daemon's polling interval and fsstats file sync interval (in seconds) of the daemon via config_db by introducing YANG models. #### How I did it Gives userside the option to dynamically a new table 'STORMOND' with key INTERVALS and fields 'daemon_polling_interval' with default value of '3600' seconds and 'fsstats_sync_interval' with default value of '86400' seconds as defined in the YANG model. #### How to verify it Flash image onto a DUT and add the aforementioned table to the CONFIG_DB. Verify that `stormond` has picked up your config intervals.
- Loading branch information
1 parent
7d7332a
commit 8db0a1f
Showing
5 changed files
with
175 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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
29 changes: 29 additions & 0 deletions
29
src/sonic-yang-models/tests/yang_model_tests/tests/stormond.json
This file contains 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,29 @@ | ||
{ | ||
"STORMOND_CONFIG_TABLE": { | ||
"desc": "Config DB interval parameters for Storage Monitoring Daemon" | ||
}, | ||
"STORMOND_INVALID_POLLING_INTERVAL": { | ||
"desc": "Configure an invalid daemon polling interval", | ||
"eStrKey" : "InvalidValue" | ||
}, | ||
"STORMOND_INVALID_SYNC_INTERVAL": { | ||
"desc": "Configure an invalid fsstats file sync interval", | ||
"eStrKey" : "InvalidValue" | ||
}, | ||
"STORMOND_POLLING_INTVL_BAD_LEN_MAX": { | ||
"desc": "Configure an invalid daemon polling interval: out of range value", | ||
"eStrKey" : "InvalidValue" | ||
}, | ||
"STORMOND_SYNC_INTVL_BAD_LEN_MAX": { | ||
"desc": "Configure an invalid fsstats file sync interval: out of range value", | ||
"eStrKey" : "InvalidValue" | ||
}, | ||
"STORMOND_SYNC_INTVL_EMPTY_VALUE": { | ||
"desc": "Configure an empty file sync interval", | ||
"eStrKey" : "InvalidValue" | ||
}, | ||
"STORMOND_POLLING_INTVL_EMPTY_VALUE": { | ||
"desc": "Configure an empty file sync interval", | ||
"eStrKey" : "InvalidValue" | ||
} | ||
} |
79 changes: 79 additions & 0 deletions
79
src/sonic-yang-models/tests/yang_model_tests/tests_config/stormond.json
This file contains 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,79 @@ | ||
{ | ||
"STORMOND_CONFIG_TABLE": { | ||
"sonic-stormond-config:sonic-stormond-config": { | ||
"sonic-stormond-config:STORMOND_CONFIG": { | ||
"INTERVALS":{ | ||
"daemon_polling_interval" : "3600", | ||
"fsstats_sync_interval" : "86400" | ||
|
||
} | ||
} | ||
} | ||
}, | ||
"STORMOND_INVALID_POLLING_INTERVAL": { | ||
"sonic-stormond-config:sonic-stormond-config": { | ||
"sonic-stormond-config:STORMOND_CONFIG": { | ||
"INTERVALS":{ | ||
"daemon_polling_interval" : "-1", | ||
"fsstats_sync_interval" : "86400" | ||
|
||
} | ||
} | ||
} | ||
}, | ||
"STORMOND_INVALID_SYNC_INTERVAL": { | ||
"sonic-stormond-config:sonic-stormond-config": { | ||
"sonic-stormond-config:STORMOND_CONFIG": { | ||
"INTERVALS":{ | ||
"daemon_polling_interval" : "3600", | ||
"fsstats_sync_interval" : "five_thousand_two_hundred_seconds" | ||
|
||
} | ||
} | ||
} | ||
}, | ||
"STORMOND_POLLING_INTVL_BAD_LEN_MAX": { | ||
"sonic-stormond-config:sonic-stormond-config": { | ||
"sonic-stormond-config:STORMOND_CONFIG": { | ||
"INTERVALS":{ | ||
"daemon_polling_interval" : "360036003600360036003600360036003", | ||
"fsstats_sync_interval" : "86400" | ||
|
||
} | ||
} | ||
} | ||
}, | ||
"STORMOND_SYNC_INTVL_BAD_LEN_MAX": { | ||
"sonic-stormond-config:sonic-stormond-config": { | ||
"sonic-stormond-config:STORMOND_CONFIG": { | ||
"INTERVALS":{ | ||
"daemon_polling_interval" : "3600", | ||
"fsstats_sync_interval" : "864008640086400864008640086400864" | ||
|
||
} | ||
} | ||
} | ||
}, | ||
"STORMOND_SYNC_INTVL_EMPTY_VALUE": { | ||
"sonic-stormond-config:sonic-stormond-config": { | ||
"sonic-stormond-config:STORMOND_CONFIG": { | ||
"INTERVALS":{ | ||
"daemon_polling_interval" : "3600", | ||
"fsstats_sync_interval" : "" | ||
|
||
} | ||
} | ||
} | ||
}, | ||
"STORMOND_POLLING_INTVL_EMPTY_VALUE": { | ||
"sonic-stormond-config:sonic-stormond-config": { | ||
"sonic-stormond-config:STORMOND_CONFIG": { | ||
"INTERVALS":{ | ||
"daemon_polling_interval" : "", | ||
"fsstats_sync_interval" : "86400" | ||
|
||
} | ||
} | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
src/sonic-yang-models/yang-models/sonic-stormond-config.yang
This file contains 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,40 @@ | ||
module sonic-stormond-config{ | ||
|
||
yang-version 1.1; | ||
|
||
namespace "http://github.com/sonic-net/sonic-stormond-config"; | ||
prefix stormond-config; | ||
|
||
import sonic-types { | ||
prefix stypes; | ||
} | ||
|
||
description "STORMOND_CONFIG Table yang Module for SONiC"; | ||
|
||
container sonic-stormond-config { | ||
|
||
container STORMOND_CONFIG { | ||
|
||
description "stormond_config table in config_db.json"; | ||
|
||
container INTERVALS { | ||
|
||
leaf daemon_polling_interval { | ||
description "Polling inerval for Storage Monitoring Daemon in STORMOND_CONFIG table"; | ||
type uint32 { | ||
range "1..4294967295"; | ||
} | ||
default "3600"; | ||
} | ||
|
||
leaf fsstats_sync_interval { | ||
description "FSSTATS JSON file syncing interval for the Storage Monitoring Daemon in STORMOND_CONFIG table"; | ||
type uint32 { | ||
range "1..4294967295"; | ||
} | ||
default "86400"; | ||
} | ||
} | ||
} | ||
} | ||
} |