Non readable - YANG

心不动则不痛 提交于 2021-01-28 05:20:22

问题


There is a way to define non readable data in yang?

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

So in this case 'password' is the non readable data.


回答1:


If you wish to make the data "unreadable", you can use binary built-in type, which enables you to set an arbitrary blob of bytes (base64 encoded) as the value for a leaf. Encrypted bytes included.

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


来源:https://stackoverflow.com/questions/60170027/non-readable-yang

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!