Subject: [Netconf] YANG Patch 'remove' operation

From: Robert Wilton <[email-masked]>
Date: Mon, 25 Sep 2017 17:55:02 +0100

Hi,

I might have found a possible bug in YANG Patch:

Regarding section 2.2 of RFC 8072, the second paragraph states (as I 
would expect):

    The "merge", "replace", "create", "delete", and "remove" edit
    operations have exactly the same meanings as those defined for the
    "operation" attribute described inSection 7.2 of [RFC6241] <https://tools.ietf.org/html/rfc6241#section-7.2>.

However, the third paragraph in this section then goes on to say:

    ... If the edit does not identify
    any existing resource instance and the operation for the edit is not
    "create", then the request MUST NOT be processed and a "404 Not
    Found" error response MUST be sent by the server.

This seems to be require that "merge" operations have to be handled like 
"create" operations, and "remove" operations have to be handled like 
"delete" operations.

Hence I think that the text in this third paragraph may be slightly 
wrong, and perhaps should be?:

    ... If the edit does not identify
    any existing resource instance and the operation for the edit is not
    "create", "merge", or "remove", then the request MUST NOT be processed and a "404 Not
    Found" error response MUST be sent by the server.

Otherwise, it seems like 'merge' has to be handled like 'create', and 
'remove' like 'delete', which then directly conflicts with the second 
paragraph?

Thanks,
Rob

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 28 Sep 2017 10:53:30 +0200 (CEST)

Robert Wilton <[email-masked]> wrote:
>    "operation" attribute described inSection 7.2 of [RFC6241]
>    <https://tools.ietf.org/html/rfc6241#section-7.2>.
> 
> This seems to be require that "merge" operations have to be handled
> like "create" operations, and "remove" operations have to be handled
> like "delete" operations.
> 

I agree with your analysis.  I think this should be filed as an errata
to RFC 8072.

/martin

---

From: Robert Wilton <[email-masked]>
Date: Thu, 28 Sep 2017 10:23:01 +0100

> I agree with your analysis.  I think this should be filed as an errata
I can file an errata.

When I looked at this again, it looks like "replace" also shouldn't fail 
on non existence.  So, perhaps the text is:

    ... If the edit does not identify
    any existing resource instance and the operation for the edit is "delete"
    then the request MUST NOT be processed and a "404 Not Found" error
    response MUST be sent by the server.

Is that right?

Thanks,
Rob

> .

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 28 Sep 2017 12:23:23 +0200 (CEST)

Robert Wilton <[email-masked]> wrote:
> When I looked at this again, it looks like "replace" also shouldn't
> fail on non existence.  So, perhaps the text is:
> 

"delete" or "move"

Also, the spec doesn't specify what happens if it is "create" and the
resource already exists.  I assume it should be 400.

/martin