[netconf] What is the response structure when querying a specific instance object in a list?

yuchaode <yuchaode@huawei.com> Tue, 16 April 2024 07:39 UTC

Return-Path: <yuchaode@huawei.com>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 86041C14F74E for <netconf@ietfa.amsl.com>; Tue, 16 Apr 2024 00:39:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_IMAGE_RATIO_02=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4zvKt9UVFM74 for <netconf@ietfa.amsl.com>; Tue, 16 Apr 2024 00:39:52 -0700 (PDT)
Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8220FC14F61A for <netconf@ietf.org>; Tue, 16 Apr 2024 00:39:51 -0700 (PDT)
Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4VJbVM1Ljvz6D97C for <netconf@ietf.org>; Tue, 16 Apr 2024 15:37:47 +0800 (CST)
Received: from lhrpeml100006.china.huawei.com (unknown [7.191.160.224]) by mail.maildlp.com (Postfix) with ESMTPS id 900BC140CB1 for <netconf@ietf.org>; Tue, 16 Apr 2024 15:39:43 +0800 (CST)
Received: from canpemm500009.china.huawei.com (7.192.105.203) by lhrpeml100006.china.huawei.com (7.191.160.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 16 Apr 2024 08:39:42 +0100
Received: from canpemm500002.china.huawei.com (7.192.104.244) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 16 Apr 2024 15:39:40 +0800
Received: from canpemm500002.china.huawei.com ([7.192.104.244]) by canpemm500002.china.huawei.com ([7.192.104.244]) with mapi id 15.01.2507.035; Tue, 16 Apr 2024 15:39:40 +0800
From: yuchaode <yuchaode@huawei.com>
To: "netconf@ietf.org" <netconf@ietf.org>
CC: "yanglin (N)" <yanglin60@huawei.com>, liuzhoulong <liuzhoulong@huawei.com>, "Wangxi(Cordelia)" <wangxi114@huawei.com>
Thread-Topic: What is the response structure when querying a specific instance object in a list?
Thread-Index: AdqP0TCO1hZzlqb7RJKJtYr2gyLP0g==
Date: Tue, 16 Apr 2024 07:39:40 +0000
Message-ID: <dec8b1969a8f4511bb99b550407f23d7@huawei.com>
Accept-Language: zh-CN, en-US
Content-Language: zh-CN
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
x-originating-ip: [10.81.218.69]
Content-Type: multipart/related; boundary="_005_dec8b1969a8f4511bb99b550407f23d7huaweicom_"; type="multipart/alternative"
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/n6Jj27cOajTWITqu9Ib92BduVI4>
Subject: [netconf] What is the response structure when querying a specific instance object in a list?
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: NETCONF WG list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 16 Apr 2024 07:39:59 -0000

Hello!
I have a question about the list node defined in Yang. When the key in the list is used to query a specific instance in the list, what should the return result be in json format ?
      Take the "example-jukebox" Yang Module in RFC 8040 A.1. as an example. The artist attribute is defined as list, and its key is name.. The artist list has two instances named Foo Fighters and Jack.
[cid:image001.jpg@01DA9014.46188A50] [cid:image002.jpg@01DA9014.46188A50]
What should the response structure look like when using a GET /restconf/data/example-jukebox:jukebox/library/artist=jack query?
{
  "example-jukebox:artist": [
    {
      "name": "jack",
      "album": []
    }
  ]
}
or
{
  "artist": {
    "name": "jack",
    "album": []
  }
}