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

Add validation for speed and description #291

Merged
merged 2 commits into from
Nov 20, 2019
Merged
Changes from 1 commit
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
11 changes: 9 additions & 2 deletions models/yang/sonic/sonic-port.yang
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ 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 {
Expand All @@ -56,7 +61,9 @@ module sonic-port {
}

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

leaf mtu{
Expand Down