【问题标题】:Non readable - YANG不可读 - YANG
【发布时间】:2020-05-26 22:19:06
【问题描述】:

有没有办法在 yang 中定义不可读的数据?

module system{
   leaf name{
      type string;
   }
   leaf password{
      type string;
   }
}

所以在这种情况下,“密码”是不可读的数据。

【问题讨论】:

    标签: ietf-netmod-yang ietf-restconf


    【解决方案1】:

    如果您希望使数据“不可读”,您可以使用binary 内置类型,它使您能够将任意字节的 blob(base64 编码)设置为叶子的值。包括加密字节。

    leaf password {
      type binary;
      default "cGFzc3dvcmQ="; // <-- plain text "password"
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-22
      • 1970-01-01
      • 2020-07-12
      • 2020-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-28
      相关资源
      最近更新 更多