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

payload is:

{
 "example-foomod:under1": {
   "foo": 54
 },
 "example-foomod:under2": {
   "bar": 45
 }
}

I didn't find answer in RFC7951. It seems like all examples in that RFC are single resource, like in section4.

来源:https://stackoverflow.com/questions/52946437/json-encoding-of-payload-to-restconf-server-for-multiple-resources-creation

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