Skip to content
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

[YangModel][asic_sensors] Add ASIC_SENSORS yang models #21218

Merged
merged 1 commit into from
Dec 19, 2024
Merged
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
18 changes: 18 additions & 0 deletions src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
* [SYSTEM_DEFAULTS table](#systemdefaults-table)
* [RADIUS](#radius)
* [Static DNS](#static-dns)
* [ASIC_SENSORS](#asic_sensors)
* [For Developers](#for-developers)
* [Generating Application Config by Jinja2 Template](#generating-application-config-by-jinja2-template)
* [Incremental Configuration by Subscribing to ConfigDB](#incremental-configuration-by-subscribing-to-configdb)
Expand Down Expand Up @@ -2914,6 +2915,23 @@ The DPUS table introduces the information on the DPUs (Data Processing Unit) ava
}
```

### ASIC_SENSORS

The ASIC_SENSORS table introduces the asic sensors polling configuration when they are available on the platform.

```json
{
"ASIC_SENSORS": {
"ASIC_SENSORS_POLLER_INTERVAL": {
"interval": "10"
},
"ASIC_SENSORS_POLLER_STATUS": {
"admin_status": "enable"
}
}
}
```


# For Developers

Expand Down
1 change: 1 addition & 0 deletions src/sonic-yang-models/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def run(self):
'./yang-models/sonic-system-port.yang',
'./yang-models/sonic-macsec.yang',
'./yang-models/sonic-bgp-sentinel.yang',
'./yang-models/sonic-asic-sensors.yang',
'./yang-models/sonic-bmp.yang',
'./yang-models/sonic-xcvrd-log.yang',
'./yang-models/sonic-grpcclient.yang',
Expand Down
8 changes: 8 additions & 0 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -2792,6 +2792,14 @@
"sampling_interval": "5",
"retention_period": "15"
}
},
"ASIC_SENSORS": {
"ASIC_SENSORS_POLLER_INTERVAL": {
"interval": "10"
},
"ASIC_SENSORS_POLLER_STATUS": {
"admin_status": "enable"
}
}
},
"SAMPLE_CONFIG_DB_UNKNOWN": {
Expand Down
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"
}
}
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": ""
}
}
}
}
}
41 changes: 41 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-asic-sensors.yang
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 */
Loading