clicon / clixon

YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI
http://www.clicon.org/
Other
206 stars 69 forks source link

The domain name is entered without restrictions, but at the same time, if you enter the ip address, the command does not pass. #526

Open khromenokroman opened 1 month ago

khromenokroman commented 1 month ago

Hello,

grouping notification-filter-top{

container notification {

    description "Настройка фильтра нотификации";

   container notification-filter{

     description "Настройка фильтра нотификации";

    list profile{

      description "Настройка профилей нотификации";

      key "profile-id";

    leaf profile-id{

       description "id профиля";

       type uint32;

    }

    list method {

      description "Способ уведомления";

      key 'method-name';

      leaf method-name{

      description "Наименование способа уведомления"; 

      type enumeration{

        enum 'email';

      }

      }

      leaf threshold {

        description "Порог частоты отправки уведомлений (в секундах)";

        type uint32;

      }

      leaf from {

        description "Адрес отправителя";

        type string;

      }

      leaf to {

        description "Адрес получателя";

        type string;

      }

      leaf server {

        description "Hostname или ip-адрес почтового сервера";

        type inet:host;

      }}}}}}

The host parameter implies two values - ip address and domain name.

The domain name is entered without restrictions, but at the same time, if you enter the ip address, the command does not pass.

root@ngfw/> set context sample system notification profile 1 method email server 1.1.1.1
CLI syntax error: "set context sample system notification profile 1 method email server 1.1.1.1" is ambiguous
root@ngfw/>
root@ngfw/>
root@ngfw/> set context sample system notification profile 1 method email server google.com
root@ngfw/>

If you make inet:ipv4-address as the data type, then everything works. I.e. in a similar structure there is a problem with inet:host, which is set via union.