Here are additional details.
my Yang file.
typedef port-number {
tailf:info "1, 2, 3, 7, 8, 9";
type uint16;
}
grouping port-config {
leaf port {
description "port number";
tailf:info "port number";
type port-number;
must "current() = 1 or
current() = 2 or
current() = 3 or
current() = 7 or
current() = 8 or
current() = 9" {
error-message "Invalid port configuration. Allowed
ports are 1, 2, 3, 7, 8, 9";
}
}
MY Annotate file
tailf:annotate-module "f5-allowed-ips" {
tailf:annotate-statement "typedef[name='port-number']" {
tailf:info "1, 2, 3, 4, 5, 6, 7, 8, 9";
}
}
tailf:annotate "/oc-sys:system/f5-allowed-ips:allowed-ips/f5-allowed-ips:allowed-ip/f5-allowed-ips:config/f5-allowed-ips:ip-config/f5-allowed-ips:ipv4/f5-allowed-ips:ipv4/f5-allowed-ips:port" {
must "(current() = '1')" +
"or (current() = '2')" +
"or (current() = '3')" +
"or (current() = '4')" +
"or (current() = '5')" +
"or (current() = '6')" +
"or (current() = '7')" +
"or (current() = '8')" +
"or (current() = '9')" "{
error-message "Invalid port configuration. Allowed
ports are 1, 2, 3, 4, 5, 6, 7, 8, 9";
}
}
}
Here I add additional ports to the list. When I am trying to configure the ports, 4, 5, 6, It showing invalid ports, actually it supposed to be accept it, In case my annotate schema is reflected.
$ default-1(config)# system allowed-ips allowed-ip ts config ipv4 address 1.2.3.4 port 4 prefix-length 24
$ default-1(config-allowed-ip-ts)# commit
Aborted: 'system allowed-ips allowed-ip ts config ipv4 port' (value "4"): Invalid port configuration. Allowed
ports are 1, 2, 3, 7, 8, 9
default-1(config-allowed-ip-ts)#
Plz help here