[Teas] Query on multiple-inheritance models
Xufeng Liu <xufeng.liu.ietf@gmail.com> Tue, 28 July 2020 15:52 UTC
Return-Path: <xufeng.liu.ietf@gmail.com>
X-Original-To: teas@ietfa.amsl.com
Delivered-To: teas@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 10F553A0E10 for <teas@ietfa.amsl.com>; Tue, 28 Jul 2020 08:52:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.854
X-Spam-Level:
X-Spam-Status: No, score=-0.854 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, NORMAL_HTTP_TO_IP=0.001, NUMERIC_HTTP_ADDR=1.242, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r3XEoD5qGlha for <teas@ietfa.amsl.com>; Tue, 28 Jul 2020 08:51:57 -0700 (PDT)
Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8360E3A0E0E for <teas@ietf.org>; Tue, 28 Jul 2020 08:51:57 -0700 (PDT)
Received: by mail-il1-x136.google.com with SMTP id y18so8167938ilp.10 for <teas@ietf.org>; Tue, 28 Jul 2020 08:51:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=XqpyiIuuSvrlS8/LWpdEZcCzlCe5GwUdht9xDTAKaL8=; b=U8UPjLRgyqDVfQSzni+rrK0cCPAqdtz+pX9+e0p0JNQrydXwUaAhWHVB1BqO/FdTjs cvQubKrNnh0yimNr6HpLLn79cOlTdso21dgW81cXv9tItVRklJSaHtIW3iRGJ31XVN1H xn6b1KGJnpBHtyVZJhzU0tDDUa9Emjbl9uAdZb5kSvTlZ2Ba6SqmZZ+s1KkEdnu4Rf0D uIfRmTQ3j72vHBSyeFGaf0qggmsjjYfr+BlhQTMJVHqizyk/rL0FeptLTtVOodpNr5Wm nNe9JdSamDnvPkwPFRd6SD38xvEo00wZEjv+rLt64GfshCUsuyDhNcn4o2T0BzHMLy3I miAQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=XqpyiIuuSvrlS8/LWpdEZcCzlCe5GwUdht9xDTAKaL8=; b=oa1LalSz1cLuRDIpVpQozUwreiD2eHjxLrn3O0Cr4i8LdhpzFMq+WQuhti9+sU1ttZ HFnpM8Fvc3BmELiyLiodMr5ML5cv0XkRdC8tPPeYRuvt5jGVfVwEaFcbmAVc3r53uouV Yebi+KwL7ZAxEFJEyCkldtcdJROIuJLx/7ISj6QI47SxKhi4Oh+7Liz+W0Fa3VPVOx+t kY/QguC4+XBs2OJ6gWE3797VJ9vI4eDXkAY8NqsnusBgjQ9NPlFIA2bTe+c98X5rffPl 2ZCun3fYgF2sosuA9i6zH4uDedvOEDg6PYycrfVhL+N+dXwbIbbaA21GA0gqwajJIpee di1A==
X-Gm-Message-State: AOAM531Fok6B4qlHObuHOqdH/d6iDIzzz229rJQaSkHJrQHsbGb1X53c hK2iAAsgpF4i35bAmNTMhetXNHSRwhbKsCozefBGl6Uu
X-Google-Smtp-Source: ABdhPJzMcpE8CL47mExSH5VmlWskrK8QIHeKTGuQ//wSMzSzWvOkP0lym7Nx94jDKD2csOAUKInSHQ0YqWabNaYRsQE=
X-Received: by 2002:a05:6e02:80e:: with SMTP id u14mr15451873ilm.181.1595951516529; Tue, 28 Jul 2020 08:51:56 -0700 (PDT)
MIME-Version: 1.0
From: Xufeng Liu <xufeng.liu.ietf@gmail.com>
Date: Tue, 28 Jul 2020 11:51:45 -0400
Message-ID: <CAEz6PPS8_Uk1OjDsLwG+X7oYr9C4ubTDxn6_0uiVChC=ZDz1NQ@mail.gmail.com>
To: TEAS WG <teas@ietf.org>
Content-Type: multipart/mixed; boundary="0000000000003900d205ab826bd8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/teas/hWHktBOcqVBI_YR2cIraztQ4dow>
Subject: [Teas] Query on multiple-inheritance models
X-BeenThere: teas@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Traffic Engineering Architecture and Signaling working group discussion list <teas.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/teas>, <mailto:teas-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/teas/>
List-Post: <mailto:teas@ietf.org>
List-Help: <mailto:teas-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/teas>, <mailto:teas-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Jul 2020 15:52:00 -0000
During our regular YANG TE Model Design Discussion meeting, we received a question about how to do queries on the data of the models with multiple inheritances. This email is an attempt to show such a query with XPath by an example. The statement is that a query is as easy on a multiple-inheritance model as on a linearly-augmented model. As an example, the module ietf-sr-mpls-topology described in draft-ietf-teas-yang-sr-te-topo is used. An SR MPLS TE topology instance can be configured by using multiple inheritances from both ietf-l3-unicast-topology and ietf-te-topology. Attached are two configuration instances of SR MPLS topology, one of which is non-TE with network-id "sr-topo-example" (that is the data example in Appendix B of draft-ietf-teas-yang-sr-te-topo), and the other of which is TE enabled with network-id "sr-te-topo-example". Both instances will co-exist in the datastore if both JSON files are sent to the server. To query on the information of the SR MPLS TE instance "sr-te-topo-example", the following XPath can be used: /networks/network[network-types/l3t:l3-unicast-topology/srmt:sr-mpls][network-types/tet:te-topology] To retrieve the information for node "D1" of the instance "sr-te-topo-example", the following XPath can be used: xget /networks/network[network-types/l3t:l3-unicast-topology/srmt:sr-mpls][network-types/tet:te-topology]/node[node-id='D1' The server will reply with the following data: { "ietf-network:networks": { "network": [ { "network-id":"sr-te-topo-example", "node": [ { "node-id":"D1", "ietf-l3-unicast-topology:l3-node-attributes": { "router-id": [ "203.0.113.1" ], "prefix": [ { "prefix":"203.0.113.1/32", "ietf-sr-mpls-topology:sr-mpls": { "start-sid":101, "range":1, "is-local":false, "is-node":true } } ], "ietf-sr-mpls-topology:sr-mpls": { "srgb": [ { "lower-bound":16000, "upper-bound":23999 } ], "srlb": [ { "lower-bound":15000, "upper-bound":15999 } ] } }, "ietf-te-topology:te": { "te-node-attributes": { "admin-status":"up", "connectivity-matrices": { }, "domain-id":1001, "is-abstract":[null], "signaling-address": [ "203.0.113.1" ] } }, "ietf-te-topology:te-node-id":"203.0.113.1", "ietf-network-topology:termination-point": [ { "tp-id":"1-0-1", "ietf-l3-unicast-topology:l3-termination-point-attributes": { "unnumbered-id":101 } }, { "tp-id":"1-2-1", "ietf-l3-unicast-topology:l3-termination-point-attributes": { "unnumbered-id":121 } }, { "tp-id":"1-3-1", "ietf-l3-unicast-topology:l3-termination-point-attributes": { "unnumbered-id":131 } } ] } ] } ] } } Thanks, - Xufeng
- [Teas] Query on multiple-inheritance models Xufeng Liu