Skip to content

Commit

Permalink
[yang]: add chassis hostname to device metadata (sonic-net#19019)
Browse files Browse the repository at this point in the history
Add chassis-hostname leaf to the sonic-device_metadata.yang
  • Loading branch information
arlakshm authored May 24, 2024
1 parent a7ab698 commit c5c54c6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@
"yang_config_validation": "disable",
"rack_mgmt_map": "dummy_value",
"timezone": "Europe/Kiev",
"bgp_router_id": "8.8.8.8"
"bgp_router_id": "8.8.8.8",
"chassis_hostname": "str-sonic-chassis-1"
}
},
"VLAN": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,8 @@
"DEVICE_METADATA_INVALID_BGP_ROUTER_ID": {
"desc": "Verifying invalid bgp_router_id configuration.",
"eStrKey": "Pattern"
},
"DEVICE_METADATA_VALID_CHASSIS_HOSTNAME": {
"desc": "Verifying valid chassis hostname configuration."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -462,5 +462,14 @@
}
}
}
},
"DEVICE_METADATA_VALID_CHASSIS_HOSTNAME": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"chassis_hostname": "sonic-chassis-1"
}
}
}
}
}
5 changes: 5 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-device_metadata.yang
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@ module sonic-device_metadata {
type inet:ipv4-address;
description "BGP Router identifier";
}

leaf chassis_hostname {
description "hostname of the chassis to which this linecard or supervisor belongs to";
type stypes:hostname;
}
}
/* end of container localhost */
}
Expand Down

0 comments on commit c5c54c6

Please sign in to comment.