Subject: [Netconf] 答复: [Restconf]How to specify a namespace in a options/get/head/delete request

From: lianji <[email-masked]>
Date: Fri, 28 Jul 2017 08:44:36 +0000

Steve,

In rfc8040 3.5.3, “If a node in the path is defined in a module other than its parent node or its parent is the datastore, then the module name followed by a colon character (":") MUST be prepended to the node name in the resource identifier.”.

A module name is used here. But a module name is not unique globally. It’s not even unique in it’s namespace. Yang module is identified uniquely with “name revision” in it’s namespace. Therefore, name, revision and namespace are all required to identify a module in a global space.

In chapter 10, “All YANG modules and submodules used by the server MUST be identified in the YANG module library.” A user can retrieve what modules are available in the server. If there are multiple modles with the same name, they can be distinguished with revision and namespace.

Get back to my question, how can we identify a module with only a name in the URI? Shouldn’t Restconf define a way to spefcify the revision and namespace?

Thanks,
Anji

发件人: Steve Truong (struong) [mailto:[email-masked]]
发送时间: 2017年7月27日 11:50
收件人: lianji <[email-masked]>
主题: RE: How to specify a namespace in a options/get/head/delete request

Anji,

restconf request URI uses the module identifier (module ID) instead of the namespace as in a netconf request.  A namespace uniquely maps to a module id.
If a path segment belongs to a different namespace, you prefix the node name with the corresponding module id.
If the request has a body and the content type is XML you’d use namespace there.
I think the RFC8040 has all the info you need including the examples.

steve

From: Netconf [mailto:[email-masked]] On Behalf Of lianji
Sent: Wednesday, July 26, 2017 7:24 PM
To: [email-masked]<mailto:[email-masked]>
Cc: Zhengguangying (Walker)
Subject: [Netconf] How to specify a namespace in a options/get/head/delete request

Hi, all,

I’m wondering how to specify a namespace in a options/get/head/delete message. Should it be a part of the request uri? What’s the format?

e.g.
"example-jukebox" YANG Module is defined in rfc8040 in namespace “http://example.com/ns/example-jukebox”. We can get data as:

GET /restconf/data/example-jukebox:jukebox/library/artist=Foo%20Fighters/album=Wasting%20Light HTTP/1.1
Host: example.com
Accept: application/yang-data+xml

If the namespace is required in the request, how to do it? Should it be put in the uri and looks like this:

GET /restconf/data/ example/com/ns/example-jukebox:jukebox/library/artist=Foo%20Fighters/album=Wasting%20Light HTTP/1.1
Host: example.com
Accept: application/yang-data+xml

Thanks,
Anji

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Fri, 28 Jul 2017 10:58:27 +0200

Note that the JSON encoding (defined in RFC 7951) uses the module name
as the namespace, not the declared namespace URI. Hence, module names
better are unique. RFC 7950 says this:

   Within a server, all module names MUST be unique.

YANG puts restrictions on what you can do when you update a module.
Hence, it should be safe to refer to an identifier without a version
number.

/js

> _______________________________________________
> Netconf mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netconf

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>