ietf-restconf

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

How to exclude module name in leaf value of Identityref during ODL validation?

痴心易碎 提交于 2019-12-13 03:22:54
问题 I have YANG model and JSON object which will be verified by ODL (see bellow). I need to exclude module name from JSON to verify. When I exclude module name from identityref ("type": "center-car-sale-type:sedan") and send only identityref name ("type": "sedan") ODL throw exception that this identityref is not found. I want to send object without module name because "module name" + "identityref name" leads to mix metadata and instance. How can I set up ODL validation to avoid module name in

Is it legal to POST/PUT/PATCH list and leaf-list in RESTCONF?

♀尐吖头ヾ 提交于 2019-12-11 05:24:26
问题 This is a follow-up question of this post. From @predi's answer I know that it is legal to GET a URL whose target resource is a list or leaf-list and DELETE can't use such URL. That is to say, given the following YANG definitions: list machine { key "name"; leaf "name" { type string; } } The request GET /restconf/data/test/machine is legal. The request DELETE /restconf/data/test/machine is illegal. I want to confirm if other methods like POST , PUT or PATCH can use list or leaf-list as URL

JSON encoding of payload to RESTCONF server for multiple resources creation

邮差的信 提交于 2019-12-08 07:35:34
问题 Is it possible to send a single request of creating multiple resources at the top-level to a RESTCONF server? For example, consider the following YANG module: module example-foomod { namespace "http://example.com/foomod"; prefix "foomod"; container top { container under1{ leaf foo { type uint8; } } container under2{ leaf bar { type uint8; } } } } Can I send the following request to create two resources one time? Or Must I create one resource at a time? POST /restconf/data/example-foomod:top