Skip to content

Commit

Permalink
[Yang] Add resource_type and downstream_subrole to yang model (#9696)
Browse files Browse the repository at this point in the history
#### Why I did it
As a fix for #9574

#### How I did it
Enhance yang model for networking-metadata

#### How to verify it
Unit testing
  • Loading branch information
anish-n authored Jan 14, 2022
1 parent bd0a19a commit cd26122
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
},
"DEVICE_METADATA_CORRECT_CLOUDTYPE_REGION_CONFIG": {
"desc": "Verifying cloudtype and region configuration."
},
"DEVICE_METADATA_DOWNSTREAM_SUBROLE_CONFIG": {
"desc": "Verifying downstream subrole configuration."
},
"DEVICE_METADATA_RESOURCE_TYPE_CONFIG": {
"desc": "Verifying resource type configuration."
},
"DEVICE_METADATA_VALID_SUBTYPE": {
"desc": "Verifying valid subtype value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,24 @@
}
}
},
"DEVICE_METADATA_DOWNSTREAM_SUBROLE_CONFIG": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"downstream_subrole": "downstream_subrole_y"
}
}
}
},
"DEVICE_METADATA_RESOURCE_TYPE_CONFIG": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"resource_type": "resource_type_x"
}
}
}
},
"DEVICE_METADATA_VALID_SUBTYPE": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
Expand Down
8 changes: 8 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 @@ -127,6 +127,14 @@ module sonic-device_metadata {
type string;
}

leaf downstream_subrole {
type string;
}

leaf resource_type {
type string;
}

leaf subtype {
type string {
pattern "DualToR";
Expand Down

0 comments on commit cd26122

Please sign in to comment.