netconf-wg / restconf-next

A repository to collection feature requests for RESTCONF
0 stars 0 forks source link

Allow renaming of key fields #17

Open kwatsen opened 7 months ago

kwatsen commented 7 months ago

Section https://datatracker.ietf.org/doc/html/rfc8040#section-4.5 says:

   The PUT method MUST NOT be used
   to change the key leaf values for a data resource instance.

And Section https://datatracker.ietf.org/doc/html/rfc8040#section-4.6.1 says:

   The PATCH method MUST NOT be
   used to change the key leaf values for a data resource instance.

IDK where this requirement comes from, but my server handles changing key values just fine. My server can support this because it uses a different primary key internally and, in effect, the "key" field(s) are just unique. What this means is that, changing a key field's value is immediately reflected in leafrefs; there is no need to do a global search/replace.

I suggest allowing the server to advertise whether it supports changing key values.

abierman commented 4 weeks ago

Do not support this change. YANG uses the defined keys. An implementation is not required to maintain an internal key.

An explicit rename operation could be defined in YANG 2.0 so a list could change key values in a protocol-consistent manner.