Skip to content

Commit e53e3d7

Browse files
committed
Add mgmt_type into device metadata YANG model.
<!-- Please make sure you've read and understood our contributing guidelines: https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md ** Make sure all your commits include a signature generated with `git commit -s` ** If this is a bug fix, make sure your description includes "fixes #xxxx", or "closes #xxxx" or "resolves #xxxx" Please provide the following information: --> #### Why I did it Enhance yang model for networking-metadata. Adding a new field in device metadata YANG model to distinguish the management type of the device. Depends on the users, this field can be used to tell the purpose of deployment or who/how the device is being managed. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it This change adds a new field called mgmt_type for this purpose. #### How to verify it Unit test. #### Which release branch to backport (provide reason below if selected) <!-- - Note we only backport fixes to a release branch, *not* features! - Please also provide a reason for the backporting below. - e.g. - [x] 202006 --> - [ ] 201811 - [ ] 201911 - [ ] 202006 - [ ] 202012 - [ ] 202106 - [ ] 202111 - [ ] 202205 - [ ] 202211 - [ ] 202305 - [X] 202405 - [X] 202411 #### Tested branch (Please provide the tested image version) <!-- - Please provide tested image version - e.g. - [x] 20201231.100 --> - [ ] <!-- image version 1 --> - [ ] <!-- image version 2 --> #### Description for the changelog <!-- Write a short (one line) summary that describes the changes in this pull request for inclusion in the changelog: --> <!-- Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU. --> #### Link to config_db schema for YANG module changes <!-- Provide a link to config_db schema for the table for which YANG model is defined Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md --> #### A picture of a cute animal (not mandatory but encouraged)
1 parent eafef39 commit e53e3d7

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json

+3
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@
8888
"DEVICE_METADATA_RESOURCE_TYPE_CONFIG": {
8989
"desc": "Verifying resource type configuration."
9090
},
91+
"DEVICE_METADATA_MGMT_TYPE_CONFIG": {
92+
"desc": "Verifying mgmt type configuration."
93+
},
9194
"DEVICE_METADATA_VALID_CLUSTER": {
9295
"desc": "Verifying valid cluster configuration."
9396
},

src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json

+9
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,15 @@
237237
}
238238
}
239239
},
240+
"DEVICE_METADATA_MGMT_TYPE_CONFIG": {
241+
"sonic-device_metadata:sonic-device_metadata": {
242+
"sonic-device_metadata:DEVICE_METADATA": {
243+
"sonic-device_metadata:localhost": {
244+
"mgmt_type": "mgmt_type_x"
245+
}
246+
}
247+
}
248+
},
240249
"DEVICE_METADATA_VALID_CLUSTER": {
241250
"sonic-device_metadata:sonic-device_metadata": {
242251
"sonic-device_metadata:DEVICE_METADATA": {

src/sonic-yang-models/yang-models/sonic-device_metadata.yang

+5
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ module sonic-device_metadata {
157157
type string;
158158
}
159159

160+
leaf mgmt_type {
161+
type string;
162+
description "Indicates the management type of this device.";
163+
}
164+
160165
leaf cluster {
161166
type string;
162167
description "The switch is a member of this cluster.";

0 commit comments

Comments
 (0)