<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>
<?rfc toc="yes"?>
<?rfc compact="no"?>
<?rfc subcompact="no"?>
<?rfc iprnotified="no"?>
<?rfc strict="yes"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF" category="std" docName="draft-ietf-netconf-list-pagination-nc-11" ipr="trust200902" consensus="true" updates="6241" tocInclude="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.30.2 -->
  <front>
    <title abbrev="NETCONF Pagination Support">NETCONF Extensions to Support
    List Pagination</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-netconf-list-pagination-nc-11"/>
    <author fullname="Kent Watsen" initials="K." surname="Watsen">
      <organization>Watsen Networks</organization>
      <address>
        <email>kent+ietf@watsen.net</email>
      </address>
    </author>
    <author fullname="Qin Wu" initials="Q." surname="Wu">
      <organization>Huawei</organization>
      <address>
        <email>bill.wu@huawei.com</email>
      </address>
    </author>
    <author fullname="Per Andersson" initials="P." surname="Andersson">
      <organization>Ionio Systems</organization>
      <address>
        <email>per.ietf@ionio.se</email>
      </address>
    </author>
    <author fullname="Olof Hagsand" initials="O." surname="Hagsand">
      <organization>SUNET</organization>
      <address>
        <email>olof@hagsand.se</email>
      </address>
    </author>
    <author fullname="Hongwei Li" initials="H." surname="Li">
      <organization>HPE</organization>
      <address>
        <email>flycoolman@gmail.com</email>
      </address>
    </author>
    <date/>
    <area>OPS Area</area>
    <workgroup>NETCONF Working Group</workgroup>
    <abstract>
      <t>This document defines a mapping of the list pagination mechanism
        defined in <xref target="I-D.ietf-netconf-list-pagination"/>
        to NETCONF <xref target="RFC6241"/>.</t>
      <t>This document updates <xref target="RFC6241"/>, to augment the &lt;get&gt; and
        &lt;get-config&gt; "rpc" statements, and <xref target="RFC8526"/>, to augment the
        &lt;get-data&gt; "rpc" statement, to define input parameters
        necessary for list pagination.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="intro">
      <name>Introduction</name>
      <t>This document defines a mapping of the list pagination mechanism
        defined in <xref target="I-D.ietf-netconf-list-pagination"/>
        to NETCONF <xref target="RFC6241"/>.</t>
      <t>This document updates <xref target="RFC6241"/> and <xref target="RFC8526"/>,
        as described in <xref target="updates"/>.</t>
      <t>While the pagination mechanism defined in this document is designed
      for the NETCONF protocol <xref target="RFC6241"/>, the augmented RPCs
      MAY be used by the RESTCONF protocol <xref target="RFC8040"/> if the
      RESTCONF server implements the "ietf-list-pagination-nc" module.</t>
      <t>The YANG data model in this document conforms to the Network
      Management Datastore Architecture defined in <xref target="RFC8342"/></t>
      <section>
        <name>Terminology</name>
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
        "OPTIONAL" in this document are to be interpreted as described in BCP
        14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only
        when, they appear in all capitals, as shown here.</t>
        <!--
        <t>The following terms are defined in <xref target="RFC8342"/> <xref
        target="RFC7950"/> and are not redefined here:</t>

        <t><list style="symbols">
            <t>server</t>
            <t>startup configuration datastore</t>
            <t>candidate configuration datastore</t>
            <t>running configuration datastore</t>
            <t>intended configuration datastore</t>
            <t>operational state datastore</t>
            <t>conventional configuration datastore</t>
            <t>datastore schema</t>
            <t>RPC operation</t>
          </list></t>

        <t>The following terms are defined in this document as follows:</t>
        <t/>
-->
      </section>
      <section>
        <name>Conventions</name>
        <t>Various examples in this document use "BASE64VALUE=" as a
          placeholder value for binary data that has been base64
          encoded (per <xref section="9.8" target="RFC7950"/>).  This
          placeholder value is used because real base64 encoded structures
          are often many lines long and hence distracting to the example
          being presented.</t>
      </section>
    </section>
    <!-- intro -->

    <section anchor="updates">
      <name>Updates to NETCONF operations</name>
      <section>
        <name>Updates to RFC 6241</name>
        <t>The &lt;get&gt; and &lt;get-config&gt; rpc statements are
          augmented to accept additional input parameters, as described
          in <xref target="solution"/>.</t>
      </section>
      <section>
        <name>Updates to RFC 8526</name>
        <t>The &lt;get-data&gt; rpc statement is augmented to
          accept additional input parameters, as described in
          in <xref target="solution"/>.</t>
      </section>
    </section>
    <!-- updates -->

    <section anchor="solution">
      <name>List Pagination for NETCONF</name>
      <t>In order for NETCONF to support <xref target="I-D.ietf-netconf-list-pagination"/>,
      this document extends the operations &lt;get&gt;, &lt;get-config&gt; and &lt;get-data&gt;
      to include additional input parameters and output annotations.</t>
      <t>The updated operations accept a content filter parameter "where", similar to the
      "filter" parameter of &lt;get-config&gt;, but includes nodes for "list" and
      "leaf-list" filtering.</t>
      <t>The "where" query parameter is used to specify the YANG list or leaf-list
      that is to be retrieved. This must be a path expression used to represent a
      list or leaf-list data node.</t>
      <t>Prefixes in the "where" query parameter XPath expression MUST be the
      YANG module prefix. If the specified XPath expression is invalid, then
      an &lt;rpc-error&gt; is returned with error type value "application" and
      "error-tag" value "invalid-value".</t>
      <t>The following tree diagram <xref target="RFC8340"/> illustrates the
        "ietf-netconf-list-pagination" module:</t>
      <artwork><![CDATA[
module: ietf-list-pagination-nc

  augment /nc:get/nc:input:
    +---w list-pagination
       +---w where?           yang:xpath1.0
       +---w locale?          string {sort}?
       +---w sort-by?         union {sort}?
       +---w direction?       enumeration
       +---w cursor?          string
       +---w offset?          uint32
       +---w limit?           union
       +---w sublist-limit?   union
  augment /nc:get-config/nc:input:
    +---w list-pagination
       +---w where?           yang:xpath1.0
       +---w locale?          string {sort}?
       +---w sort-by?         union {sort}?
       +---w direction?       enumeration
       +---w cursor?          string
       +---w offset?          uint32
       +---w limit?           union
       +---w sublist-limit?   union
  augment /ncds:get-data/ncds:input:
    +---w list-pagination
       +---w where?           yang:xpath1.0
       +---w locale?          string {sort}?
       +---w sort-by?         union {sort}?
       +---w direction?       enumeration
       +---w cursor?          string
       +---w offset?          uint32
       +---w limit?           union
       +---w sublist-limit?   union
]]></artwork>
      <t>Comments:</t>
      <ul>
        <li>This module augments three NETCONF "rpc" statements: get, get-config,
          and get-data.</li>
        <li>The "get" and "get-config" augments are against the YANG module
          defined in <xref target="RFC6241"/>.  The "get-data" augment is
          against the YANG module defined in <xref target="RFC8526"/>.</li>
      </ul>
    </section>
    <section anchor="error-reporting">
      <name>Error Reporting</name>
      <t>When an input query parameter is supplied with an erroneous
        value, an &lt;rpc-error&gt; MUST be returned containing the
        error-type value "application", the error-tag value
        "invalid-value", and MAY include the error-severity value
        "error". Additionally the error-app-tag SHOULD be set
        containing query parameter specific error value.</t>
      <section anchor="offset-out-of-range" toc="exclude">
        <name>The "offset" Query Parameter</name>
        <t>If the "offset" query parameter value supplied is larger
          than the number of instances in the working result-set, the
          &lt;rpc-error&gt; MUST contain error-app-tag with value
          "offset-out-of-range".</t>
      </section>
    </section>
    <section>
      <name>YANG Module for List Pagination in NETCONF</name>
      <t>The "ietf-netconf-list-pagination-nc" module defines conceptual
      definitions within groupings, which are not meant to be implemented as
      datastore contents by a server.</t>
      <t>This module has normative references to <xref target="RFC6241"/>,
      <xref target="RFC6243"/>, <xref target="RFC6991"/>, and <xref target="RFC8342"/>.</t>
      <t keepWithNext="true">&lt;CODE BEGINS&gt; file "ietf-list-pagination-nc@2026-04-02.yang"</t>
      <artwork><![CDATA[
module ietf-list-pagination-nc {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-list-pagination-nc";
  prefix lpgnc;

  import ietf-netconf {
    prefix nc;
    reference
      "RFC 6241: Network Configuration Protocol (NETCONF)";
  }

  import ietf-netconf-nmda {
    prefix ncds;
    reference
      "RFC 8526: NETCONF Extensions to Support the
                 Network Management Datastore Architecture";
  }

  import ietf-list-pagination {
    prefix lpg;
    reference
      "RFC XXXX: List Pagination for YANG-driven Protocols";
  }

  organization
    "IETF NETCONF (Network Configuration) Working Group";

  contact
      "WG Web:   <https://datatracker.ietf.org/wg/netconf/>
       WG List:  <mailto:netconf@ietf.org>

       Author:   Kent Watsen
                 <kent+ietf@watsen.net>

       Author:   Qin Wu
                 <bill.wu@huawei.com>

       Author:   Per Andersson
                 <per.ietf@ionio.se>

       Author:   Olof Hagsand
                 <olof@hagsand.se>

       Author:   Hongwei Li
                 <flycoolman@gmail.com>";

  description
    "This module augments the <get>, <get-config>, and <get-data>
     'rpc' statements to support list pagination.

     Copyright (c) 2026 IETF Trust and the persons identified
     as authors of the code. All rights reserved.

     Redistribution and use in source and binary forms, with
     or without modification, is permitted pursuant to, and
     subject to the license terms contained in, the Revised
     BSD License set forth in Section 4.c of the IETF Trust's
     Legal Provisions Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX
     (https://www.rfc-editor.org/info/rfcXXXX); see the RFC
     itself for full legal notices.

     The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
     'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
     'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
     are to be interpreted as described in BCP 14 (RFC 2119)
     (RFC 8174) when, and only when, they appear in all
     capitals, as shown here.";

  revision 2026-04-02 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: NETCONF Extensions to Support List Pagination";
  }

  augment "/nc:get/nc:input" {
    description
      "Allow the 'get' operation to use content filter
       parameter for specifying the YANG list or leaf-list
       that is to be retrieved";
    uses lpg:pagination-parameters;
  }

  augment "/nc:get-config/nc:input" {
    description
      "Allow the 'get-config' operation to use content filter
       parameter for specifying the YANG list or leaf-list
       that is to be retrieved";
    uses lpg:pagination-parameters;
  }

  augment "/ncds:get-data/ncds:input" {
    description
      "Allow the 'get-data' operation to use content filter
       parameter for specifying the YANG list or leaf-list
       that is to be retrieved";
    uses lpg:pagination-parameters;
  }
}
]]></artwork>
      <t keepWithPrevious="true">&lt;CODE ENDS&gt;</t>
    </section>
    <section>
      <name>IANA Considerations</name>
      <section>
        <name>The "IETF XML" Registry</name>
        <t>This document registers one URI in the "ns" subregistry of the IETF
        XML Registry <xref target="RFC3688"/> maintained at <eref target="https://www.iana.org/assignments/xml-registry/xml-registry.xhtml#ns"/>.
        Following the format in <xref target="RFC3688"/>, the following
        registration is requested:</t>
        <artwork align="center"><![CDATA[
URI: urn:ietf:params:xml:ns:yang:ietf-list-pagination-nc
Registrant Contact: The IESG.
XML: N/A, the requested URI is an XML namespace.]]></artwork>
      </section>
      <section>
        <name>The "YANG Module Names" Registry</name>
        <t>This document registers one YANG module in the YANG Module Names
        registry <xref target="RFC6020"/> maintained at <eref target="https://www.iana.org/assignments/yang-parameters/yang-parameters.xhtml"/>.
        Following the format defined in <xref target="RFC6020"/>, the below
        registration is requested:</t>
        <artwork align="center"><![CDATA[
name: ietf-list-pagination-nc
namespace: urn:ietf:params:xml:ns:yang:ietf-list-pagination-nc
prefix: pgnc
RFC: XXXX]]></artwork>
      </section>
    </section>
    <section anchor="security">
      <name>Security Considerations</name>
      <section>
        <name>The "ietf-netconf-list-pagination" YANG Module</name>
        <t>This section follows the template defined in <xref section="3.7.1" target="RFC8407"/>.</t>
        <t>The YANG module specified in this document defines a schema for data
        that is designed to be accessed via network management protocols such
        as NETCONF <xref target="RFC6241"/> or RESTCONF <xref target="RFC8040"/>.
        The lowest NETCONF layer is the secure transport layer, and the
        mandatory-to-implement secure transport is Secure Shell (SSH)
        <xref target="RFC6242"/>. The lowest RESTCONF layer is HTTPS,
        and the mandatory-to-implement secure transport is TLS
        <xref target="RFC8446"/>.</t>
        <t>The Network Configuration Access Control Model (NACM) <xref target="RFC8341"/> provides the means to restrict access for
        particular NETCONF users to a preconfigured subset of all available
        NETCONF protocol operations and content.</t>
        <t>The security considerations for the base NETCONF protocol operations
        (see Section 9 of <xref target="RFC6241"/> and Section 6 of
        <xref target="RFC8526"/>) apply to the extension of operations
        &lt;get&gt;, &lt;get-config&gt;, and &lt;get-data&gt; defined in this
        document.</t>
      </section>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <!-- Terms -->
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3688.xml"/>
        <!-- XML Registry -->
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6241.xml"/>
        <!-- NETCONF -->
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6242.xml"/>
        <!-- NC over SSH -->
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6243.xml"/>
        <!-- with-defaults -->
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6991.xml"/>
        <!-- YANG Types-->
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7950.xml"/>
        <!-- YANG -->
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8040.xml"/>
        <!-- RESTCONF -->
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <!-- Terms new -->
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8341.xml"/>
        <!-- NACM -->
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8342.xml"/>
        <!-- NMDA -->
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8446.xml"/>
        <!-- TLS 1.3 -->
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8526.xml"/>
        <!-- NMDA NETCONF -->
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netconf-list-pagination.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6020.xml"/>
        <!-- YANG orig -->
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8340.xml"/>
        <!-- Tree Diagrams -->
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8407.xml"/>
        <!-- Guidelines -->
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netconf-restconf-collection.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.zheng-netconf-fragmentation.xml"/>
      </references>
    </references>
    <section>
      <name>Example YANG Module</name>
      <t>The examples within this document use the "example-social" YANG
      module defined in <xref section="A.1" target="I-D.ietf-netconf-list-pagination"/>.</t>
    </section>
    <section>
      <name>Example Data Set</name>
      <t>The Example Data Set used by the examples is defined in
        <xref section="A.2" target="I-D.ietf-netconf-list-pagination"/>.</t>
    </section>
    <section>
      <name>Example Queries</name>
      <section>
        <name>List pagination with all query parameters</name>
        <t>This example mimics that <xref section="A.3.9" target="I-D.ietf-netconf-list-pagination"/>. In this XML example, The
          xmlns:es attribute binds the "es" prefix to the example-social module
          name. The urn:ietf:params:xml:ns:yang:ietf-list-pagination-nc
          namespace is used for the list-pagination query parameters.
        </t>
        <artwork><![CDATA[
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="42">
  <get>
    <source>
      <running/>
    </source>
    <filter type="xpath" select="/es:members/es:member"
      xmlns:es="https://example.com/ns/example-social"/>
    <list-pagination
      xmlns="urn:ietf:params:xml:ns:yang:ietf-list-pagination-nc">
      <where>//stats[starts-with(joined,'2020')]</where>
      <sort-by>joined</sort-by>
      <direction>backwards</direction>
      <offset>2</offset>
      <limit>2</limit>
      <sublist-limit>1</sublist-limit>
      <locale>sv_US</locale>
    </list-pagination>
  </get>
</rpc>
]]></artwork>
        <t>Response from the NETCONF server:
        </t>
        <artwork><![CDATA[
=============== NOTE: '\' line wrapping per RFC 8792 ================

<rpc-reply message-id="101"
     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <data>
    <members
      xmlns="https://example.com/ns/example-social"
      xmlns:lp="urn:ietf:params:xml:ns:yang:ietf-list-pagination">
      <member lp:remaining="1" lp:locale="en_US">
        <member-id>eric</member-id>
        <email-address>eric@example.com</email-address>
        <password>$0$1543</password>
        <avatar>BASE64VALUE=</avatar>
        <tagline>Go to bed with dreams; wake up with purpose.</tagli\
ne>
        <following>alice</following>
        <posts>
          <post>
            <timestamp>2020-09-17T18:02:04Z</timestamp>
            <title>Son, brother, husband, father</title>
            <body>What's your story?</body>
          </post>
        </posts>
        <favorites>
          <bits lp:remaining="2" lp:locale="en_US">two</bits>
        </favorites>
        <stats>
          <joined>2020-09-17T19:38:32Z</joined>
          <membership-level>pro</membership-level>
          <last-activity>2020-09-17T18:02:04Z</last-activity>
        </stats>
      </member>
      <member lp:remaining="1" lp:locale="en_US">
        <member-id>bob</member-id>
        <email-address>bob@example.com</email-address>
        <password>$0$1543</password>
        <avatar>BASE64VALUE=</avatar>
        <tagline>Here and now, like never before.</tagline>
        <posts>
          <post lp:remaining="2" lp:locale="en_US">
            <timestamp>2020-08-14T03:32:25Z</timestamp>
            <body>Just got in.</body>
          </post>
        </posts>
        <favorites>
          <decimal64-numbers lp:remaining="1" lp:locale="en_US">3.14\
159</decimal64-numbers>
        </favorites>
        <stats>
          <joined>2020-08-14T03:30:00Z</joined>
          <membership-level>standard</membership-level>
          <last-activity>2020-08-14T03:34:30Z</last-activity>
        </stats>
      </member>
    </members>
  </data>
</rpc-reply>


]]></artwork>
      </section>
    </section>
    <!-- Example Queries -->

    <!--
    <section title="Contributors" numbered="no">
      <figure>
        <artwork>David Cornejo
dcornejo@gmail.com</artwork>
      </figure>
    </section>
    -->

    <section numbered="false">
      <name>Acknowledgements</name>
      <t>This work has benefited from the discussions of RESTCONF resource
      collection over the years, in particular,
      <xref target="I-D.ietf-netconf-restconf-collection"/> which provides
      enhanced filtering features for the retrieval of data nodes with the GET
      method and <xref target="I-D.zheng-netconf-fragmentation"/> which document
      large size data handling challenge. The authors would like to thank the
      following for lively discussions on list (ordered by first name):
      Andy Bierman, Martin Björklund, Robert Varga, and Robert Wilton.
      </t>
    </section>
  </back>
</rfc>
