Skip to content

Commit

Permalink
Add validation for speed and description (#291)
Browse files Browse the repository at this point in the history
* Add validation for speed and description

* Add pattern for alias
  • Loading branch information
joyas-joseph authored Nov 20, 2019
1 parent 20869c8 commit ed8d2ba
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions models/yang/sonic/sonic-port.yang
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,28 @@ module sonic-port {
}

leaf speed {
type uint64;
type uint64 {
range "1000|10000|25000|40000|50000|100000|400000" {
error-message "Invalid Ethernet interface speed";
error-app-tag port-speed-invalid;
}
}
}

leaf valid_speeds {
type string;
}

leaf alias {
type string;
type string {
pattern '[ -~]{0,64}';
}
}

leaf description {
type string;
type string {
pattern '[ -~]{0,64}';
}
}

leaf mtu{
Expand Down

0 comments on commit ed8d2ba

Please sign in to comment.