Subject: Re: [Netconf] Some questions about restconf

From: Kent Watsen <[email-masked]>
Date: Wed, 29 Jun 2016 20:06:33 +0000

Please see responses inline.

Kent

From: Netconf <[email-masked]> on behalf of "fengchong (C)" <[email-masked]>
Date: Monday, May 2, 2016 at 10:07 PM
To: Andy Bierman <[email-masked]>
Cc: "[email-masked]" <[email-masked]>
Subject: [Netconf] Some questions about restconf

Hi andy,

I have some questions about restconf.

1．Leaf/leaf-list can be deleted by restconf?

If a model defined as:

Container a {

List b {

     Key c;

    Leaf c {…}

    Leaf d {…}

    Leaf e {…}

}

}

If I want to delete leaf d,the url should be:

/a/b=1/d

Or

/a/b=1 {

   <d/>

}

KENT> it’s the former (see https://tools.ietf.org/html/draft-ietf-netconf-restconf-13#section-4.7)

2. If I want to delete more than one leafs,  should I send many requests for each leaf? Is there a way one request to delete many leafs?

KENT> DELETE can only target one resource at a time, though https://tools.ietf.org/html/draft-ietf-netconf-restconf-13#section-4.7 hints at possible collections-oriented extension that might allow for more.  The best way to do this now is to use YANG-patch instead.

3. can delete request have body?
   For example:
  Delete  a/b=1
{
  <d>1</d>
<e>2</e>
}

If body can be allowed, then the content of body should be ignored or be interpreted as subtree filter?

KENT> https://tools.ietf.org/html/rfc7231#section-4.3.5 says:

   A payload within a DELETE request message has no defined semantics;
   sending a payload body on a DELETE request might cause some existing
   implementations to reject the request.

From which it can be inferred that a server SHOULD ignore the message body, if passed.  This is what RFC 2616, Section 4.3 says:

    If the request method does not include defined semantics for an
    entity-body, then the message-body SHOULD be ignored when
    handling the request.

But RFC 7230 (Section 3.3) didn’t carry this language over (don’t know why).

Kent

________________________________
冯冲
华为技术有限公司 Huawei Technologies Co., Ltd.
[ompany_logo]

Phone:
Fax:
Mobile: 18519117316
Email: [email-masked]
地址：南京市软件大道101号华为南京基地 邮编：210001
Huawei Technologies Co., Ltd.

http://www.huawei.com